/* ============================================================
   lobby.css: the front door, in three steps:
     #lobby-menu   the marquee and your name
     #lobby-join   room-code entry
     #lobby-table  the waiting room

   Every step fills the screen exactly once; none of them scroll on a
   desktop, and only one is ever mounted at a time.
   ============================================================ */

/* #screen-lobby deliberately has no positioning of its own: `.screen` in
   base.css already makes it absolute/inset-0, which is what the steps below
   size themselves against. An ID rule here would out-specify that and collapse
   them to zero height. */

.lobby-step {
    position: absolute;
    inset: 0;
    display: none;
    /* top padding clears the floating controls, which overlay this screen */
    padding: calc(var(--hud-h) + var(--sp-2)) var(--sp-5) var(--sp-5);
    overflow: auto;
}

.lobby-step.is-active {
    display: grid;
    place-items: center;
    animation: stepIn .32s var(--ease-out) both;
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ---------------- Step 1: the door ---------------- */

/*
 * The sign needs air under it, but the panel must not drop to pay for it.
 *
 * The step centres this box, so widening the gap alone would push the sign up
 * and the panel down by half the increase each. The margin-bottom cancels the
 * panel's half: it makes the box taller than its contents, and centring that
 * taller box lifts everything back up by the same amount. Net effect is the
 * sign rises by the full gap increase and the panel does not move. Keep the
 * two in step: margin-bottom should equal the gap increase over --sp-5.
 */
.menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-7);
    margin-bottom: var(--sp-5);
    width: 100%;
    max-width: 500px;
}

.marquee {
    position: relative;
    width: 100%;
    text-align: center;
}

/*
 * The bulb row is now a rule of engraved dots: the same rhythm across the top
 * of the sign, cut instead of lit. They still animate, but as ink catching the
 * light rather than filaments coming on.
 */
.marquee-bulbs {
    display: block;
    width: 76%;
    height: 12px;
    margin: 0 auto var(--sp-3);
    overflow: visible;
}

.marquee-bulbs circle {
    fill: none;
    stroke: var(--gold);
    stroke-width: 1;
    animation: bulbPulse 2.6s var(--ease-in-out) infinite;
}

@keyframes bulbPulse {

    0%,
    100% {
        opacity: .3;
    }

    50% {
        opacity: .9;
    }
}

/*
 * The sign itself: cut into the plate, not wired up. Playfair for the house
 * name because the engraved voice lives in the serif; the hard black offset
 * behind each line is the second impression that sells it as printed.
 */
.neon-sign {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--font-engraved);
    font-weight: 900;
    line-height: .9;
    letter-spacing: .01em;
}

.neon-sign__line1 {
    font-size: clamp(32px, 4.4vw, 54px);
    color: var(--gold);
    text-shadow: 2px 2px 0 #000;
}

.neon-sign__line2 {
    margin-top: 4px;
    font-size: clamp(58px, 8.4vw, 108px);
    color: var(--gold-hot);
    text-shadow: 3px 3px 0 #000, 4px 4px 0 rgba(0, 0, 0, .45);
}

/* a ruled line either side of the tagline, the way a title page sets it */
.marquee-sub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.marquee-sub::before,
.marquee-sub::after {
    content: '';
    flex: 1 1 0;
    max-width: 68px;
    height: 1px;
    background: var(--rule);
}

.menu__panel {
    width: 100%;
    padding: var(--sp-5);
}

.menu__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3);
}

/* ---------------- Step 2: join ---------------- */

.join-card {
    width: 100%;
    max-width: 430px;
    padding: var(--sp-6) var(--sp-5) var(--sp-5);
    text-align: center;
}

.step-title {
    font-family: var(--font-engraved);
    font-size: 29px;
    font-weight: 900;
    letter-spacing: .01em;
    color: var(--gold-hot);
    text-shadow: 2px 2px 0 #000;
}

.step-sub {
    margin: var(--sp-1) 0 var(--sp-5);
    font-size: 14px;
    color: var(--text-faint);
}

.step-foot {
    margin-top: var(--sp-3);
    min-height: 18px;
    font-size: 13px;
    text-align: center;
    color: var(--text-faint);
}

.status-line {
    margin-top: var(--sp-4);
    padding: 11px 13px;
    font-size: 14px;
    text-align: center;
    color: var(--text-dim);
    background: var(--ink-900);
    border: 1px solid var(--rule-faint);
    border-radius: 0;
}

