/* Module: 30-rsvp.css */
/* RSVP screen layout, focus word, and playback controls. */

/* ============================================
   RSVP
   ============================================ */

.rsvp {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Rich green gradient like actual app */
    background: linear-gradient(180deg, #0D2818 0%, #1A4D33 30%, #0F3025 70%, #0A1C15 100%);
}

.rsvp-top {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    gap: 16px;
    flex-shrink: 0;
}

.rsvp-back {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--glass2);
    color: var(--t3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.rsvp-back:hover { background: var(--glass3); color: var(--t1); }

.rsvp-info { flex: 1; }
.rsvp-doc {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.2px;
    background: linear-gradient(135deg, #F5E6D0, #C4A882);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.rsvp-loc { font-size: 12px; color: #7A8E88; }

.rsvp-wpm-badge {
    font-size: 12px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--accent);
    background: var(--accent-g);
    padding: 4px 12px;
    border-radius: 8px;
}

.rsvp-progress {
    height: 2px;
    background: var(--bg3);
    flex-shrink: 0;
}
.rsvp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 1px;
}

/* RSVP Display — horizontal 3-word context layout */
.rsvp-display {
    flex: 1;
    display: grid;
    grid-template-rows:
        minmax(0, 1fr)
        var(--rsvp-focus-stage-height, 184px)
        var(--rsvp-phrase-height, 70px)
        var(--rsvp-pause-height, 24px)
        minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    row-gap: var(--rsvp-display-gap, 20px);
    padding: 40px;
    position: relative;
    min-height: 0;
}

.rsvp-focus-stage {
    position: relative;
    display: grid;
    grid-row: 2;
    align-items: center;
    justify-items: center;
    width: 100%;
    height: var(--rsvp-focus-stage-height, 184px);
    min-height: 0;
}

/* Crosshair above focus word */
.rsvp-crosshair {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    opacity: .5;
}

/* Horizontal row: left context | focus | right context */
.rsvp-h-row {
    --rsvp-context-gap: clamp(24px, 2vw, 32px);
    --rsvp-focus-left-extent: 0px;
    --rsvp-focus-right-extent: 0px;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    justify-content: center;
    width: min(100%, 1100px);
    max-width: 1100px;
    height: var(--rsvp-focus-row-height, 144px);
    min-width: 0;
    overflow: visible;
}

.rsvp-lane {
    min-width: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.rsvp-lane-left {
    justify-content: flex-end;
    padding-right: calc(var(--rsvp-focus-left-extent) + var(--rsvp-context-gap));
}

.rsvp-lane-right {
    justify-content: flex-start;
    padding-left: calc(var(--rsvp-focus-right-extent) + var(--rsvp-context-gap));
}

.rsvp-ctx-left, .rsvp-ctx-right {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: clamp(26px, 2vw, 30px);
    font-weight: 400;
    color: rgba(232,213,176,.35);
    line-height: 1;
    white-space: nowrap;
    overflow: visible;
    flex: 0 0 auto;
    width: max-content;
    max-width: 100%;
    min-width: 0;
    pointer-events: none;
    z-index: 0;
}
.rsvp-ctx-left {
    justify-content: flex-end;
}
.rsvp-ctx-right {
    justify-content: flex-start;
}

.rsvp-focus-shell {
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 0;
    min-width: 0;
    max-width: none;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.rsvp-active-phrase-highlight {
    display: none;
}

/* Focus word — large, centered, with ORP highlight */
.rsvp-focus {
    display: inline-flex;
    align-items: baseline;
    font-size: clamp(68px, 5.6vw, 76px);
    font-weight: 800;
    letter-spacing: 1px;
    white-space: nowrap;
    flex: 0 0 auto;
    line-height: 1;
    transform: translateX(calc(-1 * var(--rsvp-focus-left-extent)));
}
.rsvp-focus-segment {
    color: var(--t1);
    flex: 0 0 auto;
}
.rsvp-focus-leading {
    text-align: right;
}
.rsvp-focus-orp {
    color: var(--orp-red);
    font-weight: 900;
}

/* Vertical ORP line */
.rsvp-orp-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1.5px;
    background: linear-gradient(to bottom, transparent, rgba(255,82,82,.25), transparent);
    transform: translateX(-50%);
    pointer-events: none;
}

.rsvp-display[data-rsvp-layout-ready="false"] .rsvp-crosshair,
.rsvp-display[data-rsvp-layout-ready="false"] .rsvp-h-row,
.rsvp-display[data-rsvp-layout-ready="false"] .rsvp-orp-line {
    opacity: 0;
    visibility: hidden;
}

/* Phrase preview below */
.rsvp-phrase {
    grid-row: 3;
    text-align: center;
    max-width: min(640px, 78vw);
    height: var(--rsvp-phrase-height, 70px);
    display: grid;
    grid-template-rows: 18px minmax(0, 1fr);
    align-items: start;
    opacity: .4;
    overflow: hidden;
}
.rsvp-phrase-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--t4);
    margin-bottom: 8px;
    display: block;
}
.rsvp-phrase p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--t3);
    min-height: 48px;
    max-height: 48px;
    overflow: hidden;
    text-wrap: balance;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Pause bar */
