/* ============================================================
   Game Hub — candy-crush style level map + system-window picker.

   Namespaces:
     .gh-*   the hub shell + level map
     .gp-*   the "choose your path" picker overlay (system window)
     .gm-*   the in-hub game mount frame (where a chosen game renders)

   Visual language matches level-up-popup.js (cyan-glass + corner
   brackets); see .sl-* in style.css for the source of truth.
   ============================================================ */


/* ---------------- HUB SHELL ---------------- */
.gh-shell {
    position: relative;
    min-height: calc(100vh - 64px);
    padding: 24px 16px 80px;
    color: #bae6fd;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(56,189,248,.10) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 100%, rgba(255,95,191,.10) 0%, transparent 55%),
        linear-gradient(180deg, #06121f 0%, #02080f 100%);
    overflow: hidden;
}
.gh-shell::before {
    /* faint grid backdrop */
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(56,189,248,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56,189,248,.05) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.gh-head {
    position: relative;
    max-width: 1080px;
    margin: 0 auto 28px;
    text-align: center;
    z-index: 2;
}
.gh-eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .58em;
    text-transform: uppercase;
    color: #7dd3fc;
    text-shadow: 0 0 10px rgba(56,189,248,.55);
    margin-bottom: 8px;
}
.gh-title {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 700;
    color: #e0f2fe;
    margin: 0 0 8px;
    letter-spacing: .04em;
}
.gh-sub {
    color: #7dd3fc;
    opacity: .78;
    margin: 0 auto;
    max-width: 540px;
    font-size: .95rem;
}

.gh-meta-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.gh-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    background: rgba(8,20,40,.6);
    border: 1px solid rgba(56,189,248,.3);
    border-radius: 999px;
    font-size: .78rem;
    color: #bae6fd;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.gh-pill strong {
    color: #38bdf8;
    font-weight: 700;
    text-shadow: 0 0 6px rgba(56,189,248,.6);
}
.gh-pill button {
    background: none; border: none;
    color: #7dd3fc; cursor: pointer;
    font: inherit; letter-spacing: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.gh-pill button:hover { color: #38bdf8; }


/* ---------------- LEVEL MAP ---------------- */
.gh-map {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 8px 48px;
    z-index: 1;
}

.gh-map-track {
    position: relative;
    width: 100%;
    /* one node per row, 100 rows visible at any moment but we render
       a dense window — see JS. height set inline via --gh-rows. */
    --gh-rows: 32;
    height: calc(var(--gh-rows) * 84px);
    isolation: isolate;
}

.gh-map-svg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.gh-node {
    position: absolute;
    width: 64px; height: 64px;
    transform: translate(-50%, -50%);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(8,20,40,.92), rgba(3,12,28,.88));
    border: 1px solid rgba(56,189,248,.45);
    box-shadow:
        0 0 0 1px rgba(56,189,248,.1),
        0 6px 18px -6px rgba(0,0,0,.7),
        inset 0 0 0 1px rgba(255,255,255,.03);
    color: #bae6fd;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform .2s cubic-bezier(.22,1,.36,1),
                box-shadow .25s ease,
                border-color .25s ease;
    z-index: 2;
}
.gh-node:hover { transform: translate(-50%, -50%) scale(1.08); }

.gh-node-cleared {
    background: linear-gradient(180deg, rgba(34,80,110,.95), rgba(8,30,55,.92));
    border-color: rgba(56,189,248,.85);
    color: #38bdf8;
    box-shadow:
        0 0 0 1px rgba(56,189,248,.3),
        0 0 20px -2px rgba(56,189,248,.55),
        0 6px 18px -6px rgba(0,0,0,.7);
}
.gh-node-current {
    background: linear-gradient(180deg, rgba(56,189,248,.35), rgba(14,80,140,.95));
    border-color: #38bdf8;
    color: #f0f9ff;
    box-shadow:
        0 0 0 1px rgba(56,189,248,.6),
        0 0 32px -2px rgba(56,189,248,.85),
        0 8px 20px -4px rgba(0,0,0,.8);
    animation: ghPulse 2.4s ease-in-out infinite;
}
.gh-node-locked {
    background: linear-gradient(180deg, rgba(20,28,40,.85), rgba(8,12,20,.85));
    border-color: rgba(120,160,200,.18);
    color: #4b6275;
    cursor: default;
}
.gh-node-locked:hover { transform: translate(-50%, -50%); }

.gh-node-boss {
    width: 78px; height: 78px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,95,191,.25), rgba(120,30,80,.92));
    border-color: rgba(255,95,191,.6);
    color: #ffd6ee;
    box-shadow:
        0 0 0 1px rgba(255,95,191,.25),
        0 0 28px -2px rgba(255,95,191,.6),
        0 8px 22px -4px rgba(0,0,0,.8);
}
.gh-node-boss.gh-node-current { animation: ghPulsePink 2.4s ease-in-out infinite; }

