/* Game-site lobby — "Forge Lobby" aesthetic.
 *
 * Hero band introduces the game; below it, two cards on desktop:
 *   left  → already have Signet (QR + same-device sign-in)
 *   right → don't have Signet (explainer + ranked install CTAs)
 * Cards stack on mobile. Whitelisted/waitlisted states use a single
 * centered card (lobby-card-solo) instead of the two-card grid.
 */

:root {
    --bg:           #0a0e1a;
    --bg-deep:      #060912;
    --surface:      #131a2c;
    --surface-2:    #1a2238;
    --border:       #2a3654;
    --gold:         #d4a044;
    --gold-bright:  #e7b85a;
    --gold-soft:    #ffd486;
    --steel:        #6f8bbd;
    --spark:        #ff9e4d;
    --text:         #e8ecf6;
    --text-muted:   #9aa3b8;
    --text-dim:     #5b6075;
    --green:        #6dd57a;
    --red:          #e07070;
    --grid-line:    rgba(212, 160, 68, 0.06);
    --shadow-deep:  0 30px 80px -20px rgba(0,0,0,.7);
    --shadow-card:  0 18px 40px -16px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }

.lobby-body {
    margin: 0;
    color: var(--text);
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 78% 18%, rgba(212,160,68,.10), transparent 55%),
        radial-gradient(circle at 8% 92%, rgba(74,123,212,.07), transparent 50%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    background-attachment: fixed;
}

/* === Nav === */

.lobby-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.05rem 2rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.75rem;
    background: linear-gradient(180deg, rgba(10,14,26,.92), rgba(10,14,26,.6));
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
    position: relative;
    z-index: 5;
}
.lobby-nav .nav-brand {
    color: var(--gold);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.brand-amp { color: var(--steel); margin: 0 1px; font-style: italic; font-weight: 400; }
.lobby-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.lobby-nav .nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    letter-spacing: .5px;
}
.lobby-nav .nav-link:hover { color: var(--gold-bright); }

.nav-user {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
    padding: 0.3rem 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.nav-handle { color: var(--gold); font-weight: 700; font-size: 0.92rem; }
.nav-npub {
    color: var(--green);
    font-size: 0.7rem;
    font-family: ui-monospace, Menlo, monospace;
    opacity: 0.75;
    margin-top: 0.15rem;
}
.nav-signout {
    background: transparent;
    border: 1px solid #6a2c2c;
    color: var(--red);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.nav-signout:hover { background: #241414; }

/* === Hero band === */

.hero-band {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 2.4rem;
    padding: 4.5rem 3rem 3.5rem;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}
.hero-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(0deg,  transparent 0, transparent calc(50% - 0.5px), var(--grid-line) calc(50% - 0.5px), var(--grid-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(90deg, transparent 0, transparent calc(50% - 0.5px), var(--grid-line) calc(50% - 0.5px), var(--grid-line) calc(50% + 0.5px), transparent calc(50% + 0.5px));
    background-size: 38px 38px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 75%);
            mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 75%);
    pointer-events: none;
    opacity: .55;
}

.hero-text {
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: heroIn .8s ease-out .1s forwards;
}
.hero-eyebrow {
    color: var(--gold-bright);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0 0 1rem;
}
.hero-title {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: 1px;
    color: var(--text);
    margin: 0 0 1.2rem;
    text-transform: uppercase;
    font-weight: 700;
    text-shadow: 0 4px 24px rgba(0,0,0,.6), 0 0 60px rgba(212,160,68,.18);
}
.title-amp {
    color: var(--gold);
    font-style: italic;
    text-transform: lowercase;
    letter-spacing: 0;
    font-weight: 400;
}
.hero-tagline {
    font-size: clamp(1.08rem, 1.7vw, 1.32rem);
    color: var(--text);
    line-height: 1.42;
    margin: 0 0 0.85rem;
    max-width: 32ch;
    font-weight: 600;
}
.hero-pitch {
    font-size: 0.97rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    max-width: 52ch;
}

/* hero art */
.hero-art {
    position: relative;
    z-index: 1;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: var(--shadow-deep), 0 0 0 1px var(--border);
    opacity: 0;
    animation: heroIn 1s ease-out .25s forwards;
}
.hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.05) contrast(1.04);
}
.hero-art-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 80%, rgba(255,158,77,.22), transparent 55%),
        linear-gradient(135deg, transparent 65%, rgba(212,160,68,.18));
    mix-blend-mode: screen;
}
.hero-art-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 60px rgba(10,14,26,.6);
}

@keyframes heroIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* === Lobby main === */

.lobby-main {
    flex: 1;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 3rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ==== Two-card entry grid (signed-out) ==== */

.entry-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    width: 100%;
}

/* === Card base === */

