/* =============================================================
   GAME HUB — QuizioMatch
   Dark base #0D0A0F, soulmate pink #E91E63, violet #7C4DFF.
   Same language as the Lounge: 22-24px cards, 999px pills,
   pink ambient halos. Mobile portrait is the primary case.
   ============================================================= */

#gameHubScreen {
    display: none;
    background: #0D0A0F;
    color: #e7e9ee;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

#gameHubScreen.active {
    display: flex !important;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
    overflow: hidden;
}

/* The match view owns the whole viewport so the playfield gets every
   pixel it can; the hub keeps a little breathing room at the bottom. */
#gameHubScreen.active.gh-in-hub .gh-scroll {
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
}

.gh-view {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}
.gh-view[hidden] { display: none !important; }

/* ---------- ambient halo ---------- */
.gh-view--hub::before {
    content: '';
    position: absolute;
    top: -70px; left: 50%;
    width: 660px; max-width: 135%; height: 440px;
    transform: translateX(-50%);
    background:
        radial-gradient(ellipse 55% 55% at 50% 38%, rgba(233, 30, 99, 0.22) 0%, transparent 62%),
        radial-gradient(ellipse 70% 35% at 50% 0%, rgba(124, 77, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(2px);
}
.gh-view--hub > * { position: relative; z-index: 1; }

/* ============================================================
   Header
   ============================================================ */

.gh-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 10px 18px;
}

.gh-back {
    width: 38px; height: 38px;
    flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    transition: background .15s ease, transform .12s ease;
}
.gh-back:active { transform: scale(0.93); background: rgba(255, 255, 255, 0.12); }

.gh-title-wrap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }

.gh-title {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -0.6px;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFCAD9 55%, #FF80AB 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.gh-sub { font-size: 12.5px; color: rgba(255, 255, 255, 0.55); margin-top: 2px; }

/* ============================================================
   Scroll body + section headings
   ============================================================ */

.gh-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 16px 28px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.gh-sec-h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 2px -6px 2px;
}
.gh-sec-h h3 {
    font-size: 15px;
    font-weight: 750;
    color: #fff;
    letter-spacing: -0.2px;
    margin: 0;
}
.gh-sec-h span { font-size: 12px; color: rgba(255, 255, 255, 0.45); }

/* ============================================================
   Free badge + level card
   ============================================================ */

.gh-free-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #7CFFB2;
    background: rgba(34, 197, 94, 0.13);
    border: 1px solid rgba(34, 197, 94, 0.30);
}
.gh-free-pill::before { content: '✓'; font-size: 11px; }