@keyframes ghPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(56,189,248,.6), 0 0 32px -2px rgba(56,189,248,.85), 0 8px 20px -4px rgba(0,0,0,.8); }
    50%      { box-shadow: 0 0 0 2px rgba(56,189,248,.85), 0 0 50px 0 rgba(56,189,248,1), 0 8px 20px -4px rgba(0,0,0,.8); }
}
@keyframes ghPulsePink {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255,95,191,.5), 0 0 28px -2px rgba(255,95,191,.7), 0 8px 22px -4px rgba(0,0,0,.8); }
    50%      { box-shadow: 0 0 0 2px rgba(255,95,191,.85), 0 0 50px 0 rgba(255,95,191,.95), 0 8px 22px -4px rgba(0,0,0,.8); }
}

.gh-node-label {
    position: absolute; left: 50%; top: calc(100% + 6px);
    transform: translateX(-50%);
    font-size: .68rem;
    letter-spacing: .14em;
    color: rgba(186,230,253,.55);
    text-transform: uppercase;
    white-space: nowrap;
}
.gh-node-current .gh-node-label { color: #7dd3fc; }
.gh-node-cleared .gh-node-label { color: rgba(186,230,253,.7); }


/* ---------------- GAME MOUNT FRAME ---------------- */
.gm-mount {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    padding: 0;
    background: linear-gradient(180deg, rgba(8,20,40,.85), rgba(3,12,28,.85));
    border: 1px solid rgba(56,189,248,.35);
    border-radius: 14px;
    box-shadow:
        0 0 0 1px rgba(56,189,248,.1),
        0 14px 40px -12px rgba(0,0,0,.8);
    overflow: hidden;
    isolation: isolate;
}
.gm-mount-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(56,189,248,.2);
    background: rgba(8,20,40,.85);
    font-size: .78rem;
    letter-spacing: .24em;
    color: #7dd3fc;
    text-transform: uppercase;
}
.gm-mount-back {
    background: none; border: 1px solid rgba(56,189,248,.3);
    color: #bae6fd;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: .72rem;
    letter-spacing: .14em;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}
.gm-mount-back:hover {
    border-color: #38bdf8;
    background: rgba(56,189,248,.12);
}
.gm-mount-body { padding: 24px; min-height: 360px; }


/* ---------------- PICKER OVERLAY (system window) ---------------- */
.gp-overlay {
    position: fixed; inset: 0;
    z-index: 9100;
    display: none;
    align-items: center; justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s ease;
}
.gp-overlay.gp-on  { display: flex; opacity: 1; pointer-events: auto; }