.rsvp-pause-track {
    grid-row: 4;
    width: 200px;
    height: 4px;
    background: var(--gold-07);
    border-radius: 2px;
    overflow: hidden;
}
.rsvp-pause-fill {
    height: 100%;
    background: white;
    border-radius: 2px;
    width: 0%;
}

.rsvp-notes {
    position: absolute;
    top: 56px;
    right: 32px;
    width: min(320px, 28vw);
    max-height: min(420px, calc(100% - 112px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(245, 230, 208, .16);
    border-radius: 8px;
    background: rgba(10, 28, 21, .72);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .24);
    backdrop-filter: blur(18px);
    color: var(--t2);
}

.rsvp-notes.is-collapsed {
    max-height: 86px;
}

.rsvp-notes-head {
    display: grid;
    gap: 4px;
}

.rsvp-notes-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.rsvp-notes-toggle:hover,
.rsvp-notes-toggle:focus-visible {
    color: var(--t1);
}

.rsvp-notes-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
}

.rsvp-notes-section {
    font-size: 12px;
    line-height: 1.35;
    color: rgba(232, 213, 176, .58);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rsvp-notes-body {
    display: contents;
}

.rsvp-notes-body[hidden] {
    display: none;
}

.rsvp-notes-input {
    width: 100%;
    min-height: 78px;
    resize: vertical;
    border: 1px solid rgba(245, 230, 208, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    color: var(--t1);
    padding: 10px 11px;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
    outline: none;
}

.rsvp-notes-input:focus {
    border-color: rgba(196, 168, 130, .78);
    box-shadow: 0 0 0 3px rgba(196, 168, 130, .16);
}

.rsvp-notes-input::placeholder {
    color: rgba(232, 213, 176, .38);
}

.rsvp-notes-save {
    align-self: flex-end;
    min-height: 32px;
    border-radius: 8px;
    padding: 0 12px;
    background: rgba(196, 168, 130, .22);
    color: var(--t1);
    font-size: 12px;
    font-weight: 750;
}

.rsvp-notes-save:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.rsvp-notes-list {
    display: grid;
    gap: 8px;
    overflow: auto;
}

.rsvp-notes-empty,
.rsvp-note p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.rsvp-notes-empty {
    color: rgba(232, 213, 176, .46);
}

.rsvp-note {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
}

.rsvp-note-anchor {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(196, 168, 130, .82);
}

.rsvp-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 24px 40px 48px;
    flex-shrink: 0;
}

.rsvp-speed {
    display: flex;
    align-items: center;
    gap: 20px;
}

.rsvp-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--glass2);
    color: var(--t2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    flex: 0 0 auto;
}
.rsvp-btn:hover { background: var(--glass3); color: var(--t1); }
.rsvp-btn-sm { width: 34px; height: 34px; border-radius: 10px; opacity: .6; }
.rsvp-btn-sm:hover { opacity: 1; }

.rsvp-speed-num {
    text-align: center;
    min-width: 70px;
}
.rsvp-speed-num span {
    font-size: 32px;
    font-weight: 800;
    font-family: var(--mono);
    display: block;
}
.rsvp-speed-num small {
    font-size: 10px;
    color: var(--t4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rsvp-play-band {
    display: grid;
    grid-template-columns: 34px max-content 34px;
    align-items: center;
    gap: 16px;
}

.rsvp-play-side-slot {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsvp-restart-phrase {
    opacity: .72;
}

.rsvp-play-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.rsvp-play {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gold-10);
    backdrop-filter: blur(12px);
    color: #F5E6D0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gold-30);
    box-shadow: 0 0 24px var(--gold-08);
}
.rsvp-play:hover {
    background: var(--gold-16);
    border-color: var(--gold-45);
    box-shadow: 0 0 36px var(--gold-12);
}

.rsvp-loop-toggle.is-active {
    background: var(--gold-16);
    color: var(--t1);
    border-color: var(--gold-45);
    box-shadow: 0 0 18px var(--gold-10);
}

.rsvp-pos {
    font-size: 12px;
    color: var(--t4);
    text-align: center;
}