.status-line[data-tone="ok"] {
    color: #9dbf94;
    border-color: rgba(110, 143, 106, .45);
}

.status-line[data-tone="busy"] {
    color: var(--amber);
    border-color: var(--line-amber);
}

.status-line[data-tone="bad"] {
    color: var(--oxblood-hot);
    border-color: rgba(142, 34, 48, .55);
}

/* ---------------- Step 3: the waiting room ---------------- */

.waitroom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: var(--sp-6);
    align-items: center;
    width: 100%;
    max-width: 1180px;
    height: 100%;
    max-height: 720px;
}

.waitroom__stage {
    display: grid;
    place-items: center;
    height: 100%;
    min-height: 0;
}

/* a scale model of the table you're about to sit at */
.wtable {
    position: relative;
    width: min(100%, 560px);
    aspect-ratio: 1.42 / 1;
    max-height: 100%;
}

/*
 * The table, drawn rather than lit. Four concentric rules stepping inward
 * (rim, cushion, two inlays) with the field crosshatched. Line weight falls
 * off toward the centre, which is what gives it depth now that there is no
 * gradient doing it.
 */
.wtable__rim {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: var(--ink-850);
    border: 1px solid var(--rule);
}

.wtable__felt {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--felt);
    background-image: var(--hatch-cross);
    border: 1px solid var(--rule-strong);
}

.wtable__inlay {
    position: absolute;
    inset: 9%;
    border: 1px solid var(--rule);
    border-radius: 50%;
    pointer-events: none;
}

.wtable__inlay::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid var(--rule-faint);
    border-radius: 50%;
}

.wtable__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.wtable__label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* the code is the one thing on the felt, so it is set like a plate number */
.wtable__code {
    font-family: var(--font-engraved);
    font-size: clamp(32px, 4.2vw, 48px);
    font-weight: 700;
    letter-spacing: .22em;
    text-indent: .22em;
    color: var(--gold-hot);
    text-shadow: 2px 2px 0 #000;
}

/* ---------------- Waiting-room seats ---------------- */

#waitroom-seats {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.wseat {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 9px;
    /* eight seats have to fit around the ellipse without touching; the pair
       either side of the top slot is the tightest spacing on the ring */
    width: 156px;
    padding: 7px 12px 7px 7px;
    transform: translate(-50%, -50%);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    pointer-events: auto;
    animation: seatPop .34s var(--ease-out) backwards;
    animation-delay: var(--wseat-delay, 0ms);
}

@keyframes seatPop {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 10px));
    }
}

.wseat.is-taken {
    background-color: var(--ink-850);
    background-image: var(--hatch-fine);
    border-color: color-mix(in srgb, var(--seat-color, var(--gold)) 55%, transparent);
    box-shadow: var(--sh-2);
}

/* an unfilled seat is ruled but not inked */
.wseat.is-empty {
    justify-content: center;
    background: var(--ink-900);
    border-style: dashed;
    border-color: var(--rule-faint);
}

.wseat__waiting {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-faint);
    animation: waitBreathe 2.4s var(--ease-in-out) infinite;
}

@keyframes waitBreathe {

    0%,
    100% {
        opacity: .35;
    }

    50% {
        opacity: .8;
    }
}

.wseat__meta {
    min-width: 0;
    flex: 1;
    text-align: left;
}

.wseat__name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wseat__tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--seat-color, var(--gold));
    opacity: .85;
}

/* ---------------- Waiting-room side panel ---------------- */

.waitroom__side {
    display: flex;
    flex-direction: column;
    padding: var(--sp-5);
}

.waitroom__tally {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.tally {
    font-family: var(--font-mono);
    letter-spacing: .05em;
    color: var(--gold);
}

.waitroom__foot {
    margin-top: auto;
    padding-top: var(--sp-5);
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-3) 0;
    border-top: 1px solid var(--line);
}

.option-row__label {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
}

.option-row__hint {
    display: block;
    font-size: 12.5px;
    color: var(--text-faint);
}

/* A seat held for somebody who has dropped out of contact. */
.wseat.is-away {
    opacity: .5;
}

.wseat.is-away .wseat__tag {
    color: var(--text-dim);
}