.gp-backdrop {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(6,18,40,.78) 0%, rgba(0,0,0,.92) 70%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.gp-panel {
    position: relative;
    z-index: 1;
    width: min(960px, 94vw);
    max-height: 88vh;
    padding: 20px 24px 24px;
    color: #bae6fd;
    background:
        linear-gradient(180deg, rgba(8,20,40,.92), rgba(3,12,28,.9));
    border: 1px solid rgba(56,189,248,.45);
    box-shadow:
        0 0 0 1px rgba(56,189,248,.12),
        0 0 50px -2px rgba(56,189,248,.45),
        0 30px 80px -10px rgba(0,0,0,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: scale(.92) translateY(8px);
    opacity: 0;
    transition: transform .45s cubic-bezier(.22,1,.36,1), opacity .35s ease;
    overflow: hidden;
    display: flex; flex-direction: column;
}
.gp-overlay.gp-on .gp-panel { transform: scale(1) translateY(0); opacity: 1; }

.gp-corner {
    position: absolute;
    width: 16px; height: 16px;
    border-color: #38bdf8;
    border-style: solid;
    filter: drop-shadow(0 0 8px rgba(56,189,248,.85));
    pointer-events: none;
    z-index: 3;
}
.gp-corner-tl { top: -3px; left:  -3px; border-width: 2px 0 0 2px; }
.gp-corner-tr { top: -3px; right: -3px; border-width: 2px 2px 0 0; }
.gp-corner-bl { bottom: -3px; left:  -3px; border-width: 0 0 2px 2px; }
.gp-corner-br { bottom: -3px; right: -3px; border-width: 0 2px 2px 0; }

.gp-header {
    text-align: center;
    font-size: .84rem;
    font-weight: 600;
    letter-spacing: .68em;
    padding-left: .68em;
    color: #7dd3fc;
    text-shadow: 0 0 10px rgba(56,189,248,.6);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.gp-warn {
    text-align: center;
    font-size: .82rem;
    color: #ff8edc;
    letter-spacing: .14em;
    margin: 0 0 20px;
    text-shadow: 0 0 8px rgba(255,95,191,.55);
    text-transform: uppercase;
}
.gp-warn-glyph {
    display: inline-block;
    margin-right: 6px;
    transform: translateY(-1px);
}

.gp-stage {
    position: relative;
    flex: 1;
    overflow: hidden;
    margin: 0 -8px;
}
.gp-track {
    display: flex;
    align-items: stretch;
    transition: transform .45s cubic-bezier(.22,1,.36,1);
    will-change: transform;
}

.gp-card {
    flex: 0 0 auto;
    width: clamp(260px, 38vw, 360px);
    margin: 0 8px;
    padding: 22px 22px 18px;
    background: linear-gradient(180deg, rgba(20,40,70,.62), rgba(8,18,36,.82));
    border: 1px solid rgba(56,189,248,.35);
    border-radius: 12px;
    color: #bae6fd;
    cursor: pointer;
    transition: transform .35s cubic-bezier(.22,1,.36,1),
                border-color .25s ease,
                box-shadow .35s ease,
                opacity .25s ease;
    transform: scale(.92);
    opacity: .55;
    isolation: isolate;
    text-align: left;
    display: flex; flex-direction: column;
    min-height: 280px;
    position: relative;
}

.gp-card-active {
    transform: scale(1);
    opacity: 1;
    border-color: #38bdf8;
    box-shadow:
        0 0 0 1px rgba(56,189,248,.4),
        0 0 36px -2px rgba(56,189,248,.7),
        0 14px 40px -10px rgba(0,0,0,.8);
}

.gp-card-locked {
    cursor: not-allowed;
}
.gp-card-locked .gp-card-name { color: #6b8398; }
.gp-card-locked .gp-card-glyph { opacity: .35; }
.gp-card-locked .gp-card-tag {
    color: #ff8edc;
    border-color: rgba(255,95,191,.45);
    background: rgba(80,20,60,.4);
}

/* Beta-tester preview state — admin can pick a game whose mount is
   still a stub. Differentiate with amber so they don't confuse it
   with a fully shipped game. */
.gp-card-preview .gp-card-tag {
    color: #fbbf24;
    border-color: rgba(251,191,36,.45);
    background: rgba(60,40,8,.4);
}
.gp-card-preview.gp-card-active {
    border-color: #fbbf24;
    box-shadow:
        0 0 0 1px rgba(251,191,36,.4),
        0 0 36px -2px rgba(251,191,36,.6),
        0 14px 40px -10px rgba(0,0,0,.8);
}
.gp-card-preview .gp-card-pick {
    background: rgba(251,191,36,.18);
    border-color: rgba(251,191,36,.55);
    color: #fef3c7;
}
.gp-card-preview .gp-card-pick:hover {
    background: rgba(251,191,36,.32);
    border-color: #fbbf24;
}

.gp-card-tag {
    align-self: flex-start;
    display: inline-block;
    padding: 3px 10px;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
    background: rgba(8,20,40,.7);
    border: 1px solid rgba(56,189,248,.4);
    border-radius: 999px;
    color: #7dd3fc;
    margin-bottom: 14px;
}

.gp-card-glyph {
    width: 64px; height: 64px;
    margin: 0 auto 14px;
    display: grid; place-items: center;
    font-size: 2.4rem;
    color: #38bdf8;
    text-shadow: 0 0 18px rgba(56,189,248,.85);
    filter: drop-shadow(0 0 10px rgba(56,189,248,.45));
}

.gp-card-name {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    color: #e0f2fe;
    margin: 0 0 6px;
    letter-spacing: .04em;
}

.gp-card-tagline {
    font-size: .82rem;
    text-align: center;
    color: #7dd3fc;
    opacity: .78;
    line-height: 1.4;
    margin: 0 0 auto;
    flex-grow: 1;
}

.gp-card-pick {
    margin-top: 14px;
    padding: 10px;
    text-align: center;
    background: rgba(56,189,248,.15);
    border: 1px solid rgba(56,189,248,.5);
    border-radius: 8px;
    color: #f0f9ff;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .24em;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0;
    transition: opacity .25s ease, background .2s ease, border-color .2s ease;
}
.gp-card-active .gp-card-pick { opacity: 1; }
.gp-card-pick:hover {
    background: rgba(56,189,248,.3);
    border-color: #38bdf8;
}
.gp-card-locked .gp-card-pick {
    background: rgba(80,20,60,.3);
    border-color: rgba(255,95,191,.4);
    color: #ff8edc;
    cursor: not-allowed;
}

.gp-arrows {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    gap: 10px;
}
.gp-arrow {
    background: rgba(8,20,40,.85);
    border: 1px solid rgba(56,189,248,.45);
    color: #bae6fd;
    width: 44px; height: 44px;
    border-radius: 12px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
    display: grid; place-items: center;
}
.gp-arrow:hover { border-color: #38bdf8; background: rgba(56,189,248,.18); transform: translateY(-1px); }
.gp-arrow:disabled { opacity: .3; cursor: default; transform: none; background: rgba(8,20,40,.4); }
.gp-arrow:disabled:hover { background: rgba(8,20,40,.4); border-color: rgba(56,189,248,.45); }

.gp-dots {
    display: flex; gap: 6px;
    align-items: center;
}
.gp-dot {
    width: 8px; height: 8px;
    background: rgba(56,189,248,.25);
    border-radius: 999px;
    transition: background .2s ease, transform .2s ease;
}
.gp-dot.gp-dot-on {
    background: #38bdf8;
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(56,189,248,.75);
}

/* ---- confirm modal (after a pick) ---- */
.gp-confirm {
    position: absolute; inset: 0;
    display: none; align-items: center; justify-content: center;
    background: rgba(2,8,18,.78);
    backdrop-filter: blur(4px);
    z-index: 4;
    opacity: 0;
    transition: opacity .3s ease;
}
.gp-confirm.gp-on { display: flex; opacity: 1; }
.gp-confirm-card {
    width: min(420px, 88vw);
    padding: 24px;
    background: linear-gradient(180deg, rgba(8,20,40,.95), rgba(3,12,28,.95));
    border: 1px solid rgba(56,189,248,.55);
    box-shadow: 0 0 28px -2px rgba(56,189,248,.75);
    text-align: center;
    color: #bae6fd;
    transform: scale(.94);
    transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.gp-confirm.gp-on .gp-confirm-card { transform: scale(1); }
.gp-confirm-h {
    font-size: .8rem;
    letter-spacing: .42em;
    color: #ff8edc;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255,95,191,.6);
    margin-bottom: 8px;
}
.gp-confirm-game {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f0f9ff;
    margin: 0 0 12px;
}
.gp-confirm-body {
    font-size: .9rem;
    color: #7dd3fc;
    line-height: 1.5;
    margin: 0 0 18px;
}
.gp-confirm-actions {
    display: flex; gap: 10px;
    justify-content: center;
}
.gp-btn {
    padding: 10px 18px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.gp-btn-primary {
    background: rgba(56,189,248,.2);
    color: #f0f9ff;
    border: 1px solid #38bdf8;
    box-shadow: 0 0 18px -4px rgba(56,189,248,.7);
}
.gp-btn-primary:hover {
    background: rgba(56,189,248,.35);
    transform: translateY(-1px);
}
.gp-btn-ghost {
    background: rgba(8,20,40,.6);
    color: #7dd3fc;
    border: 1px solid rgba(56,189,248,.35);
}
.gp-btn-ghost:hover {
    border-color: #38bdf8;
    background: rgba(8,20,40,.8);
}

/* ---- "lock-in" sequence: scanlines + flash ---- */
.gp-lock-flash {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, rgba(56,189,248,.45) 0%, rgba(56,189,248,0) 70%);
    pointer-events: none;
    opacity: 0;
    z-index: 5;
}
.gp-on-lock .gp-lock-flash { animation: gpLockFlash .9s ease-out; }
@keyframes gpLockFlash {
    0%   { opacity: 0; }
    20%  { opacity: 1; }
    100% { opacity: 0; }
}


/* ---------------- LEXICON (Wordle clone) ---------------- */
.lex-shell {
    max-width: 420px; margin: 0 auto;
    color: #bae6fd;
    text-align: center;
}
.lex-grid {
    display: grid;
    grid-template-rows: repeat(6, 56px);
    gap: 6px;
    margin: 0 auto 18px;
    width: max-content;
}
.lex-row {
    display: grid;
    grid-template-columns: repeat(5, 56px);
    gap: 6px;
}
.lex-cell {
    width: 56px; height: 56px;
    display: grid; place-items: center;
    font-size: 1.6rem; font-weight: 700;
    background: rgba(8,20,40,.6);
    border: 2px solid rgba(56,189,248,.25);
    color: #e0f2fe;
    text-transform: uppercase;
    transition: background .35s ease, border-color .35s ease, transform .35s cubic-bezier(.22,1,.36,1);
}
.lex-cell-typed { border-color: rgba(56,189,248,.55); transform: scale(1.06); }
.lex-cell.lex-hit  { background: rgba(34,197,94,.55);  border-color: rgba(34,197,94,.85); color: #f0fdf4; }
.lex-cell.lex-warm { background: rgba(234,179,8,.55);  border-color: rgba(234,179,8,.85); color: #fefce8; }
.lex-cell.lex-cold { background: rgba(60,80,100,.55); border-color: rgba(60,80,100,.55); color: #cbd5e1; }

.lex-keyboard {
    display: flex; flex-direction: column; gap: 6px;
    align-items: center;
    margin-top: 18px;
}
.lex-krow {
    display: flex; gap: 5px;
}
.lex-key {
    min-width: 32px; height: 48px;
    padding: 0 8px;
    background: rgba(8,20,40,.85);
    border: 1px solid rgba(56,189,248,.3);
    color: #bae6fd;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.lex-key:hover { background: rgba(56,189,248,.15); border-color: #38bdf8; }
.lex-key:active { transform: translateY(1px); }
.lex-key.lex-hit  { background: rgba(34,197,94,.45);  border-color: rgba(34,197,94,.7); }
.lex-key.lex-warm { background: rgba(234,179,8,.45);  border-color: rgba(234,179,8,.7); }
.lex-key.lex-cold { background: rgba(40,55,75,.6);   border-color: rgba(40,55,75,.7); color: #6b8398; }
.lex-key-wide { min-width: 60px; font-size: .78rem; }

.lex-status {
    margin-top: 10px;
    font-size: .85rem;
    color: #7dd3fc;
    letter-spacing: .12em;
    min-height: 22px;
}
.lex-status.lex-status-win  { color: #22c55e; text-shadow: 0 0 6px rgba(34,197,94,.7); }
.lex-status.lex-status-loss { color: #ff8edc; text-shadow: 0 0 6px rgba(255,95,191,.7); }


/* ---------------- DRAFT (Checkers) ---------------- */
.draft-shell {
    max-width: 540px; margin: 0 auto;
    color: #bae6fd;
    text-align: center;
}
.draft-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
    width: min(480px, 90vw);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border: 1px solid rgba(56,189,248,.4);
    box-shadow:
        0 0 0 1px rgba(56,189,248,.12),
        0 14px 40px -12px rgba(0,0,0,.8);
    user-select: none;
    background: #03101e;
}
.draft-sq {
    position: relative;
    display: grid; place-items: center;
    cursor: default;
}
.draft-sq-light { background: rgba(56,189,248,.08); }
.draft-sq-dark  { background: rgba(8,20,40,.85); }
.draft-sq-playable { cursor: pointer; }
.draft-sq-selected {
    box-shadow: inset 0 0 0 3px #38bdf8, 0 0 16px rgba(56,189,248,.55);
}
.draft-sq-target {
    box-shadow: inset 0 0 0 3px rgba(34,197,94,.7);
}
.draft-sq-target::after {
    content: '';
    position: absolute; inset: 30%;
    border-radius: 50%;
    background: rgba(34,197,94,.45);
    box-shadow: 0 0 14px rgba(34,197,94,.7);
}

.draft-piece {
    width: 70%; aspect-ratio: 1 / 1;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 1.2rem; font-weight: 700;
    transition: transform .2s ease;
}
.draft-piece-p1 {
    background: radial-gradient(circle at 30% 30%, #7dd3fc, #0284c7);
    box-shadow: 0 4px 10px -2px rgba(0,0,0,.7), inset 0 0 0 2px rgba(255,255,255,.18);
    color: #082f49;
}
.draft-piece-p2 {
    background: radial-gradient(circle at 30% 30%, #ff8edc, #b91c5c);
    box-shadow: 0 4px 10px -2px rgba(0,0,0,.7), inset 0 0 0 2px rgba(255,255,255,.18);
    color: #4c0519;
}
.draft-piece-king::after {
    content: '\2654';
    font-size: 1.6em;
    opacity: .85;
}

.draft-status {
    margin-top: 16px;
    font-size: .85rem;
    color: #7dd3fc;
    letter-spacing: .12em;
    min-height: 22px;
}
.draft-status.draft-status-win  { color: #22c55e; }
.draft-status.draft-status-loss { color: #ff8edc; }


/* ---------------- CHESS ---------------- */
.chess-shell {
    max-width: 540px; margin: 0 auto;
    color: #bae6fd;
    text-align: center;
}
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    width: min(480px, 90vw);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border: 1px solid rgba(56,189,248,.4);
    box-shadow:
        0 0 0 1px rgba(56,189,248,.12),
        0 14px 40px -12px rgba(0,0,0,.8);
    user-select: none;
    background: #03101e;
}
.chess-sq {
    position: relative;
    display: grid; place-items: center;
    cursor: pointer;
}
.chess-sq-light { background: rgba(56,189,248,.09); }
.chess-sq-dark  { background: rgba(8,20,40,.85); }
.chess-sq-selected {
    box-shadow: inset 0 0 0 3px #38bdf8, 0 0 16px rgba(56,189,248,.55);
}
.chess-sq-target::after {
    content: '';
    position: absolute; left: 50%; top: 50%;
    width: 28%; height: 28%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(34,197,94,.55);
    box-shadow: 0 0 14px rgba(34,197,94,.65);
}
/* highlight a target square that contains a piece (capture) — show
   a ring around the piece instead of a dot */
.chess-sq-target:has(.chess-piece)::after {
    width: 86%; height: 86%;
    background: transparent;
    border: 3px solid rgba(34,197,94,.7);
    box-shadow: 0 0 16px rgba(34,197,94,.55);
}
.chess-sq-last { box-shadow: inset 0 0 0 2px rgba(255,224,140,.55); }

.chess-piece {
    font-size: clamp(1.6rem, 5.5vw, 2.4rem);
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,.55);
    pointer-events: none;
}
.chess-w { color: #f0f9ff; text-shadow: 0 0 6px rgba(255,255,255,.4), 0 2px 4px rgba(0,0,0,.6); }
.chess-b { color: #1e293b; text-shadow: 0 0 4px rgba(0,0,0,.7); }

.chess-captured {
    min-height: 28px;
    display: flex; flex-wrap: wrap; gap: 2px;
    justify-content: center;
    margin: 6px auto;
    width: min(480px, 90vw);
}
.chess-cap { font-size: 1.1rem; opacity: .75; }

.chess-status {
    margin-top: 14px;
    font-size: .85rem;
    color: #7dd3fc;
    letter-spacing: .12em;
    min-height: 22px;
}
.chess-status.chess-status-check { color: #ff8edc; text-shadow: 0 0 6px rgba(255,95,191,.55); }
.chess-status.chess-status-win   { color: #22c55e; text-shadow: 0 0 6px rgba(34,197,94,.65); }
.chess-status.chess-status-loss  { color: #ff8edc; }
.chess-status.chess-status-draw  { color: #cbd5e1; }


/* ---------------- SOLITAIRE (Klondike) ---------------- */
.sol-shell {
    max-width: 760px; margin: 0 auto;
    color: #bae6fd;
    text-align: center;
}
.sol-top {
    display: grid;
    grid-template-columns: 70px 70px 1fr auto;
    gap: 10px;
    align-items: start;
    margin-bottom: 16px;
}
.sol-spacer { /* nothing */ }
.sol-foundations {
    display: grid;
    grid-template-columns: repeat(4, 70px);
    gap: 10px;
}
.sol-tableau {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: min(620px, 100%);
    margin: 0 auto;
}
.sol-col {
    position: relative;
    min-height: 96px;
    border: 1px dashed rgba(56,189,248,.18);
    border-radius: 6px;
}
.sol-col-empty { background: rgba(56,189,248,.04); }

.sol-card {
    position: relative;
    width: 64px;
    height: 92px;
    border-radius: 6px;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid rgba(0,0,0,.18);
    box-shadow: 0 2px 6px -2px rgba(0,0,0,.55);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: transform .12s ease, box-shadow .12s ease;
}
.sol-col .sol-card { position: absolute; left: 50%; transform: translateX(-50%); }
.sol-col .sol-card:hover { transform: translateX(-50%) translateY(-2px); }

.sol-down {
    background:
        repeating-linear-gradient(45deg, rgba(56,189,248,.45), rgba(56,189,248,.45) 4px, rgba(8,30,50,.85) 4px, rgba(8,30,50,.85) 8px),
        linear-gradient(180deg, #0c2238, #08182a);
    border-color: rgba(56,189,248,.4);
    box-shadow: 0 2px 6px -2px rgba(0,0,0,.7), inset 0 0 0 2px rgba(56,189,248,.18);
}
.sol-up.sol-r { color: #be123c; }
.sol-up.sol-b { color: #1e293b; }

.sol-rank {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}
.sol-suit {
    font-size: 1.6rem;
    line-height: 1;
    margin-top: 2px;
}

.sol-selected {
    box-shadow: 0 0 0 3px #38bdf8, 0 0 18px rgba(56,189,248,.7) !important;
    transform: translateX(-50%) translateY(-3px) !important;
    z-index: 20;
}
.sol-waste .sol-selected,
.sol-waste .sol-card.sol-selected {
    transform: translateY(-3px) !important;
}

.sol-stock, .sol-waste {
    position: relative;
    width: 64px; height: 92px;
    border: 1px dashed rgba(56,189,248,.3);
    border-radius: 6px;
    cursor: pointer;
    display: grid; place-items: center;
}
.sol-stock.sol-empty .sol-recycle {
    color: #7dd3fc;
    font-size: 1.6rem;
    text-shadow: 0 0 8px rgba(56,189,248,.6);
}
.sol-pile-count {
    position: absolute;
    bottom: -18px; left: 50%; transform: translateX(-50%);
    font-size: .68rem;
    color: rgba(186,230,253,.55);
    letter-spacing: .12em;
}

.sol-found-slot {
    position: relative;
    width: 64px; height: 92px;
    border: 1px dashed rgba(56,189,248,.3);
    border-radius: 6px;
    display: grid; place-items: center;
}
.sol-foundation-glyph {
    color: rgba(56,189,248,.3);
    font-size: 2rem;
}

.sol-status {
    margin-top: 16px;
    font-size: .85rem;
    color: #7dd3fc;
    letter-spacing: .12em;
    min-height: 22px;
}
.sol-status.sol-status-win { color: #22c55e; text-shadow: 0 0 6px rgba(34,197,94,.7); }


/* ---------------- CANVAS-GAME SHARED ---------------- */
.bb-shell, .ftb-shell, .race-shell, .pool-shell {
    max-width: 700px; margin: 0 auto;
    color: #bae6fd;
    text-align: center;
}
.bb-canvas, .ftb-canvas, .race-canvas, .pool-canvas {
    width: 100%; max-width: 640px;
    aspect-ratio: 8 / 5;
    border: 1px solid rgba(56,189,248,.4);
    border-radius: 10px;
    background: #03101e;
    box-shadow:
        0 0 0 1px rgba(56,189,248,.12),
        0 14px 40px -12px rgba(0,0,0,.8);
    cursor: crosshair;
    touch-action: none;
}
.race-canvas { cursor: default; }
.bb-hud, .ftb-hud, .race-hud, .pool-hud {
    display: flex; justify-content: center; flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
/* re-use the .bb-pill class for all canvas-game HUDs */
.bb-pill {
    display: inline-flex; gap: 6px; align-items: center;
    padding: 4px 12px;
    background: rgba(8,20,40,.7);
    border: 1px solid rgba(56,189,248,.3);
    border-radius: 999px;
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #bae6fd;
}
.bb-pill strong {
    color: #38bdf8; font-weight: 700;
    text-shadow: 0 0 6px rgba(56,189,248,.6);
}
.bb-status, .ftb-status, .race-status, .pool-status {
    margin-top: 10px;
    font-size: .85rem;
    color: #7dd3fc;
    letter-spacing: .12em;
    min-height: 22px;
}
.bb-status.bb-status-win,
.ftb-status.ftb-status-win,
.race-status.race-status-win,
.pool-status.pool-status-win   { color: #22c55e; text-shadow: 0 0 6px rgba(34,197,94,.65); }
.bb-status.bb-status-loss,
.ftb-status.ftb-status-loss,
.race-status.race-status-loss,
.pool-status.pool-status-loss  { color: #ff8edc; }


/* ---------------- COMING SOON STUB ---------------- */
.gh-stub {
    text-align: center;
    padding: 40px 20px;
    color: #7dd3fc;
}
.gh-stub-eyebrow {
    font-size: .72rem;
    letter-spacing: .58em;
    color: #ff8edc;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255,95,191,.55);
    margin-bottom: 10px;
}
.gh-stub-title {
    font-size: 1.6rem;
    color: #e0f2fe;
    margin: 0 0 8px;
}
.gh-stub-body {
    font-size: .9rem;
    color: #7dd3fc;
    opacity: .78;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.5;
}


/* ---------------- MOBILE ---------------- */
@media (max-width: 540px) {
    .gp-card { width: 78vw; min-height: 320px; }
    .gh-map { padding: 12px 4px 32px; }
    .gh-node { width: 56px; height: 56px; font-size: .95rem; }
    .gh-node-boss { width: 68px; height: 68px; }
    .lex-cell { width: 48px; height: 48px; font-size: 1.3rem; }
    .lex-row { grid-template-columns: repeat(5, 48px); }
}