.lobby-card {
    background:
        linear-gradient(180deg, rgba(255,212,134,.04), transparent 55%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2.2rem 2.2rem;
    box-shadow: var(--shadow-card);
    position: relative;
    opacity: 0;
    animation: heroIn .8s ease-out .35s forwards;
}
.lobby-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(212,160,68,.55), transparent 55%);
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
            mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    padding: 1px;
    pointer-events: none;
    opacity: .35;
}

.lobby-card-solo {
    max-width: 540px;
    margin: 0 auto;
    text-align: center;
}
.entry-card-explain { animation-delay: .5s; }

.entry-head { margin-bottom: 1.1rem; }
.entry-eyebrow {
    display: inline-block;
    color: var(--gold-bright);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    margin: 0 0 .55rem;
}
.card-title {
    color: var(--text);
    font-size: clamp(1.5rem, 2.5vw, 1.85rem);
    margin: 0;
    letter-spacing: .5px;
    line-height: 1.1;
}
.card-lede {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.55;
    margin: 0 0 1.4rem;
}

/* === Sign-in card (left) === */

#qr-slot {
    background: #fff;
    padding: 0.7rem;
    border-radius: 10px;
    width: 100%;
    max-width: 280px;
    margin: 0.4rem auto 0.4rem;
    line-height: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(212,160,68,.3), 0 12px 32px -8px rgba(0,0,0,.5);
}
#qr-slot svg { width: 100%; height: 100%; }
#qr-slot .hint { color: #5b6075; line-height: 1.4; margin: 0; font-family: Georgia, serif; }

.qr-cap {
    text-align: center;
    margin: 0.6rem 0 0 !important;
}
.qr-countdown {
    text-align: center;
    margin: 0.4rem 0 0 !important;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    color: var(--text-dim);
}
.qr-countdown.expired { color: #e07070; }
.qr-refresh-btn {
    display: block;
    margin: 0.5rem auto 0;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 0.35rem 0.9rem;
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.qr-refresh-btn:hover { color: var(--gold); border-color: var(--gold); }

.divider {
    margin: 1.1rem 0 .9rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.74rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: .8rem;
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.divider span { padding: 0 .15rem; }

/* CTA buttons */
.cta {
    display: inline-block;
    background: var(--gold);
    color: #1d1404;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    padding: 0.85rem 1.5rem;
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
    box-shadow: 0 6px 20px -8px rgba(212,160,68,.6), inset 0 1px 0 rgba(255,255,255,.2);
}
.cta:hover:not(:disabled) {
    background: var(--gold-bright);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px -8px rgba(212,160,68,.7), inset 0 1px 0 rgba(255,255,255,.3);
}
.cta:disabled { opacity: .55; cursor: progress; }
.cta-large {
    font-size: 1.05rem;
    padding: 1rem 1.7rem;
    width: 100%;
    text-align: center;
}
.cta-secondary {
    background: transparent;
    color: var(--gold-bright);
    border: 1px solid var(--gold);
    box-shadow: inset 0 0 0 1px rgba(212,160,68,.15);
}
.cta-secondary:hover:not(:disabled) {
    background: rgba(212,160,68,.12);
    color: var(--gold-soft);
}
.cta-enter {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
    box-shadow: 0 8px 30px -6px rgba(212,160,68,.55), inset 0 1px 0 rgba(255,255,255,.25);
}

/* override auth-ui.css's #auth-same-device defaults */
#auth-same-device {
    display: block;
    width: 100%;
}

/* === Explainer card (right) === */

.signet-bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 1.6rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.signet-bullets li {
    display: flex;
    gap: .7rem;
    align-items: center;
    color: var(--text);
    font-size: .97rem;
}
.bullet-glyph {
    width: 14px;
    height: 14px;
    display: inline-grid;
    place-items: center;
    color: var(--gold);
    font-size: .85rem;
    flex-shrink: 0;
}

.signet-step-head {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    margin: 0 0 0.85rem;
}

.signet-cta {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.95rem 1.05rem;
    margin-bottom: 0.7rem;
    transition: border-color .15s ease, transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.signet-cta:hover {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(212,160,68,.10), var(--surface-2));
    transform: translateX(2px);
    box-shadow: 0 8px 24px -10px rgba(212,160,68,.4);
}
.signet-cta-phone {
    border-color: rgba(212,160,68,.6);
    background: linear-gradient(180deg, rgba(212,160,68,.08), var(--surface-2));
}

.cta-rank {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--gold);
    font-weight: 700;
    font-size: 0.95rem;
    background: var(--bg);
}
.signet-cta-phone .cta-rank {
    border-color: var(--gold);
    color: #1d1404;
    background: var(--gold);
}
.cta-content { display: flex; flex-direction: column; gap: 0.18rem; }
.cta-title {
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: .3px;
    display: flex;
    gap: .55rem;
    align-items: baseline;
    flex-wrap: wrap;
    color: var(--text);
}
.cta-tag {
    font-style: normal;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #1d1404;
    background: var(--gold-bright);
    padding: .15rem .45rem;
    border-radius: 4px;
    font-weight: 700;
}
.cta-sub {
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}
.cta-arrow {
    color: var(--gold);
    font-size: 1.4rem;
    line-height: 1;
}

.hint-back {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 1.1rem;
    text-align: center;
}

/* === Status / identity (signed-in) === */

.status-pill {
    display: inline-block;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    font-size: 0.74rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    border: 1px solid;
    text-transform: uppercase;
    font-weight: 700;
}
.status-pill.signed-in {
    color: var(--green);
    border-color: #2c6a36;
    background: #14241a;
}
.status-pill.signed-out {
    color: var(--red);
    border-color: #6a2c2c;
    background: #241414;
}

.identity-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin: 1.2rem auto 1.6rem;
    text-align: left;
    max-width: 380px;
}
.identity-label {
    color: var(--text-dim);
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}
.identity-handle {
    color: var(--gold);
    font-size: 1.15rem;
    font-weight: 700;
}
.identity-npub {
    color: var(--green);
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.85rem;
}