.gh-level-card {
    border-radius: 22px;
    padding: 16px 18px;
    background:
        linear-gradient(135deg, rgba(233, 30, 99, 0.20) 0%, rgba(124, 77, 255, 0.16) 100%),
        rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.gh-level-top { display: flex; align-items: center; gap: 12px; }
.gh-level-badge {
    width: 46px; height: 46px;
    flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #E91E63, #7C4DFF);
    font-size: 18px; font-weight: 800; color: #fff;
    box-shadow: 0 6px 18px rgba(233, 30, 99, 0.35);
}
.gh-level-meta { flex: 1 1 auto; min-width: 0; }
.gh-level-name { font-size: 14.5px; font-weight: 750; color: #fff; }
.gh-level-gp { font-size: 12.5px; color: rgba(255, 255, 255, 0.60); margin-top: 1px; }

.gh-bar {
    margin-top: 12px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}
.gh-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #FF80AB, #E91E63 60%, #7C4DFF);
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.gh-bar-label { margin-top: 6px; font-size: 11.5px; color: rgba(255, 255, 255, 0.48); }

/* Three numbers under the level bar — the whole record, at a glance. */
.gh-record {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.gh-record-cell { text-align: center; min-width: 0; }
.gh-record-cell b {
    display: block;
    font-size: 17px; font-weight: 800; color: #fff;
    font-variant-numeric: tabular-nums;
}
.gh-record-cell span {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.48);
}

/* ============================================================
   Game cards
   ============================================================ */

.gh-games { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.gh-game-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 14px 13px 13px 13px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 124px;
    transition: transform .12s ease, border-color .15s ease;
}
.gh-game-card:active { transform: scale(0.975); }
.gh-game-card::after {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 110px; height: 110px;
    border-radius: 50%;
    background: var(--gh-accent, #E91E63);
    opacity: 0.16;
    filter: blur(18px);
    pointer-events: none;
}
.gh-game-emoji { font-size: 26px; line-height: 1; }
.gh-game-name { font-size: 14.5px; font-weight: 750; color: #fff; letter-spacing: -0.2px; }
.gh-game-desc {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.52);
    line-height: 1.35;
    flex: 1 1 auto;
}
.gh-game-dur {
    font-size: 10.5px;
    font-weight: 650;
    color: var(--gh-accent, #E91E63);
    filter: brightness(1.35);
}

/* ============================================================
   Account rows / suggestion cards
   ============================================================ */

.gh-accounts {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 6px 2px;
    scrollbar-width: none;
}
.gh-accounts::-webkit-scrollbar { display: none; }

.gh-acc-card {
    flex: 0 0 auto;
    width: 138px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-align: left;
    padding: 0;
    transition: transform .12s ease;
}
.gh-acc-card:active { transform: scale(0.97); }
.gh-acc-photo {
    width: 100%;
    height: 118px;
    background: linear-gradient(135deg, #E91E63, #7C4DFF);
    background-size: cover;
    background-position: center;
    display: grid;
    place-items: center;
    font-size: 32px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
}
.gh-acc-body { padding: 9px 11px 11px 11px; }
.gh-acc-name { font-size: 13.5px; font-weight: 750; color: #fff; display: flex; align-items: center; gap: 5px; }
.gh-acc-bio {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.50);
    margin-top: 2px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gh-acc-fav {
    margin-top: 7px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 650;
    color: #FFCAD9;
    background: rgba(233, 30, 99, 0.16);
    border: 1px solid rgba(233, 30, 99, 0.26);
}

/* ============================================================
   Notice cards (resume / invite / chat request)
   ============================================================ */

.gh-card {
    border-radius: 20px;
    padding: 14px 15px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    display: flex;
    align-items: center;
    gap: 12px;
}
.gh-card--accent {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.16), rgba(124, 77, 255, 0.12)), rgba(255, 255, 255, 0.03);
    border-color: rgba(233, 30, 99, 0.28);
}
.gh-card-av {
    width: 44px; height: 44px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #E91E63, #7C4DFF);
    background-size: cover; background-position: center;
    display: grid; place-items: center;
    font-weight: 800; color: #fff; font-size: 16px;
}
.gh-card-body { flex: 1 1 auto; min-width: 0; }
.gh-card-t { font-size: 13.5px; font-weight: 700; color: #fff; }
.gh-card-s { font-size: 11.5px; color: rgba(255, 255, 255, 0.55); margin-top: 2px; line-height: 1.35; }
.gh-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.gh-btn {
    border: none;
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    transition: transform .12s ease, filter .15s ease;
    font-family: inherit;
}
.gh-btn:active { transform: scale(0.95); }
.gh-btn--primary {
    background: linear-gradient(135deg, #E91E63, #FF4081);
    box-shadow: 0 6px 18px rgba(233, 30, 99, 0.32);
}
.gh-btn--ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.16); }
.gh-btn--block { width: 100%; }
.gh-btn[disabled] { opacity: .45; pointer-events: none; }

/* history list */
.gh-hist { display: flex; flex-direction: column; gap: 8px; }
.gh-hist-row {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.gh-hist-em { font-size: 18px; }
.gh-hist-main { flex: 1 1 auto; min-width: 0; }
.gh-hist-t { font-size: 12.5px; font-weight: 650; color: #fff; }
.gh-hist-s { font-size: 11px; color: rgba(255, 255, 255, 0.45); margin-top: 1px; }
.gh-hist-res { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.gh-res--win  { color: #7CFFB2; background: rgba(34, 197, 94, 0.15); }
.gh-res--loss { color: #FF8FA3; background: rgba(233, 30, 99, 0.15); }
.gh-res--draw { color: #CBB6FF; background: rgba(124, 77, 255, 0.16); }

.gh-empty {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.42);
    padding: 14px 4px;
    text-align: center;
}

/* ============================================================
   Bottom sheet (pick an account / pick a game)
   ============================================================ */

.gh-sheet-wrap {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
}
.gh-sheet-wrap.open { display: block; }
.gh-sheet-back {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.gh-sheet {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-height: 82vh;
    overflow-y: auto;
    background: #14101A;
    border-top-left-radius: 26px;
    border-top-right-radius: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    padding: 10px 18px calc(24px + env(safe-area-inset-bottom, 0px)) 18px;
    animation: ghSheetUp .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes ghSheetUp { from { transform: translateY(22px); opacity: .4; } to { transform: none; opacity: 1; } }
.gh-sheet-grip {
    width: 38px; height: 4px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.20);
    margin: 6px auto 14px auto;
}
.gh-sheet-title { font-size: 17px; font-weight: 780; color: #fff; margin: 0 0 3px 0; }
.gh-sheet-sub { font-size: 12.5px; color: rgba(255, 255, 255, 0.52); margin: 0 0 14px 0; line-height: 1.4; }
.gh-sheet-list { display: flex; flex-direction: column; gap: 9px; }
.gh-sheet-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.07);
    cursor: pointer;
    color: inherit; font: inherit; text-align: left; width: 100%;
}
.gh-sheet-row:active { transform: scale(0.985); }

/* ============================================================
   MATCH SCREEN
   ============================================================ */

.gh-view--match { background: #0A070D; }

.gh-mhead {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 8px 14px;
}
.gh-mhead .gh-back { width: 34px; height: 34px; }

.gh-mplayer { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gh-mav {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #E91E63, #7C4DFF);
    background-size: cover; background-position: center;
    display: grid; place-items: center;
    font-size: 12px; font-weight: 800; color: #fff;
    flex: 0 0 auto;
}
.gh-mname {
    font-size: 12.5px; font-weight: 700; color: #fff;
    max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gh-mscore {
    flex: 1 1 auto;
    text-align: center;
    font-size: 21px;
    font-weight: 850;
    letter-spacing: 1px;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.gh-mscore small { font-size: 10.5px; display: block; font-weight: 600; color: rgba(255,255,255,.42); letter-spacing: 0; }

/* the playfield gets all remaining space */
.gh-stage {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.gh-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 60px rgba(124, 77, 255, 0.10);
    display: block;
    /* The playfield repaints every frame — give it its own layer so the rest
       of the screen is never dragged into the repaint. */
    contain: layout paint;
    will-change: contents;
    background: #12060f;
}

.gh-stage-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: rgba(10, 7, 13, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 18px;
    text-align: center;
    padding: 22px;
    z-index: 3;
}
.gh-stage-overlay.show { display: flex; }
.gh-ov-title { font-size: 19px; font-weight: 800; color: #fff; }
.gh-ov-text { font-size: 13px; color: rgba(255, 255, 255, 0.62); max-width: 260px; line-height: 1.45; }

/* transient banner (goal / point) */
.gh-flash {
    position: absolute;
    top: 16%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #E91E63, #7C4DFF);
    box-shadow: 0 8px 26px rgba(233, 30, 99, 0.42);
    opacity: 0;
    pointer-events: none;
    z-index: 4;
}
.gh-flash.show { animation: ghFlash 1.15s ease forwards; }
@keyframes ghFlash {
    0%   { opacity: 0; transform: translate(-50%, 8px) scale(.9); }
    18%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
    75%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -10px) scale(.97); }
}

/* ---------- controls (never covered by the chat) ---------- */
.gh-controls {
    flex: 0 0 auto;
    padding: 8px 14px 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 0;
}
.gh-controls:empty { display: none; }
.gh-hint {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.42);
    text-align: center;
}
.gh-shoot {
    width: 72px; height: 72px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #E91E63, #FF4081);
    box-shadow: 0 8px 24px rgba(233, 30, 99, 0.42), inset 0 2px 0 rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .5px;
    cursor: pointer;
    display: grid;
    place-items: center;
    line-height: 1.1;
    opacity: .68;
    transform: scale(.96);
    transition: transform .16s cubic-bezier(.2, .9, .3, 1.3), box-shadow .18s ease, opacity .16s ease;
    will-change: transform;
}
/* lit up exactly while the ball is at your feet */
.gh-shoot--armed {
    opacity: 1;
    transform: scale(1);
    box-shadow:
        0 10px 30px rgba(233, 30, 99, 0.55),
        0 0 0 3px rgba(255, 255, 255, 0.16),
        inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.gh-shoot:active { transform: scale(0.9); }

/* ---------- reaction duel ---------- */
.gh-react {
    width: 100%;
    height: 100%;
    max-width: 460px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(124, 77, 255, 0.16), transparent 70%),
        radial-gradient(120% 80% at 50% 100%, rgba(233, 30, 99, 0.14), transparent 70%),
        rgba(255, 255, 255, 0.03);
    transition: background-color .14s ease, border-color .14s ease;
    text-align: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    contain: layout paint;
}
/* the tap target itself — a physical-feeling button, not just a label */
.gh-react-pad {
    position: relative;
    width: 180px;
    height: 180px;
    max-width: 52vw;
    max-height: 52vw;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03) 60%, rgba(255, 255, 255, 0.015));
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 2px 18px rgba(255, 255, 255, 0.06), 0 14px 34px rgba(0, 0, 0, 0.42);
    transition: transform .16s cubic-bezier(.2, .9, .3, 1.2), box-shadow .18s ease, border-color .18s ease;
    /* transform/opacity only — the pings never trigger a layout pass */
    will-change: transform;
}
.gh-react-ping {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
    color: rgba(255, 255, 255, 0.5);
    opacity: 0;
    pointer-events: none;
}
.gh-react-big {
    font-size: 30px;
    font-weight: 850;
    color: #fff;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
.gh-react-sub   { font-size: 13px; color: rgba(255, 255, 255, 0.65); max-width: 260px; line-height: 1.4; }
.gh-react-times { font-size: 12px; color: rgba(255, 255, 255, 0.55); font-variant-numeric: tabular-nums; min-height: 15px; }
.gh-react-dots  { display: flex; gap: 6px; margin-top: 2px; }
.gh-react-dot   { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.gh-react-dot--u { background: #FF4081; box-shadow: 0 0 10px rgba(255, 64, 129, .6); }
.gh-react-dot--o { background: #7C4DFF; box-shadow: 0 0 10px rgba(124, 77, 255, .6); }

/* hold — a slow breath, so the wait is visibly a wait */
.gh-react[data-mode="wait"] { background-color: rgba(233, 30, 99, 0.14); border-color: rgba(233, 30, 99, 0.34); }
.gh-react[data-mode="wait"] .gh-react-pad {
    background: radial-gradient(circle at 38% 32%, rgba(255, 120, 170, 0.32), rgba(233, 30, 99, 0.22) 62%, rgba(233, 30, 99, 0.12));
    border-color: rgba(255, 120, 170, 0.5);
    box-shadow: inset 0 2px 22px rgba(255, 120, 170, 0.18), 0 0 40px rgba(233, 30, 99, 0.28);
    animation: ghReactBreath 1.6s ease-in-out infinite;
}
@keyframes ghReactBreath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

/* go — snap to green and throw two rings outward */
.gh-react[data-mode="go"] { background-color: rgba(34, 197, 94, 0.2); border-color: rgba(34, 197, 94, 0.45); }
.gh-react[data-mode="go"] .gh-react-pad {
    background: radial-gradient(circle at 38% 32%, rgba(190, 255, 214, 0.5), rgba(34, 197, 94, 0.42) 60%, rgba(16, 140, 70, 0.3));
    border-color: rgba(150, 255, 190, 0.75);
    box-shadow: inset 0 2px 26px rgba(190, 255, 214, 0.3), 0 0 60px rgba(34, 197, 94, 0.5);
    transform: scale(1.06);
}
.gh-react[data-mode="go"] .gh-react-ping {
    color: rgba(150, 255, 190, 0.85);
    animation: ghReactPing 1s cubic-bezier(.15, .7, .3, 1) infinite;
}
.gh-react[data-mode="go"] .gh-react-ping--b { animation-delay: .5s; }
@keyframes ghReactPing {
    0%   { opacity: .8; transform: scale(1); }
    100% { opacity: 0;  transform: scale(1.7); }
}

/* the verdict of the round */
.gh-react[data-mode="won"]  .gh-react-pad { border-color: rgba(255, 211, 77, 0.7); box-shadow: inset 0 2px 22px rgba(255, 211, 77, .2), 0 0 46px rgba(255, 211, 77, .34); }
.gh-react[data-mode="lost"] .gh-react-pad { border-color: rgba(255, 255, 255, 0.12); opacity: .72; }
.gh-react[data-mode="won"], .gh-react[data-mode="lost"], .gh-react[data-mode="tie"] { background-color: rgba(255, 255, 255, 0.03); }

/* ---------- connect four ---------- */
.gh-c4 {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gh-c4-turn {
    text-align: center;
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
}
.gh-c4-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    padding: 9px;
    border-radius: 18px;
    background:
        linear-gradient(160deg, rgba(124, 77, 255, 0.3), rgba(233, 30, 99, 0.18)),
        rgba(10, 7, 13, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -10px 24px rgba(0, 0, 0, 0.28),
        0 16px 40px rgba(0, 0, 0, 0.45);
    transition: box-shadow .3s ease;
    contain: layout paint;
}
.gh-c4-grid[data-turn="me"] {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -10px 24px rgba(0, 0, 0, 0.28),
        0 16px 40px rgba(0, 0, 0, 0.45),
        0 0 0 1.5px rgba(255, 64, 129, 0.45);
}
.gh-c4-cell {
    aspect-ratio: 1;
    border-radius: 50%;
    /* an empty socket: dark, with the light catching the top rim */
    background:
        radial-gradient(circle at 50% 34%, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.6) 70%),
        rgba(10, 7, 13, 0.72);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.75), inset 0 -1px 0 rgba(255, 255, 255, 0.07);
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    transition: transform .12s ease, box-shadow .2s ease;
}
.gh-c4-cell[data-p="1"] {
    background: radial-gradient(circle at 34% 28%, #FFA8C6, #E91E63 62%, #A5124A 100%);
    box-shadow: inset 0 -3px 7px rgba(0, 0, 0, .38), inset 0 2px 4px rgba(255, 255, 255, .32), 0 0 14px rgba(233, 30, 99, .38);
}
.gh-c4-cell[data-p="2"] {
    background: radial-gradient(circle at 34% 28%, #D0BCFF, #7C4DFF 62%, #4B2BB5 100%);
    box-shadow: inset 0 -3px 7px rgba(0, 0, 0, .38), inset 0 2px 4px rgba(255, 255, 255, .32), 0 0 14px rgba(124, 77, 255, .38);
}
.gh-c4-cell.gh-c4-last  { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: -2px; }
/* Specific enough to outrank the drop animation below: a disc that both
   lands and completes the line must show the win, not the fall. */
.gh-c4-grid .gh-c4-cell.gh-c4-win {
    outline: 2.5px solid #FFD34D;
    outline-offset: -1px;
    animation: ghPulse 1s ease infinite alternate;
}
@keyframes ghPulse { to { transform: scale(1.07); } }
.gh-c4-cell[disabled] { cursor: default; }
/* a landing disc falls in from above its own column */
.gh-c4-cell.gh-c4-drop { animation: ghC4Drop .34s cubic-bezier(.34, .6, .3, 1.25); }
@keyframes ghC4Drop {
    0%   { transform: translateY(calc(var(--gh-fall, 1) * -118%)); opacity: .35; }
    72%  { transform: translateY(0); opacity: 1; }
    84%  { transform: translateY(-6%) scaleY(.94); }
    100% { transform: translateY(0) scaleY(1); }
}
/* the free slot under the pointer lights up, so a column is easy to aim at */
@media (hover: hover) {
    .gh-c4-grid[data-turn="me"] .gh-c4-cell:not([disabled]):hover {
        box-shadow: inset 0 2px 5px rgba(0, 0, 0, .75), 0 0 0 2px rgba(255, 64, 129, .55);
    }
}

/* The three dots while the account thinks about a chat request. */
.gh-typing { display: inline-flex; gap: 4px; vertical-align: middle; }
.gh-typing i {
    width: 5px; height: 5px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    animation: ghDot .9s ease-in-out infinite;
}
.gh-typing i:nth-child(2) { animation-delay: .15s; }
.gh-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ghDot { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }


/* ============================================================
   RESULT SCREEN
   ============================================================ */

.gh-view--result .gh-scroll { gap: 16px; }

.gh-result-hero {
    border-radius: 24px;
    padding: 22px 18px;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(233, 30, 99, 0.22) 0%, rgba(124, 77, 255, 0.18) 100%),
        rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.10);
}
.gh-result-verdict { font-size: 24px; font-weight: 850; color: #fff; letter-spacing: -0.5px; }
.gh-result-game { font-size: 12.5px; color: rgba(255, 255, 255, 0.55); margin-top: 3px; }
.gh-result-players {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; margin: 16px 0 6px 0;
}
.gh-rp { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 92px; }
.gh-rp-av {
    width: 58px; height: 58px; border-radius: 50%;
    background: linear-gradient(135deg, #E91E63, #7C4DFF);
    background-size: cover; background-position: center;
    display: grid; place-items: center;
    font-size: 21px; font-weight: 800; color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.14);
}
.gh-rp-av.gh-rp-winner { border-color: #FFD34D; box-shadow: 0 0 20px rgba(255, 211, 77, 0.45); }
.gh-rp-name {
    font-size: 12px; font-weight: 650; color: rgba(255, 255, 255, 0.82);
    max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gh-rp-score { font-size: 30px; font-weight: 850; color: #fff; font-variant-numeric: tabular-nums; }
.gh-vs { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.35); }

.gh-gp-row {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 8px;
    font-size: 15px; font-weight: 800; color: #7CFFB2;
}
.gh-gp-break { font-size: 11.5px; color: rgba(255, 255, 255, 0.50); margin-top: 5px; line-height: 1.5; }
.gh-levelup {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 211, 77, 0.13);
    border: 1px solid rgba(255, 211, 77, 0.35);
    color: #FFD98A;
    font-size: 13px;
    font-weight: 700;
}
.gh-actions { display: flex; flex-direction: column; gap: 9px; }

/* ============================================================
   Profile — game section
   ============================================================ */

#gameProfileStats:empty { display: none; }
.ghp-card {
    border-radius: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 14px;
}
.ghp-open {
    border: none; background: rgba(233, 30, 99, 0.18); color: #FFCAD9;
    border-radius: 999px; padding: 6px 13px; font-size: 11.5px; font-weight: 700; cursor: pointer;
    font-family: inherit;
    flex: 0 0 auto;
    white-space: nowrap;
}

/* ── Two slots: keys on the left, Game Level on the right ──────────
   Equal columns rather than auto-sizing, so the key count doesn't
   shift sideways every time it changes from 9 to 10. */
.ghp-duo {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 10px;
    align-items: stretch;
}
.ghp-duo--solo { grid-template-columns: 1fr; }

.ghp-slot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    border-radius: 16px;
    padding: 12px 13px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    min-width: 0;
}

.ghp-slot--keys {
    /* It is a <button>: strip the UA chrome, keep the affordance. */
    font-family: inherit;
    cursor: pointer;
    background: linear-gradient(150deg, rgba(233, 30, 99, 0.20), rgba(124, 77, 255, 0.14));
    border-color: rgba(233, 30, 99, 0.30);
    transition: transform 0.16s ease, filter 0.16s ease;
}
.ghp-slot--keys:active { transform: scale(0.97); }
.ghp-slot--keys:hover  { filter: brightness(1.08); }
.ghp-slot--keys:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 2px; }

.ghp-slot-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ghp-key-icn  { font-size: 20px; line-height: 1; flex: 0 0 auto; }
.ghp-slot-num {
    font-size: 26px; font-weight: 800; color: #fff; line-height: 1;
    font-variant-numeric: tabular-nums;
}
.ghp-slot-lvl {
    font-size: 13.5px; font-weight: 750; color: #fff; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ghp-slot-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.52);
    line-height: 1.35;
}

/* The shared badge is sized for the hub header; shrink it in the slot. */
.ghp-slot--level .gh-level-badge {
    width: 30px; height: 30px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.30);
}
.ghp-slot--level .gh-bar { margin-top: 9px; height: 6px; }

.ghp-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.ghp-hint {
    flex: 1 1 auto;
    font-size: 11px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.45);
}

/* Narrow phones: the two slots stop fitting side by side long before the
   card does, and a squashed level bar reads worse than a stacked one. */
@media (max-width: 360px) {
    .ghp-duo { grid-template-columns: 1fr; }
    .ghp-foot { flex-direction: column; align-items: stretch; }
    .ghp-open { width: 100%; padding: 9px 13px; }
}

/* The app-wide "create your quiz" nudge is position:fixed at z-index 9000
   and would sit right on top of the shoot button / the Connect-Four
   columns. It is suppressed while the Game Hub owns the screen and
   returns the moment the user leaves it. */
body.gh-hub-active #userQuizPromptBanner { display: none !important; }

/* ============================================================
   Lounge entry card → Game Hub
   ============================================================ */
.lng-games-card { cursor: pointer; }
.lng-games-badge.lng-games-badge--free {
    color: #7CFFB2 !important;
    background: rgba(34, 197, 94, 0.14) !important;
    border: 1px solid rgba(34, 197, 94, 0.30) !important;
}

/* ============================================================
   Landscape + larger screens
   ============================================================ */

@media (min-width: 620px) {
    .gh-games { grid-template-columns: repeat(3, 1fr); }
    .gh-scroll { padding-left: 24px; padding-right: 24px; }
}

@media (orientation: landscape) and (max-height: 520px) {
    .gh-mhead { padding-top: 6px; padding-bottom: 4px; }
    .gh-mscore { font-size: 17px; }
    .gh-shoot { width: 58px; height: 58px; font-size: 11px; }
}

/* ============================================================
   Reduced motion — the games stay fully playable and readable
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .gh-flash.show { animation-duration: .01ms; opacity: 1; }
    .gh-c4-cell.gh-c4-win { animation: none; }
    .gh-c4-cell.gh-c4-drop { animation: none; }
    .gh-typing i { animation: none; opacity: .6; }
    .gh-sheet { animation: none; }
    .gh-bar-fill { transition: none; }
    .gh-react-pad { animation: none !important; transition: none; }
    .gh-react-ping { animation: none !important; opacity: 0; }
    .gh-shoot { transition: none; }
}

/* ============================================================
   Matchmaking — looking for an opponent
   ============================================================ */

.gh-find {
    flex: 1;
    overflow-y: auto;
    padding: 18px 18px 28px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    -webkit-overflow-scrolling: touch;
}

.gh-find-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 26px 18px 24px;
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(233, 30, 99, 0.10), rgba(124, 77, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gh-find-orbit {
    position: relative;
    width: 168px;
    height: 168px;
}

.gh-find-core {
    position: absolute;
    inset: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: rgba(13, 10, 15, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 0 34px rgba(233, 30, 99, 0.28);
}

.gh-find-orbit::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #E91E63;
    border-right-color: rgba(124, 77, 255, 0.7);
    animation: ghSpin 1.15s linear infinite;
}

@keyframes ghSpin { to { transform: rotate(360deg); } }

.gh-find-face {
    position: absolute;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    background-color: #7C4DFF;
    border: 1.5px solid rgba(13, 10, 15, 0.9);
    animation: ghFacePulse 2.4s ease-in-out infinite;
}

.gh-find-face--0 { top: -4px;   left: 65px; animation-delay: 0s; }
.gh-find-face--1 { top: 26px;   right: 2px; animation-delay: .3s; }
.gh-find-face--2 { bottom: 26px;right: 2px; animation-delay: .6s; }
.gh-find-face--3 { bottom: -4px;left: 65px; animation-delay: .9s; }
.gh-find-face--4 { bottom: 26px;left: 2px;  animation-delay: 1.2s; }
.gh-find-face--5 { top: 26px;   left: 2px;  animation-delay: 1.5s; }

@keyframes ghFacePulse {
    0%, 100% { opacity: .45; transform: scale(.94); }
    50%      { opacity: 1;   transform: scale(1.04); }
}

.gh-find-status {
    font-size: 14.5px;
    font-weight: 600;
    color: #EDE7F6;
    text-align: center;
    min-height: 20px;
}

.gh-find-bar {
    width: 100%;
    max-width: 280px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}

.gh-find-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #E91E63, #7C4DFF);
    transition: width .12s linear;
}

.gh-find-cancel { margin-top: 2px; }

.gh-find-stage--found { gap: 10px; }

.gh-find-found-label {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: #4ade80;
}

.gh-find-found-av {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #7C4DFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, .5), 0 0 30px rgba(74, 222, 128, .28);
    animation: ghFoundPop .35s cubic-bezier(.2, .9, .3, 1.3);
}

@keyframes ghFoundPop {
    from { transform: scale(.7); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}

.gh-find-found-name { font-size: 19px; font-weight: 700; color: #fff; }
.gh-find-found-bio  { font-size: 13px; color: rgba(255,255,255,.62); text-align: center; }
.gh-find-go         { font-size: 13px; color: #E91E63; font-weight: 700; margin-top: 4px; }

.gh-find-alt {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gh-find-alt-t { font-size: 15px; font-weight: 700; color: #fff; }
.gh-find-alt-s { font-size: 13px; color: rgba(255,255,255,.60); line-height: 1.45; }
.gh-find-alt .gh-btn { margin-top: 4px; }

/* ============================================================
   Live duel — invite, waiting room, countdown
   ============================================================ */

.gh-duel-card {
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(150deg, rgba(124, 77, 255, 0.13), rgba(233, 30, 99, 0.08));
    border: 1px solid rgba(124, 77, 255, 0.24);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gh-duel-t { font-size: 15.5px; font-weight: 700; color: #fff; }
.gh-duel-s { font-size: 13px; color: rgba(255,255,255,.62); line-height: 1.45; }

.gh-duel-games {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 4px;
}

.gh-duel-pill {
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: #EDE7F6;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.gh-duel-pill:hover  { background: rgba(255, 255, 255, 0.12); }
.gh-duel-pill:active { transform: scale(.96); }

.gh-duel-wait {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 34px 20px;
    text-align: center;
}

.gh-duel-spin {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: #E91E63;
    animation: ghSpin 1s linear infinite;
}

.gh-duel-wait-t { font-size: 17px; font-weight: 700; color: #fff; }
.gh-duel-wait-s { font-size: 13.5px; color: rgba(255,255,255,.62); line-height: 1.5; max-width: 320px; }

.gh-duel-link {
    width: 100%;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.10);
    font-size: 12.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #C4B1FF;
    word-break: break-all;
    user-select: all;
    -webkit-user-select: all;
}

.gh-duel-actions { justify-content: center; flex-wrap: wrap; }
.gh-duel-note    { font-size: 12px; color: rgba(255,255,255,.45); max-width: 320px; }

.gh-duel-challenge-av {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E91E63, #7C4DFF);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

.gh-duel-count {
    font-size: 72px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    animation: ghCount .7s ease-out;
    text-shadow: 0 0 34px rgba(233, 30, 99, .55);
}

@keyframes ghCount {
    from { transform: scale(1.5); opacity: .2; }
    to   { transform: scale(1);   opacity: 1; }
}

.gh-duel-rstate {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,.62);
    padding: 4px 18px 18px;
}

@media (prefers-reduced-motion: reduce) {
    .gh-find-orbit::after,
    .gh-duel-spin { animation-duration: 2.4s; }
    .gh-find-face,
    .gh-find-found-av,
    .gh-duel-count { animation: none; }
}

/* ============================================================
   How do you want to play — the step before every match
   ============================================================ */

.gh-mode {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 6px 0 4px;
}

.gh-mode-card {
    font: inherit;
    text-align: left;
    display: grid;
    grid-template-columns: 46px 1fr;
    grid-template-rows: auto auto;
    column-gap: 14px;
    row-gap: 3px;
    padding: 18px 16px;
    border-radius: 20px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(150deg, rgba(233, 30, 99, 0.12), rgba(124, 77, 255, 0.10));
    border: 1px solid rgba(255, 255, 255, 0.10);
    transition: transform .15s ease, border-color .15s ease;
}

.gh-mode-card:hover  { border-color: rgba(233, 30, 99, 0.42); }
.gh-mode-card:active { transform: scale(.985); }

.gh-mode-icn {
    grid-row: 1 / span 2;
    width: 46px; height: 46px;
    border-radius: 14px;
    display: grid; place-items: center;
    font-size: 22px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gh-mode-t { font-size: 16px; font-weight: 750; }
.gh-mode-s { font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, 0.62); }

/* ============================================================
   Chat request after the match
   ============================================================ */

.gh-req-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gh-req-card--yes {
    background: linear-gradient(150deg, rgba(74, 222, 128, 0.12), rgba(124, 77, 255, 0.08));
    border-color: rgba(74, 222, 128, 0.30);
}

.gh-req-t { font-size: 15.5px; font-weight: 700; color: #fff; }
.gh-req-s { font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, 0.62); }
.gh-req-card .gh-btn { margin-top: 4px; }