.auth-error {
    color: var(--red);
    font-size: 0.9rem;
    margin-top: 0.8rem;
    text-align: center;
}

.hint {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 0.8rem 0 0;
}

/* === WebGPU pre-flight block === */

.webgpu-block {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto 1.6rem;
    background:
        linear-gradient(180deg, rgba(224,112,112,.10), transparent 65%),
        var(--surface);
    border: 1px solid #6a2c2c;
    border-radius: 12px;
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow-card);
    position: relative;
}
.webgpu-block::before {
    content: "⚠";
    position: absolute;
    top: 1.1rem;
    left: 1.1rem;
    font-size: 1.4rem;
    color: var(--red);
    line-height: 1;
}
.webgpu-block-title {
    color: var(--text);
    font-size: 1.15rem;
    margin: 0 0 0.45rem 2.2rem;
    letter-spacing: .3px;
}
.webgpu-block-lede {
    color: var(--text-muted);
    margin: 0 0 0.9rem 2.2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}
.webgpu-block-fix {
    margin: 0 0 0.9rem 2.2rem;
}
.webgpu-steps {
    margin: 0 0 0.6rem;
    padding-left: 1.2rem;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.6;
}
.webgpu-steps li { margin-bottom: 0.25rem; }
.webgpu-steps code {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--gold-soft);
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: ui-monospace, Menlo, monospace;
}
.webgpu-fallback {
    color: var(--text-dim);
    font-size: 0.86rem;
    margin: 0.4rem 0 0;
    line-height: 1.5;
}
.webgpu-retest {
    display: inline-block;
    margin-left: 2.2rem;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold-bright);
    border-radius: 6px;
    padding: 0.45rem 1.1rem;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.webgpu-retest:hover:not(:disabled) {
    background: rgba(212,160,68,.12);
    color: var(--gold-soft);
}
.webgpu-retest:disabled { opacity: .55; cursor: progress; }

/* Disabled "Enter the game" CTA when WebGPU check fails. */
.cta.cta-blocked {
    background: var(--surface-2);
    color: var(--text-dim);
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid var(--border);
}
.cta.cta-blocked:hover { transform: none; box-shadow: none; }

@media (max-width: 580px) {
    .webgpu-block { padding: 1.1rem 1.1rem 1.1rem 1.1rem; }
    .webgpu-block::before { left: 0.9rem; top: 0.95rem; }
    .webgpu-block-title,
    .webgpu-block-lede,
    .webgpu-block-fix,
    .webgpu-retest { margin-left: 1.7rem; }
}

/* === Footer === */

.lobby-footer {
    text-align: center;
    padding: 1.6rem 1rem 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}
.lobby-footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.4rem;
}
.lobby-footer a:hover { color: var(--gold-bright); }

/* === Responsive === */

@media (max-width: 920px) {
    .hero-band {
        grid-template-columns: 1fr;
        padding: 2.6rem 1.5rem 2rem;
        gap: 1.6rem;
        text-align: center;
    }
    .hero-text { order: 2; }
    .hero-tagline,
    .hero-pitch { margin-left: auto; margin-right: auto; }
    .hero-art { order: 1; max-width: 100%; }

    .entry-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .lobby-main { padding: 0 1.5rem 3rem; }
}

@media (max-width: 580px) {
    .lobby-nav { padding: 0.8rem 1rem; }
    .lobby-main { padding: 0 1rem 2.5rem; }
    .lobby-card { padding: 1.6rem 1.4rem; }
    .signet-cta {
        grid-template-columns: auto 1fr;
        gap: .7rem;
        padding: 0.85rem 1rem;
    }
    .signet-cta .cta-arrow { display: none; }
    .hero-title { letter-spacing: 0.5px; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-text,
    .hero-art,
    .lobby-card,
    .entry-card-explain {
        animation: none !important;
        opacity: 1 !important;
    }
}
