/* ==========================================
   BLUFFLAB — Design system
   Loaded after styles.css, and wins over it.
   A game, not a settings app: warm charcoal, one blue for "go",
   chunky pieces that press in, hand-drawn art, and motion that
   feels physical. See docs/DESIGN.md.
   ========================================== */

@font-face {
    font-family: 'Rubik Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 300 900;
    src: url(../fonts/rubik-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Rubik Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 300 900;
    src: url(../fonts/rubik-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Tokens ─────────────────────────────────────── */
:root {
    --bg: #262421;
    --bg-deep: #1E1C1A;
    --tile: #312E2B;
    --tile-hi: #3A3734;
    --tile-2: #45423E;
    --lip: #1A1816;
    --line: rgba(255,255,255,0.07);
    --text: #FFFFFF;
    --text-2: #BCB8B1;
    --text-3: #9A958D;          /* 4.5:1 on tiles, for small labels */

    --blue: #3F89F2;
    --blue-lip: #2A63B8;
    --blue-hi: #5A9BF5;
    --blue-rgb: 63,137,242;
    --good: #81B64C;
    --good-lip: #5A8A2F;
    --good-rgb: 129,182,76;
    --bad: #E5484D;
    --bad-lip: #A83034;
    --bad-text: #FF6F73;        /* red for small text on dark (5:1 on tiles) */
    --gold: #F5B83D;
    --gold-lip: #C98A1E;
    --orange: #FF8A2A;
    --purple: #8B6CFF;
    --purple-lip: #6247D6;

    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --ease: cubic-bezier(.2,.8,.2,1);
    --spring: cubic-bezier(.34,1.56,.64,1);
    --press: 3px;

    --font-main: 'Rubik Variable', 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-action: var(--font-main);

    /* Names the older stylesheet uses, pointed at this palette */
    --play: var(--blue);
    --play-dark: var(--blue-lip);
    --play-rgb: var(--blue-rgb);
    --bg-dark: var(--bg);
    --bg-card: var(--tile);
    --bg-elevated: var(--tile);
    --bg-input: var(--bg-deep);
    --text-primary: var(--text);
    --text-secondary: var(--text-2);
    --text-muted: var(--text-3);
    --border: transparent;
    --border-light: rgba(255,255,255,0.06);
    --accent: var(--blue);
    --accent-blue: var(--blue);
    --accent-green: var(--good);
    --accent-red: var(--bad);
    --accent-gold: var(--gold);
    --btn-primary-bg: var(--tile-2);
    --btn-primary-text: var(--text);
    --btn-secondary-bg: var(--tile-2);
    --btn-secondary-text: var(--text);
}

html, body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.screen { background: var(--bg); }
button, input, select, textarea { font-family: var(--font-main); }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.01em; }
p { line-height: 1.4; }
::selection { background: rgba(var(--blue-rgb),0.35); }

/* ── Motion: screens push and pop ───────────────── */
.screen.leaving { display: flex; pointer-events: none; z-index: 0; }
.screen.active { z-index: 1; }
.screen.enter-forward { animation: scrInF 0.34s var(--ease) both; }
.screen.leave-forward { animation: scrOutF 0.3s var(--ease) both; }
.screen.enter-back { animation: scrInB 0.32s var(--ease) both; }
.screen.leave-back { animation: scrOutB 0.28s var(--ease) both; }
@keyframes scrInF { from { transform: translateX(36px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes scrOutF { to { transform: translateX(-24px); opacity: 0; } }
@keyframes scrInB { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes scrOutB { to { transform: translateX(36px); opacity: 0; } }

/* Content rises in, one piece after another */
.screen.enter-forward .rise > *, .screen.enter-back .rise > *, .rise.now > * { animation: riseIn 0.46s var(--ease) both; }
.rise > *:nth-child(1) { animation-delay: 0.04s; }
.rise > *:nth-child(2) { animation-delay: 0.08s; }
.rise > *:nth-child(3) { animation-delay: 0.12s; }
.rise > *:nth-child(4) { animation-delay: 0.16s; }
.rise > *:nth-child(5) { animation-delay: 0.2s; }
.rise > *:nth-child(6) { animation-delay: 0.24s; }
.rise > *:nth-child(7) { animation-delay: 0.28s; }
.rise > *:nth-child(8) { animation-delay: 0.32s; }
.rise > *:nth-child(n+9) { animation-delay: 0.36s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.85); } 70% { opacity: 1; transform: scale(1.03); } 100% { transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.04, 0.97) rotate(-2deg); } 60% { transform: scale(0.98, 1.03) rotate(2deg); } }

@media (prefers-reduced-motion: reduce) {
    .screen.enter-forward, .screen.leave-forward, .screen.enter-back, .screen.leave-back, .rise > * { animation: none !important; }
}

/* ── Icons (small glyphs) ───────────────────────── */
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex-shrink: 0; overflow: visible; }
.ic .i-p { fill: currentColor; }
.ic .i-s { fill: currentColor; opacity: 0.45; }
.ic .i-d { fill: rgba(0,0,0,0.2); }
.ic .i-line { fill: none !important; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ic .i-p.i-line, .ic .i-s.i-line { stroke: currentColor; }
.ic .i-d.i-line { stroke: rgba(0,0,0,0.26); }
.spot { display: block; width: 56px; height: 56px; flex-shrink: 0; overflow: visible; }
.medal { display: block; width: 52px; height: 56px; overflow: visible; }
.medal .ic { width: 24px; height: 24px; }
.medal .i-p, .medal .i-s { fill: #fff; }
.medal .i-d { fill: rgba(0,0,0,0.18); }
.medal .i-line { fill: none !important; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.medal .i-p.i-line, .medal .i-s.i-line { stroke: #fff; }
.face { display: block; width: 100%; height: 100%; }
.logo-mark { width: 34px; height: 34px; display: block; }

/* ── Buttons: flat colour on a chunky edge; they press in ── */
.btn {
    position: relative; min-height: 50px; padding: 0 1.25rem; border: none; border-radius: var(--r);
    font: 700 1.0625rem/1.15 var(--font-main); letter-spacing: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: var(--tile-2); color: var(--text); box-shadow: 0 4px 0 var(--lip);
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease, filter 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(var(--press)); box-shadow: 0 1px 0 var(--lip); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-large { min-height: 58px; font-size: 1.1875rem; border-radius: 14px; }
.btn-small { min-height: 36px; padding: 0 0.85rem; font-size: 0.9375rem; border-radius: 10px; box-shadow: 0 3px 0 var(--lip); }
.btn-small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.btn-play, .btn-accent, .btn-raise-confirm {
    background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-lip); font-weight: 800;
    text-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.btn-play:active, .btn-accent:active, .btn-raise-confirm:active { transform: translateY(var(--press)); box-shadow: 0 1px 0 var(--blue-lip); background: var(--blue); }
.btn-secondary { background: var(--tile-2); color: var(--text); border: none; box-shadow: 0 4px 0 var(--lip); }
.btn-secondary:active { background: var(--tile-2); transform: translateY(var(--press)); box-shadow: 0 1px 0 var(--lip); }
.btn-primary { background: var(--blue); color: #fff; border: none; box-shadow: 0 4px 0 var(--blue-lip); font-weight: 800; }
.btn-primary:active { background: var(--blue); transform: translateY(var(--press)); box-shadow: 0 1px 0 var(--blue-lip); }
.btn-good { background: var(--good); color: #fff; box-shadow: 0 4px 0 var(--good-lip); font-weight: 800; }
.btn-good:active { box-shadow: 0 1px 0 var(--good-lip); }
.btn-danger { background: var(--bad); color: #fff; box-shadow: 0 4px 0 var(--bad-lip); }
.btn-danger:active { box-shadow: 0 1px 0 var(--bad-lip); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:active { transform: none; box-shadow: none; background: var(--tile); }

/* Round icon buttons and the back arrow */
.icon-btn {
    width: 42px; height: 42px; border-radius: 12px; border: none; background: transparent; color: var(--text);
    display: inline-grid; place-items: center; cursor: pointer; position: relative; padding: 0;
    transition: background-color 0.15s ease, transform 0.1s ease;
}
.icon-btn .ic { width: 25px; height: 25px; }
.icon-btn:active { background: var(--tile); transform: scale(0.94); }
.btn-back {
    width: 42px; height: 42px; padding: 0; font-size: 0 !important; color: var(--text);
    display: inline-grid; place-items: center; border-radius: 12px; background: transparent; border: none; cursor: pointer;
}
.btn-back::before {
    content: ''; width: 26px; height: 26px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 12H5.5M11 5.5 4.5 12l6.5 6.5' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 12H5.5M11 5.5 4.5 12l6.5 6.5' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.btn-back:active { background: var(--tile); }
.btn-icon-only { color: var(--text); }
.btn-icon-only .ic { width: 25px; height: 25px; }

/* ── Screen header: back arrow and a bold title ── */
.screen-header {
    background: var(--bg); border-bottom: none; justify-content: flex-start; gap: 0.25rem;
    padding: calc(0.6rem + var(--safe-top)) 0.75rem 0.4rem;
}
.screen-header h2 { font-size: 1.3125rem; font-weight: 800; flex: 1; text-align: left; letter-spacing: -0.01em; }
.screen-header .header-spacer { display: none; }
.screen-body { padding: 0.5rem 1rem 2rem; }

/* ── Tiles: the building block ─────────────────── */
.tile, .game-card, .mode-card, .setup-section, .today-card, .bot-detail, .read-row {
    background: var(--tile); border: none; border-radius: var(--r-lg); box-shadow: 0 3px 0 var(--lip);
}
.game-cards-grid { display: flex; flex-direction: column; gap: 0.75rem; background: none; border-radius: 0; overflow: visible; max-width: 560px; }
.game-card, .mode-card {
    position: relative; display: flex; align-items: center; gap: 0.9rem; width: 100%; min-height: 84px;
    padding: 0.85rem 1rem; text-align: left; color: var(--text); cursor: pointer; flex-direction: row;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}
.game-card:active, .mode-card:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); background: var(--tile-hi); }
.game-card::before, .mode-card::before { display: none !important; }
.game-card.featured, .mode-card.featured { border: none; background: var(--tile); }
.game-card-icon { width: 56px; height: 56px; display: grid; place-items: center; position: relative; flex-shrink: 0; }
.game-card-info, .mode-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.game-card-info h3, .mode-card h3 { font-size: 1.125rem; font-weight: 800; margin: 0; }
.game-card-info p, .mode-card p { font-size: 0.875rem; color: var(--text-2); margin: 0; line-height: 1.3; }
.game-card-arrow { display: none; }
.game-card-resume { color: var(--gold); font-weight: 700; font-size: 0.8125rem; }
.game-card.hidden { display: none; }

/* Two tiles side by side */
.tile-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.tile-pair .game-card { flex-direction: column; align-items: flex-start; gap: 0.6rem; min-height: 0; padding: 1rem; }
.tile-pair .game-card-icon { width: 60px; height: 60px; }
.tile-pair .game-card-icon .spot { width: 60px; height: 60px; }

/* Section titles */
.home-section { max-width: 560px; margin: 0 auto 1.6rem; }
.home-section-title {
    font: 800 1.25rem var(--font-main); letter-spacing: -0.01em; text-transform: none; color: var(--text);
    margin: 0 0 0.75rem 0.1rem; padding: 0;
}
.setting-label, .lobby-section-title, .profile-h {
    font: 700 0.875rem var(--font-main); text-transform: none; letter-spacing: 0; color: var(--text-2);
    margin: 0 0 0.5rem 0.1rem;
}
.setting-hint, .hint { color: var(--text-3); font-size: 0.8125rem; line-height: 1.4; }

/* ── Panels ─────────────────────────────────────── */
.setup-section h3 { font-size: 1.0625rem; font-weight: 800; }

/* ── Segmented control: a sliding thumb ─────────── */
.segmented {
    position: relative; display: flex; background: var(--bg-deep); border: none; border-radius: 13px;
    padding: 4px; gap: 4px; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25);
}
.segmented button {
    position: relative; z-index: 1; flex: 1; background: transparent; border: none; color: var(--text-3);
    font: 700 0.9375rem var(--font-main); padding: 0.65rem 0.35rem; border-radius: 10px; cursor: pointer;
    transition: color 0.2s ease;
}
.segmented button.active { color: var(--text); background: transparent; box-shadow: none; }
.segmented .seg-thumb {
    position: absolute; z-index: 0; top: 4px; bottom: 7px; left: 0; width: 0; border-radius: 10px;
    background: var(--tile-2); box-shadow: 0 3px 0 var(--lip);
    transition: transform 0.32s var(--spring), width 0.32s var(--ease);
}
.segmented:not(.has-thumb) button.active { background: var(--tile-2); box-shadow: 0 3px 0 var(--lip); }
.segmented button:disabled { cursor: default; }

/* ── Toggle ─────────────────────────────────────── */
.toggle { position: relative; width: 54px; height: 32px; border-radius: 16px; background: var(--bg-deep); border: none; cursor: pointer; flex-shrink: 0; box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); transition: background-color 0.2s ease; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 #C9C3B8; transition: transform 0.3s var(--spring); }
.toggle.on { background: var(--blue); }
.toggle.on::after { transform: translateX(22px); }

/* ── Inputs ─────────────────────────────────────── */
.input-field, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"] {
    background: var(--bg-deep); border: none; border-radius: 12px; color: var(--text);
    box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); font-weight: 500;
}
.input-field:focus, input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.input-group { background: var(--bg-deep); border: none; border-radius: 12px; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); }
.input-group .input-field { box-shadow: none; }
.btn-stepper { width: 48px; height: 48px; border-radius: 12px; border: none; background: var(--tile-2); color: var(--text); box-shadow: 0 3px 0 var(--lip); font-size: 1.5rem; transition: transform 0.08s ease, box-shadow 0.08s ease; }
.btn-stepper:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); background: var(--tile-2); }

/* ── Dialogs ────────────────────────────────────── */
.overlay { background: rgba(14,13,12,0.72); backdrop-filter: none; -webkit-backdrop-filter: none; }
.overlay-content, .overlay-panel {
    background: var(--tile); border: none; border-radius: 20px; box-shadow: 0 5px 0 var(--lip), 0 30px 60px rgba(0,0,0,0.45);
    padding: 1.6rem 1.25rem 1.35rem; animation: popIn 0.36s var(--spring) both;
}
.overlay-content h2, .overlay-panel h3 { font-size: 1.375rem; font-weight: 800; }
.overlay-content p { color: var(--text-2); }
.overlay-content .btn + .btn, .overlay-panel .btn + .btn { margin-top: 0.75rem; }

/* ── Toast: drops in from the top ───────────────── */
.app-toast {
    top: calc(12px + var(--safe-top)); bottom: auto; transform: translate(-50%, -24px) scale(0.96);
    background: var(--tile-2); color: var(--text); font: 700 0.9375rem var(--font-main);
    box-shadow: 0 4px 0 var(--lip), 0 16px 36px rgba(0,0,0,0.4); border-radius: 16px; padding: 0.6rem 1rem 0.6rem 0.65rem;
    display: inline-flex; align-items: center; gap: 0.6rem; transition: opacity 0.25s ease, transform 0.4s var(--spring);
}
.app-toast.visible { transform: translate(-50%, 0) scale(1); }
.app-toast .ic { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--gold); color: #fff; box-shadow: 0 2px 0 var(--gold-lip); }

/* ── Home ───────────────────────────────────────── */
.home-header { padding: calc(0.9rem + var(--safe-top)) 1rem 0.6rem; display: flex; align-items: center; justify-content: space-between; }
.home-logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; }
.home-logo .logo-mark { width: 36px; height: 36px; }
.logo-bluff { color: #fff; }
.logo-lab { color: var(--blue); font-weight: 800; }
.home-header-actions { display: flex; align-items: center; gap: 0.25rem; }
.friends-badge { background: var(--bad); top: 3px; right: 3px; box-shadow: 0 0 0 2px var(--bg); }
.home-profile-btn { background: none; border: none; padding: 0 0 0 0.3rem; cursor: pointer; }
.profile-avatar-sm { width: 38px; height: 38px; border-radius: 12px; font: 800 0.875rem var(--font-main); letter-spacing: 0; overflow: hidden; background: var(--blue); box-shadow: 0 3px 0 var(--blue-lip); }
.streak-chip { display: inline-flex; align-items: center; gap: 0.25rem; font: 800 1rem var(--font-main); color: var(--text); padding: 0 0.4rem; height: 42px; border: none; background: none; cursor: pointer; }
.streak-chip .spot { width: 26px; height: 26px; }
.streak-chip.cold .spot { filter: grayscale(1) brightness(0.8); }
.streak-chip.lit .spot { animation: flicker 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.home-body { padding: 0.25rem 1rem 2.5rem; }

/* The big card: the bots line up, then one blue button */
.play-hero {
    position: relative; display: block; width: 100%; max-width: 560px; margin: 0.25rem auto 1.1rem; padding: 1.1rem 1.1rem 1.15rem;
    background: var(--tile); border: none; border-radius: 20px; box-shadow: 0 4px 0 var(--lip); color: var(--text); text-align: left;
}
.play-hero-faces { display: flex; align-items: flex-end; margin: 0 0 0.9rem; height: 64px; }
.play-hero-faces .face { width: 54px; height: 54px; margin-right: -8px; border-radius: 50%; box-shadow: 0 0 0 3px var(--tile); transition: transform 0.25s var(--spring); }
.play-hero-faces .face:nth-child(2) { width: 58px; height: 58px; }
.play-hero-faces .face:nth-child(3) { width: 62px; height: 62px; z-index: 1; }
.play-hero-faces .face:nth-child(4) { width: 58px; height: 58px; }
.play-hero-faces .face:nth-child(5) { width: 54px; height: 54px; }
.play-hero-faces .face:nth-child(6) { width: 50px; height: 50px; }
.play-hero h2, .play-hero h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.2rem; }
.play-hero p { font-size: 0.9375rem; color: var(--text-2); margin: 0 0 1rem; }
.play-hero .btn { width: 100%; }

/* Daily card: streak, today's XP, the next thing to do */
.today-card { display: flex; align-items: center; gap: 0.85rem; max-width: 560px; margin: 0 auto 1.6rem; padding: 0.9rem 1rem; }
.today-ring {
    --p: 0; width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0; position: relative;
    display: grid; place-items: center;
    background: radial-gradient(closest-side, var(--tile) 76%, transparent 77% 100%), conic-gradient(var(--orange) calc(var(--p) * 1%), var(--bg-deep) 0);
}
.today-ring .spot { width: 30px; height: 30px; }
.today-ring:not(.lit) .spot { filter: grayscale(1) brightness(0.75); }
.today-ring.lit .spot { animation: flicker 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.today-ring strong { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font: 800 0.75rem var(--font-main); background: var(--orange); color: #fff; padding: 1px 7px; border-radius: 999px; box-shadow: 0 2px 0 #C9661A; }
.today-ring:not(.lit) strong { background: var(--tile-2); box-shadow: 0 2px 0 var(--lip); }
.today-info { flex: 1; min-width: 0; }
.today-info strong { display: block; font-size: 1.0625rem; font-weight: 800; }
.today-info small { display: block; color: var(--text-2); font-size: 0.8125rem; margin: 0.1rem 0 0.4rem; }
.today-xp { height: 8px; border-radius: 4px; background: var(--bg-deep); overflow: hidden; }
.today-xp div { height: 100%; border-radius: 4px; background: var(--gold); transition: width 0.8s var(--ease); }
.today-cta {
    display: flex; flex-direction: column; align-items: center; gap: 0.05rem; flex-shrink: 0; max-width: 118px;
    background: var(--blue); color: #fff; border: none; border-radius: 12px; padding: 0.55rem 0.8rem;
    box-shadow: 0 4px 0 var(--blue-lip); cursor: pointer; transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.today-cta:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-lip); }
.today-cta span { font-weight: 800; font-size: 0.9375rem; }
.today-cta small { font-size: 0.6875rem; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 500; overflow: hidden; }
.confetti i { position: absolute; left: 0; top: 0; display: block; will-change: transform; }
.confetti svg { display: block; }

/* ── Play vs Computer: pick your opponent ───────── */
.cpu-setup-body { padding-bottom: 7rem; }
.bot-stage { display: flex; gap: 0.9rem; align-items: flex-start; margin: 0.25rem 0 1.1rem; min-height: 112px; }
.bot-stage-face {
    width: 108px; height: 108px; flex-shrink: 0; border-radius: 24px; overflow: hidden;
    box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 55%, #000);
}
.bot-stage-face .face { width: 100%; height: 100%; }
.bot-stage-face.swap { animation: faceIn 0.5s var(--spring) both; }
@keyframes faceIn { 0% { transform: scale(0.8) rotate(-4deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.bot-stage-text { flex: 1; min-width: 0; padding-top: 0.1rem; }
.bot-bubble {
    position: relative; display: inline-block; max-width: 100%; background: #fff; color: #25231F;
    font: 600 0.9375rem/1.3 var(--font-main); padding: 0.55rem 0.75rem; border-radius: 14px; margin-bottom: 0.6rem;
    box-shadow: 0 3px 0 #C9C3B8;
}
.bot-bubble::before { content: ''; position: absolute; left: -7px; top: 14px; border: 7px solid transparent; border-left: 0; border-right-color: #fff; }
.bot-bubble.swap { animation: bubbleIn 0.45s var(--spring) 0.12s both; transform-origin: 0 50%; }
@keyframes bubbleIn { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
.bot-detail-name { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; }
.bot-detail-meta { display: flex; align-items: center; gap: 0.5rem; color: var(--text-2); font-size: 0.9375rem; margin-top: 0.25rem; }
.bot-rating { font: 800 0.8125rem var(--font-main); color: #fff; background: var(--tile-2); padding: 0.15rem 0.5rem; border-radius: 7px; box-shadow: 0 2px 0 var(--lip); }

.bot-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.55rem; margin: 0 0 1.1rem; }
.bot-card {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    background: none; border: none; box-shadow: none; padding: 0; border-radius: 0; cursor: pointer; color: var(--text);
}
.bot-card:active { transform: none; }
.bot-card .bot-avatar {
    position: relative; width: 100%; height: auto; aspect-ratio: 1; border-radius: 14px; box-shadow: 0 3px 0 var(--lip);
    transition: transform 0.25s var(--spring), box-shadow 0.2s ease;
}
.bot-card .bot-avatar .face { border-radius: 14px; }
.bot-card:active .bot-avatar { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.bot-card.selected .bot-avatar { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--blue), 0 6px 0 3px var(--blue-lip); }
.bot-card-name { display: none; }
.bot-card-rating { font: 700 0.75rem var(--font-main); color: var(--text-3); font-variant-numeric: tabular-nums; }
.bot-card.selected .bot-card-rating { color: var(--text); }
.bot-card.locked .bot-avatar .face { filter: grayscale(1) brightness(0.45); }
.bot-card.locked .bot-card-rating { color: var(--text-3); opacity: 0.7; }
.bot-lock {
    position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: none; box-shadow: none; width: auto; height: auto;
}
.bot-lock .ic { width: 22px; height: 22px; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.4)); }
.bot-beaten {
    position: absolute; right: -4px; top: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--good);
    box-shadow: 0 2px 0 var(--good-lip), 0 0 0 2px var(--bg); display: grid; place-items: center; color: #fff;
}
.bot-beaten .ic { width: 12px; height: 12px; }
.bot-beaten .ic .i-line { stroke-width: 3.4; }

.bot-detail { padding: 1rem 1rem 1.05rem; margin-bottom: 0.9rem; }
.bot-detail-blurb { color: var(--text-2); font-size: 0.9375rem; line-height: 1.45; margin-bottom: 0.75rem; }
.bot-habits { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.85rem; }
.bot-habits span { font: 700 0.8125rem var(--font-main); color: var(--text); background: var(--tile-2); border: none; border-radius: 8px; padding: 0.3rem 0.6rem; box-shadow: 0 2px 0 var(--lip); }
.bot-detail-tip { background: var(--bg-deep); border: none; border-radius: 12px; padding: 0.75rem 0.85rem; font-size: 0.9375rem; line-height: 1.45; color: var(--text); box-shadow: inset 0 2px 0 rgba(0,0,0,0.2); }
.bot-detail-tip strong { display: block; text-transform: none; letter-spacing: 0; font-size: 0.875rem; font-weight: 800; color: var(--gold); margin-bottom: 0.2rem; }
.bot-detail-record { color: var(--text-3); font-size: 0.8125rem; margin-top: 0.7rem; }

.read-row { display: flex; align-items: center; gap: 0.8rem; width: 100%; padding: 0.8rem 1rem; color: var(--text); cursor: pointer; transition: transform 0.08s ease, box-shadow 0.08s ease; margin-bottom: 1.4rem; }
.read-row:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.read-row .ic-tile { width: 40px; height: 40px; border-radius: 12px; background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-lip); display: grid; place-items: center; }
.read-row .ic-tile .ic { width: 24px; height: 24px; }
.read-row-text strong { font-size: 1rem; font-weight: 800; }
.read-row-text small { color: var(--text-2); font-size: 0.8125rem; }
.read-row-arrow { color: var(--text-3); display: grid; }
.read-row-arrow .ic { width: 20px; height: 20px; }

.setting-group { margin-bottom: 1.1rem; }
.seg-sub { margin-top: 0.5rem; }
.cpu-setup-footer { padding: 0.9rem 1rem calc(1rem + var(--safe-bottom)); background: linear-gradient(rgba(38,36,33,0), var(--bg) 38%); }

/* ══════════════════════════════════════════════════
   THE TABLE (every mode)
   ══════════════════════════════════════════════════ */
.game-surface, #cpu-table-screen, #game-screen, #poker-table-screen {
    background: var(--table-surface, radial-gradient(130% 75% at 50% 44%, #2D2A27 0%, #232120 58%, #1C1A18 100%));
    transition: background 0.4s ease;
}

/* Cards: drawn, not typed; everything scales with the card's width */
.pc {
    container-type: inline-size; --w: 56px; width: var(--w); height: calc(var(--w) * 1.4);
    border-radius: 12% / 8.57%; background: #fff; color: #25231F; position: relative; overflow: hidden; flex-shrink: 0;
    border: none; box-shadow: 0 2px 0 #CFC8BC, 0 8px 16px rgba(0,0,0,0.3); font-family: var(--font-main); user-select: none;
}
.pc.red { color: #E5484D; }
/* Four-colour deck: diamonds blue, clubs green */
.four-colour .pc.s-diamonds { color: #2F7BEA; }
.four-colour .pc.s-clubs { color: #2A9A4C; }
.pc .pc-r { position: absolute; left: 10cqw; top: 4cqw; right: auto; font-size: 42cqw; font-weight: 750; line-height: 1; letter-spacing: -0.03em; text-align: left; }
.pc.ten .pc-r { left: 5cqw; font-size: 38cqw; letter-spacing: -0.1em; }
.pc .pc-s { position: absolute; left: 12cqw; top: 51cqw; bottom: auto; width: 23cqw; height: 23cqw; display: block; }
.pc .pc-big { position: absolute; right: 8cqw; bottom: 8cqw; width: 52cqw; height: 52cqw; display: block; opacity: 1; }
.pc.back { background-color: var(--blue); background-size: 100% 100%; background-repeat: no-repeat; border: none; box-shadow: 0 2px 0 rgba(0,0,0,0.35), 0 6px 14px rgba(0,0,0,0.3); }
.pc-face { border-radius: 12% / 8.57%; }
.pc-face.pc-up, .pc-face.pc-down { box-shadow: 0 2px 0 #CFC8BC, 0 8px 18px rgba(0,0,0,0.3); }
.pc-face.back { box-shadow: 0 2px 0 rgba(0,0,0,0.4), 0 8px 18px rgba(0,0,0,0.3); }

/* Opponents' little cards */
.pc.mini { --w: 30px; box-shadow: 0 2px 0 rgba(0,0,0,0.35); }
.pc.mini .pc-big { display: none; }
.pc.mini .pc-r { left: 0; right: 0; top: 6cqw; text-align: center; font-size: 52cqw; letter-spacing: -0.04em; }
.pc.mini.ten .pc-r { font-size: 44cqw; letter-spacing: -0.12em; }
.pc.mini .pc-s { display: block; left: 25cqw; top: auto; bottom: 10cqw; width: 50cqw; height: 50cqw; }
.pc.mini.show, .pc.mini.peeked { --w: 34px; box-shadow: 0 2px 0 #CFC8BC, 0 6px 12px rgba(0,0,0,0.35); }
.pc.mini.peeked { box-shadow: 0 2px 0 #CFC8BC, 0 0 0 3px var(--purple); }
.pc.ghost { opacity: 0.6; box-shadow: 0 0 0 3px var(--blue); }

/* The board */
.tv-slot { background: rgba(0,0,0,0.2); border: none; box-shadow: inset 0 3px 0 rgba(0,0,0,0.25); border-radius: 12% / 8.57%; }
.tv-slot.filled { background: none; box-shadow: none; }
.tv-center { gap: 12px; }
.tv-pot {
    min-height: 34px; gap: 8px; padding: 5px 14px 5px 8px; border-radius: 999px; background: rgba(0,0,0,0.3); border: none;
    align-items: center; box-shadow: inset 0 2px 0 rgba(0,0,0,0.2);
}
.tv-pot::before { content: ''; width: 20px; height: 22px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 43'%3E%3Ccircle cx='20' cy='22.4' r='18' fill='%23C98A1E'/%3E%3Ccircle cx='20' cy='20' r='18' fill='%23F5B83D'/%3E%3Ccircle cx='20' cy='20' r='10' fill='%23E0A12C'/%3E%3C/svg%3E") center / contain no-repeat; }
.tv-pot span { font: 700 0.75rem var(--font-main); color: var(--text-3); text-transform: none; letter-spacing: 0; }
.tv-pot strong { font: 800 1.125rem var(--font-main); color: #fff; }

/* Chips */
i.chip { display: inline-block; width: 18px; height: 19px; border: none; border-radius: 0; background: none; box-shadow: none; flex-shrink: 0; }
i.chip svg { display: block; width: 100%; height: 100%; }
.tv-bet { background: rgba(0,0,0,0.38); padding: 3px 10px 3px 4px; gap: 5px; font: 800 0.8125rem var(--font-main); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.tv-fly.chip i.chip, .tv-fly i.chip { width: 20px; height: 21px; }

/* Players */
.tv-pod { width: 96px; }
.tv-avatar {
    width: 58px; height: 58px; background: var(--c); border-radius: 50%;
    box-shadow: 0 0 0 3px #1E1C1A, 0 4px 0 3px rgba(0,0,0,0.35); transition: transform 0.25s var(--spring), box-shadow 0.2s ease, filter 0.3s ease;
}
.tv-avatar > span { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; filter: none; }
.tv-avatar > span .face { width: 100%; height: 100%; }
.tv-pod.to-act .tv-avatar, .tv-pod.thinking .tv-avatar { box-shadow: 0 0 0 3px var(--blue), 0 4px 0 3px var(--blue-lip); transform: translateY(-2px); }
.tv-ring circle { stroke: #fff; stroke-width: 3.2; }
.tv-pod.timed .tv-ring circle { stroke: #fff; }
.tv-pod.winner .tv-avatar { box-shadow: 0 0 0 3px var(--gold), 0 4px 0 3px var(--gold-lip); animation: winBounce 0.7s var(--spring); }
@keyframes winBounce { 0% { transform: scale(1); } 40% { transform: scale(1.14) translateY(-4px); } 100% { transform: scale(1); } }
.tv-pod.folded .tv-avatar, .tv-pod.folded .tv-plate { filter: grayscale(0.9) brightness(0.5); }
.tv-pod.targetable .tv-avatar { box-shadow: 0 0 0 3px var(--purple), 0 4px 0 3px var(--purple-lip); animation: tvPulse 1s ease-in-out infinite; }
.tv-plate { margin-top: 8px; gap: 3px; }
.tv-name { font: 700 0.8125rem var(--font-main); color: var(--text); }
.tv-stack { font: 800 0.8125rem var(--font-main); color: #fff; background: rgba(0,0,0,0.38); padding: 2px 9px; border-radius: 8px; margin-top: 0; }
.tv-dealer {
    width: 22px; height: 22px; background: #fff; color: #25231F; font: 800 0.6875rem var(--font-main);
    box-shadow: 0 2px 0 #B9B2A6, 0 3px 8px rgba(0,0,0,0.4);
}
/* Position by the dealer button: SB, BB, UTG … CO */
.tv-pos { position: absolute; right: -14px; bottom: 26px; z-index: 7; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center;
    background: rgba(0,0,0,0.55); color: #fff; font: 800 0.5625rem var(--font-main); letter-spacing: 0.04em; box-shadow: 0 0 0 1px rgba(255,255,255,0.18); pointer-events: none; }
.tv-pos.hidden { display: none; }
.tv-pod.right .tv-pos { right: auto; left: -14px; }
.tv-pos.hero { position: static; height: 20px; font-size: 0.625rem; }
.tv-tag { background: var(--tile-2); box-shadow: 0 2px 0 var(--lip); font: 800 0.6875rem var(--font-main); letter-spacing: 0.02em; padding: 2px 8px; border-radius: 7px; }
.tv-tag.hot { background: var(--blue); box-shadow: 0 2px 0 var(--blue-lip); }
.tv-tag.muted { background: rgba(0,0,0,0.3); box-shadow: none; color: var(--text-3); }
.tv-tag.show-hand { background: var(--gold); color: #25231F; box-shadow: 0 2px 0 var(--gold-lip); }
.tv-tag.perk { background: var(--purple); color: #fff; box-shadow: 0 2px 0 var(--purple-lip); }
.tv-bubble { font: 600 0.8125rem var(--font-main); color: #25231F; border-radius: 12px; box-shadow: 0 3px 0 #C9C3B8, 0 10px 20px rgba(0,0,0,0.3); padding: 0.4rem 0.65rem; }

/* You, at the bottom */
.tv-hero-cards { --fw: min(23vw, 88px); }
.tv-hero-meta { gap: 8px; margin-top: 8px; font: 700 0.875rem var(--font-main); }
.tv-hero-avatar { width: 30px; height: 30px; border-radius: 50%; background: none; overflow: hidden; box-shadow: 0 2px 0 rgba(0,0,0,0.4); }
.tv-hero-avatar .face { width: 100%; height: 100%; }
.tv-hero-hand { color: var(--text-2); font-weight: 700; }
.tv-stack.hero { font-size: 0.9375rem; padding: 3px 10px; }
.tv-hero.to-act .tv-hero-cards .pc-flip.up .pc-up { box-shadow: 0 2px 0 #CFC8BC, 0 0 0 3px var(--blue), 0 10px 22px rgba(var(--blue-rgb),0.25); }
.tv-hero-cards.fogged::after { content: 'Clouded'; background: rgba(0,0,0,0.65); font: 800 0.8125rem var(--font-main); }

/* Results and floating numbers */
.tv-result { font: 800 0.9375rem var(--font-main); background: var(--tile-2); color: #fff; border: none; border-radius: 14px; box-shadow: 0 3px 0 var(--lip), 0 10px 24px rgba(0,0,0,0.35); padding: 0.55rem 1rem; animation: popIn 0.4s var(--spring) both; }
.tv-result.win { background: var(--good); color: #fff; box-shadow: 0 3px 0 var(--good-lip), 0 10px 24px rgba(0,0,0,0.35); }
.tv-result.perk { background: var(--purple); box-shadow: 0 3px 0 var(--purple-lip); }
.tv-float { font: 800 1.0625rem var(--font-main); text-shadow: 0 2px 0 rgba(0,0,0,0.45); }
.tv-float.win { color: #A6E07A; }
.tv-float.perk { background: var(--purple); color: #fff; box-shadow: 0 2px 0 var(--purple-lip); text-shadow: none; }

/* Top bar */
.ct-topbar { padding: calc(0.45rem + var(--safe-top)) 0.6rem 0.35rem; }
.ct-menu-btn { width: 42px; height: 42px; border-radius: 12px; color: var(--text); }
.ct-menu-btn:active { background: rgba(0,0,0,0.25); }
.ct-info { font: 600 0.75rem var(--font-main); color: var(--text-3); }
.ct-info span:first-child { font: 800 0.875rem var(--font-main); color: var(--text); }
.ct-coach-pill {
    font: 800 0.8125rem var(--font-main); color: var(--text); background: var(--tile-2); border: none; border-radius: 10px;
    padding: 0.45rem 0.8rem; box-shadow: 0 3px 0 var(--lip); transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.ct-coach-pill:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.ct-coach-pill.on { color: #fff; background: var(--blue); box-shadow: 0 3px 0 var(--blue-lip); border: none; }

/* Fold · Call · Raise */
.ct-actions, .ct-next { gap: 0.6rem; padding: 0.4rem 0.9rem calc(0.8rem + var(--safe-bottom)); }
.ct-btn {
    min-height: 60px; border-radius: 15px; font: 800 1.125rem/1.1 var(--font-main); text-transform: none; letter-spacing: 0;
    transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s ease; -webkit-tap-highlight-color: transparent;
}
.ct-btn small { font: 700 0.8125rem var(--font-main); opacity: 0.75; margin-top: 2px; }
.ct-btn.fold { background: var(--tile-2); color: var(--text); box-shadow: 0 4px 0 var(--lip); }
.ct-btn.fold.dim { opacity: 0.6; }
.ct-btn.call { background: #F2EFE9; color: #25231F; box-shadow: 0 4px 0 #B3AB9E; }
.ct-btn.call small { color: #25231F; }
.ct-btn.raise, .ct-btn.next { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-lip); text-shadow: 0 1px 0 rgba(0,0,0,0.15); }
.ct-btn.review { background: var(--tile-2); color: var(--text); box-shadow: 0 4px 0 var(--lip); font-size: 1rem; }
.ct-btn:active { transform: translateY(3px); }
.ct-btn.fold:active, .ct-btn.review:active { box-shadow: 0 1px 0 var(--lip); }
.ct-btn.call:active { box-shadow: 0 1px 0 #B3AB9E; }
.ct-btn.raise:active, .ct-btn.next:active { box-shadow: 0 1px 0 var(--blue-lip); }
.ct-btn:disabled { opacity: 0.35; }

/* The raise sheet */
.ct-raise-sheet {
    background: var(--tile); border-top: none; border-radius: 24px 24px 0 0; padding: 1rem 1rem calc(1rem + var(--safe-bottom));
    box-shadow: 0 -4px 0 var(--lip), 0 -24px 48px rgba(0,0,0,0.45); animation: sheetUp 0.34s var(--spring) both;
}
.ct-raise-top { color: var(--text-2); font: 700 0.9375rem var(--font-main); }
.ct-raise-top strong { font: 800 1.75rem var(--font-main); color: #fff; }
.ct-presets { gap: 0.5rem; margin-bottom: 1rem; }
.ct-presets button {
    background: var(--tile-2); border: none; color: var(--text); font: 800 0.9375rem var(--font-main); border-radius: 10px;
    padding: 0.6rem 0; box-shadow: 0 3px 0 var(--lip); transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.ct-presets button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.ct-presets button.active { background: var(--blue); box-shadow: 0 3px 0 var(--blue-lip); }
.ct-raise-row .btn { min-height: 54px; }
.raise-slider { height: 10px; border-radius: 5px; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); margin: 0.4rem 0 1.1rem; }
.raise-slider::-webkit-slider-thumb { width: 30px; height: 30px; background: #fff; box-shadow: 0 3px 0 #B3AB9E, 0 4px 10px rgba(0,0,0,0.4); }
.raise-slider::-moz-range-thumb { width: 30px; height: 30px; border: none; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 #B3AB9E; }

/* Next hand bar and hints */
.discard-hint { font: 800 0.9375rem var(--font-main); color: var(--gold); }
.pp-look { background: var(--blue); border: none; color: #fff; box-shadow: 0 3px 0 var(--blue-lip); font: 800 0.875rem var(--font-main); animation: popIn 0.4s var(--spring) both, bob 1.8s ease-in-out 0.4s infinite; }
.pp-look .ic { color: #fff; }
.pp-turn { color: var(--blue-hi); font: 800 0.8125rem var(--font-main); }

/* Party Poker dock */
.perk-dock { background: var(--tile); border: none; border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 8px 12px; }
.perk-dock .perk-dock-icon { box-shadow: 0 3px 0 rgba(0,0,0,0.3); border-radius: 12px; }
.perk-dock .perk-dock-go { background: var(--purple); box-shadow: 0 3px 0 var(--purple-lip); border-radius: 10px; font-weight: 800; }
.perk-dock.ready { border: none; box-shadow: 0 3px 0 var(--purple-lip), 0 0 0 2px var(--purple); animation: none; }
.perk-dock.used .perk-dock-go, .perk-dock.waiting .perk-dock-go { background: var(--tile-2); box-shadow: 0 3px 0 var(--lip); color: var(--text-2); }
.perk-card { background: var(--pc); box-shadow: 0 0 0 3px #fff inset, 0 5px 0 color-mix(in srgb, var(--pc) 55%, #000), 0 20px 40px rgba(0,0,0,0.45); overflow: hidden; }
.perk-card::before { content: ''; position: absolute; left: -30%; right: -30%; top: -42%; height: 70%; border-radius: 50%; background: rgba(255,255,255,0.14); }
.perk-card .perk-icon { filter: none; position: relative; display: grid; place-items: center; width: 60px; height: 60px; }
.perk-card .perk-icon .ic { width: 54px; height: 54px; color: #fff; }
.perk-card strong, .perk-card small { position: relative; }
.perk-card strong { font-weight: 800; }
.perk-card.small .perk-icon { width: 30px; height: 30px; }
.perk-card.small .perk-icon .ic { width: 28px; height: 28px; }
.perk-caption .ic { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
.tv-badges span { background: var(--purple); box-shadow: 0 2px 0 var(--purple-lip); color: #fff; }
.tv-badges span .ic { width: 13px; height: 13px; }

/* Coach grade badges: chess.com style */
.grade-pill { font: 800 0.8125rem var(--font-main); border-radius: 12px; box-shadow: 0 3px 0 color-mix(in srgb, var(--g) 60%, #000), 0 8px 20px rgba(0,0,0,0.35); }
.grade-icon { width: 22px; height: 22px; min-width: 22px; background: #fff; color: var(--g); border-radius: 50%; font-weight: 900; font-size: 0.6875rem; }
.grade-icon .ic { width: 13px; height: 13px; }
.grade-icon .ic .i-line { stroke-width: 3.2; }
.btn-raise-confirm, #btn-raise-confirm, #ct-raise-confirm, #pt-raise-confirm { text-transform: none; letter-spacing: 0; }
.ct-coach-pill.on { background: var(--tile-2); color: var(--text); box-shadow: 0 3px 0 var(--lip); }
.ct-coach-pill.on::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(var(--good-rgb),0.25); }
/* Shown cards sit beside players along the top, not over the top bar */
.tv-pod.top .tv-cards:has(.show), .tv-pod.top .tv-cards:has(.peeked) { bottom: auto; top: 6px; left: calc(50% + 34px); right: auto; }
.tv-pod.top.right .tv-cards:has(.show), .tv-pod.top.right .tv-cards:has(.peeked) { left: auto; right: calc(50% + 34px); }
.tv-pod.top.mid .tv-cards:has(.show), .tv-pod.top.mid .tv-cards:has(.peeked) { left: calc(50% + 36px); right: auto; }

/* ── Shared card motion ─────────────────────────── */
.pc.deal-in { animation: dealIn 0.5s var(--spring) both; }
@keyframes dealIn { from { opacity: 0; transform: translateY(-22px) rotate(-8deg) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* Stat pills in game headers */
.game-header { background: var(--bg); border-bottom: none; padding-top: var(--safe-top); }
.game-info-bar { gap: 0.5rem; padding: 0.7rem 0.9rem 0.4rem; }
.game-info-item { background: var(--tile); border-radius: 12px; box-shadow: 0 3px 0 var(--lip); padding: 0.4rem 0.6rem; }
.info-label { font: 700 0.6875rem var(--font-main); color: var(--text-3); text-transform: none; letter-spacing: 0; }
.info-value { font: 800 1.25rem var(--font-main); font-variant-numeric: tabular-nums; }
#btn-nuts-quit { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }

/* ── What's the Nuts? ───────────────────────────── */
.nuts-prompt { font: 700 1.125rem var(--font-main); color: var(--text-2); margin: 0.6rem 0 0.9rem; }
.nuts-prompt strong { color: var(--gold); font-weight: 800; }
.nuts-community { gap: 6px; margin-bottom: 1.25rem; }
.nuts-comm-card { --w: min(17vw, 66px); width: var(--w); height: calc(var(--w) * 1.4); border: none; border-radius: 12% / 8.57%; animation: none; }
.nuts-options { gap: 0.8rem; }
.nuts-option-btn {
    display: flex; gap: 0.6rem; justify-content: center; align-items: center; background: var(--tile); border: none;
    border-radius: 18px; padding: 0.9rem; box-shadow: 0 4px 0 var(--lip); cursor: pointer;
    animation: riseIn 0.45s var(--ease) both; transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.2s ease;
}
.nuts-option-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.nuts-option-card { --w: min(15vw, 58px); width: var(--w); height: calc(var(--w) * 1.4); border: none; border-radius: 12% / 8.57%; }
.nuts-option-btn.nuts-correct { background: var(--good); box-shadow: 0 4px 0 var(--good-lip); border: none; animation: popIn 0.4s var(--spring) both; }
.nuts-option-btn.nuts-wrong { background: var(--bad); box-shadow: 0 4px 0 var(--bad-lip); border: none; animation: shake 0.45s ease both; }
.nuts-result-content { text-align: center; }
.nuts-result-icon {
    width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: -0.25rem auto 0.8rem; color: #fff; font-size: 0;
    animation: popIn 0.5s var(--spring) both;
}
.nuts-result-icon.right { background: var(--good); box-shadow: 0 5px 0 var(--good-lip); }
.nuts-result-icon.wrong { background: var(--bad); box-shadow: 0 5px 0 var(--bad-lip); }
.nuts-result-icon .ic { width: 40px; height: 40px; }
.nuts-result-icon .ic .i-line { stroke-width: 3.4; }
#nuts-result-title { font-size: 1.75rem; }
.nuts-result-cards { gap: 0.6rem; margin: 0.9rem 0 0.5rem; }
.nuts-result-card-img { --w: 66px; width: var(--w); height: calc(var(--w) * 1.4); border: none; border-radius: 12% / 8.57%; }
.nuts-result-hand { font: 800 1.0625rem var(--font-main); color: #fff; margin-bottom: 1.1rem; }
.gameover-content .trophy { display: grid; place-items: center; margin: -0.4rem auto 0.6rem; }
.gameover-content .trophy .spot { width: 84px; height: 84px; animation: popIn 0.5s var(--spring) both; }
.nuts-go-stats { background: var(--bg-deep); border-radius: 14px; padding: 0.4rem 0.9rem; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); }
.nuts-stat-row { border-bottom: 1px solid var(--line); }
.nuts-stat-row:last-child { border-bottom: none; }
.nuts-stat-row strong { color: var(--gold); font-weight: 800; }
.nuts-highscores, .pf-highscores { background: var(--tile); border: none; border-radius: var(--r-lg); box-shadow: 0 3px 0 var(--lip); }
.nuts-hs-label, .pf-highscores h4 { font: 700 0.75rem var(--font-main); color: var(--text-3); text-transform: none; letter-spacing: 0; }
.nuts-hs-val { color: var(--gold); font-weight: 800; }

/* ── Preflop Practice ───────────────────────────── */
.pf-header-stats { font: 800 1rem var(--font-main); gap: 0.4rem; color: var(--text); }
.pf-stat .ic, #pf-streak-display .ic { color: var(--orange); width: 1.05em; height: 1.05em; vertical-align: -0.15em; }
.pf-players-row { gap: 6px; }
.pf-player-box { background: var(--tile); border: none; border-radius: 12px; box-shadow: 0 3px 0 var(--lip); padding: 0.45rem 0.1rem; }
.pf-player-box .pf-pb-pos { font: 800 0.8125rem var(--font-main); }
.pf-player-box .pf-pb-action { font: 700 0.6875rem var(--font-main); text-transform: none; letter-spacing: 0; }
.pf-player-box.folded { opacity: 0.4; }
.pf-player-box.raised { background: var(--gold); box-shadow: 0 3px 0 var(--gold-lip); border: none; }
.pf-player-box.raised .pf-pb-pos, .pf-player-box.raised .pf-pb-action { color: #25231F; }
.pf-player-box.you { background: var(--blue); box-shadow: 0 3px 0 var(--blue-lip); border: none; }
.pf-player-box.you .pf-pb-pos, .pf-player-box.you .pf-pb-action { color: #fff; }
.pf-position-badge { font: 800 1.125rem var(--font-main); border-radius: 12px; padding: 0.35rem 1.1rem; box-shadow: 0 3px 0 rgba(0,0,0,0.3); }
.pf-cards { gap: 0.6rem; }
.pf-cards .pc { --w: min(26vw, 96px); }
.pf-hand-label { font: 800 1.0625rem var(--font-main); color: var(--text); letter-spacing: 0; }
.pf-stack { font: 700 0.8125rem var(--font-main); color: var(--text-2); background: var(--tile); border: none; box-shadow: 0 2px 0 var(--lip); }
.pf-actions { gap: 0.7rem; max-width: 460px; }
.pf-actions .btn { min-height: 60px; font: 800 1.1875rem var(--font-main); text-transform: none; letter-spacing: 0; border-radius: 15px; border: none; }
.pf-actions .btn-fold { background: var(--tile-2); color: var(--text); box-shadow: 0 4px 0 var(--lip); }
.pf-actions .btn-call { background: #F2EFE9; color: #25231F; box-shadow: 0 4px 0 #B3AB9E; }
.pf-actions .btn-raise { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-lip); }
.pf-actions .btn:active { transform: translateY(3px); }
.pf-actions .btn-fold:active { box-shadow: 0 1px 0 var(--lip); }
.pf-actions .btn-call:active { box-shadow: 0 1px 0 #B3AB9E; }
.pf-actions .btn-raise:active { box-shadow: 0 1px 0 var(--blue-lip); }
.pf-feedback { background: rgba(14,13,12,0.78); align-items: flex-end; }
.pf-feedback-inner {
    background: var(--tile); width: 100%; max-width: 520px; border-radius: 24px 24px 0 0; padding: 1.4rem 1.2rem calc(1.2rem + var(--safe-bottom));
    box-shadow: 0 -4px 0 var(--lip), 0 -20px 50px rgba(0,0,0,0.4); animation: sheetUp 0.4s var(--spring) both;
}
.pf-feedback-icon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 0.5rem; color: #fff; font-size: 0; animation: popIn 0.45s var(--spring) both; }
.pf-feedback-icon.correct { background: var(--good); box-shadow: 0 4px 0 var(--good-lip); color: #fff; }
.pf-feedback-icon.wrong { background: var(--bad); box-shadow: 0 4px 0 var(--bad-lip); color: #fff; }
.pf-feedback-icon .ic { width: 32px; height: 32px; }
.pf-feedback-icon .ic .i-line { stroke-width: 3.4; }
.pf-feedback h2 { font-size: 1.5rem; }
.pf-feedback h2.correct { color: var(--good); }
.pf-feedback h2.wrong { color: var(--bad); }
.pf-feedback .btn { width: 100%; }

/* ── Lessons: levels and a path ─────────────────── */
:root { --lv-green: #81B64C; --lv-blue: #3F89F2; --lv-purple: #8B6CFF; --lv-orange: #F0883E; --lv-gold: #F5B83D; --lv-teal: #2FB5A5; --lv-red: #E5484D; }
.ls-continue {
    display: flex; align-items: center; gap: 0.85rem; background: var(--tile); border-radius: 20px; padding: 1rem;
    box-shadow: 0 4px 0 var(--lip); margin: 0.25rem 0 1.4rem;
}
.ls-continue-art .spot { width: 60px; height: 60px; }
.ls-continue-text { flex: 1; min-width: 0; }
.ls-continue-text small { display: block; color: var(--text-3); font: 700 0.8125rem var(--font-main); }
.ls-continue-text strong { display: block; font: 800 1.1875rem/1.2 var(--font-main); margin-top: 0.15rem; }
.ls-continue .btn { min-height: 46px; padding: 0 1.1rem; }
.ls-h { font: 800 1.125rem var(--font-main); margin: 0 0 0.6rem 0.1rem; }
.ls-recs { margin-bottom: 1.4rem; display: flex; flex-direction: column; gap: 0.6rem; }
.ls-rec { display: flex; align-items: center; gap: 0.75rem; background: var(--tile); border: none; border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.75rem 0.9rem; color: var(--text); text-align: left; cursor: pointer; }
.ls-rec > .ic { width: 32px; height: 32px; color: var(--gold); flex-shrink: 0; }
.ls-rec strong { display: block; font-weight: 800; }
.ls-rec small { display: block; color: var(--text-2); font-size: 0.8125rem; }
.ls-level { margin-bottom: 1.6rem; }
.ls-level-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.75rem; }
.ls-level-medal { width: 52px; height: 56px; flex-shrink: 0; }
.ls-level-title { flex: 1; min-width: 0; }
.ls-level-title small { display: block; font: 800 0.75rem var(--font-main); color: var(--lc); letter-spacing: 0.02em; }
.ls-level-title strong { display: block; font: 800 1.25rem/1.2 var(--font-main); letter-spacing: -0.01em; }
.ls-level-bar { height: 8px; border-radius: 4px; background: var(--bg-deep); margin-top: 0.4rem; overflow: hidden; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); }
.ls-level-bar i { display: block; height: 100%; background: var(--lc); border-radius: 4px; transition: width 0.9s var(--ease); }
.ls-level-count { font: 800 0.9375rem var(--font-main); color: var(--text-2); align-self: flex-start; margin-top: 0.2rem; }
.ls-level.complete .ls-level-title small { color: var(--gold); }

.ls-path { position: relative; display: flex; flex-direction: column; gap: 0.6rem; }
.ls-path::before { content: ''; position: absolute; left: 30px; top: 30px; bottom: 30px; width: 4px; border-radius: 2px; background: var(--tile); }
.ls-node {
    position: relative; display: flex; align-items: center; gap: 0.8rem; width: 100%; background: var(--tile); border: none;
    border-radius: 16px; padding: 0.7rem 0.9rem 0.7rem 0.7rem; box-shadow: 0 3px 0 var(--lip); color: var(--text); text-align: left; cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.ls-node:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.ls-node-dot {
    width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; position: relative; z-index: 1;
    background: var(--tile-2); color: var(--text-2); box-shadow: 0 3px 0 var(--lip);
}
.ls-node-dot .ic { width: 24px; height: 24px; }
.ls-node.done .ls-node-dot { background: var(--lc); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--lc) 60%, #000); }
.ls-node.done .ls-node-dot .ic .i-line { stroke-width: 3.2; }
.ls-node.next { box-shadow: 0 3px 0 var(--lip), 0 0 0 3px var(--lc); }
.ls-node.next .ls-node-dot { background: var(--lc); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--lc) 60%, #000); animation: bob 2s ease-in-out infinite; }
.ls-node-info { flex: 1; min-width: 0; }
.ls-node-info strong { display: block; font: 800 1rem var(--font-main); }
.ls-node-info small { display: block; color: var(--text-2); font-size: 0.8125rem; line-height: 1.3; margin-top: 0.1rem; }
.ls-node-meta small { color: var(--text-3); font: 700 0.8125rem var(--font-main); white-space: nowrap; }
.ls-start { font: 800 0.8125rem var(--font-main); color: #fff; background: var(--lc); padding: 0.35rem 0.7rem; border-radius: 9px; box-shadow: 0 2px 0 color-mix(in srgb, var(--lc) 60%, #000); }
.ls-mini-stars i { color: var(--tile-2); font-style: normal; font-size: 0.9375rem; }
.ls-mini-stars i.on { color: var(--gold); }
.ls-done-medal { width: 96px; height: 104px; margin: 0 auto; animation: popIn 0.6s var(--spring) both; }
.ls-two-icon .ic { width: 40px; height: 40px; }

/* ── Inside a lesson ────────────────────────────── */
.ls-top { padding: calc(0.6rem + var(--safe-top)) 1rem 0.5rem; gap: 0.6rem; }
.ls-close { width: 42px; height: 42px; border-radius: 12px; }
.ls-progress { height: 14px; background: var(--bg-deep); border-radius: 8px; box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); }
.ls-progress div { position: relative; background: var(--good); border-radius: 8px; transition: width 0.5s var(--spring); }
.ls-progress div::after { content: ''; position: absolute; left: 6px; right: 6px; top: 3px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.3); }
.ls-body { padding: 0.5rem 1.1rem 1rem; }
.ls-step { animation: riseIn 0.4s var(--ease) both; }
.ls-title { font-size: 1.625rem; font-weight: 800; letter-spacing: -0.015em; }
.ls-prompt { font-size: 1.3125rem; font-weight: 800; letter-spacing: -0.01em; }
.ls-text { font-size: 1.0625rem; color: var(--text-2); }
.ls-hint { color: var(--text-3); font-size: 0.875rem; }
.ls-guide { background: var(--tile); border: none; box-shadow: 0 2px 0 var(--lip); border-radius: 999px; padding: 0.25rem 0.9rem 0.25rem 0.25rem; font: 700 0.8125rem var(--font-main); color: var(--text-2); }
.ls-guide .bot-avatar { width: 32px; height: 32px; }
.bot-avatar .face { border-radius: 50%; }

/* Cards in lessons use the same drawn cards */
.pc.ls-card { --w: 58px; width: var(--w); height: calc(var(--w) * 1.4); border-radius: 12% / 8.57%; transition: opacity 0.2s ease, transform 0.25s var(--spring), box-shadow 0.2s ease; }
.ls-cards.sm .pc.ls-card { --w: 44px; }
.ls-cards.xs .pc.ls-card { --w: 30px; }
.ls-cards.lg .pc.ls-card { --w: 74px; }
.ls-board-slot .pc.ls-card { --w: 50px; }
.pc.ls-card.hl { box-shadow: 0 2px 0 #CFC8BC, 0 0 0 3px var(--gold); transform: translateY(-4px); }
.pc.ls-card.dim { opacity: 0.3; }
.ls-cards.xs .pc .pc-big { display: none; }
.ls-cards.xs .pc .pc-r { left: 0; right: 0; text-align: center; font-size: 50cqw; }
.ls-cards.xs .pc .pc-s { left: 25cqw; top: auto; bottom: 10cqw; width: 50cqw; height: 50cqw; }
.ls-flip { width: 88px; height: 123px; }
.ls-flip .flip > .pc { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ls-flip .flip > .ls-face-front { transform: rotateY(180deg); }
.ls-deck-card .pc { width: 100%; height: auto; aspect-ratio: 1 / 1.4; box-shadow: 0 1px 0 #CFC8BC; }
.ls-deck-card .pc .pc-big { display: none; }
.ls-deck-card .pc .pc-r { left: 0; right: 0; text-align: center; font-size: 52cqw; top: 6cqw; }
.ls-deck-card .pc .pc-s { left: 25cqw; top: auto; bottom: 10cqw; width: 50cqw; height: 50cqw; }
.ls-deck-card { border-radius: 6px; }
.ls-deck-card.sel { border-color: var(--blue); }
.ls-deck-card.right, .ls-deck-card.missed { border-color: var(--good); }
.ls-deck-card.wrong { border-color: var(--bad); }

/* No felt: boards sit in a recessed panel */
.ls-board, .ls-board-mini, .ls-pot, .ls-chart-spot {
    background: var(--bg-deep); border-radius: 18px; box-shadow: inset 0 3px 0 rgba(0,0,0,0.3);
}
.ls-board-slot small { color: var(--text-2); font: 700 0.6875rem var(--font-main); }
.ls-felt { background: var(--tile); box-shadow: inset 0 0 0 7px var(--tile-2), 0 6px 0 var(--lip); }
.ls-seat-dot { background: var(--tile-2); border: none; box-shadow: 0 3px 0 var(--lip); }
.ls-seat.hl .ls-seat-dot { background: var(--blue); box-shadow: 0 3px 0 var(--blue-lip); border: none; }
.ls-seat.right .ls-seat-dot { background: var(--good); box-shadow: 0 3px 0 var(--good-lip); border: none; }
.ls-seat.wrong .ls-seat-dot { background: var(--bad); box-shadow: 0 3px 0 var(--bad-lip); border: none; }
.ls-seat-label { font: 800 0.75rem var(--font-main); }
.ls-btn-chip { background: #fff; color: #25231F; box-shadow: 0 2px 0 #B3AB9E; }
.ls-chipstack { display: flex; flex-direction: column; align-items: center; }
.ls-chipstack .chip-svg { width: 34px; height: 36px; }
.ls-chipstack .chip-svg + .chip-svg { margin-top: -28px; }
.ls-pot-stack, .ls-pot-bet { font: 800 1rem var(--font-main); }

/* Answers: chunky tiles that turn green or red */
.ls-option, .ls-player, .ls-choice, .ls-rung, .ls-versus, .ls-best5, .ls-bars, .ls-odds, .ls-two-col, .ls-bot {
    background: var(--tile); border: none; border-radius: 16px; box-shadow: 0 3px 0 var(--lip);
}
.ls-option, .ls-player, .ls-choice { transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.2s ease; }
.ls-option:active, .ls-player:active, .ls-choice:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.ls-option.picked { box-shadow: 0 3px 0 var(--lip), 0 0 0 3px var(--blue); }
.ls-order { background: var(--blue); box-shadow: 0 2px 0 var(--blue-lip); }
.ls-option.right, .ls-player.right, .ls-choice.right, .ls-split.right { background: var(--good); box-shadow: 0 3px 0 var(--good-lip); border-color: transparent; color: #fff; animation: popIn 0.4s var(--spring) both; }
.ls-option.wrong, .ls-player.wrong, .ls-choice.wrong { background: var(--bad); box-shadow: 0 3px 0 var(--bad-lip); border-color: transparent; color: #fff; animation: shake 0.45s ease both; }
.ls-option.right .ls-option-name, .ls-player.right .ls-player-hand, .ls-option.wrong .ls-option-name, .ls-player.wrong .ls-player-hand { color: rgba(255,255,255,0.85); }
.ls-option-name, .ls-player-hand { color: var(--text-2); font: 700 0.8125rem var(--font-main); }
.ls-player-name { font-weight: 800; }
.ls-player .bot-avatar { width: 40px; height: 40px; }
.ls-split { border: 2px dashed var(--tile-2); border-radius: 16px; color: var(--text-2); font: 800 0.9375rem var(--font-main); }
.ls-choice { font: 800 1rem var(--font-main); padding: 0.95rem 1rem; }
.ls-choices.two .ls-choice { text-transform: none; letter-spacing: 0; font-size: 1.125rem; }
.ls-choice.fold { background: var(--tile-2); box-shadow: 0 4px 0 var(--lip); }
.ls-choice.raise { background: var(--blue); box-shadow: 0 4px 0 var(--blue-lip); border: none; color: #fff; }
.ls-rung-n { color: var(--text-3); font-weight: 800; }
.ls-rung-body strong { font-size: 0.9375rem; font-weight: 800; }
.ls-vs-label { text-transform: none; letter-spacing: 0; font: 700 0.8125rem var(--font-main); color: var(--text-3); }
.ls-vs-beats { text-transform: none; letter-spacing: 0; font: 800 0.8125rem var(--font-main); }
.ls-b5-row > span { text-transform: none; font: 700 0.75rem var(--font-main); }
.ls-b5-name { color: var(--gold); }
.ls-act { border-radius: 14px; box-shadow: 0 3px 0 var(--lip); }
.ls-act strong { text-transform: none; font: 800 1rem var(--font-main); }
.ls-act.fold { background: var(--tile-2); }
.ls-act.call { background: #F2EFE9; color: #25231F; box-shadow: 0 3px 0 #B3AB9E; }
.ls-act.raise { background: var(--blue); box-shadow: 0 3px 0 var(--blue-lip); }
.ls-cell { background: var(--bg-deep); color: var(--text-3); border-radius: 3px; }
.ls-cell.on { background: var(--good); color: #fff; }
.ls-cell.me { outline: 2px solid var(--gold); }
.ls-grid-key span { background: var(--bg-deep); }
.ls-grid-key span.on { background: var(--good); }
.ls-bar { height: 12px; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); }
.ls-bar div { background: var(--blue); }
.ls-bar.price div { background: var(--orange); }
.ls-odds-verdict.good { background: var(--good); color: #fff; box-shadow: 0 2px 0 var(--good-lip); }
.ls-odds-verdict.bad { background: var(--orange); color: #fff; box-shadow: 0 2px 0 #C9661A; }
.ls-pos { background: var(--blue); box-shadow: 0 2px 0 var(--blue-lip); font-weight: 800; }
.ls-fo-top small { text-transform: none; font: 700 0.75rem var(--font-main); color: var(--text-3); }

/* Feedback: a bold banner, then the big button */
.ls-bottom { gap: 0.65rem; }
.ls-feedback { border: none; border-radius: 16px; padding: 0.85rem 1rem; animation: sheetUp 0.35s var(--spring) both; }
.ls-feedback.good { background: var(--good); box-shadow: 0 4px 0 var(--good-lip); border: none; }
.ls-feedback.bad { background: var(--bad); box-shadow: 0 4px 0 var(--bad-lip); border: none; }
.ls-feedback strong, .ls-feedback.good strong, .ls-feedback.bad strong { color: #fff; font-size: 1.0625rem; font-weight: 800; }
.ls-feedback p { color: rgba(255,255,255,0.92); font-size: 0.9375rem; }

/* Lesson complete */
.ls-done h2 { font-size: 1.875rem; font-weight: 800; }
.ls-stars { font-size: 3rem; gap: 0.5rem; }
.ls-stars span { color: var(--tile-2); }
.ls-stars span.on { color: var(--gold); text-shadow: 0 3px 0 var(--gold-lip); animation: popIn 0.5s var(--spring) both; }
.ls-xp { font: 800 1.25rem var(--font-main); color: #fff; background: var(--good); box-shadow: 0 3px 0 var(--good-lip); border-radius: 12px; padding: 0.45rem 1.1rem; }

/* ══════════════════════════════════════════════════
   DIALOGS, SHEETS AND MENUS
   ══════════════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { opacity: 0; transform: scale(0.94); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.overlay:not(.hidden) { animation: fadeIn 0.18s ease both; }
.overlay-content { max-height: calc(100dvh - 2rem - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain; }

/* A dialog: art on top, a title, a line of text, then big buttons */
.ui-dialog { z-index: 400; padding: 1.25rem; }
.ui-dialog.closing { animation: fadeOut 0.18s ease both; pointer-events: none; }
.ui-dialog.closing .dialog-card { animation: popOut 0.18s ease both; }
.dialog-card { max-width: 340px; text-align: center; padding: 1.5rem 1.25rem 1.25rem; }
.dialog-art { display: grid; place-items: center; margin: -0.25rem auto 0.6rem; }
.dialog-art .spot { width: 76px; height: 76px; animation: popIn 0.5s var(--spring) 0.05s both; }
.dialog-art .medal { width: 88px; height: 94px; animation: popIn 0.5s var(--spring) 0.05s both; }
.dialog-card h2 { font-size: 1.375rem; line-height: 1.2; margin: 0 0 0.4rem; }
.dialog-card p { font-size: 1rem; line-height: 1.45; color: var(--text-2); margin: 0 0 1.2rem; }
.dialog-actions { display: flex; flex-direction: column; gap: 0.7rem; }
.dialog-actions .btn + .btn { margin-top: 0; }
.dialog-note { display: inline-flex; align-items: center; gap: 0.4rem; font: 700 0.875rem var(--font-main); color: var(--text-2); background: var(--bg-deep); border-radius: 10px; padding: 0.45rem 0.75rem; margin: -0.4rem 0 1.1rem; }
.dialog-note .ic { width: 18px; height: 18px; color: var(--gold); }

/* A sheet slides up from the bottom (menus) */
.overlay.sheet { align-items: flex-end; padding: 0; }
.overlay.sheet > .overlay-content {
    width: 100%; max-width: 560px; max-height: 88dvh; border-radius: 24px 24px 0 0; text-align: left;
    padding: 0.6rem 1rem calc(1rem + var(--safe-bottom)); box-shadow: 0 -4px 0 var(--lip), 0 -24px 60px rgba(0,0,0,0.45);
    animation: sheetUp 0.36s var(--ease) both;
}
.overlay.sheet > .overlay-content::before {
    content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--tile-2); margin: 0 auto 0.9rem;
}
.sheet-title { font-size: 1.25rem !important; font-weight: 800; margin: 0 0 0.8rem 0.25rem !important; text-align: left; }
.sheet-info { display: flex; gap: 0.5rem; margin: 0 0 0.9rem; }
.sheet-info > span { flex: 1; min-width: 0; background: var(--bg-deep); border-radius: 12px; padding: 0.5rem 0.7rem; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); }
.sheet-info small { display: block; font: 700 0.6875rem var(--font-main); color: var(--text-3); }
.sheet-info strong { display: block; font: 800 0.9375rem var(--font-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu-list { display: flex; flex-direction: column; background: var(--bg-deep); border-radius: 16px; padding: 4px; margin: 0 0 1rem; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); }
.menu-row {
    display: flex; align-items: center; gap: 0.8rem; width: 100%; min-height: 56px; padding: 0.4rem 0.75rem 0.4rem 0.5rem;
    background: transparent; border: none; border-radius: 12px; color: var(--text); font: 700 1.0625rem var(--font-main);
    text-align: left; cursor: pointer; transition: background-color 0.12s ease, transform 0.08s ease;
}
.menu-row + .menu-row { box-shadow: 0 -1px 0 var(--line); }
.menu-row:active { background: var(--tile); transform: scale(0.99); }
.menu-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--tile-2); color: var(--text); box-shadow: 0 2px 0 var(--lip); }
.menu-ic .ic { width: 22px; height: 22px; }
.menu-label { flex: 1; min-width: 0; }
.menu-value { font: 700 0.9375rem var(--font-main); color: var(--text-3); }
.menu-row.danger { color: #FF6B6F; }
.menu-row.danger .menu-ic { background: rgba(229,72,77,0.16); color: #FF6B6F; box-shadow: none; }
.menu-row[data-sound-toggle].off .menu-value { color: var(--text-3); }
.menu-row[data-sound-toggle]:not(.off) .menu-value { color: var(--good); }

/* Toggle switches (buttons and checkboxes) */
input.toggle { -webkit-appearance: none; appearance: none; margin: 0; }
input.toggle:focus { outline: none; }
input.toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.set-row:has(#set-sound:not(:checked)) .set-ic-blue { background: var(--tile-2); color: var(--text-2); box-shadow: 0 2px 0 var(--lip); }
.toggle:checked { background: var(--blue); border: none; }
.toggle:checked::after { left: 3px; background: #fff; transform: translateX(22px); }

/* Toast: one tidy line */
.app-toast { white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; text-align: left; }
.app-toast span { overflow: hidden; text-overflow: ellipsis; }

/* Mode lists: a drawing, a title and a line */
.mode-cards { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.4rem; }
.mode-card .game-card-icon .spot { width: 52px; height: 52px; }
.mode-card { min-height: 88px; }
.mode-card:active .game-card-icon .spot, .game-card:active .game-card-icon .spot { transform: scale(0.94); }
.game-card-icon .spot { transition: transform 0.2s var(--spring); }

/* ── Settings ───────────────────────────────────── */
.settings-body { padding-top: 0.25rem; }
.set-group { margin-bottom: 1.5rem; }
.set-h { font: 800 1.125rem var(--font-main); margin: 0 0 0.6rem 0.1rem; }
.set-list { background: var(--tile); border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 4px; }
.set-row {
    display: flex; align-items: center; gap: 0.8rem; width: 100%; min-height: 64px; padding: 0.5rem 0.75rem 0.5rem 0.55rem;
    background: transparent; border: none; border-radius: 12px; color: var(--text); text-align: left; cursor: pointer;
    font-family: var(--font-main); transition: background-color 0.12s ease;
}
.set-row + .set-row { box-shadow: 0 -1px 0 var(--line); }
.set-row:active { background: var(--tile-hi); }
.set-text { flex: 1; min-width: 0; }
.set-text strong { display: block; font: 800 1rem var(--font-main); }
.set-text small { display: block; font: 500 0.8125rem var(--font-main); color: var(--text-2); margin-top: 0.1rem; }
.set-chev { color: var(--text-3); display: grid; }
.set-chev .ic { width: 20px; height: 20px; }
.set-ic-blue { background: var(--blue); color: #fff; box-shadow: 0 2px 0 var(--blue-lip); }
.set-ic-green { background: var(--good); color: #fff; box-shadow: 0 2px 0 var(--good-lip); }
.set-ic-purple { background: var(--purple); color: #fff; box-shadow: 0 2px 0 var(--purple-lip); }
.set-foot { text-align: center; color: var(--text-3); font: 600 0.8125rem var(--font-main); margin: 0.5rem 0 1rem; }

/* Card back: a little table with your back and a face card, colours underneath */
.cb-panel { background: var(--tile); border-radius: 20px; box-shadow: 0 3px 0 var(--lip); padding: 0.75rem; margin-bottom: 0.85rem; }
.cb-stage {
    height: 176px; border-radius: 14px; display: grid; place-items: center; overflow: hidden;
    background: radial-gradient(120% 90% at 50% 40%, #2F2C29 0%, #242220 70%); box-shadow: inset 0 3px 0 rgba(0,0,0,0.3);
}
.cb-fan { position: relative; width: 170px; height: 132px; }
.cb-card { position: absolute; top: 4px; width: 90px; height: 126px; border-radius: 11px; }
.cb-back { left: 4px; transform: rotate(-9deg); box-shadow: 0 3px 0 rgba(0,0,0,0.35), 0 10px 20px rgba(0,0,0,0.35); }
.cb-back img { display: block; width: 100%; height: 100%; border-radius: 11px; }
.cb-back.turn { animation: cbTurn 0.55s var(--spring) both; }
@keyframes cbTurn { 0% { transform: rotate(-9deg) rotateY(90deg) scale(0.92); } 100% { transform: rotate(-9deg); } }
.pc.cb-face { --w: 90px; left: 76px; top: 8px; transform: rotate(8deg); z-index: 1; box-shadow: 0 2px 0 #CFC8BC, -6px 8px 18px rgba(0,0,0,0.35); }
.cb-colors { display: flex; justify-content: center; gap: 0.7rem; padding: 0.85rem 0 0.2rem; }
.cb-swatch {
    width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; background: var(--sw); color: #fff;
    box-shadow: 0 3px 0 color-mix(in srgb, var(--sw) 55%, #000); display: grid; place-items: center; padding: 0;
    transition: transform 0.2s var(--spring), box-shadow 0.15s ease;
}
.cb-swatch.dark { box-shadow: 0 3px 0 #141312, inset 0 0 0 2px rgba(255,255,255,0.14); }
.cb-swatch .ic { width: 22px; height: 22px; opacity: 0; transform: scale(0.4); transition: opacity 0.15s ease, transform 0.25s var(--spring); }
.cb-swatch .ic .i-line { stroke-width: 3.4; }
.cb-swatch.active { transform: translateY(-2px); box-shadow: 0 0 0 3px var(--tile), 0 0 0 6px #fff, 0 5px 0 3px color-mix(in srgb, var(--sw) 55%, #000); }
.cb-swatch.active .ic { opacity: 1; transform: none; }
.cb-swatch:active { transform: translateY(1px); }
.cb-designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.cb-design {
    display: flex; flex-direction: column; align-items: center; gap: 0.45rem; padding: 0.7rem 0.4rem 0.6rem; border: none; cursor: pointer;
    background: var(--tile); border-radius: 16px; box-shadow: 0 3px 0 var(--lip); color: var(--text);
    transition: transform 0.08s ease, box-shadow 0.12s ease;
}
.cb-design:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.cb-design.active { box-shadow: 0 3px 0 var(--lip), 0 0 0 3px var(--blue); }
.cb-design-card { position: relative; width: 56px; height: 78px; display: block; }
.cb-design-card img { display: block; width: 100%; height: 100%; border-radius: 7px; box-shadow: 0 2px 0 rgba(0,0,0,0.35); }
.cb-design.locked .cb-design-card img { filter: grayscale(1) brightness(0.55); }
.cb-lock { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.cb-lock .ic { width: 22px; height: 22px; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.45)); }
.cb-design-name { font: 800 0.875rem var(--font-main); }
.cb-design.locked .cb-design-name { color: var(--text-3); }
.cb-count { grid-column: 1 / -1; text-align: center; color: var(--text-3); font: 600 0.8125rem var(--font-main); margin: 0.3rem 0 0; }
.cb-locked-preview { position: relative; width: 80px; height: 112px; margin: -0.4rem auto 1.1rem; }
.cb-locked-preview img { width: 100%; height: 100%; border-radius: 10px; filter: grayscale(1) brightness(0.6); box-shadow: 0 3px 0 rgba(0,0,0,0.35); }
.cb-locked-preview span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.cb-locked-preview .ic { width: 30px; height: 30px; }

/* Preflop: table size picker */
.pf-table-size { margin: 0 0 1.4rem; }
.pf-table-size h3 { text-align: left; }
.pf-size-btns.segmented { display: flex; gap: 4px; }
.pf-size-btns.segmented .pf-size-btn { flex: 1; background: transparent; border: none; box-shadow: none; color: var(--text-3); font: 700 0.9375rem var(--font-main); padding: 0.65rem 0.35rem; border-radius: 10px; }
.pf-size-btns.segmented .pf-size-btn.active { color: var(--text); background: transparent; }
.pf-size-btns.segmented:not(.has-thumb) .pf-size-btn.active { background: var(--tile-2); box-shadow: 0 3px 0 var(--lip); }

/* ── Profile ────────────────────────────────────── */
.me-body { padding-top: 0.25rem; }
.me-head { display: flex; align-items: center; gap: 1rem; margin: 0.25rem 0 1.2rem; }
.me-avatar { width: 84px; height: 84px; border-radius: 22px; overflow: hidden; flex-shrink: 0; box-shadow: 0 4px 0 var(--blue-lip); background: var(--blue); }
.me-avatar .face { width: 100%; height: 100%; }
.me-id { min-width: 0; }
.me-id h2 { font-size: 1.5rem; line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
.me-sub { color: var(--text-2); font-size: 0.9375rem; margin: 0.2rem 0 0; overflow-wrap: anywhere; }
.me-level { display: flex; align-items: center; gap: 0.85rem; background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); padding: 0.85rem 1rem; margin-bottom: 0.8rem; }
.medal.me-level-medal { width: 54px; height: 58px; flex-shrink: 0; }
.me-level-info { flex: 1; min-width: 0; }
.me-level-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.me-level-top strong { font: 800 1.125rem var(--font-main); }
.me-level-top span { font: 700 0.8125rem var(--font-main); color: var(--text-2); white-space: nowrap; }
.me-bar { height: 12px; border-radius: 6px; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); margin: 0.45rem 0 0.35rem; overflow: hidden; }
.me-bar i { position: relative; display: block; height: 100%; min-width: 12px; border-radius: 6px; background: var(--gold); animation: barGrow 0.9s var(--ease) 0.15s both; transform-origin: left; }
.me-bar i::after { content: ''; position: absolute; left: 5px; right: 5px; top: 3px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.35); }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: none; } }
.me-level-info small { display: block; color: var(--text-3); font: 600 0.75rem var(--font-main); }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1.5rem; }
.me-stat { background: var(--tile); border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.75rem 0.4rem 0.7rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.1rem; min-width: 0; }
.me-stat .spot { width: 36px; height: 36px; margin-bottom: 0.3rem; }
.me-stat strong { font: 800 1.25rem/1.1 var(--font-main); font-variant-numeric: tabular-nums; }
.me-stat strong em { font-style: normal; color: var(--text-3); font-size: 0.875rem; }
.me-stat small { font: 700 0.6875rem/1.2 var(--font-main); color: var(--text-3); }
.me-leaks { margin-bottom: 1.5rem; }
.me-ach-h { display: flex; justify-content: space-between; align-items: baseline; }
.me-ach-h span { font: 700 0.875rem var(--font-main); color: var(--text-3); }
.me-medals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem 0.35rem; margin-bottom: 1.8rem; }
.me-medal { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; background: none; border: none; color: var(--text); cursor: pointer; padding: 0; min-width: 0; }
.me-medal .medal { width: 60px; height: 64px; transition: transform 0.25s var(--spring); }
.me-medal:active .medal { transform: scale(0.9); }
.me-medal small { font: 700 0.75rem/1.2 var(--font-main); text-align: center; color: var(--text-2); }
.me-medal:not(.earned) small { color: var(--text-3); }
.me-medal:not(.earned) .medal { opacity: 0.8; }
.me-actions { display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 1.5rem; }
.btn.me-delete { color: #FF6B6F; min-height: 44px; }

/* ── Award banner (achievements, levels, daily goal) ── */
.award {
    position: fixed; z-index: 450; top: calc(10px + var(--safe-top)); left: 50%; width: min(420px, calc(100vw - 24px));
    display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 1rem 0.6rem 0.6rem; cursor: pointer;
    background: var(--tile-2); color: var(--text); border-radius: 18px;
    box-shadow: 0 4px 0 var(--lip), 0 18px 40px rgba(0,0,0,0.45);
    animation: awardIn 0.5s var(--spring) both; transform: translateX(-50%);
}
.award.out { animation: awardOut 0.26s var(--ease) both; }
@keyframes awardIn { from { opacity: 0; transform: translate(-50%, -120%) scale(0.9); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes awardOut { to { opacity: 0; transform: translate(-50%, -110%); } }
.award-art { width: 50px; height: 54px; flex-shrink: 0; display: grid; place-items: center; }
.award-art .medal { width: 50px; height: 54px; animation: awardArt 0.7s var(--spring) 0.15s both; }
.award-art .spot { width: 44px; height: 44px; animation: awardArt 0.7s var(--spring) 0.15s both; }
@keyframes awardArt { 0% { transform: scale(0.4) rotate(-20deg); } 100% { transform: none; } }
.award-text { min-width: 0; flex: 1; }
.award-text small { display: block; font: 800 0.75rem var(--font-main); color: var(--gold); letter-spacing: 0.01em; }
.award-text strong { display: block; font: 800 1.0625rem/1.2 var(--font-main); }
.award-text span { display: block; font: 600 0.8125rem/1.3 var(--font-main); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Friends ────────────────────────────────────── */
.friends-search-bar {
    position: relative; display: flex; align-items: center; gap: 0.5rem; background: var(--bg-deep); border-radius: 14px;
    padding: 5px 5px 5px 0; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); margin-bottom: 0.75rem;
}
.friends-search-ic { display: grid; place-items: center; padding-left: 0.8rem; color: var(--text-3); }
.friends-search-ic .ic { width: 20px; height: 20px; }
.friends-search-bar input, .friends-search-bar input:focus {
    flex: 1; min-width: 0; background: transparent; border: none; box-shadow: none; outline: none; padding: 0.55rem 0.1rem;
    font: 600 1rem var(--font-main); color: var(--text); -webkit-appearance: none; appearance: none;
}
.friends-search-bar input::-webkit-search-cancel-button { -webkit-appearance: none; }
.friends-search-bar:focus-within { box-shadow: inset 0 2px 0 rgba(0,0,0,0.25), 0 0 0 2px var(--blue); }
.friends-search-go.btn-small { min-height: 40px; padding: 0 0.95rem; border-radius: 10px; }
.friends-section { margin-bottom: 1.6rem; }
.friends-section h3 { font: 800 1.125rem var(--font-main); text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 0.6rem 0.1rem; display: flex; align-items: center; gap: 0.5rem; }
.friends-count-badge { background: var(--bad); color: #fff; font: 800 0.75rem var(--font-main); padding: 0.1rem 0.45rem; border-radius: 999px; box-shadow: 0 2px 0 var(--bad-lip); }
.friends-count-text { font: 700 0.875rem var(--font-main); color: var(--good); }
.friends-list { gap: 0.6rem; }
.friend-row { background: var(--tile); border: none; border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.65rem 0.75rem 0.65rem 0.65rem; gap: 0.75rem; }
.friend-avatar { width: 46px; height: 46px; background: none; border-radius: 50%; }
.friend-avatar .face { width: 100%; height: 100%; display: block; }
.friend-status-dot { width: 14px; height: 14px; border: 3px solid var(--tile); right: -1px; bottom: -1px; }
.friend-status-dot.online { background: var(--good); }
.friend-status-dot.offline { background: var(--tile-2); }
.friend-name { font: 800 1rem var(--font-main); }
.friend-status-text { font: 600 0.8125rem var(--font-main); color: var(--text-3); }
.friend-action-btn {
    min-width: 40px; height: 40px; padding: 0 0.8rem; border: none; border-radius: 11px; display: inline-grid; place-items: center;
    background: var(--tile-2); color: var(--text-2); box-shadow: 0 3px 0 var(--lip); font: 800 0.875rem var(--font-main);
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.friend-action-btn .ic { width: 20px; height: 20px; }
.friend-action-btn .ic .i-line { stroke-width: 3; }
.friend-action-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.friend-action-btn.accept { background: var(--good); color: #fff; box-shadow: 0 3px 0 var(--good-lip); border: none; }
.friend-action-btn.decline { background: var(--tile-2); color: var(--text-2); border: none; }
.friend-action-btn.add { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-lip); border: none; }
.friend-action-btn.sent { background: transparent; color: var(--text-3); box-shadow: none; }
.friends-empty { color: var(--text-3); font: 600 0.9375rem var(--font-main); padding: 1rem 0; }

/* Empty states: a drawing, a heading and a line */
.empty-state { text-align: center; padding: 1.6rem 1rem 1rem; }
.empty-state .spot { width: 88px; height: 88px; margin: 0 auto 0.8rem; }
.empty-state h3 { font: 800 1.25rem var(--font-main) !important; color: var(--text) !important; margin: 0 0 0.35rem !important; justify-content: center; }
.empty-state p { color: var(--text-2); font-size: 0.9375rem; line-height: 1.45; max-width: 300px; margin: 0 auto; }

/* ── Sign in ────────────────────────────────────── */
#auth-screen { background: var(--bg); align-items: center; justify-content: flex-start; overflow-y: auto; }
.auth-content { max-width: 400px; padding: calc(2.2rem + var(--safe-top)) 1.25rem calc(2rem + var(--safe-bottom)); margin: auto 0; }
.auth-brand { text-align: center; margin-bottom: 1.6rem; }
.auth-brand .logo-mark { width: 76px; height: 76px; margin: 0 auto; display: block; animation: popIn 0.6s var(--spring) both; }
.auth-brand h1 { font-size: 2.125rem; font-weight: 800; letter-spacing: -0.03em; margin: 0.6rem 0 0.2rem; }
.brand-bluff { color: #fff; }
.brand-lab { color: var(--blue); }
.auth-tagline { color: var(--text-2); font: 600 1rem var(--font-main); margin: 0; }
.auth-tabs.segmented { margin-bottom: 1.1rem; border: none; overflow: visible; }
.auth-tabs.segmented .auth-tab { background: transparent; color: var(--text-3); font: 700 1rem var(--font-main); padding: 0.7rem; }
.auth-tabs.segmented .auth-tab.active { background: transparent; color: var(--text); }
.auth-tabs.segmented:not(.has-thumb) .auth-tab.active { background: var(--tile-2); box-shadow: 0 3px 0 var(--lip); }
.auth-field-group { margin-bottom: 0.7rem; }
.auth-field-group .auth-field { margin-bottom: 0.3rem; }
.auth-field {
    display: flex; align-items: center; gap: 0.1rem; margin-bottom: 0.7rem; background: var(--bg-deep); border-radius: 14px;
    box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); transition: box-shadow 0.15s ease;
}
.auth-field:focus-within { box-shadow: inset 0 2px 0 rgba(0,0,0,0.25), 0 0 0 2px var(--blue); }
.auth-ic { display: grid; place-items: center; padding-left: 0.9rem; color: var(--text-3); }
.auth-ic .ic { width: 20px; height: 20px; }
.auth-field:focus-within .auth-ic { color: var(--blue-hi); }
.auth-field input, .auth-field input:focus {
    flex: 1; min-width: 0; background: transparent; border: none; box-shadow: none; outline: none;
    padding: 0.95rem 0.9rem 0.95rem 0.6rem; font: 600 1rem var(--font-main); color: var(--text);
}
.auth-field-hint { color: var(--text-3); font: 600 0.75rem var(--font-main); margin: 0 0 0 0.4rem; letter-spacing: 0; }
.auth-remember-label { color: var(--text-2); font: 600 0.9375rem var(--font-main); gap: 0.6rem; margin: 0.2rem 0 0.4rem 0.2rem; }
input.check {
    -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin: 0; border-radius: 7px; flex-shrink: 0; cursor: pointer;
    background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); transition: background-color 0.15s ease;
    display: grid; place-items: center;
}
input.check::after {
    content: ''; width: 14px; height: 14px; background: #fff; transform: scale(0); transition: transform 0.25s var(--spring);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
input.check:checked { background: var(--blue); box-shadow: 0 2px 0 var(--blue-lip); }
input.check:checked::after { transform: scale(1); }
input.check:focus { outline: none; }
input.check:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.auth-error { color: #FF6B6F; font: 700 0.875rem var(--font-main); min-height: 1.3em; margin: 0.3rem 0 0.6rem 0.2rem; }
.auth-error:empty { min-height: 0.4rem; }
.auth-divider { color: var(--text-3); font: 700 0.8125rem var(--font-main); margin: 1.2rem 0; }
.auth-divider::before, .auth-divider::after { background: var(--line); height: 2px; border-radius: 1px; }
.btn-google { background: #F2EFE9; color: #25231F; box-shadow: 0 4px 0 #B3AB9E; font-weight: 800; gap: 0.7rem; }
.btn-google:active { background: #F2EFE9; box-shadow: 0 1px 0 #B3AB9E; }
.auth-guest-btn { margin-top: 0.6rem; color: var(--text-2); }
.friends-section.bare > h3 { display: none; }
.brand-lab { font-weight: 800; }

/* ── Home: header and the daily card ────────────── */
.home-header { gap: 0.5rem; }
.home-logo { font-size: 1.5rem; min-width: 0; }
.home-logo .logo-mark { width: 34px; height: 34px; flex-shrink: 0; }
.home-header-actions { gap: 0.15rem; flex-shrink: 0; }
.home-profile-btn { padding-left: 0.35rem; }
.set-ic-red { background: var(--bad); color: #fff; box-shadow: 0 2px 0 var(--bad-lip); }
.set-ic-gold { background: var(--gold); color: #fff; box-shadow: 0 2px 0 var(--gold-lip); }
.today-card { display: block; padding: 0.9rem 0.9rem 0.6rem; }
.today-top { display: flex; align-items: center; gap: 0.9rem; padding: 0 0.1rem 0.8rem; }
.today-info strong { font-size: 1.1875rem; }
.today-info small { margin: 0.15rem 0 0; font-size: 0.875rem; }
.today-next {
    display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.6rem 0.4rem 0.35rem; margin: 0; background: none; border: none;
    border-top: 2px solid var(--line); color: var(--text); text-align: left; cursor: pointer; font-family: var(--font-main); border-radius: 0;
}
.today-next:active { opacity: 0.75; }
.today-next .menu-ic { width: 38px; height: 38px; border-radius: 11px; }
.today-next .menu-ic .ic { width: 21px; height: 21px; }
.today-next-text { flex: 1; min-width: 0; }
.today-next-text small { display: block; font: 700 0.75rem var(--font-main); color: var(--text-3); }
.today-next-text strong { display: block; font: 800 1rem var(--font-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 359px) { .home-logo > span:last-child { display: none; } }

/* ── Bot picker touches ─────────────────────────── */
.bot-card.selected, .bot-card.selected:active { background: none; border: none; }
.read-faces { display: flex; flex-shrink: 0; padding-left: 2px; }
.read-faces > span { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px var(--tile); margin-right: -12px; display: block; }
.read-faces > span:last-child { margin-right: 4px; }
.read-faces .face { width: 100%; height: 100%; display: block; }

/* ── My Mistakes ────────────────────────────────── */
.mk-hero { background: var(--tile); border: none; border-radius: 20px; box-shadow: 0 4px 0 var(--lip); padding: 1.3rem 1.1rem 1.15rem; text-align: center; margin-bottom: 0.9rem; }
.mk-hero .mk-art { width: 84px; height: 84px; margin: 0 auto 0.5rem; display: block; animation: popIn 0.5s var(--spring) both; }
.mk-hero .medal.mk-art { width: 76px; height: 82px; }
.mk-hero h3 { font: 800 1.25rem var(--font-main); margin: 0 0 0.35rem; }
.mk-hero p { font-size: 0.9375rem; color: var(--text-2); line-height: 1.45; margin: 0 0 1rem; }
.mk-count { margin-bottom: 1rem; }
.mk-count strong { display: block; font: 800 2.75rem/1 var(--font-main); color: var(--text); }
.mk-count span { display: block; font: 700 0.9375rem var(--font-main); color: var(--text-2); text-transform: none; letter-spacing: 0; margin-top: 0.3rem; }
.mk-count.done strong { font-size: 1.5rem; }
.mk-count.done { margin-bottom: 0.35rem; }
.mk-boxes { gap: 0.6rem; margin-bottom: 1.6rem; }
.mk-boxes div { background: var(--tile); border: none; border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.75rem 0.4rem; }
.mk-boxes strong { font: 800 1.5rem var(--font-main); }
.mk-boxes span { font: 700 0.75rem var(--font-main); color: var(--text-3); }
.mk-boxes .learning strong { color: #FF6B6F; }
.mk-boxes .reviewing strong { color: var(--blue-hi); }
.mk-boxes .mastered strong { color: var(--good); }
.mk-steps { list-style: none; margin: 0 0 1.5rem; padding: 0; background: var(--tile); border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.35rem 0.8rem; }
.mk-steps li { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.7rem 0; }
.mk-steps li + li { border-top: 2px solid var(--line); }
.mk-steps strong { display: block; font: 800 0.9375rem var(--font-main); margin-top: 0.1rem; }
.mk-steps small { display: block; font: 500 0.8125rem/1.4 var(--font-main); color: var(--text-2); margin-top: 0.1rem; }
.mk-icon .spot { width: 56px; height: 56px; }
.mk-badge { background: var(--bad); box-shadow: 0 2px 0 var(--bad-lip), 0 0 0 2px var(--tile); top: -2px; right: -2px; min-width: 22px; height: 22px; border-radius: 11px; font: 800 0.75rem/22px var(--font-main); }

/* The puzzle, full screen */
.overlay.pz-screen { padding: 0; background: var(--bg); align-items: stretch; animation: fadeIn 0.2s ease both; }
.overlay.pz-screen > .gr-puzzle-card {
    max-width: 560px; width: 100%; max-height: none; height: 100%; margin: 0 auto; border-radius: 0; box-shadow: none; background: var(--bg);
    padding: 0; display: flex; flex-direction: column; text-align: left; overflow: hidden; animation: scrInF 0.34s var(--ease) both;
}
.pz-top { display: flex; align-items: center; gap: 0.7rem; padding: calc(0.6rem + var(--safe-top)) 1rem 0.5rem; }
.pz-top .pz-close { flex-shrink: 0; }
.pz-progress { flex: 1; height: 14px; border-radius: 8px; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); overflow: hidden; }
.pz-progress i { position: relative; display: block; height: 100%; min-width: 14px; border-radius: 8px; background: var(--good); transition: width 0.5s var(--spring); }
.pz-progress i::after { content: ''; position: absolute; left: 6px; right: 6px; top: 3px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.3); }
.pz-count { font: 800 0.9375rem var(--font-main); color: var(--text-2); min-width: 2.2em; text-align: right; }
.pz-scroll { flex: 1; overflow-y: auto; padding: 0.4rem 1rem 1rem; overscroll-behavior: contain; }
.pz-head { display: flex; align-items: center; gap: 0.8rem; margin: 0.2rem 0 0.9rem; }
.pz-face { width: 52px; height: 52px; border-radius: 14px; overflow: hidden; flex-shrink: 0; box-shadow: 0 3px 0 var(--lip); background: var(--tile-2); display: grid; place-items: center; }
.pz-face .face { width: 100%; height: 100%; display: block; }
.pz-face-many .ic { width: 28px; height: 28px; color: var(--text-2); }
.pz-kicker { display: block; font: 800 0.8125rem var(--font-main); color: var(--blue-hi); text-transform: none; letter-spacing: 0; margin: 0; }
.pz-head h2 { font-size: 1.375rem; margin: 0.05rem 0 0; line-height: 1.2; }
.pz-table {
    background: radial-gradient(120% 90% at 50% 30%, #2F2C29 0%, #242220 75%); border: none; border-radius: 20px;
    box-shadow: inset 0 3px 0 rgba(0,0,0,0.3); padding: 0.9rem 0.75rem 0.85rem; margin-bottom: 1rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
}
.pz-board { display: flex; justify-content: center; gap: 6px; width: 100%; }
.pz-slot { width: min(16vw, 60px); aspect-ratio: 1 / 1.4; border-radius: 12% / 8.57%; background: rgba(0,0,0,0.2); box-shadow: inset 0 3px 0 rgba(0,0,0,0.25); }
.pz-slot.filled { background: none; box-shadow: none; }
.pz-slot .pc { --w: 100%; width: 100%; height: 100%; }
.pz-slot .pc.deal-in { animation-delay: calc(var(--d) * 70ms); }
.pz-pot { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 999px; background: rgba(0,0,0,0.3); font: 700 0.8125rem var(--font-main); color: var(--text-3); }
.pz-pot i.chip { width: 20px; height: 21px; }
.pz-pot strong { font: 800 1rem var(--font-main); color: #fff; margin-left: 2px; }
.pz-story { list-style: none; width: 100%; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8125rem; color: var(--text-2); }
.pz-story li { display: flex; gap: 0.5rem; align-items: baseline; margin: 0; line-height: 1.4; }
.pz-story b { flex-shrink: 0; min-width: 3.9rem; font: 800 0.6875rem var(--font-main); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }
.pz-facing { margin: 0; color: var(--text-2); font-size: 0.875rem; text-align: center; }
.pz-hero { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; margin-top: 0.1rem; }
.pz-hand { display: flex; gap: 6px; }
.pz-hand .pc { --w: min(22vw, 84px); }
.pz-hand .pc:nth-child(1) { transform: rotate(-4deg); animation-delay: 0.36s; }
.pz-hand .pc:nth-child(2) { transform: rotate(4deg); animation-delay: 0.44s; }
.pz-me { display: flex; align-items: center; gap: 0.5rem; font: 700 0.875rem var(--font-main); color: var(--text-2); }
.pz-pos { font: 800 0.75rem var(--font-main); color: #fff; background: #2A6CCF; padding: 2px 8px; border-radius: 7px; box-shadow: 0 2px 0 #1F55A6; }
.pz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.pz-opt {
    min-height: 56px; border: none; border-radius: 15px; padding: 0.55rem 0.4rem; cursor: pointer; font: 800 1rem/1.15 var(--font-main);
    background: var(--tile-2); color: var(--text); box-shadow: 0 4px 0 var(--lip); transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s ease;
}
.pz-opt.call { background: #F2EFE9; color: #25231F; box-shadow: 0 4px 0 #B3AB9E; }
.pz-opt.raise { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-lip); }
.pz-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.pz-opt:disabled { opacity: 0.35; cursor: default; }
.pz-opt.picked, .pz-opt.best { opacity: 1; border: none; }
.pz-opt.right, .pz-opt.best { background: var(--good); color: #fff; box-shadow: 0 4px 0 var(--good-lip); animation: popIn 0.4s var(--spring) both; }
.pz-opt.wrong { background: var(--bad); color: #fff; box-shadow: 0 4px 0 var(--bad-lip); animation: shake 0.45s ease both; }
.pz-result { background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); padding: 0.9rem 1rem 1rem; margin-bottom: 0.5rem; animation: riseIn 0.4s var(--ease) both; scroll-margin-top: 0.5rem; }
.pz-verdict { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.pz-verdict .grade-icon { width: 36px; height: 36px; min-width: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--g); color: #fff; font: 900 0.875rem var(--font-main); box-shadow: 0 3px 0 color-mix(in srgb, var(--g) 60%, #000); }
.pz-verdict .grade-icon .ic { width: 20px; height: 20px; }
.pz-verdict small { display: block; font: 800 0.8125rem var(--font-main); color: var(--g); }
.pz-verdict strong { display: block; font: 800 1.0625rem/1.25 var(--font-main); }
.pz-result p { font-size: 0.9375rem; color: var(--text-2); line-height: 1.5; margin: 0.45rem 0 0; }
.pz-result .pz-best { color: var(--text); }
.pz-result .pz-mix, .pz-result .pz-orig { font-size: 0.8125rem; color: var(--text-3); }
.pz-result .pz-when { display: flex; align-items: center; gap: 0.45rem; font: 700 0.875rem var(--font-main); color: var(--blue-hi); margin-top: 0.7rem; }
.pz-result .pz-when .ic { width: 18px; height: 18px; }
.pz-result .pz-when.mastered { color: var(--gold); }
.pz-foot { padding: 0.6rem 1rem calc(0.9rem + var(--safe-bottom)); animation: riseIn 0.35s var(--ease) both; }

/* ── Game Review ────────────────────────────────── */
#cpu-review-screen .screen-header { justify-content: center; }
#cpu-review-screen .screen-header h2 { text-align: center; }
#cpu-review-body { padding-bottom: 7rem; }
.gr-coach { display: flex; align-items: flex-start; gap: 0.8rem; margin: 0.3rem 0 1rem; }
.gr-coach-face { width: 64px; height: 64px; border-radius: 18px; overflow: hidden; flex-shrink: 0; box-shadow: 0 4px 0 #8E7118; animation: faceIn 0.5s var(--spring) both; }
.gr-coach-face .face { width: 100%; height: 100%; display: block; }
.gr-coach .bot-bubble { margin: 0.35rem 0 0; animation: bubbleIn 0.45s var(--spring) 0.2s both; transform-origin: 0 50%; }
.gr-hero { display: block; background: var(--tile); border: none; border-radius: 20px; box-shadow: 0 4px 0 var(--lip); padding: 1rem 1rem 0.9rem; margin-bottom: 0.9rem; }
.gr-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; }
.gr-p { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; min-width: 0; }
.gr-p small { font: 800 0.875rem var(--font-main); color: var(--text-2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-p-face { width: 56px; height: 56px; border-radius: 16px; overflow: hidden; display: block; box-shadow: 0 3px 0 var(--lip); }
.gr-p-face .face { width: 100%; height: 100%; display: block; }
.gr-p-faces { display: flex; width: auto; overflow: visible; box-shadow: none; border-radius: 0; }
.gr-p-faces > span { width: 50px; height: 50px; border-radius: 50%; overflow: hidden; margin-left: -18px; box-shadow: 0 0 0 3px var(--tile); display: block; }
.gr-p-faces > span:first-child { margin-left: 0; }
.gr-p-faces:has(> span:only-child) > span { width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 3px 0 var(--lip); }
.gr-acc { background: #fff; color: #25231F; border-radius: 14px; padding: 0.5rem 1rem 0.55rem; text-align: center; box-shadow: 0 4px 0 #B3AB9E; min-width: 108px; animation: popIn 0.5s var(--spring) 0.15s both; }
.gr-acc small { display: block; font: 800 0.75rem var(--font-main); color: #6E6961; }
.gr-acc strong { display: block; font: 800 2.25rem/1 var(--font-main); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.gr-acc.none strong { color: #9A948B; }
.gr-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 0.95rem; padding-top: 0.85rem; border-top: 2px solid var(--line); text-align: center; }
.gr-facts small { display: block; font: 700 0.75rem var(--font-main); color: var(--text-3); }
.gr-facts strong { display: block; font: 800 1.125rem var(--font-main); margin-top: 0.1rem; }
.gr-facts .up strong { color: var(--good); }
.gr-facts .down strong { color: #FF6B6F; }
.gr-luck { background: var(--bg-deep); border: none; border-radius: 14px; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); color: var(--text-2); font-size: 0.875rem; padding: 0.7rem 0.85rem; margin: 0 0 0.9rem; }
.gr-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.9rem; background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); padding: 0.35rem 0.9rem; margin-bottom: 1.4rem; }
.gr-count { display: flex; align-items: center; gap: 0.55rem; background: none; border: none; border-radius: 0; padding: 0.55rem 0; font: 700 0.9375rem var(--font-main); color: var(--text); border-bottom: 2px solid var(--line); }
.gr-count:nth-last-child(-n+2) { border-bottom: none; }
.gr-count .grade-icon { width: 26px; height: 26px; min-width: 26px; background: var(--g); color: #fff; box-shadow: 0 2px 0 color-mix(in srgb, var(--g) 60%, #000); font-size: 0.75rem; }
.gr-count .grade-icon .ic { width: 15px; height: 15px; }
.gr-count strong { margin-left: auto; color: var(--g); font: 800 1.0625rem var(--font-main); }
.gr-count.none { color: var(--text-3); }
.gr-count.none .grade-icon { filter: grayscale(0.8) brightness(0.6); box-shadow: none; }
.gr-count.none strong { color: var(--text-3); }
.gr-h { font: 800 1.125rem var(--font-main); color: var(--text); text-transform: none; letter-spacing: 0; margin: 0 0 0.55rem 0.1rem; }
.gr-sub { font-size: 0.875rem; color: var(--text-2); margin: -0.2rem 0 0.7rem 0.1rem; line-height: 1.45; }
.gr-moment { align-items: flex-start; gap: 0.75rem; background: var(--tile); border: none; border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.75rem 0.85rem; margin-bottom: 0.6rem; }
.gr-moment .grade-icon { width: 32px; height: 32px; min-width: 32px; background: var(--g); color: #fff; box-shadow: 0 2px 0 color-mix(in srgb, var(--g) 60%, #000); }
.gr-moment strong { font: 800 0.9375rem var(--font-main); }
.gr-moment p { font-size: 0.8125rem; color: var(--text-2); }
.gr-retry { align-items: center; }
.gr-retry .btn-small { min-height: 38px; }
.gr-retry .btn-solved { background: var(--good); color: #fff; box-shadow: 0 3px 0 var(--good-lip); }
.gr-retry:last-of-type { margin-bottom: 1.4rem; }
.gr-leak { background: var(--tile); border: none; border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.8rem 0.85rem; margin-bottom: 0.6rem; gap: 0.75rem; }
.gr-leak strong { font: 800 0.9375rem var(--font-main); }
.gr-leak p { font-size: 0.8125rem; color: var(--text-2); }
.gr-leak .btn-accent { background: var(--purple); box-shadow: 0 3px 0 var(--purple-lip); }
.gr-leak + .gr-h, .gr-leak:last-of-type { margin-bottom: 1.4rem; }
.gr-stats { gap: 0.55rem; margin-bottom: 0.6rem; }
.gr-stats div { background: var(--tile); border: none; border-radius: 14px; box-shadow: 0 3px 0 var(--lip); padding: 0.65rem 0.35rem; }
.gr-stats strong { font: 800 1.1875rem var(--font-main); }
.gr-stats span { font: 700 0.6875rem var(--font-main); color: var(--text-2); margin-top: 0.1rem; }
.gr-stats em { font: 700 0.625rem var(--font-main); color: var(--text-3); }
.gr-stat.ok em { color: var(--good); }
.gr-stat.low em, .gr-stat.high em { color: var(--orange); }
.gr-stat.low, .gr-stat.high { box-shadow: 0 3px 0 var(--lip), inset 0 0 0 2px rgba(255,138,42,0.35); }
.gr-tips { color: var(--text-2); font-size: 0.875rem; margin: 0.6rem 0 1rem 1.1rem; }
.gr-read { margin-top: 1.2rem; }
.gr-note { font-size: 0.75rem; color: var(--text-3); }

/* Hand review (one hand, from the table) */
.ct-review-content { text-align: left; max-width: 420px; }
.ct-review-content h2 { text-align: center; }
.rv-hand { background: var(--bg-deep); border: none; border-radius: 16px; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); padding: 0.75rem 0.8rem; margin-bottom: 0.8rem; }
.rv-row, .rv-show { gap: 5px; margin-bottom: 0.45rem; }
.rv-label, .rv-show > span { width: 54px; font: 800 0.6875rem var(--font-main); color: var(--text-3); letter-spacing: 0.04em; }
.pc.rv-card { --w: 34px; }
.pc.rv-card .pc-big { display: none; }
.pc.rv-card .pc-r { left: 0; right: 0; text-align: center; font-size: 52cqw; top: 6cqw; }
.pc.rv-card.ten .pc-r { font-size: 44cqw; letter-spacing: -0.12em; }
.pc.rv-card .pc-s { left: 25cqw; top: auto; bottom: 10cqw; width: 50cqw; height: 50cqw; }
.rv-show em { color: var(--text-2); font-size: 0.75rem; }
.rv-net { font: 800 1rem var(--font-main); }
.rv-net.up { color: var(--good); }
.rv-net.down { color: #FF6B6F; }
.rv-decision { border-left: none; background: var(--bg-deep); border-radius: 14px; padding: 0.75rem 0.85rem; margin-bottom: 0.6rem; box-shadow: inset 4px 0 0 var(--g); }
.rv-dec-head .grade-icon { width: 24px; height: 24px; min-width: 24px; }
.rv-street { font: 800 0.6875rem var(--font-main); color: var(--text-3); letter-spacing: 0.04em; }
.rv-action { font-weight: 800; }
.rv-grade { font-weight: 800; }
.rv-title { font: 800 0.9375rem var(--font-main); }
.rv-decision p { font-size: 0.875rem; color: var(--text-2); line-height: 1.45; }
.rv-best { color: var(--blue-hi); font: 700 0.8125rem var(--font-main); }
.gr-counts { margin-bottom: 0; }
.gr-h { margin-top: 1.6rem; }
.gr-luck + .gr-counts, .gr-hero + .gr-counts { margin-top: 0; }
.ct-review-content h2.sheet-title { text-align: left; }
.sheet-foot { position: sticky; bottom: calc(-1rem - var(--safe-bottom)); margin: 0.4rem -1rem calc(-1rem - var(--safe-bottom)); padding: 0.7rem 1rem calc(1rem + var(--safe-bottom)); background: linear-gradient(rgba(49,46,43,0), var(--tile) 30%); }

/* ── Pass & Play setup ──────────────────────────── */
.setup-section { padding: 1rem 1rem 1.05rem; margin-bottom: 0.9rem; }
.setup-section h3 { font: 800 1.0625rem var(--font-main); margin: 0 0 0.3rem; }
.setup-section .hint { color: var(--text-3); font-size: 0.8125rem; margin: 0 0 0.75rem; }
.setup-section > .segmented { margin-top: 0.4rem; }
.stepper { gap: 1.4rem; margin: 0.35rem 0 0.1rem; }
.btn-stepper { width: 52px; height: 52px; border-radius: 50%; font: 700 1.625rem/1 var(--font-main); display: grid; place-items: center; padding: 0; }
.stepper-value { font: 800 2.75rem/1 var(--font-main); min-width: 64px; font-variant-numeric: tabular-nums; }
.player-names-list { gap: 0.55rem; margin-bottom: 1rem; }
.player-name-row { background: var(--tile); border: none; border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.55rem 0.6rem 0.55rem 0.55rem; gap: 0.7rem; animation: riseIn 0.35s var(--ease) both; }
.player-avatar { width: 46px; height: 46px; border-radius: 50%; background: none; overflow: hidden; }
.player-avatar .face { width: 100%; height: 100%; display: block; }
.player-name-input { background: var(--bg-deep); border: none; border-radius: 12px; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); padding: 0.75rem 0.85rem; font: 700 1rem var(--font-main); min-width: 0; }
.player-name-input:focus { outline: 2px solid var(--blue); outline-offset: 0; }
.input-group { border-radius: 12px; }
.input-prefix { color: var(--gold); font: 800 1.0625rem var(--font-main); padding-left: 0.85rem; }
.input-group .input-field, .blind-input > .input-field { font: 700 1.0625rem var(--font-main); padding-top: 0.75rem; padding-bottom: 0.75rem; }
.blind-input > .input-field { padding-left: 0.85rem; border-radius: 12px; }
.blind-input label { font: 700 0.8125rem var(--font-main); color: var(--text-2); margin-bottom: 0.35rem; }
.chip-config-grid { grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.chip-config-item {
    background: var(--bg-deep); border: none; border-radius: 14px; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25);
    padding: 0.7rem 0.4rem 0.55rem; gap: 0.45rem; cursor: text;
}
.cc-chip { width: 44px; height: 47px; display: block; }
.cc-chip svg { width: 100%; height: 100%; display: block; }
.chip-config-item input {
    width: 100%; max-width: 84px; text-align: center; background: var(--tile-2); border: none; border-radius: 9px;
    box-shadow: 0 2px 0 var(--lip); padding: 0.35rem 0.2rem; font: 800 0.9375rem var(--font-main); color: var(--text);
    -moz-appearance: textfield;
}
.chip-config-item input::-webkit-inner-spin-button, .chip-config-item input::-webkit-outer-spin-button { -webkit-appearance: none; }
.chip-config-item input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.toggle-row { gap: 0.8rem; margin: 0.2rem 0 0.8rem; }
.toggle-row label { color: var(--text-2); font: 600 0.9375rem var(--font-main); }
.setup-nav { gap: 0.7rem; margin-top: 1.1rem; }
.setup-nav .btn { min-height: 56px; }
.setup-nav .btn-secondary { flex: 0 0 38%; }
.mode-cards { max-width: 560px; margin: 0.25rem 0 1.4rem; padding: 0; }
.mode-card .game-card-icon { width: 60px; height: 60px; }
.mode-card .game-card-icon .spot { width: 58px; height: 58px; }

/* ── Pass & Play: the pass cover and the pop-ups ── */
.pass-cover.overlay { --pc: var(--blue); background: radial-gradient(90% 60% at 50% 40%, color-mix(in srgb, var(--pc) 24%, #262421) 0%, #1E1C1A 72%); }
.pass-card { animation: popIn 0.45s var(--spring) both; }
.pass-avatar { width: 112px; height: 112px; border-radius: 50%; overflow: hidden; margin-bottom: 1.2rem; box-shadow: 0 0 0 6px rgba(255,255,255,0.1), 0 8px 0 4px rgba(0,0,0,0.25); animation: bob 2.4s ease-in-out 0.5s infinite; }
.pass-avatar .face { width: 100%; height: 100%; display: block; }
.pass-card .pass-subtitle { font: 700 1rem var(--font-main); color: var(--text-2); }
.pass-card .pass-name { font: 800 2.25rem/1.1 var(--font-main); letter-spacing: -0.02em; color: #fff; }
.pass-why { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--gold); font: 800 0.9375rem var(--font-main); }
.pass-why .ic { width: 20px; height: 20px; }
.pass-hint { color: var(--text-3); font: 600 0.875rem var(--font-main); margin: 0 0 1.4rem; }
.pass-why:not(:empty) + .pass-hint { display: none; }
.pass-card .btn { max-width: 300px; }

.turn-toast { top: 38%; padding-top: 0; }
.toast-inner { display: inline-flex; align-items: center; gap: 0.6rem; background: var(--tile-2); border: none; border-radius: 999px; padding: 0.45rem 1.2rem 0.45rem 0.45rem; font: 800 1.0625rem var(--font-main); letter-spacing: 0; box-shadow: 0 4px 0 var(--lip), 0 18px 40px rgba(0,0,0,0.45); animation: popIn 0.4s var(--spring) both; }
.tt-face { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: block; }
.tt-face .face { width: 100%; height: 100%; display: block; }

.winner-candidates { gap: 0.55rem; margin-bottom: 0.9rem; }
.winner-candidate-btn {
    background: var(--tile-2); border: none; border-radius: 14px; box-shadow: 0 3px 0 var(--lip); padding: 0.5rem 0.9rem 0.5rem 0.5rem;
    font: 800 1.0625rem var(--font-main); text-align: left; transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}
.winner-candidate-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); border: none; background: var(--tile-2); }
.winner-candidate-btn.selected { background: var(--blue); box-shadow: 0 3px 0 var(--blue-lip); border: none; }
.candidate-avatar { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: none; display: block; }
.candidate-avatar .face { width: 100%; height: 100%; display: block; }
.candidate-name { flex: 1; min-width: 0; }
.candidate-tick { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,0.2); color: transparent; }
.candidate-tick .ic { width: 16px; height: 16px; }
.candidate-tick .ic .i-line { stroke-width: 3.4; }
.split-select .winner-candidate-btn.selected .candidate-tick { background: #fff; color: var(--blue); }
.winner-select .candidate-tick { display: none; }
.split-actions, .buyin-actions { gap: 0.7rem; }
.buyin-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 0 0 1.2rem; }
.buyin-facts div { background: var(--bg-deep); border-radius: 12px; padding: 0.55rem; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); }
.buyin-facts small { display: block; font: 700 0.75rem var(--font-main); color: var(--text-3); }
.buyin-facts strong { display: block; font: 800 1.25rem var(--font-main); color: var(--gold); }
.overlay-content .trophy { display: grid; place-items: center; margin: -0.3rem auto 0.5rem; animation: none; font-size: 0; }
.overlay-content .trophy .spot { width: 80px; height: 80px; animation: popIn 0.5s var(--spring) both; }
.gameover-content .btn + .btn { margin-top: 0.7rem; }

.standings-list { gap: 0.5rem; margin-bottom: 1.1rem; text-align: left; }
.standing-row { background: var(--bg-deep); border: none; border-radius: 14px; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); padding: 0.45rem 0.8rem 0.45rem 0.5rem; gap: 0.65rem; }
.standing-rank { min-width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 800 0.875rem var(--font-main); color: var(--text-2); background: var(--tile-2); }
.standing-rank.r1 { background: var(--gold); color: #fff; box-shadow: 0 2px 0 var(--gold-lip); }
.standing-rank.r2 { background: #BCC3CC; color: #25231F; box-shadow: 0 2px 0 #8A929C; }
.standing-rank.r3 { background: #CD8A4E; color: #fff; box-shadow: 0 2px 0 #9A6233; }
.standing-face { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.standing-face .face { width: 100%; height: 100%; display: block; }
.standing-name { flex: 1; min-width: 0; font: 800 1rem var(--font-main); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.standing-chips { font: 800 1rem var(--font-main); color: var(--gold); }
.standing-row.eliminated { opacity: 0.45; }
.pass-why:empty { display: none; }

/* ── Opening intro ──────────────────────────────── */
#loading-screen { background: radial-gradient(90% 60% at 50% 42%, #302D2A 0%, #1E1C1A 70%); }
.intro-glow { background: radial-gradient(circle, rgba(var(--blue-rgb),0.22) 0%, rgba(var(--blue-rgb),0) 65%); }
.intro-face.back { background-color: var(--blue); background-size: 100% 100%; border-radius: 12% / 8.57%; }
.intro-card .pc { box-shadow: 0 2px 0 #CFC8BC, 0 12px 24px rgba(0,0,0,0.4); }
.intro-card .pc.back { box-shadow: 0 3px 0 rgba(0,0,0,0.35), 0 12px 24px rgba(0,0,0,0.4); }
.intro-chip { width: 64px; height: 69px; }
.intro-chip svg { display: block; width: 64px; height: 69px; filter: drop-shadow(0 10px 16px rgba(0,0,0,0.5)); animation: introSpin 2.4s ease-in-out 2.1s infinite; }
.loading-brand { font-size: 2.5rem; letter-spacing: -0.03em; }

/* ── Online lobby ───────────────────────────────── */
.lobby-body { padding-bottom: 1.5rem; }
.lobby-hero { display: flex; align-items: center; gap: 0.85rem; background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); padding: 0.85rem 1rem; margin: 0.25rem 0 1.2rem; }
.lobby-hero .spot { width: 52px; height: 52px; }
.lobby-hero strong { display: block; font: 800 1.125rem var(--font-main); }
.lobby-hero small { display: block; font: 600 0.8125rem var(--font-main); color: var(--text-2); margin-top: 0.1rem; }
.lobby-h { display: flex; align-items: baseline; justify-content: space-between; margin-top: 0.4rem; }
.lobby-h span { font: 700 0.875rem var(--font-main); color: var(--text-3); }
.table-lobby-players { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 0.6rem; }
.table-lobby-player { display: flex; align-items: center; gap: 0.75rem; background: var(--tile); border: none; border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.55rem 0.7rem 0.55rem 0.55rem; animation: riseIn 0.35s var(--ease) both; }
.lobby-face { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: block; }
.lobby-face .face { width: 100%; height: 100%; display: block; }
.table-lobby-player.is-bot .lobby-face { border-radius: 13px; }
.table-lobby-player.is-bot .lobby-face .face { border-radius: 13px; }
.lobby-who { flex: 1; min-width: 0; }
.lobby-who strong { display: block; font: 800 1rem var(--font-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby-who small { display: block; font: 600 0.8125rem var(--font-main); color: var(--text-3); }
.lobby-tag { font: 800 0.75rem var(--font-main); padding: 0.2rem 0.55rem; border-radius: 8px; flex-shrink: 0; }
.lobby-tag.host { background: var(--gold); color: #25231F; box-shadow: 0 2px 0 var(--gold-lip); }
.lobby-tag.bot { background: var(--tile-2); color: var(--text); box-shadow: 0 2px 0 var(--lip); }
.lobby-remove { width: 36px; height: 36px; border-radius: 10px; border: none; background: transparent; color: var(--text-3); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.lobby-remove:active { background: var(--tile-2); }
.lobby-remove .ic { width: 18px; height: 18px; }
.lobby-remove .ic .i-line { stroke-width: 3; }
.lobby-add-bot {
    display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.55rem 0.7rem 0.55rem 0.55rem; margin: 0 0 1.4rem;
    background: transparent; border: 2px dashed var(--tile-2); border-radius: 16px; color: var(--text); text-align: left; cursor: pointer;
    font-family: var(--font-main); transition: background-color 0.12s ease, border-color 0.12s ease;
}
.lobby-add-bot:active { background: var(--tile); border-color: var(--blue); }
.lobby-add-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-lip); flex-shrink: 0; }
.lobby-add-ic .ic { width: 24px; height: 24px; }
.lobby-add-ic .ic .i-line { stroke-width: 3; }
.table-lobby-players:not(:has(+ .lobby-add-bot:not(.hidden))) { margin-bottom: 1.4rem; }
.lobby-friends-list { gap: 0.55rem; }
.lobby-friend-row { background: var(--tile); border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.55rem 0.7rem 0.55rem 0.55rem; gap: 0.75rem; }
.lobby-friend-row .friend-avatar { width: 42px; height: 42px; }
.lobby-friend-name { font: 800 1rem var(--font-main); }
.lobby-friend-name small { display: block; font: 600 0.8125rem var(--font-main); color: var(--text-3); }
.lobby-empty { color: var(--text-3); font: 600 0.875rem var(--font-main); margin: 0 0.1rem; }
.table-lobby-actions { margin: 0; text-align: center; }
.lobby-waiting { color: var(--text-2); font: 700 0.9375rem var(--font-main); margin: 0.2rem 0 0.4rem; }
.bot-pick-list { max-height: 60dvh; overflow-y: auto; }
.bot-pick .bot-pick-face { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex-shrink: 0; display: block; }
.bot-pick .bot-pick-face .face { width: 100%; height: 100%; display: block; }
.bot-pick .menu-label strong { display: block; font: 800 1rem var(--font-main); }
.bot-pick .menu-label small { display: block; font: 600 0.8125rem var(--font-main); color: var(--text-3); }

/* ── Your first game ────────────────────────────── */
.tut-top { padding-bottom: 0.25rem; }
#tut-progress { position: relative; height: 100%; width: 0; background: var(--good); border-radius: 8px; transition: width 0.5s var(--spring); }
#tut-progress::after { content: ''; position: absolute; left: 6px; right: 6px; top: 3px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.3); }
.tut-guide { display: flex; align-items: flex-end; gap: 0.6rem; padding: 0.2rem 0.9rem 0.6rem; min-height: 88px; }
.tut-face { width: 56px; height: 56px; border-radius: 16px; overflow: hidden; flex-shrink: 0; box-shadow: 0 3px 0 #8E7118; }
.tut-face .face { width: 100%; height: 100%; display: block; }
.tut-bubble {
    position: relative; flex: 1; min-width: 0; background: #fff; color: #25231F; border-radius: 16px; padding: 0.7rem 0.85rem;
    box-shadow: 0 3px 0 #C9C3B8, 0 12px 28px rgba(0,0,0,0.35); font: 600 0.9375rem/1.4 var(--font-main); max-height: 44dvh; overflow-y: auto;
}
.tut-bubble::before { content: ''; position: absolute; left: -7px; bottom: 18px; border: 7px solid transparent; border-left: 0; border-right-color: #fff; }
.tut-bubble p { margin: 0; }
.tut-bubble.in { animation: bubbleIn 0.4s var(--spring) both; transform-origin: 0 100%; }
.tut-bubble.nudge { animation: shake 0.45s ease both; }
.tut-bubble:empty { visibility: hidden; }
.ct-btn.tut-off { opacity: 0.35; }
.ct-btn.tut-go { animation: tutGo 1.6s ease-in-out infinite; }
@keyframes tutGo { 0%, 100% { filter: none; } 50% { filter: brightness(1.15); transform: translateY(-2px); } }
.tut-focus { z-index: 6; border-radius: 12px; box-shadow: 0 0 0 3px var(--gold), 0 0 0 9px rgba(245,184,61,0.22) !important; animation: tutFocus 1.6s ease-in-out infinite; }
@keyframes tutFocus { 0%, 100% { box-shadow: 0 0 0 3px var(--gold), 0 0 0 8px rgba(245,184,61,0.2); } 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 0 13px rgba(245,184,61,0.08); } }
.tv-pod.tut-focus { border-radius: 18px; }
.tv-bet.tut-focus { border-radius: 999px; }
.tut-ranks { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.tut-ranks li { display: flex; align-items: center; gap: 0.5rem; background: #F2EFE9; border-radius: 10px; padding: 0.25rem 0.5rem 0.25rem 0.3rem; }
.tut-rank-n { width: 20px; text-align: center; font: 800 0.75rem var(--font-main); color: #8B867F; }
.tut-rank-cards { display: flex; gap: 2px; }
.tut-rank-cards .pc.mini { --w: 20px; box-shadow: 0 1px 0 #CFC8BC; }
.tut-rank-name { font: 800 0.8125rem var(--font-main); }
@media (prefers-reduced-motion: reduce) { .tut-focus, .ct-btn.tut-go { animation: none; } }
.tut-sheet-lede { color: var(--text-2); font: 600 0.9375rem var(--font-main); margin: -0.3rem 0 0.7rem 0.2rem; }
.tut-sheet-body { margin-bottom: 1rem; }
.tut-sheet-body .tut-ranks { margin: 0; }
.tut-sheet-body .tut-ranks li { background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.2); padding: 0.35rem 0.6rem 0.35rem 0.35rem; }
.tut-sheet-body .tut-rank-n { color: var(--text-3); }
.tut-sheet-body .tut-rank-name { color: var(--text); font-size: 0.9375rem; }
.tut-sheet-body .tut-rank-cards .pc.mini { --w: 24px; }

/* ── Game invites on the home screen ────────────── */
.invite-banners { max-width: 560px; margin: 0 auto; }
.invite-banner {
    display: flex; align-items: center; gap: 0.75rem; background: var(--tile); border: none; border-radius: 18px;
    box-shadow: 0 3px 0 var(--lip), 0 0 0 2px var(--blue); padding: 0.6rem 0.7rem 0.6rem 0.6rem; margin-bottom: 0.9rem;
    animation: popIn 0.45s var(--spring) both;
}
.invite-banner-icon { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: none; }
.invite-banner-icon .face { width: 100%; height: 100%; display: block; }
.invite-banner-info strong { font: 800 1rem var(--font-main); color: var(--text); }
.invite-banner-info small { font: 600 0.8125rem var(--font-main); color: var(--text-2); }
.invite-banner-btn { width: 42px; height: 42px; border-radius: 12px; border: none; display: grid; place-items: center; transition: transform 0.08s ease, box-shadow 0.08s ease; }
.invite-banner-btn .ic { width: 20px; height: 20px; }
.invite-banner-btn .ic .i-line { stroke-width: 3; }
.invite-banner-btn.accept { background: var(--good); color: #fff; box-shadow: 0 3px 0 var(--good-lip); }
.invite-banner-btn.decline { background: var(--tile-2); color: var(--text-2); box-shadow: 0 3px 0 var(--lip); }
.invite-banner-btn:active { transform: translateY(2px); box-shadow: none; }
.resume-choice-panel { max-width: 340px; text-align: center; }
.resume-choice-panel .dialog-art .spot { width: 76px; height: 76px; }

/* ── The coach at the table ─────────────────────── */
.ct-coach { margin: 0 0.9rem 0.5rem; padding: 0.7rem 0.85rem; background: var(--tile); border: none; border-radius: 16px; box-shadow: 0 3px 0 var(--lip); }
.hud-eq-bar { height: 10px; border-radius: 5px; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); }
.hud-eq-bar div { background: var(--blue); border-radius: 5px; }
.hud-eq-bar i { background: #fff; box-shadow: 0 0 0 2px var(--tile); }
.hud-eq-text { color: var(--text-2); font-size: 0.8125rem; }
.hud-stat { font: 700 0.6875rem var(--font-main); color: var(--text-3); text-transform: none; letter-spacing: 0; }
.hud-stat span { font: 800 1.125rem var(--font-main); }
.hud-advice { color: var(--text-2); font-size: 0.875rem; line-height: 1.4; }
.hud-tag { background: var(--purple); color: #fff; font: 800 0.6875rem var(--font-main); letter-spacing: 0.02em; padding: 0.12rem 0.45rem; border-radius: 6px; box-shadow: 0 2px 0 var(--purple-lip); }
.ct-explain {
    left: 0.9rem; right: 0.9rem; bottom: calc(84px + var(--safe-bottom)); background: var(--tile); border: none; border-radius: 20px;
    box-shadow: 0 4px 0 var(--lip), 0 24px 50px rgba(0,0,0,0.5); padding: 1rem 1rem 0.9rem; animation: sheetUp 0.34s var(--spring) both;
}
.explain-head { gap: 0.55rem; font: 800 0.875rem var(--font-main); margin-bottom: 0.5rem; }
.explain-head .grade-icon { width: 30px; height: 30px; min-width: 30px; box-shadow: 0 2px 0 color-mix(in srgb, var(--g) 60%, #000); }
.explain-head strong { font: 800 1.0625rem var(--font-main); }
.ct-explain p { color: var(--text-2); font-size: 0.9375rem; }
.explain-best { color: var(--text-2); font-size: 0.875rem; }
.explain-best strong { color: var(--blue-hi); }
.explain-cost { color: var(--orange); }
.hud-mix, .explain-mix { color: var(--text-3); font-size: 0.8125rem; }
.explain-lesson {
    display: flex; align-items: center; gap: 0.5rem; background: var(--purple); border: none; color: #fff; font: 800 0.9375rem var(--font-main);
    padding: 0.7rem 0.85rem; border-radius: 12px; box-shadow: 0 3px 0 var(--purple-lip); margin-bottom: 0.6rem; transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.explain-lesson:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--purple-lip); }
.explain-close { background: var(--tile-2); color: var(--text); font: 800 1rem var(--font-main); padding: 0.75rem; border-radius: 12px; box-shadow: 0 3px 0 var(--lip); transition: transform 0.08s ease, box-shadow 0.08s ease; }
.explain-close:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }

/* Preflop: calm seat labels (your seat in blue, the raiser in gold) and the chart */
.pf-player-box .pf-pb-pos { color: var(--text-2); }
.pf-player-box .pf-pb-action { color: var(--text-3); }
.pf-position-badge { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-lip); }
.pf-range-chart { margin: 0.4rem 0 1.1rem; }
.pf-range-grid { gap: 2px; border-radius: 10px; padding: 3px; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); }
.pf-range-cell { background: var(--tile); color: var(--text-3); border: none; border-radius: 3px; font-weight: 700; }
.pf-range-cell.raise { background: var(--good); color: #fff; }
.pf-range-cell.call { background: var(--blue); color: #fff; }
.pf-range-cell.highlight { outline: 2px solid var(--gold); outline-offset: 0; box-shadow: 0 0 0 3px rgba(245,184,61,0.35); font-weight: 900; }
.pf-range-legend { font: 700 0.75rem var(--font-main); color: var(--text-2); gap: 1rem; margin-top: 0.6rem; }
.pf-legend-swatch { width: 10px; height: 10px; border-radius: 3px; }
.pf-legend-swatch.raise-sw { background: var(--good); }
.pf-legend-swatch.call-sw { background: var(--blue); }
.pf-legend-swatch.fold-sw { background: var(--tile); }
.pf-table-size h3.setting-label { text-transform: none; letter-spacing: 0; font: 700 0.875rem var(--font-main); color: var(--text-2); text-align: left; margin: 0 0 0.5rem 0.1rem; }
.pf-highscores, .nuts-highscores { padding: 0.9rem 0.6rem; }
.nuts-hs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.nuts-hs-item { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; text-align: center; }
.nuts-hs-item + .nuts-hs-item { border-left: 2px solid var(--line); }
.nuts-hs-label { font: 700 0.8125rem var(--font-main); color: var(--text-3); }
.nuts-hs-val { font: 800 1.75rem/1.1 var(--font-main); color: var(--gold); }
.pf-legend-swatch.fold-sw { background: var(--tile); box-shadow: inset 0 0 0 1.5px var(--text-3); }

/* ── Short phones: shrink the table so everyone fits ── */
/* Phones up to the big ones: the hints panel stays short so the table keeps its room */
@media (max-height: 900px) {
    .ct-coach { padding: 0.6rem 0.8rem; }
    .ct-coach .hud-mix { display: none; }
    .ct-coach .hud-advice { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 0.35rem; }
}
@media (max-height: 740px) {
    .tv-hero-cards { --fw: min(18vw, 68px); }
    .tv-avatar { width: 48px; height: 48px; }
    .tv-pod { width: 86px; }
    .tv-name, .tv-stack { font-size: 0.75rem; }
    .tv-stack { padding: 1px 7px; }
    .tv-plate { margin-top: 5px; }
    .tv-slot { --fw: min(13vw, 52px); }
    .tv-hero-meta { margin-top: 4px; }
    .ct-btn { min-height: 54px; }
    .ct-coach { padding: 0.55rem 0.75rem; }
    .ct-coach .rg, .ct-coach .hud-mix { display: none; }
    .ct-coach .hud-advice { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 0.35rem; }
    .tut-bubble { font-size: 0.875rem; padding: 0.55rem 0.7rem; }
    .tut-face { width: 44px; height: 44px; border-radius: 13px; }
    .tut-guide { min-height: 0; padding-bottom: 0.45rem; }
}
@media (max-height: 640px) {
    .tv-hero-cards { --fw: min(15vw, 58px); }
    .tv-avatar { width: 42px; height: 42px; }
    .tv-pod { width: 80px; }
}

/* ── Wide screens: one centred column, headers included ── */
@media (min-width: 700px) {
    .home-header, .screen-header { padding-left: max(1rem, calc(50% - 296px)); padding-right: max(1rem, calc(50% - 296px)); }
    .screen-body { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
    .screen-body:not(.home-body) { padding-left: max(1rem, calc(50% - 290px)); padding-right: max(1rem, calc(50% - 290px)); }
    .cpu-setup-footer { padding-left: max(1rem, calc(50% - 290px)); padding-right: max(1rem, calc(50% - 290px)); }
}

/* ── Coach grades as chips ─────────────────────────────
   Each grade is a poker chip in its colour with a white mark (Icons.grade).
   The grade you just earned sits beside your last move, above your cards. */
.grade-icon, .pz-verdict .grade-icon, .gr-count .grade-icon, .gr-moment .grade-icon, .rv-dec-head .grade-icon, .explain-head .grade-icon {
    display: inline-grid; place-items: center; background: none; box-shadow: none; border-radius: 0; padding: 0; color: inherit;
}
.grade-icon .gchip { width: 100%; height: 100%; display: block; overflow: visible; }
.gr-count.none .grade-icon { filter: grayscale(1) brightness(0.55); }

.tv-hero-top { height: 26px; }
.tv-grade:empty { display: none; }
.tv-grade .grade-pill {
    display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 3px; border: none; cursor: pointer;
    background: #fff; color: #25231F; font: 800 0.78rem var(--font-main); border-radius: 999px;
    box-shadow: 0 3px 0 #C9C3B8, 0 8px 18px rgba(0,0,0,0.3);
    animation: gradeIn 0.42s var(--spring) both;
}
.tv-grade .grade-pill .grade-icon { width: 20px; height: 20px; min-width: 20px; }
.tv-grade .grade-pill:active { transform: translateY(2px); box-shadow: 0 1px 0 #C9C3B8; }

.gr-legend-btn { display: block; margin: 0.15rem auto 1.4rem; background: none; border: none; color: var(--blue-hi); font: 700 0.875rem var(--font-main); cursor: pointer; padding: 0.4rem 0.6rem; }
.grade-legend { display: grid; gap: 0.15rem; margin: 0.2rem 0 1rem; text-align: left; }
.grade-legend-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 2px solid var(--line); }
.grade-legend-row:last-child { border-bottom: none; }
.grade-legend-row .grade-icon { width: 30px; height: 30px; min-width: 30px; }
.grade-legend-row strong { display: block; font: 800 0.9375rem var(--font-main); color: var(--g); }
.grade-legend-row span { display: block; font: 500 0.8125rem/1.35 var(--font-main); color: var(--text-2); }

/* ── Dramatic showdowns ────────────────────────────────
   All in: hands turn face up, each player's odds sit on their tag, the
   next card's slot pulses, and the winning five cards lift at the end. */
.set-row:has(#set-drama:not(:checked)) .set-ic-gold { background: var(--tile-2); color: var(--text-2); box-shadow: 0 2px 0 var(--lip); }
.tv.drama .tv-pod:not(.in-drama):not(.folded) { opacity: 0.55; transition: opacity 0.4s ease; }
.tv-tag.odds { font: 800 0.8125rem/1.25 var(--font-main); letter-spacing: 0; text-transform: none; padding: 2px 9px; background: #fff; color: #25231F; box-shadow: 0 2px 0 #C9C3B8; font-variant-numeric: tabular-nums; animation: oddsIn 0.35s var(--spring) both; }
.tv-tag.odds.lead { background: var(--good); color: #fff; box-shadow: 0 2px 0 var(--good-lip); }
.tv-tag.odds.dead { background: rgba(255,255,255,0.08); color: var(--text-3); box-shadow: none; }
.tv-hero-top .tv-tag.odds { font-size: 0.875rem; padding: 3px 11px; }
.tv-pod.dead { opacity: 0.45; transition: opacity 0.4s ease; }
.pc.mini.show.big { --w: 40px; }
.tv-slot.next { box-shadow: inset 0 0 0 2px rgba(245,184,61,0.6); animation: slotPulse 0.9s ease-in-out infinite; }
.pc-flip.slow .pc-inner { transition-duration: 0.85s; transition-timing-function: cubic-bezier(.4,.05,.2,1); }
.tv.lift .tv-slot.filled:not(.used) { filter: brightness(0.42) saturate(0.6); }
.tv.lift .tv-slot.used { transform: translateY(-15%); }
.tv.lift .tv-slot.used .pc-up { box-shadow: 0 0 0 3px var(--gold), 0 12px 24px rgba(0,0,0,0.45); }
.tv.lift .pc.mini.unused, .tv.lift .tv-hero-cards .pc-flip.unused { filter: brightness(0.42) saturate(0.6); transition: filter 0.35s ease; }
.tv-slot { transition: transform 0.5s var(--spring), filter 0.35s ease; }
.tv-tag.show-hand.lose { background: rgba(255,255,255,0.1); color: var(--text-2); box-shadow: none; }
/* Where a big shown hand sits, clear of the neighbours' hands and tags */
/* Along the top: under the player (the corners lean outwards) */
.tv-pod.top .tv-cards:has(.big) { top: calc(100% + 30px); bottom: auto; left: 50%; right: auto; transform: translateX(-50%); }
.tv-pod.top.left .tv-cards:has(.big) { left: auto; right: 0; transform: none; }
.tv-pod.top.right .tv-cards:has(.big) { left: 0; right: auto; transform: none; }
/* Down the sides: above the face, nudged towards the middle */
.tv-pod.left:not(.top) .tv-cards:has(.big) { top: auto; bottom: calc(100% - 4px); left: calc(50% - 22px); right: auto; transform: none; }
.tv-pod.right:not(.top) .tv-cards:has(.big) { top: auto; bottom: calc(100% - 4px); right: calc(50% - 22px); left: auto; transform: none; }
/* Low down the sides: beside the face, towards the middle */
.tv-pod.low.left .tv-cards:has(.big) { top: 0; bottom: auto; left: calc(50% + 30px); }
.tv-pod.low.right .tv-cards:has(.big) { top: 0; bottom: auto; right: calc(50% + 30px); }
.tv.lift .pc.mini.used { box-shadow: 0 0 0 2.5px var(--gold), 0 6px 14px rgba(0,0,0,0.45); }
.tv.lift .tv-hero-cards .pc-flip.used .pc-up { box-shadow: 0 0 0 3px var(--gold), 0 12px 24px rgba(0,0,0,0.45); }
.tv-tag.show-hand.win { background: var(--gold); color: #25231F; box-shadow: 0 2px 0 var(--gold-lip); }
@keyframes slotPulse { 0%, 100% { box-shadow: inset 0 0 0 2px rgba(245,184,61,0.25), 0 0 0 rgba(245,184,61,0); } 50% { box-shadow: inset 0 0 0 2px rgba(245,184,61,0.85), 0 0 22px rgba(245,184,61,0.35); } }
@keyframes oddsIn { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .tv-slot.next { animation: none; }
    .tv-slot, .tv-tag.odds { transition: none; animation: none; }
}

/* Tags of players down the sides grow towards the middle, so long hand names stay on screen */
.tv-pod.left .tv-tag { left: calc(50% - 32px); }
.tv-pod.right .tv-tag { right: calc(50% - 32px); }

/* ── Online hub: rating, quick match, private tables ─────── */
.online-body { padding-bottom: 1.6rem; }
.rating-card { display: flex; align-items: center; gap: 0.85rem; background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); padding: 0.85rem 1rem; margin: 0.25rem 0 1rem; }
.rating-chip { width: 52px; height: 56px; flex-shrink: 0; display: block; }
.rating-chip .chip-svg { width: 100%; height: 100%; display: block; }
.rating-text { flex: 1; min-width: 0; }
.rating-text small { display: block; font: 700 0.8125rem var(--font-main); color: var(--text-3); }
.rating-text strong { display: block; font: 800 1.875rem/1.05 var(--font-main); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.rating-text em { display: block; font: 700 0.8125rem var(--font-main); font-style: normal; color: var(--text-2); margin-top: 0.1rem; }
.rating-spark { width: 96px; height: 30px; flex-shrink: 0; overflow: visible; }
.rating-spark polyline { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.rating-spark.up polyline { stroke: var(--good); }
.rating-spark.down polyline { stroke: #FF6B6F; }

.qm-card { background: var(--tile); border-radius: 20px; box-shadow: 0 4px 0 var(--lip); padding: 1rem 1rem 1.1rem; margin-bottom: 1.4rem; }
.qm-head h3 { font: 800 1.25rem var(--font-main); margin: 0 0 0.15rem; }
.qm-head p { font: 500 0.875rem/1.4 var(--font-main); color: var(--text-2); margin: 0 0 0.9rem; }
.qm-card .setting-label { margin-top: 0.9rem; }
.qm-card .segmented { margin-top: 0.4rem; }
.qm-sizes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.45rem; margin-top: 0.45rem; }
.qm-size { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.55rem 0.2rem 0.5rem; border: none; border-radius: 14px; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); color: var(--text-2); font: 700 0.6875rem var(--font-main); cursor: pointer; transition: transform 0.08s ease; }
.qm-size svg { width: 44px; height: 30px; }
.qm-size .qm-felt { fill: var(--tile-2); }
.qm-size circle { fill: var(--text-3); }
.qm-size.active { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-lip); }
.qm-size.active .qm-felt { fill: rgba(255,255,255,0.28); }
.qm-size.active circle { fill: #fff; }
.qm-size:active { transform: translateY(2px); }
.qm-fill { margin: 1rem 0 1rem; background: var(--bg-deep); box-shadow: none; border-radius: 14px; }
.online-foot { text-align: left; line-height: 1.45; margin-top: 1rem; }

/* Quick match lobby: the countdown and empty seats */
.qm-wait { background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); padding: 0.85rem 1rem 0.9rem; margin: 0 0 1.1rem; }
.qm-wait-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.qm-wait-top strong { font: 800 1.0625rem var(--font-main); }
.qm-wait-top span { font: 800 1.0625rem var(--font-main); color: var(--blue-hi); font-variant-numeric: tabular-nums; }
.qm-wait-bar { height: 10px; border-radius: 6px; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); margin: 0.6rem 0 0.55rem; overflow: hidden; }
.qm-wait-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--blue); transition: width 0.5s linear; }
.qm-wait p { font: 600 0.8125rem/1.4 var(--font-main); color: var(--text-2); margin: 0; }
.table-lobby-player.empty { background: transparent; box-shadow: none; border: 2px dashed var(--line); }
.table-lobby-player.empty .lobby-face { background: var(--bg-deep); animation: seatPulse 1.4s ease-in-out infinite; }
.table-lobby-player.empty strong { color: var(--text-3); }
@keyframes seatPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.lobby-tag.rating { background: var(--bg-deep); color: var(--text); box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); font-variant-numeric: tabular-nums; }
.tl-guard { margin: 0 0 1.1rem; }

/* After a rated game */
.rated-result { display: flex; align-items: center; justify-content: center; gap: 0.9rem; background: var(--bg-deep); border-radius: 16px; padding: 0.8rem 1rem; margin: 0.2rem 0 1rem; text-align: left; }
.rated-result small { display: block; font: 700 0.8125rem var(--font-main); color: var(--text-3); }
.rated-result strong { display: block; font: 800 2rem/1.05 var(--font-main); font-variant-numeric: tabular-nums; }
.rated-result em { display: block; font: 800 0.875rem var(--font-main); font-style: normal; }
.rated-result.up em { color: var(--good); }
.rated-result.down em { color: #FF6B6F; }

/* ── Party Poker: power cards ─────────────────────
   One look everywhere: a card in its family's colour (--pc) with a big
   white icon. See is blue, Change purple, Stop orange, Protect green. */
.power-card {
    --pc: var(--purple);
    position: relative; width: 112px; height: 156px; border-radius: 16px; padding: 12px 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
    background: var(--pc); color: #fff; overflow: hidden;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.9) inset, 0 5px 0 color-mix(in srgb, var(--pc) 55%, #000), 0 18px 36px rgba(0,0,0,0.4);
}
.power-card::before { content: ''; position: absolute; left: -30%; right: -30%; top: -42%; height: 70%; border-radius: 50%; background: rgba(255,255,255,0.14); }
.power-card > * { position: relative; }
.power-ic { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: rgba(0,0,0,0.16); }
.power-ic .ic { width: 36px; height: 36px; color: #fff; }
.power-card strong { font: 800 1rem/1.1 var(--font-main); }
.power-card small { font: 800 0.625rem var(--font-main); text-transform: uppercase; letter-spacing: 0.12em; opacity: 0.85; }
.power-card.big { width: 132px; height: 184px; }
.power-card.big .power-ic { width: 70px; height: 70px; }
.power-card.big .power-ic .ic { width: 44px; height: 44px; }
.power-card.sheet-card { width: 64px; height: 88px; border-radius: 11px; padding: 6px; gap: 0; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.9) inset, 0 3px 0 color-mix(in srgb, var(--pc) 55%, #000); }
.power-card.sheet-card .power-ic { width: 40px; height: 40px; background: none; }
.power-card.sheet-card .power-ic .ic { width: 30px; height: 30px; }
.power-card.sheet-card strong { display: none; }
.power-card.sheet-card small { font-size: 0.5625rem; }
.perk-stage.in .power-card { animation: perkShine 1.1s ease both; }
.perk-stage.reflected .power-card { animation: perkFlip 0.6s ease; }
.perk-caption { background: var(--tile-2); box-shadow: 0 3px 0 var(--lip), 0 10px 24px rgba(0,0,0,0.4); font-weight: 700; }
.perk-caption b { color: #fff; }

/* The dock under the table: your cards, and when you can play them */
.power-dock {
    display: flex; align-items: center; gap: 10px; width: calc(100% - 24px); max-width: 596px; align-self: center;
    margin: 0 12px 6px; padding: 7px 10px 7px 8px; border: none; border-radius: 16px; cursor: pointer; text-align: left;
    background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font-family: var(--font-main);
}
.power-dock.hidden { display: none; }
.power-dock:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.power-dock-cards { display: flex; flex: none; }
.power-dock-cards .power-mini + .power-mini { margin-left: -8px; transform: rotate(6deg); }
.power-dock-text { flex: 1; min-width: 0; }
.power-dock-text strong { display: block; font: 800 0.875rem var(--font-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.power-dock-text small { display: block; font: 600 0.75rem var(--font-main); color: var(--text-2); }
.power-dock-go { flex: none; font: 800 0.8125rem var(--font-main); color: #fff; background: var(--purple); box-shadow: 0 3px 0 var(--purple-lip); padding: 0.45rem 0.9rem; border-radius: 10px; }
.power-dock.ready { box-shadow: 0 3px 0 var(--purple-lip), 0 0 0 2px var(--purple); animation: powerReady 1.6s ease-in-out infinite; }
.power-dock.ready small { color: #D9CEFF; }
@keyframes powerReady { 0%, 100% { box-shadow: 0 3px 0 var(--purple-lip), 0 0 0 2px var(--purple), 0 0 0 rgba(139,108,255,0); } 50% { box-shadow: 0 3px 0 var(--purple-lip), 0 0 0 2px var(--purple), 0 0 22px rgba(139,108,255,0.5); } }
.power-mini {
    --pc: var(--purple);
    display: grid; place-items: center; width: 30px; height: 40px; border-radius: 7px; background: var(--pc);
    box-shadow: 0 0 0 1.5px rgba(255,255,255,0.85) inset, 0 2px 0 color-mix(in srgb, var(--pc) 55%, #000);
}
.power-mini .ic { width: 18px; height: 18px; color: #fff; }
.power-mini.empty { background: transparent; box-shadow: none; border: 2px dashed var(--tile-2); }

/* The power sheet */
.power-sheet .sheet-title { margin-bottom: 0.3rem !important; }
.power-sub { font: 600 0.9375rem/1.4 var(--font-main); color: var(--text-2); margin: 0 0.25rem 0.9rem; text-align: left; }
.power-choices { display: flex; flex-direction: column; gap: 0.6rem; margin: 0 0 0.9rem; }
.power-choice { display: flex; align-items: center; gap: 0.85rem; background: var(--bg-deep); border-radius: 16px; padding: 0.6rem 0.7rem; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); }
.power-choice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; }
.power-choice-text strong { font: 800 1rem var(--font-main); color: var(--text); }
.power-choice-text span { font: 600 0.8125rem/1.35 var(--font-main); color: var(--text-2); }
.power-choice-text .btn { margin-top: 0.35rem; width: auto; min-width: 96px; padding: 0.45rem 1rem; }
.power-choice-text .btn[disabled] { font-size: 0.75rem; opacity: 1; color: var(--text-3); }
.power-actions .btn { margin: 0; }

/* The power round: a banner over the board and a purple glow round the table */
.tv-power-banner {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px 5px 10px; border-radius: 999px;
    background: var(--purple); box-shadow: 0 3px 0 var(--purple-lip), 0 8px 22px rgba(139,108,255,0.35);
    font: 800 0.8125rem var(--font-main); color: #fff; text-transform: uppercase; letter-spacing: 0.08em;
    animation: popIn 0.4s var(--spring) both;
}
.tv-power-banner.hidden { display: none; }
.tv-power-banner .ic { width: 16px; height: 16px; }
.tv.power .tv-stage::before {
    content: ''; position: absolute; inset: 4% 3%; border-radius: 48%; pointer-events: none; z-index: 0;
    box-shadow: 0 0 0 2px rgba(139,108,255,0.35), 0 0 60px rgba(139,108,255,0.25), inset 0 0 60px rgba(139,108,255,0.18);
    animation: fadeIn 0.5s ease both;
}

/* What's on a player this hand: Frozen, Blindfolded, Shielded, Mirror */
.tv-badges .pw-badge { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; animation: popIn 0.35s var(--spring) both; }
.tv-badges .pw-freeze, .tv-badges .pw-blindfold { background: #F0883E; box-shadow: 0 2px 0 #B5601F; }
.tv-badges .pw-shield, .tv-badges .pw-mirror { background: #4FB85C; box-shadow: 0 2px 0 #34883F; }

/* Pass & play: what a See card showed, before the phone moves on */
.seen-who { margin: 0 0 0.8rem !important; color: var(--text) !important; font-weight: 700; }
.seen-cards { display: flex; justify-content: center; gap: 10px; margin: 0 0 1rem; }
.seen-cards .pc { --w: 64px; }
.seen-note { font-size: 0.875rem !important; }

@media (prefers-reduced-motion: reduce) {
    .power-dock.ready, .tv-power-banner, .tv.power .tv-stage::before, .tv-badges .pw-badge, .perk-stage.in .power-card { animation: none; }
}
/* The seat at the top in the middle: in front of the face, clear of the pot below and the
   neighbours' hands either side (heads up there's room beside the face) */
.tv-pod.top.mid .tv-cards:has(.big) { top: 3px; left: 50%; right: auto; transform: translateX(-50%); z-index: 7; }
.tv[data-n="2"] .tv-pod.top.mid .tv-cards:has(.big) { top: 2px; left: calc(50% + 36px); transform: none; }
.power-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.power-head .sheet-title { margin-bottom: 0.3rem !important; }
.power-hand { display: flex; align-items: center; gap: 4px; flex: none; }
.power-hand span { font: 700 0.75rem var(--font-main); color: var(--text-3); margin-right: 4px; }
.power-hand .pc { --w: 32px; }
/* Face-down cards of the players along the top stay below the header */
.tv-pod.top .tv-cards { top: 2px; }

/* ── Lessons: Pineapple discards, boards, races, power cards ── */
.ls-discard { display: flex; justify-content: center; gap: 12px; margin: 0.4rem 0 1.4rem; }
.ls-discard-card { border: none; background: none; padding: 0; cursor: pointer; border-radius: 10px; transition: transform 0.25s var(--spring), opacity 0.3s ease, filter 0.3s ease; }
.ls-discard-card .pc.ls-card { --w: 76px; box-shadow: 0 4px 0 #CFC8BC, 0 10px 20px rgba(0,0,0,0.35); }
.ls-discard-card:active { transform: translateY(2px); }
.ls-discard-card.gone { transform: translateY(14px) rotate(-8deg); opacity: 0.35; filter: grayscale(0.7); }
.ls-discard-card.kept .pc.ls-card { box-shadow: 0 4px 0 #CFC8BC, 0 0 0 3px var(--good); }
.ls-discard-card.wrong .pc.ls-card { box-shadow: 0 4px 0 #CFC8BC, 0 0 0 3px var(--bad); animation: shake 0.45s ease both; }
.ls-board-mini { align-items: center; gap: 0.6rem; }
.ls-board-mini small { font: 800 0.6875rem var(--font-main); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.ls-board-pick { flex-direction: column; }
.ls-race { display: flex; flex-direction: column; gap: 0.6rem; background: var(--bg-deep); border-radius: 18px; box-shadow: inset 0 3px 0 rgba(0,0,0,0.3); padding: 0.8rem; margin: 0 0 0.9rem; }
.ls-race-row { display: flex; align-items: center; gap: 0.7rem; }
.ls-race-row .bot-avatar { width: 40px; height: 40px; flex: none; }
.ls-race-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.ls-race-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ls-race-top strong { font: 800 0.9375rem var(--font-main); }
.ls-race-pct { font: 800 1.0625rem var(--font-main); min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; }
.ls-race-main .ls-bar { flex: none; height: 10px; }
.ls-bar.race div { background: var(--good); }
.ls-race-row + .ls-race-row .ls-bar.race div { background: var(--bad); }
.ls-choices.three { flex-direction: row; }
.ls-choices.three .ls-choice { flex: 1; text-align: center; padding-left: 0.4rem; padding-right: 0.4rem; }
.ls-powers { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0.6rem 0 0.2rem; }
.ls-powers .power-card { width: 76px; height: 104px; padding: 8px 6px; border-radius: 12px; gap: 3px; }
.ls-powers .power-ic { width: 40px; height: 40px; }
.ls-powers .power-ic .ic { width: 26px; height: 26px; }
.ls-powers .power-card strong { font-size: 0.75rem; }
.ls-powers .power-card small { font-size: 0.5rem; }
.ls-powers.many { display: grid; grid-template-columns: repeat(3, 76px); justify-content: center; }
@media (prefers-reduced-motion: reduce) { .ls-discard-card { transition: none; } }

/* Card back colours: two rows on a phone; gold stays locked until it's earned */
.cb-colors { display: grid; grid-template-columns: repeat(5, 44px); justify-content: center; gap: 0.75rem 0.7rem; }
.cb-swatch.locked { filter: saturate(0.35) brightness(0.75); }
.cb-swatch.locked .ic { opacity: 0.95; transform: none; width: 18px; height: 18px; }

/* Achievements, grouped */
.me-ach-group h4 { display: flex; align-items: baseline; justify-content: space-between; margin: 0.2rem 0.25rem 0.75rem; font: 800 0.875rem var(--font-main); color: var(--text-2); }
.me-ach-group h4 span { font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.me-ach-group .me-medals { margin-bottom: 1.4rem; }

/* ── Daily Challenge ───────────────────────────── */
#daily-screen, #squares-screen { background: var(--bg); }
.dc-dots { flex: 1; display: flex; gap: 6px; }
.dc-dot { flex: 1; height: 12px; border-radius: 6px; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); transition: background 0.3s ease; }
.dc-dot.now { background: var(--tile-2); box-shadow: none; }
.dc-dot.right { background: var(--good); box-shadow: 0 2px 0 var(--good-lip); }
.dc-dot.wrong { background: var(--bad); box-shadow: 0 2px 0 var(--bad-lip); }
#daily-screen .ls-lesson-title { display: inline; font: 800 0.875rem var(--font-main); color: var(--text-2); white-space: nowrap; }
.dc-kicker { font: 800 0.75rem var(--font-main); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin: 0.3rem 0 0.25rem; }
.ls-options.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.ls-options.two-col .ls-option { flex-direction: column; justify-content: center; }
.ls-choices.dc-four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.55rem; }
.ls-choices.dc-four .ls-choice { text-align: center; font-size: 1.375rem; font-weight: 800; padding-left: 0; padding-right: 0; }
.dc-vs { display: flex; gap: 0.6rem; margin: 0 0 0.8rem; }
.dc-vs-side { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; background: var(--tile); border-radius: 16px; padding: 0.6rem 0.4rem; box-shadow: 0 3px 0 var(--lip); }
.dc-vs-side .bot-avatar { width: 38px; height: 38px; }
.dc-vs-side strong { font: 800 0.875rem var(--font-main); }
.dc-result { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 0.4rem; }
.dc-result-art .spot { width: 76px; height: 76px; }
.dc-result > small { font: 700 0.8125rem var(--font-main); color: var(--text-3); margin-top: 0.4rem; }
.dc-score { font: 800 3.75rem/1 var(--font-main); font-variant-numeric: tabular-nums; }
.dc-score em { font-size: 1.75rem; color: var(--text-3); font-style: normal; }
.dc-verdict { color: var(--text-2); font: 700 0.9375rem var(--font-main); margin: 0.35rem 0 0.9rem; }
.dc-squares { display: flex; gap: 8px; margin-bottom: 1.2rem; }
.dc-squares span { width: 42px; height: 42px; border-radius: 10px; animation: popIn 0.4s var(--spring) both; }
.dc-squares span:nth-child(2) { animation-delay: 0.08s; } .dc-squares span:nth-child(3) { animation-delay: 0.16s; }
.dc-squares span:nth-child(4) { animation-delay: 0.24s; } .dc-squares span:nth-child(5) { animation-delay: 0.32s; }
.dc-squares .right { background: var(--good); box-shadow: 0 3px 0 var(--good-lip); }
.dc-squares .wrong { background: var(--bad); box-shadow: 0 3px 0 var(--bad-lip); }
.dc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; width: 100%; margin-bottom: 1.1rem; }
.dc-stats > div { background: var(--tile); border-radius: 14px; padding: 0.55rem 0.3rem; box-shadow: 0 3px 0 var(--lip); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 72px; }
.dc-stats .spot { width: 22px; height: 22px; }
.dc-stats strong { font: 800 1.375rem var(--font-main); font-variant-numeric: tabular-nums; }
.dc-stats small { font: 700 0.6875rem var(--font-main); color: var(--text-3); }
#dc-share { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; }
#dc-share .ic, #sq-share .ic { width: 18px; height: 18px; }
.dc-next { color: var(--text-2); font: 600 0.9375rem var(--font-main); margin: 0.9rem 0 0; }
.game-card.done .game-card-icon { position: relative; }
.game-card.done .game-card-icon::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: 0 2px 0 var(--good-lip); }

/* ── Poker Squares ─────────────────────────────── */
.sq-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0.4rem 1rem calc(1rem + var(--safe-bottom)); max-width: 560px; width: 100%; margin: 0 auto; }
.sq-mode { margin: 0 0 0.6rem; }
.sq-meta { display: flex; justify-content: space-between; font: 700 0.8125rem var(--font-main); color: var(--text-2); margin: 0 0.2rem 0.55rem; }
.sq-meta strong { color: var(--text); }
.sq-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 46px; gap: 5px; }
.sq-cell { aspect-ratio: 5 / 7; border-radius: 9px; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); border: none; padding: 0; position: relative; min-width: 0; }
button.sq-cell { cursor: pointer; transition: background 0.15s ease; }
button.sq-cell:active { background: var(--tile-2); }
.sq-grid.over button.sq-cell { cursor: default; }
.sq-cell .pc.sq-card { width: 100%; height: 100%; box-shadow: 0 2px 0 #CFC8BC; }
.sq-cell.fresh .pc { animation: dealIn 0.32s var(--spring) both; }
.sq-line { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 9px; color: var(--text-3); min-width: 0; overflow: hidden; }
.sq-line.col { min-height: 46px; }
.sq-line.done { background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); animation: popIn 0.35s var(--spring) both; }
.sq-line strong { font: 800 1rem var(--font-main); font-variant-numeric: tabular-nums; }
.sq-line small { font: 700 0.5rem/1.1 var(--font-main); color: var(--text-2); text-align: center; padding: 0 2px; }
.sq-line.zero { opacity: 0.55; }
.sq-line.big strong { color: var(--gold); }
.sq-total { display: grid; place-items: center; border-radius: 9px; background: var(--blue); box-shadow: 0 3px 0 var(--blue-lip); min-height: 46px; }
.sq-total strong { font: 800 1.125rem var(--font-main); color: #fff; font-variant-numeric: tabular-nums; }
.sq-dock { margin-top: 0.9rem; }
.sq-next { display: flex; align-items: center; gap: 0.9rem; background: var(--tile); border-radius: 18px; padding: 0.7rem 0.9rem; box-shadow: 0 3px 0 var(--lip); }
.sq-next .pc.sq-card.big { --w: 62px; animation: dealIn 0.32s var(--spring) both; }
.sq-next strong { display: block; font: 800 1.0625rem var(--font-main); }
.sq-next small { display: block; color: var(--text-2); font: 600 0.8125rem/1.35 var(--font-main); margin-top: 0.15rem; }
.sq-final { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; background: var(--tile); border-radius: 18px; padding: 0.8rem 1rem; box-shadow: 0 3px 0 var(--lip); }
.sq-final small { display: block; color: var(--text-3); font: 700 0.75rem var(--font-main); }
.sq-final strong { display: block; font: 800 1.5rem var(--font-main); }
.sq-final span { color: var(--text-2); font: 700 0.8125rem var(--font-main); }
.sq-final-btns { display: flex; flex-direction: column; gap: 0.5rem; flex: none; }
.sq-final-btns .btn { width: auto; padding: 0.55rem 1rem; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; }
.sq-table { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 1rem; text-align: left; background: var(--bg-deep); border-radius: 14px; padding: 0.7rem 0.9rem; margin: 0 0 0.9rem; }
.sq-table div { display: flex; justify-content: space-between; font: 600 0.875rem var(--font-main); color: var(--text-2); }
.sq-table strong { color: var(--text); }
.sq-tip { font-size: 0.875rem !important; }
@media (prefers-reduced-motion: reduce) { .sq-cell.fresh .pc, .sq-line.done, .sq-next .pc, .dc-squares span { animation: none; } }
/* Right and wrong also show on the coloured Fold / Raise / Call buttons */
.ls-choices .ls-choice.right { background: var(--good); box-shadow: 0 3px 0 var(--good-lip); border-color: transparent; color: #fff; }
.ls-choices .ls-choice.wrong { background: var(--bad); box-shadow: 0 3px 0 var(--bad-lip); border-color: transparent; color: #fff; }
.sq-line:not(.done) { border: 2px dashed rgba(255,255,255,0.06); }

/* ── Your progress ─────────────────────────────── */
:root { --ch-surface: #312E2B; --ch-line: #3F89F2; --ch-good: #3F89F2; --ch-shaky: #8B867F; --ch-leak: #E5484D;
        --ch-d0: #256abf; --ch-d2: #3987e5; --ch-d4: #6da7ec; --ch-d5: #b7d3f6; }
#stats-screen { background: var(--bg); }
.me-progress { display: flex; align-items: center; gap: 0.8rem; width: 100%; border: none; cursor: pointer; text-align: left; color: var(--text);
    background: var(--tile); border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.7rem 0.8rem; margin: 0 0 1rem; font-family: var(--font-main); }
.me-progress:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.st-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 0 0 1rem; }
.st-tile { position: relative; background: var(--tile); border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.7rem 0.8rem 0.65rem; min-height: 104px; overflow: hidden; }
.st-tile small { display: block; font: 700 0.75rem var(--font-main); color: var(--text-3); }
.st-tile strong { display: block; font: 800 1.75rem/1.15 var(--font-main); margin-top: 0.1rem; }
.st-sub { display: block; font: 600 0.6875rem var(--font-main); color: var(--text-3); margin-top: 0.15rem; }
.st-delta { display: inline-flex; align-items: center; gap: 2px; font: 700 0.6875rem var(--font-main); color: var(--text-2); }
.st-delta .ic { width: 12px; height: 12px; }
.st-delta.up .ic { transform: rotate(-45deg); color: var(--good); }
.st-delta.down .ic { transform: rotate(45deg); color: var(--bad); }
.ch-spark { position: absolute; right: 8px; top: 10px; }
.ch-spark path { fill: none; stroke: var(--text-3); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ch-spark circle { fill: var(--ch-line); }
.st-card { background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); padding: 0.85rem 0.85rem 0.9rem; margin: 0 0 1rem; }
.st-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.st-card h3 { font: 800 1rem var(--font-main); margin: 0; }
.st-card-sub { font: 600 0.75rem/1.35 var(--font-main); color: var(--text-3); margin: 0.2rem 0 0.6rem; }
.st-seg { margin: 0; }
.st-seg button { font-size: 0.75rem; padding: 0.3rem 0.6rem; white-space: nowrap; }
.st-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin: 0 0 0.6rem; font: 700 0.75rem var(--font-main); color: var(--text-2); }
.st-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.st-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.st-legend .ch-good { background: var(--ch-good); } .st-legend .ch-shaky { background: var(--ch-shaky); } .st-legend .ch-leak { background: var(--ch-leak); }
.st-legend-days { margin: 0.6rem 0 0; }
.st-legend .d0 { background: var(--ch-d0); } .st-legend .d2 { background: var(--ch-d2); } .st-legend .d4 { background: var(--ch-d4); } .st-legend .d5 { background: var(--ch-d5); }
.st-chart { position: relative; }
.st-multiples { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.st-mini { background: var(--bg-deep); border-radius: 12px; padding: 0.5rem 0.55rem 0.4rem; box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); --ch-surface: #1E1C1A; min-width: 0; }
.st-mini-head { display: flex; flex-direction: column; gap: 0.05rem; font: 700 0.6875rem var(--font-main); color: var(--text-2); margin-bottom: 0.3rem; }
.st-mini-head strong { display: flex; align-items: baseline; gap: 0.35rem; font: 800 1.125rem var(--font-main); color: var(--text); white-space: nowrap; }
.st-mini-head em { font-style: normal; font-weight: 700; font-size: 0.6875rem; color: var(--text-3); }
.st-mini-head em.off { color: #FF8F6B; }
.st-mini .ch-band { fill: rgba(255,255,255,0.1); }
.st-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.st-day { aspect-ratio: 1; border-radius: 7px; display: grid; place-items: center; font: 800 0.8125rem var(--font-main); color: #fff; }
.st-day.none { background: transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.06); }
.st-day.d0 { background: var(--ch-d0); } .st-day.d2 { background: var(--ch-d2); }
.st-day.d4 { background: var(--ch-d4); color: #13253D; } .st-day.d5 { background: var(--ch-d5); color: #13253D; }
.st-day.today { box-shadow: 0 0 0 2px var(--tile), 0 0 0 4px #fff; }
.st-leaks { margin: 0.4rem 0 0; }
.st-leaks .set-row { align-items: center; }
.st-trend { flex: none; font: 700 0.6875rem var(--font-main); color: var(--text-3); background: var(--bg-deep); border-radius: 999px; padding: 0.2rem 0.55rem; }
.st-trend.good { color: #fff; background: var(--good); }
.st-trend.bad { color: #fff; background: var(--bad); }
.st-table-wrap { overflow-x: auto; margin-top: 0.4rem; }
.st-table { width: 100%; border-collapse: collapse; font: 600 0.8125rem var(--font-main); }
.st-table th { text-align: left; font: 700 0.6875rem var(--font-main); color: var(--text-3); padding: 0.3rem 0.35rem; border-bottom: 1px solid var(--line); }
.st-table td { padding: 0.45rem 0.35rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-table td em { font-style: normal; font-size: 0.625rem; color: var(--text-3); }
.st-table td.up { color: var(--good); } .st-table td.down { color: #FF6B6F; }
.st-empty { text-align: center; padding: 2rem 1rem; }
.st-empty .spot { width: 84px; height: 84px; }
.st-empty h3 { font: 800 1.25rem var(--font-main); margin: 0.6rem 0 0.4rem; }
.st-empty p { color: var(--text-2); font: 600 0.9375rem/1.45 var(--font-main); margin: 0 0 1.1rem; }

/* Chart marks (see js/charts.js) */
.ch { position: relative; }
.ch-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.ch-grid { stroke: rgba(255,255,255,0.07); stroke-width: 1; }
.ch-axis { fill: var(--text-3); font: 600 10.5px var(--font-main); }
.ch-band { fill: rgba(255,255,255,0.06); }
.ch-band-label { fill: var(--text-3); font: 700 9.5px var(--font-main); }
.ch-area { fill: var(--ch-line); opacity: 0.1; }
.ch-line { fill: none; stroke: var(--ch-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--ch-line); stroke: var(--ch-surface); stroke-width: 2; }
.ch-end { fill: var(--text); font: 800 12px var(--font-main); }
.ch-cross { stroke: rgba(255,255,255,0.35); stroke-width: 1; }
.ch-focus { fill: var(--ch-line); stroke: #fff; stroke-width: 2; }
.ch-seg.ch-good { fill: var(--ch-good); } .ch-seg.ch-shaky { fill: var(--ch-shaky); } .ch-seg.ch-leak { fill: var(--ch-leak); }
.ch-hit { fill: transparent; cursor: pointer; }
.ch-hit.on { fill: rgba(255,255,255,0.05); }
.ch-empty { font: 600 0.8125rem var(--font-main); color: var(--text-3); margin: 0.6rem 0; }
.ch-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--bg-deep); border-radius: 10px; padding: 0.4rem 0.6rem; box-shadow: 0 6px 18px rgba(0,0,0,0.45); min-width: 84px; }
.ch-tip.hidden { display: none; }
.ch-tip small { display: block; font: 700 0.6875rem var(--font-main); color: var(--text-3); margin-bottom: 0.15rem; white-space: nowrap; }
.ch-tip-row { display: flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.ch-tip-row i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.ch-tip-row strong { font: 800 0.875rem var(--font-main); color: var(--text); }
.ch-tip-row span { font: 600 0.75rem var(--font-main); color: var(--text-2); }
.ch-cross.hidden, .ch-focus.hidden { display: none; }
/* Friends: finding and inviting */
.friends-find { margin: 0 0 1rem; }
.friends-find .set-list { margin-bottom: 0; }
#contacts-results:not(:empty) { margin: 0.7rem 0 0; display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Membership ─────────────────────────────────── */
#membership-screen { background: var(--bg); }
.mb-body { padding-bottom: calc(2rem + var(--safe-bottom)); }
.me-member { margin-top: -0.4rem; }
.mb-hero { text-align: center; border-radius: 20px; box-shadow: 0 3px 0 var(--lip); padding: 1.3rem 1.1rem 1.1rem; margin: 0.25rem 0 1.1rem;
    background: radial-gradient(120% 80% at 50% 0%, rgba(var(--blue-rgb),0.32) 0%, rgba(var(--blue-rgb),0) 70%), var(--tile); }
.mb-logo { width: 68px; height: 68px; display: block; margin: 0 auto 0.4rem; animation: popIn 0.6s var(--spring) both; }
.mb-hero h3 { font: 800 1.375rem var(--font-main); margin: 0 0 0.35rem; letter-spacing: -0.01em; }
.mb-hero p { color: var(--text-2); font: 500 0.9375rem/1.45 var(--font-main); margin: 0 auto; max-width: 320px; }
.mb-now { display: inline-flex; align-items: center; gap: 0.6rem; text-align: left; margin-top: 0.9rem; background: rgba(var(--good-rgb),0.14); border-radius: 14px; padding: 0.55rem 0.9rem 0.55rem 0.55rem; }
.mb-now-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--good); box-shadow: 0 2px 0 var(--good-lip); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.mb-now-ic .ic { width: 18px; height: 18px; }
.mb-now strong { display: block; font: 800 0.9375rem var(--font-main); }
.mb-now small { display: block; font: 600 0.75rem var(--font-main); color: var(--text-2); margin-top: 0.05rem; }
.mb-tabs { margin-bottom: 0.8rem; }
.mb-plan { background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); padding: 1rem; margin-bottom: 1.3rem; animation: riseIn 0.3s var(--ease) both; }
.mb-plan-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; }
.mb-plan-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex-shrink: 0; background: var(--tile-2); box-shadow: 0 3px 0 var(--lip); }
.mb-plan-ic .ic { width: 24px; height: 24px; }
.mb-plus .mb-plan-ic { background: var(--blue); box-shadow: 0 3px 0 var(--blue-lip); }
.mb-pro .mb-plan-ic { background: var(--gold); box-shadow: 0 3px 0 var(--gold-lip); }
.mb-plan-name { flex: 1; min-width: 0; }
.mb-plan-name h4 { font: 800 1.25rem var(--font-main); margin: 0; }
.mb-plan-name p { font: 600 0.8125rem var(--font-main); color: var(--text-2); margin: 0.1rem 0 0; }
.mb-pill { flex-shrink: 0; font: 800 0.6875rem var(--font-main); letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-2); background: var(--tile-2); border-radius: 999px; padding: 0.3rem 0.6rem; }
.mb-pill.mine { color: #fff; background: var(--good); }
.mb-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.6rem; }
.mb-list li { display: flex; align-items: flex-start; gap: 0.6rem; font: 600 0.9375rem/1.35 var(--font-main); }
.mb-list li .ic { width: 18px; height: 18px; flex-shrink: 0; margin-top: 0.1rem; color: var(--good); }
.mb-plus .mb-list li .ic { color: var(--blue-hi); }
.mb-pro .mb-list li .ic { color: var(--gold); }
.mb-plan .btn .ic { width: 18px; height: 18px; }
.btn.mb-joined:disabled { opacity: 1; color: var(--text-2); }
.btn.mb-joined .ic { color: var(--good); }
.mb-later { display: inline-block; font: 800 0.625rem var(--font-main); font-style: normal; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-2); background: var(--tile-2); border-radius: 999px; padding: 0.18rem 0.45rem; margin-left: 0.4rem; vertical-align: 0.1em; }
.mb-note { color: var(--text-3); font: 600 0.75rem/1.4 var(--font-main); text-align: center; margin: 0.65rem 0 0; }
.mb-table { background: var(--tile); border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.2rem 0.7rem; margin-bottom: 1.3rem; }
.mb-tr { display: grid; grid-template-columns: minmax(0, 1fr) 54px 54px 54px; align-items: center; gap: 0.2rem; padding: 0.6rem 0; }
.mb-tr + .mb-tr { box-shadow: 0 -1px 0 var(--line); }
.mb-tr > span:not(.mb-feat) { text-align: center; }
.mb-th > span { font: 800 0.8125rem var(--font-main); color: var(--text-2); }
.mb-th > span:nth-child(3) { color: var(--blue-hi); }
.mb-th > span:nth-child(4) { color: var(--gold); }
.mb-feat { font: 600 0.8125rem/1.3 var(--font-main); }
.mb-feat em { display: block; font: 700 0.6875rem var(--font-main); font-style: normal; color: var(--text-3); margin-top: 0.1rem; }
.mb-yes { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(var(--blue-rgb),0.18); color: var(--blue-hi); vertical-align: middle; }
.mb-yes .ic { width: 14px; height: 14px; }
.mb-no { color: var(--text-3); font: 800 0.9375rem var(--font-main); }
.mb-amt { display: inline-block; font: 700 0.6875rem/1.2 var(--font-main); color: var(--text-2); }
.mb-faq { background: var(--tile); border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.1rem 0.95rem; }
.mb-faq details + details { box-shadow: 0 -1px 0 var(--line); }
.mb-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; font: 800 0.9375rem var(--font-main); padding: 0.9rem 0; }
.mb-faq summary::-webkit-details-marker { display: none; }
.mb-faq summary::after { content: '+'; font: 800 1.375rem/1 var(--font-main); color: var(--text-3); transition: transform 0.2s var(--ease); }
.mb-faq details[open] summary::after { transform: rotate(45deg); }
.mb-faq p { color: var(--text-2); font: 500 0.875rem/1.45 var(--font-main); margin: -0.3rem 0 0.9rem; }
.dialog-field { margin: 0.1rem 0 0.9rem; text-align: left; }
.dialog-field input { padding-left: 0.95rem !important; }
a.set-row { text-decoration: none; color: var(--text); }
.ps-face { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; margin: 0 auto; box-shadow: 0 3px 0 var(--lip); }
.ps-face .face, .ps-face svg { width: 100%; height: 100%; display: block; }
.friend-row .friend-info { cursor: pointer; }

/* ── Zoom into places you play ──────────────────── */
.screen.enter-zoom { animation: scrInZ 0.36s var(--ease) both; }
.screen.leave-zoom { animation: scrOutZ 0.3s var(--ease) both; }
.screen.enter-unzoom { animation: scrInU 0.34s var(--ease) both; }
.screen.leave-unzoom { animation: scrOutU 0.28s var(--ease) both; }
@keyframes scrInZ { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes scrOutZ { to { transform: scale(1.05); opacity: 0; } }
@keyframes scrInU { from { transform: scale(1.05); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes scrOutU { to { transform: scale(0.93); opacity: 0; } }
.screen.enter-zoom .rise > *, .screen.enter-unzoom .rise > * { animation: riseIn 0.46s var(--ease) both; }
.game-card, .play-hero, .ms-row, .today-next { transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease; }
.game-card:active, .play-hero:active { transform: translateY(2px) scale(0.985); }

/* ── Celebrations ───────────────────────────────── */
.cel { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: calc(16px + var(--safe-top, 0px)) 16px calc(16px + var(--safe-bottom, 0px)); }
.cel-back { position: absolute; inset: 0; background: rgba(14,13,12,0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.3s ease; }
.cel.in .cel-back { opacity: 1; }
.cel-card { position: relative; width: min(100%, 380px); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; opacity: 0; transform: translateY(18px) scale(0.96); transition: opacity 0.35s var(--ease), transform 0.45s var(--spring); }
.cel.in .cel-card { opacity: 1; transform: none; }
.cel.out .cel-back, .cel.out .cel-card { opacity: 0; transition-duration: 0.22s; }
.cel-kicker { font: 800 0.8125rem var(--font-main); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.cel-title { font: 800 2.25rem/1.1 var(--font-main); letter-spacing: -0.02em; margin: 0.2rem 0 0; color: #fff; }
.cel-text { color: var(--text-2); font: 600 1rem/1.45 var(--font-main); margin: 0.2rem 0 0.6rem; max-width: 300px; }
.cel .cel-go { margin-top: 0.9rem; min-height: 56px; font-size: 1.125rem; }
.cel .cel-go:focus:not(:focus-visible) { outline: none; box-shadow: 0 4px 0 var(--blue-lip); }
.cel-roll { display: inline-block; height: 1.1em; overflow: hidden; vertical-align: bottom; line-height: 1.1; }
.cel-roll-in { display: flex; flex-direction: column; animation: celRoll 0.7s var(--spring) 0.45s both; }
.cel-roll b { display: block; height: 1.1em; font-weight: 800; }
@keyframes celRoll { from { transform: translateY(0); } to { transform: translateY(-50%); } }

/* Level up: rays behind a big medal */
.cel-rays { position: absolute; top: -40px; left: 50%; width: 520px; height: 520px; margin-left: -260px; border-radius: 50%; pointer-events: none;
    background: repeating-conic-gradient(from 0deg, rgba(245,184,61,0.16) 0deg 9deg, rgba(245,184,61,0) 9deg 22.5deg);
    -webkit-mask: radial-gradient(circle, #000 18%, transparent 62%); mask: radial-gradient(circle, #000 18%, transparent 62%);
    animation: celSpin 14s linear infinite, fadeIn 0.6s ease both; }
@keyframes celSpin { to { transform: rotate(360deg); } }
.cel-medal { position: relative; width: 150px; height: 160px; margin: 0.4rem 0 0.2rem; animation: celPop 0.7s var(--spring) 0.15s both; }
.cel-medal .medal { width: 100%; height: 100%; filter: drop-shadow(0 14px 22px rgba(0,0,0,0.45)); }
@keyframes celPop { 0% { opacity: 0; transform: scale(0.3) rotate(-25deg); } 60% { opacity: 1; transform: scale(1.08) rotate(4deg); } 100% { transform: none; } }
.cel-unlocked { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 0.3rem; }
.cel-chip { display: inline-flex; align-items: center; gap: 6px; font: 800 0.875rem var(--font-main); color: #25231F; background: var(--gold); box-shadow: 0 3px 0 var(--gold-lip); border-radius: 999px; padding: 0.35rem 0.75rem; animation: popIn 0.5s var(--spring) 0.9s both; }
.cel-chip .ic { width: 16px; height: 16px; }
.cel-xp { width: 100%; max-width: 300px; }
.cel-xp-bar { height: 12px; border-radius: 6px; background: rgba(255,255,255,0.1); overflow: hidden; }
.cel-xp-bar i { display: block; height: 100%; width: var(--to); border-radius: 6px; background: var(--gold); animation: celFill 1s var(--ease) 0.8s both; }
@keyframes celFill { from { width: 0; } }
.cel-xp small { display: block; margin-top: 0.45rem; color: var(--text-3); font: 700 0.8125rem var(--font-main); }

/* Streak: a big flame and the week */
.cel-flame { width: 140px; height: 140px; position: relative; animation: celPop 0.65s var(--spring) both; }
.cel-flame::before { content: ''; position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, rgba(255,138,42,0.45) 0%, rgba(255,138,42,0) 65%); animation: celGlow 1.6s ease-in-out infinite; }
.cel-flame .spot { position: relative; width: 100%; height: 100%; animation: flicker 1.4s ease-in-out 0.7s infinite; transform-origin: 50% 90%; }
@keyframes celGlow { 0%, 100% { transform: scale(0.92); opacity: 0.8; } 50% { transform: scale(1.06); opacity: 1; } }
.cel-count { font: 800 4.5rem/1 var(--font-main); color: var(--orange); letter-spacing: -0.03em; text-shadow: 0 4px 0 rgba(0,0,0,0.25); margin-top: -0.2rem; }
.cel-streak .cel-title { font-size: 1.75rem; margin-top: 0; }
.cel-week { display: flex; gap: 8px; justify-content: center; margin: 0.2rem 0 0.2rem; }
.cel-day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cel-day i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.08); color: #fff; }
.cel-day i .ic { width: 18px; height: 18px; }
.cel-day small { font: 700 0.75rem var(--font-main); color: var(--text-3); }
.cel-day.done i { background: var(--orange); box-shadow: 0 3px 0 #B85F16; animation: popIn 0.4s var(--spring) calc(0.6s + var(--i) * 0.06s) both; }
.cel-day.today i { background: var(--orange); box-shadow: 0 3px 0 #B85F16, 0 0 0 3px rgba(255,138,42,0.35); animation: celToday 0.6s var(--spring) 1.1s both; }
.cel-day.today small { color: #fff; }
.cel-day.frozen i { background: #6EC3F5; box-shadow: 0 3px 0 #3B8DBF; color: #fff; }
@keyframes celToday { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: none; } }
.cel-freeze { display: inline-flex; align-items: center; gap: 6px; color: #8FD3FA; font: 700 0.875rem var(--font-main); margin: 0.4rem 0 0; }
.cel-freeze .ic { width: 18px; height: 18px; }
.cel-streak.milestone .cel-count { color: var(--gold); }

/* Missions done: the chest opens */
.cel-chest-art { width: 170px; height: 160px; position: relative; animation: celPop 0.6s var(--spring) both; }
.cel-chest-art .chest { width: 100%; height: 100%; overflow: visible; }
.cel-chest .chest-lid { transform-box: fill-box; transform-origin: 0% 100%; transition: transform 0.5s var(--spring); }
.cel-chest:not(.open) .chest { animation: celWiggle 0.5s ease-in-out 0.35s 2; }
.cel-chest.open .chest-lid { transform: rotate(-30deg); }
@keyframes celWiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.cel-glow { position: absolute; top: -30px; left: 50%; width: 360px; height: 360px; margin-left: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(245,184,61,0.5) 0%, rgba(245,184,61,0) 60%); opacity: 0; transform: scale(0.6); transition: opacity 0.5s ease, transform 0.8s var(--ease); pointer-events: none; }
.cel-chest.open .cel-glow { opacity: 1; transform: none; }
.cel-rewards { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 0.2rem; }
.cel-reward { display: inline-flex; align-items: center; gap: 8px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); border-radius: 14px; padding: 0.55rem 0.85rem; font: 800 1rem var(--font-main); opacity: 0; transform: translateY(10px) scale(0.9); transition: opacity 0.35s ease, transform 0.45s var(--spring); transition-delay: calc(0.15s + var(--i) * 0.12s); }
.cel-reward .ic { width: 20px; height: 20px; color: var(--gold); }
.cel-reward:nth-child(2) .ic { color: #8FD3FA; }
.cel-chest.open .cel-reward { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .cel-card, .cel-back { transition: none; }
    .cel-rays, .cel-medal, .cel-flame, .cel-flame .spot, .cel-flame::before, .cel-roll-in, .cel-chip, .cel-day i, .cel-chest-art, .cel-chest .chest { animation: none !important; }
    .cel-roll-in { transform: translateY(-50%); }
    .screen.enter-zoom, .screen.leave-zoom, .screen.enter-unzoom, .screen.leave-unzoom { animation: none !important; }
}

/* ── Today card: a streak in danger, and freezes ── */
.today-top { position: relative; }
.today-freeze { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 4px; padding: 0.3rem 0.6rem; border-radius: 999px; background: rgba(110,195,245,0.14); color: #8FD3FA; font: 800 0.875rem var(--font-main); }
.today-freeze .ic { width: 16px; height: 16px; }
.today-card.at-risk .today-ring .spot { animation: flicker 1.2s ease-in-out infinite; transform-origin: 50% 90%; }
.today-card.at-risk .today-info small { color: #FFB27A; font-weight: 700; }
.today-card.late { box-shadow: 0 3px 0 var(--lip), inset 0 0 0 2px rgba(255,138,42,0.55); }

/* ── Daily missions ─────────────────────────────── */
.home-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.ms-timer { font: 700 0.8125rem var(--font-main); color: var(--text-3); white-space: nowrap; }
.ms-card { background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); padding: 6px; }
.ms-row { display: flex; align-items: center; gap: 0.75rem; width: 100%; border: none; background: transparent; color: var(--text); text-align: left; padding: 0.65rem 0.6rem; border-radius: 13px; cursor: pointer; font-family: var(--font-main); animation: riseIn 0.4s var(--ease) calc(var(--i) * 0.06s) both; }
.ms-row + .ms-row { box-shadow: 0 -1px 0 var(--line); border-radius: 0; }
.ms-row:active { background: var(--tile-hi); }
.ms-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--tile-2); box-shadow: 0 3px 0 var(--lip); color: var(--text); }
.ms-ic .ic { width: 22px; height: 22px; }
.ms-row.done .ms-ic { background: var(--good); box-shadow: 0 3px 0 var(--good-lip); color: #fff; }
.ms-row.just .ms-ic { animation: celToday 0.6s var(--spring) 0.9s both; }
.ms-info { flex: 1; min-width: 0; }
.ms-info strong { display: block; font: 700 0.9375rem/1.3 var(--font-main); }
.ms-row.done .ms-info strong { color: var(--text-2); }
.ms-track { display: flex; align-items: center; gap: 0.55rem; margin-top: 0.35rem; }
.ms-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--bg-deep); box-shadow: inset 0 1px 0 rgba(0,0,0,0.3); overflow: hidden; }
.ms-bar i { display: block; height: 100%; width: var(--to); border-radius: 4px; background: var(--gold); animation: msFill 0.9s var(--ease) 0.3s both; }
.ms-row.done .ms-bar i { background: var(--good); }
@keyframes msFill { from { width: var(--from); } }
.ms-track small { font: 700 0.75rem var(--font-main); color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 2.4em; text-align: right; }
.ms-xp { font: 800 0.8125rem var(--font-main); color: var(--gold); background: rgba(245,184,61,0.12); border-radius: 999px; padding: 0.25rem 0.5rem; flex-shrink: 0; }
.ms-row.done .ms-xp { color: var(--text-3); background: transparent; text-decoration: line-through; }
.ms-foot { display: flex; align-items: center; gap: 0.6rem; margin: 2px 4px 2px; padding: 0.6rem 0.65rem; border-radius: 12px; background: rgba(110,195,245,0.08); color: var(--text-2); font: 600 0.8125rem/1.35 var(--font-main); }
.ms-foot .ms-chest { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(110,195,245,0.16); color: #8FD3FA; flex-shrink: 0; }
.ms-foot .ms-chest .ic { width: 16px; height: 16px; }
.ms-foot.done { background: rgba(var(--good-rgb),0.12); color: var(--text); }
.ms-foot.done .ms-chest { background: var(--good); color: #fff; }
.ms-award { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--good); box-shadow: 0 3px 0 var(--good-lip); color: #fff; }
.ms-award .ic { width: 24px; height: 24px; }
@media (prefers-reduced-motion: reduce) { .ms-row, .ms-bar i, .ms-row.just .ms-ic { animation: none !important; } }

/* ── Quick games (Who's Ahead?, Push or Fold) ── */
.tile-pair > .game-card:nth-child(3):last-child { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 0.9rem; }
.tile-pair > .game-card:nth-child(3):last-child .game-card-icon, .tile-pair > .game-card:nth-child(3):last-child .game-card-icon .spot { width: 52px; height: 52px; }
.game-card.done .game-card-info p { color: var(--good); }
.qg-lives { display: flex; gap: 4px; flex: 1; justify-content: center; }
.qg-heart { width: 26px; height: 26px; color: var(--bad); transition: transform 0.3s var(--spring), color 0.3s ease, opacity 0.3s ease; }
.qg-heart .ic { width: 100%; height: 100%; }
.qg-heart.lost { color: var(--tile-2); transform: scale(0.8); }
.qg-score { min-width: 2.6rem; text-align: right; font: 800 1.125rem var(--font-main); color: var(--gold); font-variant-numeric: tabular-nums; }
#pushfold-screen .ls-top .ls-progress { flex: 1; }
#pushfold-screen .qg-score { min-width: 3.4rem; font-size: 1rem; }
.ls-cards.md .pc.ls-card { --w: 58px; }

/* Who's Ahead? */
.ah-board { display: flex; justify-content: center; min-height: 72px; align-items: center; margin: 0.6rem 0 0.2rem; }
.ah-none { color: var(--text-3); font: 700 0.875rem var(--font-main); border: 2px dashed var(--tile-2); border-radius: 12px; padding: 0.8rem 1rem; }
.ah-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.8rem; }
.ah-hand { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; padding: 0.85rem 0.6rem 0.75rem; border: none; border-radius: 18px; background: var(--tile); box-shadow: 0 4px 0 var(--lip); color: var(--text); cursor: pointer; font-family: var(--font-main);
    transition: transform 0.15s var(--spring), box-shadow 0.2s ease, background-color 0.2s ease; animation: riseIn 0.4s var(--ease) both; }
.ah-hand:nth-child(2) { animation-delay: 0.06s; }
.ah-hand:active:not(.revealed) { transform: translateY(3px); box-shadow: 0 1px 0 var(--lip); }
.ah-name { font: 800 0.75rem var(--font-main); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.ah-made { font: 700 0.8125rem/1.25 var(--font-main); color: var(--text-2); text-align: center; min-height: 2.5em; }
.ah-eq { display: flex; align-items: center; gap: 0.45rem; width: 100%; }
.ah-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--bg-deep); overflow: hidden; }
.ah-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--text-3); transition: width 0.7s var(--ease); }
.ah-eq b { font: 800 0.9375rem var(--font-main); min-width: 2.6em; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ah-hand.revealed { cursor: default; }
.ah-hand.leader .ah-bar i { background: var(--good); }
.ah-hand.leader .ah-eq b { color: var(--good); }
.ah-hand.right { box-shadow: 0 4px 0 var(--good-lip), 0 0 0 3px var(--good); animation: popIn 0.4s var(--spring) both; }
.ah-hand.wrong { box-shadow: 0 4px 0 var(--bad-lip), 0 0 0 3px var(--bad); animation: shake 0.45s ease both; }
.ah-hand.trailer:not(.wrong) { opacity: 0.75; }
.ah-hint { text-align: center; color: var(--text-3); font: 600 0.875rem var(--font-main); margin-top: 0.9rem; min-height: 1.2em; }

/* Push or Fold */
.pfs { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; margin: 0.8rem 0 1rem; }
.pfs-info { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; align-items: center; }
.pfs-pos { font: 800 0.9375rem var(--font-main); color: #fff; background: var(--blue); box-shadow: 0 2px 0 var(--blue-lip); border-radius: 9px; padding: 0.3rem 0.65rem; }
.pfs-stack { display: inline-flex; align-items: center; gap: 0.35rem; font: 600 0.9375rem var(--font-main); color: var(--text-2); background: var(--tile); border-radius: 999px; padding: 0.25rem 0.75rem 0.25rem 0.35rem; box-shadow: 0 2px 0 var(--lip); }
.pfs-stack b { font-weight: 800; color: var(--gold); font-size: 1.0625rem; }
.pfs-chip { width: 24px; height: 26px; }
.pfs-shove { font: 800 0.8125rem var(--font-main); color: #fff; background: var(--bad); border-radius: 999px; padding: 0.3rem 0.7rem; box-shadow: 0 2px 0 var(--bad-lip); animation: popIn 0.4s var(--spring) 0.2s both; }
.pf-range { margin-top: 1rem; background: var(--tile); border-radius: 16px; box-shadow: 0 3px 0 var(--lip); padding: 0.75rem; animation: riseIn 0.4s var(--ease) both; }
.pf-range-head { display: flex; flex-direction: column; gap: 0.1rem; margin-bottom: 0.6rem; }
.pf-range-head strong { font: 800 0.9375rem var(--font-main); }
.pf-range-head span { font: 600 0.8125rem var(--font-main); color: var(--text-2); }
.pf-grid { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 2px; }
.pf-grid span { aspect-ratio: 1; display: grid; place-items: center; font: 700 clamp(6px, 1.9vw, 9px) var(--font-main); color: var(--text-3); background: var(--bg-deep); border-radius: 3px; overflow: hidden; letter-spacing: -0.03em; }
.pf-grid span.in.push { background: #3E8A4C; color: #fff; }
.pf-grid span.in.call { background: #2A63B8; color: #fff; }
.pf-grid span.me { box-shadow: 0 0 0 2px var(--gold); position: relative; z-index: 1; transform: scale(1.25); border-radius: 4px; font-weight: 800; }

/* Results */
.qg-result { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.2rem 0 0.5rem; animation: riseIn 0.45s var(--ease) both; }
.qg-result-art .spot { width: 84px; height: 84px; animation: celPop 0.6s var(--spring) both; }
.qg-kicker { font: 800 0.8125rem var(--font-main); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-top: 0.4rem; }
.qg-big { font: 800 4.25rem/1 var(--font-main); color: var(--gold); letter-spacing: -0.03em; margin-top: 0.3rem; animation: popIn 0.5s var(--spring) 0.15s both; }
.qg-big em { font-style: normal; font-size: 0.45em; color: var(--text-3); margin-left: 0.1em; }
.qg-sub { color: var(--text-2); font: 600 1rem var(--font-main); margin: 0.4rem 0 0; max-width: 300px; }
.qg-newbest { margin-top: 0.7rem; font: 800 0.875rem var(--font-main); color: #25231F; background: var(--gold); box-shadow: 0 3px 0 var(--gold-lip); border-radius: 999px; padding: 0.35rem 0.85rem; animation: popIn 0.5s var(--spring) 0.4s both; }
.qg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 0.6rem; width: 100%; margin: 1.1rem 0 0.4rem; }
.qg-stats div { background: var(--tile); border-radius: 14px; box-shadow: 0 3px 0 var(--lip); padding: 0.6rem 0.4rem; }
.qg-stats strong { display: block; font: 800 1.375rem var(--font-main); font-variant-numeric: tabular-nums; }
.qg-stats small { display: block; font: 700 0.6875rem var(--font-main); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.1rem; }
.qg-actions { display: flex; flex-direction: column; gap: 0.6rem; width: 100%; margin-top: 1rem; }
.qg-actions .btn .ic { width: 20px; height: 20px; }

/* ── Hand of the Day ─────────────────────────────── */
.hotd-loading { position: fixed; inset: 0; z-index: 9400; display: grid; place-items: center; background: rgba(14,13,12,0.78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn 0.25s ease both; }
.hotd-loading-card { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center; background: var(--tile); border-radius: 20px; box-shadow: 0 4px 0 var(--lip); padding: 1.4rem 1.6rem; width: min(86vw, 320px); animation: popIn 0.4s var(--spring) both; }
.hotd-loading-card .spot { width: 72px; height: 72px; animation: bob 1.6s ease-in-out infinite; }
.hotd-loading-card strong { font: 800 1.125rem var(--font-main); margin-top: 0.3rem; }
.hotd-loading-card small { font: 600 0.875rem var(--font-main); color: var(--text-2); }
.hotd-dots { display: flex; gap: 6px; margin-top: 0.6rem; }
.hotd-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: hotdDot 1s ease-in-out infinite; }
.hotd-dots i:nth-child(2) { animation-delay: 0.15s; }
.hotd-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes hotdDot { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
.pz-foot { display: flex; flex-direction: column; gap: 0.6rem; }
.pz-foot .pz-share .ic { width: 20px; height: 20px; }

/* ── Weekly league ──────────────────────────────── */
.lg-badge { display: block; width: 100%; height: 100%; overflow: visible; }
.lg-badge.lg-ace { filter: drop-shadow(0 0 6px rgba(155,107,255,0.55)); }

/* Home card */
.lg-card { display: flex; align-items: center; gap: 0.85rem; width: 100%; max-width: 560px; margin: 0 auto 1.6rem; padding: 0.8rem 0.9rem 0.8rem 0.85rem; border: none; border-radius: 18px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease; }
.lg-card:active { transform: translateY(2px) scale(0.985); box-shadow: 0 1px 0 var(--lip); }
.lg-card-badge { width: 38px; height: 52px; flex-shrink: 0; transition: transform 0.3s var(--spring); }
.lg-card:hover .lg-card-badge { transform: rotate(-6deg) scale(1.05); }
.lg-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lg-card-kicker { font: 800 0.6875rem var(--font-main); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.lg-card-info strong { font: 800 1.0625rem/1.2 var(--font-main); }
.lg-card-info span { font: 600 0.8125rem/1.35 var(--font-main); color: var(--text-2); }
.lg-card-rank { position: relative; flex-shrink: 0; min-width: 58px; display: flex; flex-direction: column; align-items: center; padding: 0.4rem 0.55rem; border-radius: 13px; background: var(--tile-2); box-shadow: 0 3px 0 var(--lip); }
.lg-card-rank b { font: 800 1.125rem/1.1 var(--font-main); }
.lg-card-rank small { font: 700 0.6875rem var(--font-main); color: var(--text-3); }
.lg-card.up .lg-card-rank { background: var(--good); box-shadow: 0 3px 0 var(--good-lip); }
.lg-card.up .lg-card-rank small { color: rgba(255,255,255,0.8); }
.lg-card.down .lg-card-rank { background: var(--bad); box-shadow: 0 3px 0 var(--bad-lip); }
.lg-card.down .lg-card-rank small { color: rgba(255,255,255,0.8); }
.lg-card-rank.climb { animation: lgBump 0.7s var(--spring) 0.35s both; }
.lg-card-rank.climb::after { content: attr(data-up); position: absolute; top: -10px; right: -6px; font: 800 0.6875rem var(--font-main); color: #fff; background: var(--good); border-radius: 999px; padding: 0.15rem 0.4rem; box-shadow: 0 2px 0 var(--good-lip); animation: lgTag 2.6s ease 0.5s both; }
@keyframes lgBump { 0% { transform: scale(1); } 35% { transform: scale(1.18) translateY(-4px); } 100% { transform: none; } }
@keyframes lgTag { 0% { opacity: 0; transform: translateY(6px) scale(0.6); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }

/* Screen */
.lg-body { max-width: 560px; margin: 0 auto; width: 100%; }
.lg-hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0.4rem 0 0.9rem; }
.lg-ladder { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin-bottom: 0.7rem; }
.lg-step { width: 26px; height: 36px; opacity: 0.38; filter: grayscale(0.6); animation: riseIn 0.45s var(--ease) calc(var(--i) * 0.05s) both; }
.lg-step.past { opacity: 0.75; filter: none; }
.lg-step.on { width: 72px; height: 98px; opacity: 1; filter: drop-shadow(0 10px 18px rgba(0,0,0,0.45)); margin: 0 6px; animation: lgHero 0.8s var(--spring) 0.15s both; }
.lg-step.on .lg-badge { animation: lgFloat 3.2s ease-in-out 1s infinite; }
@keyframes lgHero { 0% { opacity: 0; transform: translateY(16px) rotate(-14deg) scale(0.6); } 60% { opacity: 1; transform: rotate(4deg) scale(1.06); } 100% { transform: none; } }
@keyframes lgFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-2deg); } }
.lg-title { font: 800 1.625rem/1.15 var(--font-main); margin: 0; letter-spacing: -0.01em; }
.lg-rules { font: 600 0.875rem var(--font-main); color: var(--text-2); margin: 0.25rem 0 0.6rem; }
.lg-ends { display: inline-flex; align-items: center; gap: 6px; font: 700 0.8125rem var(--font-main); color: var(--text-2); background: var(--tile); border-radius: 999px; padding: 0.35rem 0.75rem 0.35rem 0.55rem; box-shadow: 0 2px 0 var(--lip); }
.lg-ends .ic { width: 16px; height: 16px; color: var(--gold); }
.lg-ends b { color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.lg-standing { display: flex; align-items: center; gap: 0.6rem; margin: 0.2rem 0 0.75rem; padding: 0.7rem 0.85rem; border-radius: 14px; background: var(--tile); font: 700 0.9375rem/1.3 var(--font-main); animation: riseIn 0.45s var(--ease) 0.1s both; }
.lg-standing .ic { width: 22px; height: 22px; flex-shrink: 0; color: var(--text-2); }
.lg-standing.up { background: rgba(var(--good-rgb),0.14); }
.lg-standing.up .ic { color: var(--good); }
.lg-standing.down { background: rgba(229,72,77,0.14); }
.lg-standing.down .ic { color: var(--bad); }

/* The table */
.lg-table { list-style: none; margin: 0 0 1rem; padding: 6px; background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); }
.lg-row { position: relative; display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.6rem; border-radius: 13px; }
.lg-enter .lg-row { animation: riseIn 0.42s var(--ease) calc(0.12s + var(--i) * 0.045s) both; }
.lg-row + .lg-row { box-shadow: 0 -1px 0 var(--line); }
.lg-row.me { background: rgba(var(--blue-rgb),0.16); box-shadow: inset 0 0 0 2px rgba(var(--blue-rgb),0.6); z-index: 1; }
.lg-row.me + .lg-row, .lg-line + .lg-row { box-shadow: none; }
.lg-rank { width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; font: 800 0.875rem var(--font-main); color: var(--text-2); font-variant-numeric: tabular-nums; }
.lg-rank.r1 { background: var(--gold); color: #3B2A06; box-shadow: 0 2px 0 var(--gold-lip); }
.lg-rank.r2 { background: #C4CCD6; color: #2C333B; box-shadow: 0 2px 0 #8C96A3; }
.lg-rank.r3 { background: #D08C4F; color: #3A2210; box-shadow: 0 2px 0 #96582A; }
.lg-face { position: relative; width: 38px; height: 38px; flex-shrink: 0; }
.lg-face .face { width: 100%; height: 100%; display: block; border-radius: 50%; }
.lg-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2px var(--tile); }
.lg-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lg-name strong { display: flex; align-items: center; gap: 6px; font: 700 0.9375rem/1.25 var(--font-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-name small { font: 600 0.75rem var(--font-main); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-tag { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; font: 800 0.625rem var(--font-main); letter-spacing: 0.06em; text-transform: uppercase; padding: 0.15rem 0.4rem; border-radius: 6px; }
.lg-tag .ic { width: 11px; height: 11px; }
.lg-tag.me { background: var(--blue); color: #fff; }
.lg-tag.friend { background: rgba(var(--good-rgb),0.18); color: var(--good); }
.lg-row.tap { cursor: pointer; transition: background 0.15s ease; }
@media (hover: hover) { .lg-row.tap:hover { background: var(--tile-2); } }
.lg-row.tap:active { transform: scale(0.99); }
.lg-row.tap:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.lg-views { margin: 0 0 0.75rem; }
.lg-card.out .lg-card-rank { display: none; }
.lg-xp { display: flex; align-items: baseline; gap: 3px; flex-shrink: 0; }
.lg-xp b { font: 800 1rem var(--font-main); font-variant-numeric: tabular-nums; }
.lg-xp small { font: 700 0.6875rem var(--font-main); color: var(--text-3); }
.lg-row.lg-gain .lg-xp b { color: var(--gold); transition: color 1.2s ease 0.9s; }
.lg-row.me.lg-climb { animation: lgClimb 0.9s var(--spring) both; }
@keyframes lgClimb { 0% { transform: scale(1); } 30% { transform: scale(1.035); box-shadow: inset 0 0 0 2px var(--blue), 0 0 0 6px rgba(var(--blue-rgb),0.25); } 100% { transform: none; } }
.lg-line { display: flex; align-items: center; gap: 8px; padding: 0.35rem 0.4rem; font: 800 0.6875rem var(--font-main); letter-spacing: 0.08em; text-transform: uppercase; }
.lg-line::before, .lg-line::after { content: ''; flex: 1; height: 2px; border-radius: 1px; }
.lg-line span { display: inline-flex; align-items: center; gap: 4px; }
.lg-line .ic { width: 12px; height: 12px; }
.lg-line.up { color: var(--good); }
.lg-line.up::before, .lg-line.up::after { background: rgba(var(--good-rgb),0.45); }
.lg-line.up .ic { transform: rotate(-90deg); }
.lg-line.down { color: var(--bad-text); }
.lg-line.down::before, .lg-line.down::after { background: rgba(229,72,77,0.45); }
.lg-line.down .ic { transform: rotate(90deg); }

.lg-invite { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); margin-bottom: 1.2rem; }
.lg-invite > .ic { width: 28px; height: 28px; flex-shrink: 0; color: var(--blue-hi); }
.lg-invite div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lg-invite strong { font: 800 0.9375rem var(--font-main); }
.lg-invite small { font: 600 0.8125rem/1.35 var(--font-main); color: var(--text-2); }
.lg-note { font: 600 0.8125rem/1.45 var(--font-main); color: var(--text-3); text-align: center; margin: 0 0.5rem 1.2rem; }
.lg-h { font: 800 0.8125rem var(--font-main); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin: 0.4rem 0 0.5rem; }
.lg-history { display: flex; flex-direction: column; gap: 6px; }
.lg-past { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem; border-radius: 14px; background: var(--tile); }
.lg-past-badge { width: 24px; height: 33px; flex-shrink: 0; }
.lg-past div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lg-past strong { font: 700 0.9375rem var(--font-main); }
.lg-past small { font: 600 0.75rem var(--font-main); color: var(--text-3); }
.lg-move { display: inline-flex; align-items: center; gap: 3px; font: 700 0.75rem var(--font-main); color: var(--text-3); text-align: right; }
.lg-move .ic { width: 12px; height: 12px; }
.lg-move.up { color: var(--good); }
.lg-move.up .ic { transform: rotate(-90deg); }
.lg-move.down { color: var(--bad-text); }
.lg-move.down .ic { transform: rotate(90deg); }
.lg-help p { color: var(--text-2); font: 600 0.9375rem/1.5 var(--font-main); margin: 0 0 0.7rem; text-align: left; }
.lg-help b { color: #fff; }

/* Last week's result: the old division's card turns over to show the new one */
.cel-lg-art { position: relative; width: 120px; height: 164px; margin: 0.5rem 0 0.4rem; perspective: 700px; animation: celPop 0.7s var(--spring) 0.1s both; }
.cel-lg-flip, .cel-lg-still { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.9s var(--spring); }
.cel-lg-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cel-lg-face.back { transform: rotateY(180deg); }
.cel-league.flipped .cel-lg-flip { transform: rotateY(180deg); }
.cel-lg-badge { filter: drop-shadow(0 14px 22px rgba(0,0,0,0.45)); }
.cel-lg-place { position: absolute; right: -14px; top: -10px; min-width: 46px; padding: 0.3rem 0.55rem; border-radius: 999px; font: 800 1rem var(--font-main); color: #fff; background: var(--tile-2); box-shadow: 0 3px 0 var(--lip); animation: popIn 0.5s var(--spring) 0.5s both; }
.cel-lg-place.r1 { background: var(--gold); color: #3B2A06; box-shadow: 0 3px 0 var(--gold-lip); }
.cel-lg-place.r2 { background: #C4CCD6; color: #2C333B; box-shadow: 0 3px 0 #8C96A3; }
.cel-lg-place.r3 { background: #D08C4F; color: #3A2210; box-shadow: 0 3px 0 #96582A; }
.cel-league .cel-title { font-size: 1.875rem; }
.cel-league.down .cel-kicker { color: var(--text-3); }
.cel-league .cel-reward { opacity: 1; transform: none; animation: popIn 0.5s var(--spring) 1.2s both; }

@media (prefers-reduced-motion: reduce) {
    .lg-step, .lg-step.on, .lg-step.on .lg-badge, .lg-enter .lg-row, .lg-standing, .lg-card-rank.climb, .lg-card-rank.climb::after, .lg-row.me.lg-climb, .cel-lg-art, .cel-lg-place, .cel-league .cel-reward { animation: none !important; }
    .cel-lg-flip { transition: none; }
}

/* ── Table colours and the four-colour deck (settings) ── */
.tt-panel { background: var(--tile); border-radius: 20px; box-shadow: 0 3px 0 var(--lip); padding: 0.75rem; margin-top: 0.85rem; }
.tt-stage { position: relative; height: 150px; border-radius: 14px; overflow: hidden; box-shadow: inset 0 3px 0 rgba(0,0,0,0.3); display: grid; place-items: center; transition: background 0.4s ease; }
.tt-cards { display: flex; gap: 6px; }
.tt-cards .pc { --w: 46px; animation: popIn 0.4s var(--spring) both; }
.tt-cards .pc:nth-child(2) { animation-delay: 0.04s; } .tt-cards .pc:nth-child(3) { animation-delay: 0.08s; } .tt-cards .pc:nth-child(4) { animation-delay: 0.12s; }
.tt-pot { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); font: 800 0.8125rem var(--font-main); color: #fff; background: rgba(0,0,0,0.3); border-radius: 999px; padding: 0.2rem 0.6rem; }
.tt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.55rem; margin-top: 0.75rem; }
.tt-swatch { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0; border: none; background: none; color: var(--text); cursor: pointer; font-family: var(--font-main); }
.tt-swatch i { width: 100%; aspect-ratio: 1.35; border-radius: 12px; box-shadow: 0 3px 0 var(--lip), inset 0 0 0 1px rgba(255,255,255,0.08); display: grid; place-items: center; transition: transform 0.2s var(--spring), box-shadow 0.15s ease; }
.tt-swatch i .ic { width: 20px; height: 20px; color: #fff; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.4)); }
.tt-swatch small { font: 700 0.6875rem/1.2 var(--font-main); color: var(--text-2); text-align: center; }
.tt-swatch.active i { transform: translateY(-2px); box-shadow: 0 0 0 3px var(--tile), 0 0 0 5px #fff, 0 5px 0 3px var(--lip); }
.tt-swatch.locked i { filter: grayscale(0.7) brightness(0.6); }
.tt-swatch.locked small { color: var(--text-3); }
.tt-swatch:active i { transform: translateY(1px); }
.set-list.tt-four { margin-top: 0.85rem; }
.set-row:has(#set-four:not(:checked)) .set-ic-green { background: var(--tile-2); color: var(--text-2); box-shadow: 0 2px 0 var(--lip); }
.tt-locked { width: 140px; height: 96px; margin: -0.4rem auto 1.1rem; border-radius: 14px; display: grid; place-items: center; color: #fff; filter: grayscale(0.5) brightness(0.75); box-shadow: 0 3px 0 rgba(0,0,0,0.35); }
.tt-locked .ic { width: 30px; height: 30px; }

/* ── Quick chat at online tables ── */
.pt-chat-btn { width: 42px; height: 42px; border-radius: 12px; color: var(--text); flex-shrink: 0; display: grid; place-items: center; }
.pt-chat-btn .ic { width: 22px; height: 22px; }
.pt-chat-btn:active, .pt-chat-btn[aria-expanded="true"] { background: rgba(0,0,0,0.25); }
.pt-chat { position: absolute; z-index: 40; top: calc(3.3rem + var(--safe-top)); right: 0.6rem; width: min(250px, calc(100vw - 1.2rem)); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip), 0 14px 30px rgba(0,0,0,0.45); transform-origin: 90% 0; animation: popIn 0.25s var(--spring) both; }
.pt-chat.hidden { display: none; }
.pt-chat-opt { border: none; border-radius: 11px; background: var(--tile-2); box-shadow: 0 2px 0 var(--lip); color: var(--text); font: 700 0.875rem var(--font-main); padding: 0.6rem 0.4rem; cursor: pointer; animation: riseIn 0.25s var(--ease) calc(var(--i) * 0.025s) both; }
.pt-chat-opt:active { transform: translateY(2px); box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .pt-chat, .pt-chat-opt { animation: none; } }

/* Sign in with Apple: Apple's black button */
.btn-apple { background: #000; color: #fff; box-shadow: 0 4px 0 #3A3836; font-weight: 800; gap: 0.6rem; margin-top: 0.7rem; }
.btn-apple:active { background: #000; box-shadow: 0 1px 0 #3A3836; }
.btn-apple svg { flex-shrink: 0; margin-top: -2px; }

/* ── Tournaments ────────────────────────────────── */
.tn-card { margin-top: -0.6rem; }
.tn-card-art { width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center; border-radius: 13px; background: rgba(245,184,61,0.14); }
.tn-card-art .spot { width: 38px; height: 38px; transition: transform 0.3s var(--spring); }
.tn-card:hover .tn-card-art .spot { transform: rotate(-8deg) scale(1.06); }
.tn-card-go { color: var(--text-3); display: grid; }
.tn-card-go .ic { width: 20px; height: 20px; }

.tn-body { max-width: 560px; margin: 0 auto; width: 100%; }
.tn-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0.2rem 0.5rem 1rem; }
.tn-hero-art { width: 92px; height: 92px; animation: celPop 0.7s var(--spring) both; }
.tn-hero-art .spot { width: 100%; height: 100%; filter: drop-shadow(0 10px 18px rgba(0,0,0,0.4)); }
.tn-hero h3 { font: 800 1.625rem var(--font-main); margin: 0.3rem 0 0.2rem; }
.tn-hero p { font: 600 0.9375rem/1.45 var(--font-main); color: var(--text-2); margin: 0; max-width: 340px; }
.tn-totals { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.tn-totals span { display: flex; flex-direction: column; align-items: center; min-width: 72px; padding: 0.45rem 0.6rem; border-radius: 12px; background: var(--tile); box-shadow: 0 2px 0 var(--lip); }
.tn-totals b { font: 800 1.125rem var(--font-main); }
.tn-totals small { font: 700 0.6875rem var(--font-main); color: var(--text-3); }
.tn-event { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 0.7rem; padding: 0.95rem 0.95rem 0.9rem 1.15rem; margin-bottom: 0.9rem; border-radius: 18px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); animation: riseIn 0.45s var(--ease) calc(0.08s + var(--i) * 0.07s) both; }
.tn-event::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--ev); }
.tn-event-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.tn-event-name strong { display: block; font: 800 1.25rem var(--font-main); }
.tn-event-name small { font: 600 0.8125rem var(--font-main); color: var(--text-2); }
.tn-time { display: inline-flex; align-items: center; gap: 4px; font: 700 0.75rem var(--font-main); color: var(--text-2); background: var(--tile-2); border-radius: 999px; padding: 0.25rem 0.55rem; white-space: nowrap; }
.tn-time .ic { width: 14px; height: 14px; color: var(--ev); }
.tn-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tn-facts span { display: flex; flex-direction: column; padding: 0.45rem 0.55rem; border-radius: 11px; background: var(--bg-deep); }
.tn-facts b { font: 800 1rem var(--font-main); }
.tn-facts small { font: 600 0.6875rem var(--font-main); color: var(--text-3); }
.tn-field { display: flex; align-items: center; gap: 0.6rem; }
.tn-faces { display: flex; }
.tn-face { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 2px var(--tile); }
.tn-face + .tn-face { margin-left: -7px; }
.tn-face .face { width: 100%; height: 100%; display: block; border-radius: 50%; }
.tn-field small { font: 600 0.75rem var(--font-main); color: var(--text-3); }
.tn-prizes { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.7rem; font: 700 0.8125rem var(--font-main); color: var(--text-2); }
.tn-prizes > .ic { width: 16px; height: 16px; color: var(--gold); }
.tn-prizes b { color: var(--gold); font-weight: 800; }
.tn-rest { color: var(--text-3); }
.tn-record { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tn-record span { display: inline-flex; align-items: center; gap: 4px; font: 700 0.75rem var(--font-main); color: var(--text-2); background: var(--tile-2); border-radius: 8px; padding: 0.2rem 0.5rem; }
.tn-record .tn-wins { background: rgba(245,184,61,0.16); color: var(--gold); }
.tn-record .ic { width: 13px; height: 13px; }
.tn-lock { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem; border-radius: 12px; background: var(--bg-deep); color: var(--text-3); font: 700 0.875rem var(--font-main); text-align: center; }
.tn-lock .ic { width: 18px; height: 18px; flex-shrink: 0; }
.tn-event.locked .tn-faces, .tn-event.locked .tn-facts { opacity: 0.55; }
.tn-note { font: 600 0.8125rem/1.45 var(--font-main); color: var(--text-3); text-align: center; margin: 0.2rem 0.5rem 1rem; }

/* Result: where you finished */
.tr-result { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: calc(16px + var(--safe-top, 0px)) 16px calc(16px + var(--safe-bottom, 0px)); opacity: 0; transition: opacity 0.3s ease; }
.tr-result.in { opacity: 1; }
.tr-card { position: relative; width: min(100%, 400px); text-align: center; overflow-x: hidden; transform: translateY(18px) scale(0.96); transition: transform 0.45s var(--spring); }
.tr-result.in .tr-card { transform: none; }
.tr-card .cel-rays { top: -120px; }
.tr-art { position: relative; width: 112px; height: 112px; margin: 0 auto 0.2rem; animation: celPop 0.7s var(--spring) 0.15s both; }
.tr-art .spot, .tr-art .medal { width: 100%; height: 100%; filter: drop-shadow(0 12px 20px rgba(0,0,0,0.45)); }
.tr-kicker { position: relative; font: 800 0.75rem var(--font-main); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.tr-title { position: relative; font: 800 2rem/1.1 var(--font-main) !important; margin: 0.2rem 0 0.3rem; }
.tr-sub { position: relative; font: 600 0.9375rem/1.4 var(--font-main); color: var(--text-2); margin: 0 0 0.7rem; }
.tr-prize { position: relative; display: inline-flex; align-items: center; gap: 6px; font: 800 1.0625rem var(--font-main); color: #3B2A06; background: var(--gold); box-shadow: 0 3px 0 var(--gold-lip); border-radius: 999px; padding: 0.4rem 0.9rem; animation: popIn 0.5s var(--spring) 0.6s both; }
.tr-prize .ic { width: 18px; height: 18px; }
.tr-standings { position: relative; list-style: none; margin: 1rem 0 1rem; padding: 6px; border-radius: 16px; background: var(--bg-deep); text-align: left; }
.tr-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem; border-radius: 11px; animation: riseIn 0.35s var(--ease) both; }
.tr-row.me { background: rgba(var(--blue-rgb),0.16); box-shadow: inset 0 0 0 2px rgba(var(--blue-rgb),0.55); }
.tr-place { min-width: 40px; font: 800 0.875rem var(--font-main); color: var(--text-2); }
.tr-place.p1 { color: var(--gold); } .tr-place.p2 { color: #C4CCD6; } .tr-place.p3 { color: #D08C4F; }
.tr-face { width: 30px; height: 30px; flex-shrink: 0; }
.tr-face .face { width: 100%; height: 100%; display: block; border-radius: 50%; }
.tr-name { flex: 1; font: 700 0.9375rem var(--font-main); }
.tr-xp { font: 800 0.8125rem var(--font-main); color: var(--gold); }
.tr-still { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0.5rem; border-top: 1px solid var(--line); margin-top: 4px; }
.tr-still small { width: 100%; font: 800 0.6875rem var(--font-main); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.tr-chip { display: inline-flex; align-items: center; gap: 5px; padding: 0.2rem 0.55rem 0.2rem 0.2rem; border-radius: 999px; background: var(--tile); font: 700 0.75rem var(--font-main); }
.tr-chip .face { width: 22px; height: 22px; display: block; border-radius: 50%; }
.tr-chip i { font-style: normal; color: var(--text-3); }
.tr-actions { position: relative; display: flex; flex-direction: column; gap: 0.6rem; }
@media (prefers-reduced-motion: reduce) { .tn-event, .tn-hero-art, .tr-art, .tr-prize, .tr-row { animation: none !important; } .tr-card { transition: none; } }

/* ── Welcome (first run) ────────────────────────── */
.wl { position: fixed; inset: 0; z-index: 9400; display: flex; flex-direction: column; background: radial-gradient(120% 70% at 50% 30%, #2F2C29 0%, var(--bg) 60%, var(--bg-deep) 100%); padding: calc(10px + var(--safe-top, 0px)) 16px calc(16px + var(--safe-bottom, 0px)); opacity: 0; transition: opacity 0.35s ease; }
.wl.in { opacity: 1; }
.wl.out { opacity: 0; transition-duration: 0.3s; }
.wl-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; max-width: 480px; width: 100%; margin: 0 auto; }
.wl-back { width: 40px; height: 40px; display: grid; place-items: center; color: var(--text-2); border-radius: 12px; }
.wl-back .ic { width: 22px; height: 22px; }
.wl-dots { display: flex; gap: 6px; }
.wl-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--tile-2); transition: width 0.35s var(--spring), background-color 0.3s ease; }
.wl-dots i.on { width: 26px; background: var(--blue); }
.wl-dots i.past { background: rgba(var(--blue-rgb),0.55); }
.wl-body { position: relative; flex: 1; max-width: 480px; width: 100%; margin: 0 auto; overflow: hidden; }
.wl-step { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.35rem; text-align: center; padding: 0 2px 6px; overflow-y: auto; transition: transform 0.45s var(--spring), opacity 0.3s ease; }
.wl-step.from-right { transform: translateX(60px); opacity: 0; }
.wl-step.from-left { transform: translateX(-60px); opacity: 0; }
.wl-step.to-left { transform: translateX(-60px); opacity: 0; pointer-events: none; }
.wl-step.to-right { transform: translateX(60px); opacity: 0; pointer-events: none; }
.wl-title { font: 800 1.875rem/1.15 var(--font-main); margin: 0.4rem 0 0.1rem; letter-spacing: -0.01em; }
.wl-text { font: 600 1rem/1.45 var(--font-main); color: var(--text-2); margin: 0 auto 1.1rem; max-width: 340px; }
.wl-text b { color: #fff; }
.wl-step > .btn { margin-top: 0.4rem; }
.wl-hero { position: relative; height: 200px; margin-bottom: 0.6rem; display: grid; place-items: center; }
.wl-fan { position: absolute; inset: 0; display: grid; place-items: center; }
.wl-card { position: absolute; transform-origin: 50% 120%; animation: wlFan 0.8s var(--spring) calc(0.25s + var(--k) * 0.08s) both; }
.wl-card .pc { --w: 74px; }
.wl-card:nth-child(1) { --r: -22deg; --x: -46px; }
.wl-card:nth-child(2) { --r: 0deg; --x: 0px; }
.wl-card:nth-child(3) { --r: 22deg; --x: 46px; }
@keyframes wlFan { from { transform: translateY(40px) rotate(0) scale(0.7); opacity: 0; } to { transform: translateX(var(--x)) translateY(-18px) rotate(var(--r)); opacity: 1; } }
.wl-logo { position: relative; width: 96px; height: 96px; margin-top: 90px; animation: celPop 0.7s var(--spring) 0.65s both; filter: drop-shadow(0 12px 20px rgba(0,0,0,0.45)); }
.wl-logo svg { width: 100%; height: 100%; }
.wl-options { display: flex; flex-direction: column; gap: 0.6rem; text-align: left; margin-bottom: 0.4rem; }
.wl-opt { display: flex; align-items: center; gap: 0.8rem; width: 100%; padding: 0.85rem 0.9rem; border: none; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font-family: var(--font-main); cursor: pointer; text-align: left; animation: riseIn 0.4s var(--ease) calc(0.1s + var(--k) * 0.06s) both; transition: transform 0.15s var(--spring), box-shadow 0.15s ease, background-color 0.15s ease; }
.wl-opt:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.wl-opt.on { background: rgba(var(--blue-rgb),0.16); box-shadow: 0 3px 0 var(--lip), inset 0 0 0 2px var(--blue); }
.wl-opt .menu-ic { flex-shrink: 0; }
.wl-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wl-opt-text strong { font: 800 1.0625rem var(--font-main); }
.wl-opt-text small { font: 600 0.8125rem var(--font-main); color: var(--text-2); }
.wl-goal-xp { width: 52px; height: 46px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: rgba(245,184,61,0.14); color: var(--gold); }
.wl-goal-xp b { font: 800 1.125rem/1 var(--font-main); }
.wl-goal-xp small { font: 800 0.625rem var(--font-main); letter-spacing: 0.08em; }
.wl-opt.on .wl-goal-xp { background: var(--gold); color: #3B2A06; }
.wl-done-art { width: 120px; height: 120px; margin: 0 auto 0.2rem; animation: celPop 0.7s var(--spring) 0.1s both; }
.wl-done-art .spot { width: 100%; height: 100%; animation: flicker 1.4s ease-in-out 0.8s infinite; transform-origin: 50% 90%; }
.wl-first { display: flex; flex-direction: column; gap: 3px; padding: 0.9rem 1rem; margin: 0 0 0.9rem; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); text-align: left; animation: riseIn 0.45s var(--ease) 0.3s both; }
.wl-first small { font: 800 0.6875rem var(--font-main); letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-hi); }
.wl-first strong { font: 800 1.125rem var(--font-main); }
.wl-first span { font: 600 0.875rem/1.4 var(--font-main); color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { .wl-card, .wl-logo, .wl-opt, .wl-done-art, .wl-done-art .spot, .wl-first { animation: none !important; } .wl-card { transform: translateX(var(--x)) translateY(-18px) rotate(var(--r)); } .wl-step { transition: none; } }

/* ── XP as you earn it ── */
.xp-pill { position: fixed; z-index: 9300; top: calc(var(--safe-top, 0px) + 58px); right: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 0.3rem 0.7rem 0.3rem 0.35rem; border-radius: 999px; background: var(--tile); box-shadow: 0 3px 0 var(--lip), 0 8px 18px rgba(0,0,0,0.35); color: #fff; pointer-events: none; opacity: 0; transform: translateY(-10px) scale(0.8); transition: opacity 0.25s ease, transform 0.35s var(--spring); }
.xp-pill.show { opacity: 1; transform: none; }
.xp-pill.leave { opacity: 0; transform: translateY(-18px) scale(0.9); transition: opacity 0.35s ease, transform 0.4s var(--ease); }
.xp-pill.bump .xp-pill-star { animation: xpSpin 0.5s var(--spring); }
.xp-pill-star { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #3B2A06; box-shadow: 0 2px 0 var(--gold-lip); }
.xp-pill-star .ic { width: 15px; height: 15px; }
.xp-pill b { font: 800 0.9375rem var(--font-main); font-variant-numeric: tabular-nums; color: var(--gold); }
.xp-pill small { font: 800 0.6875rem var(--font-main); color: var(--text-2); }
@keyframes xpSpin { 0% { transform: scale(1) rotate(0); } 50% { transform: scale(1.25) rotate(-18deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .xp-pill, .xp-pill.leave { transition: opacity 0.2s ease; transform: none; } .xp-pill.bump .xp-pill-star { animation: none; } }

/* XP earned in a game (session review) */
.gr-xp { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1rem; padding: 0.75rem 0.85rem; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); animation: riseIn 0.45s var(--ease) 0.1s both; }
.gr-xp-badge { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #3B2A06; box-shadow: 0 3px 0 var(--gold-lip); font: 800 0.875rem var(--font-main); }
.gr-xp-info { flex: 1; min-width: 0; }
.gr-xp-info strong { display: block; font: 800 1rem var(--font-main); }
.gr-xp-bar { height: 10px; margin: 0.4rem 0 0.25rem; border-radius: 5px; background: var(--bg-deep); overflow: hidden; }
.gr-xp-bar i { display: block; height: 100%; width: var(--to); border-radius: 5px; background: var(--gold); animation: grXp 1.1s var(--ease) 0.5s both; }
@keyframes grXp { from { width: var(--from); } }
.gr-xp-info small { font: 700 0.75rem var(--font-main); color: var(--text-3); }
@media (prefers-reduced-motion: reduce) { .gr-xp, .gr-xp-bar i { animation: none; } }

/* ── Home: tournaments and the boss, side by side ── */
.home-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; max-width: 560px; margin: 0 auto 1.6rem; }
.duo-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 0.8rem 0.85rem 0.85rem; border: none; border-radius: 18px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer; overflow: hidden;
    transition: transform 0.12s ease, box-shadow 0.12s ease; }
.duo-card:active { transform: translateY(2px) scale(0.985); box-shadow: 0 1px 0 var(--lip); }
.duo-card strong { font: 800 1.0625rem/1.2 var(--font-main); }
.duo-sub { font: 600 0.75rem/1.35 var(--font-main); color: var(--text-2); }
.duo-art { width: 44px; height: 44px; margin-bottom: 0.45rem; display: grid; place-items: center; border-radius: 13px; background: rgba(245,184,61,0.14); }
.duo-art .spot { width: 36px; height: 36px; transition: transform 0.3s var(--spring); }
.duo-card:hover .duo-art .spot { transform: rotate(-8deg) scale(1.06); }
.duo-face { position: relative; background: none; }
.duo-face span, .duo-face .face { width: 44px; height: 44px; display: block; border-radius: 50%; }
.duo-face { box-shadow: 0 0 0 2px #E5484D; border-radius: 50%; }
.duo-crown { position: absolute; top: -9px; right: -7px; width: 22px; height: 22px; color: var(--gold); filter: drop-shadow(0 2px 0 rgba(0,0,0,0.45)); transform: rotate(18deg); animation: bsBob 2.4s ease-in-out infinite; }
.duo-crown .ic { width: 100%; height: 100%; }
.duo-card.boss::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(229,72,77,0.22), transparent 70%); pointer-events: none; }
.duo-card.boss.beaten .duo-face { box-shadow: 0 0 0 2px var(--good); }
.duo-card.boss.beaten .duo-sub { color: var(--good); }
@keyframes bsBob { 0%, 100% { transform: rotate(18deg) translateY(0); } 50% { transform: rotate(12deg) translateY(-2px); } }

/* ── Boss of the week ── */
.bs-body { max-width: 560px; margin: 0 auto; width: 100%; }
.bs-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0.4rem 0 1rem; }
.bs-portrait { position: relative; width: 120px; height: 120px; margin-bottom: 0.5rem; border-radius: 50%; box-shadow: 0 0 0 4px #E5484D, 0 0 0 10px rgba(229,72,77,0.18), 0 14px 26px rgba(0,0,0,0.45); animation: celPop 0.7s var(--spring) 0.1s both; }
.bs-portrait .face { width: 100%; height: 100%; display: block; border-radius: 50%; }
.bs-portrait .bs-crown { position: absolute; top: -26px; left: 50%; width: 48px; height: 48px; margin-left: -24px; color: var(--gold); filter: drop-shadow(0 3px 0 rgba(0,0,0,0.4)); animation: bsCrown 0.7s var(--spring) 0.5s both; }
.bs-crown .ic { width: 100%; height: 100%; }
@keyframes bsCrown { from { opacity: 0; transform: translateY(-16px) rotate(-20deg) scale(0.6); } to { opacity: 1; transform: none; } }
.bs-hero.beaten .bs-portrait { box-shadow: 0 0 0 4px var(--good), 0 0 0 10px rgba(var(--good-rgb),0.18), 0 14px 26px rgba(0,0,0,0.45); }
.bs-stamp { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%) rotate(-8deg); font: 800 0.75rem var(--font-main); letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: var(--good); box-shadow: 0 2px 0 var(--good-lip); border-radius: 7px; padding: 0.2rem 0.55rem; animation: popIn 0.5s var(--spring) 0.8s both; }
.bs-kicker { font: 800 0.75rem var(--font-main); letter-spacing: 0.12em; text-transform: uppercase; color: #FF7A7E; margin-top: 0.4rem; }
.bs-hero h3 { font: 800 1.625rem var(--font-main); margin: 0.15rem 0 0.2rem; }
.bs-clue { font: 600 italic 0.9375rem/1.4 var(--font-main); color: var(--text-2); margin: 0 0 0.7rem; max-width: 320px; }
.bs-card { display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 18px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); margin-bottom: 0.9rem; animation: riseIn 0.45s var(--ease) 0.1s both; }
.bs-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.65rem; font: 600 0.875rem/1.35 var(--font-main); color: var(--text-2); }
.bs-row + .bs-row { box-shadow: 0 -1px 0 var(--line); }
.bs-row .ic { width: 20px; height: 20px; flex-shrink: 0; color: var(--gold); }
.bs-row b { color: #fff; }
.bs-row em { font-style: normal; color: var(--good); font-weight: 700; }
.bs-tip { font: 600 0.875rem/1.45 var(--font-main); color: var(--text-3); text-align: center; margin: 0 0.6rem 1rem; }
.bs-twist, .bs-reveal { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.85rem 0.95rem; margin-bottom: 1rem; border-radius: 16px; background: rgba(229,72,77,0.1); box-shadow: inset 0 0 0 1px rgba(229,72,77,0.3); text-align: left; animation: riseIn 0.4s var(--ease) both; }
.bs-twist small { font: 800 0.6875rem var(--font-main); letter-spacing: 0.1em; text-transform: uppercase; color: #FF7A7E; }
.bs-twist strong, .bs-reveal strong { font: 800 1rem/1.3 var(--font-main); }
.bs-twist p, .bs-reveal p { font: 600 0.875rem/1.45 var(--font-main); color: var(--text-2); margin: 0; }
.bs-beat b { color: #fff; }
.bs-count { display: flex; align-items: center; justify-content: center; gap: 6px; font: 700 0.8125rem var(--font-main); color: var(--text-3); margin: 0.9rem 0; }
.bs-count .ic { width: 16px; height: 16px; color: var(--gold); }
/* In the result */
.bs-art { border-radius: 50%; }
.bs-art .face { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 0 0 4px #E5484D; }
.bs-art.beaten .face { box-shadow: 0 0 0 4px var(--good); filter: grayscale(0.25); }
.bs-art .bs-crown { position: absolute; top: -20px; right: -6px; width: 38px; height: 38px; color: var(--gold); transform: rotate(16deg); filter: drop-shadow(0 3px 0 rgba(0,0,0,0.4)); }
.bs-art.beaten .bs-crown { animation: bsFall 0.9s var(--ease) 0.6s both; }
@keyframes bsFall { to { transform: translate(26px, 70px) rotate(80deg); opacity: 0; } }
.bs-guess { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.85rem; margin-bottom: 1rem; border-radius: 16px; background: var(--bg-deep); text-align: left; position: relative; }
.bs-guess strong { font: 800 1rem var(--font-main); }
.bs-guess small { font: 600 0.75rem var(--font-main); color: var(--text-3); margin-bottom: 0.2rem; }
.bs-choice { border: none; border-radius: 12px; padding: 0.7rem 0.8rem; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font: 700 0.9375rem var(--font-main); text-align: left; cursor: pointer; }
.bs-choice:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.bs-verdict { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font: 800 0.875rem var(--font-main); border-radius: 999px; padding: 0.25rem 0.65rem; margin-bottom: 0.15rem; }
.bs-verdict .ic { width: 16px; height: 16px; }
.bs-verdict.good { background: var(--good); color: #fff; }
.bs-verdict.bad { background: rgba(255,255,255,0.1); color: var(--text-2); }
.bs-slot { position: relative; }
@media (prefers-reduced-motion: reduce) { .bs-portrait, .bs-portrait .bs-crown, .bs-stamp, .bs-card, .bs-twist, .bs-reveal, .duo-crown, .bs-art.beaten .bs-crown { animation: none !important; } }

/* ── Share buttons ── */
.tr-share, .cel-share { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin: 0.7rem auto 0; padding: 0.45rem 0.95rem; border: none; border-radius: 999px; background: rgba(255,255,255,0.08); color: #fff; font: 800 0.875rem var(--font-main); cursor: pointer; transition: transform 0.12s ease, background-color 0.15s ease; }
.tr-share .ic, .cel-share .ic { width: 16px; height: 16px; }
.tr-share:active, .cel-share:active { transform: translateY(1px) scale(0.97); }
.tr-share:hover, .cel-share:hover { background: rgba(255,255,255,0.14); }
.cel .cel-share { margin-top: 0.5rem; }

/* ── Rating against the computer ── */
.cpu-rating { display: flex; align-items: center; gap: 0.75rem; width: 100%; margin: 0 0 1rem; padding: 0.7rem 0.85rem; border: none; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer; }
.cpu-rating:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.cpu-rating-face { width: 40px; height: 40px; flex-shrink: 0; }
.cpu-rating-face .face { width: 100%; height: 100%; display: block; border-radius: 50%; }
.cpu-rating-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cpu-rating-text small { font: 800 0.6875rem var(--font-main); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.cpu-rating-text strong { font: 800 1.375rem/1.15 var(--font-main); font-variant-numeric: tabular-nums; }
.cpu-rating-text em { font: 600 0.75rem var(--font-main); font-style: normal; color: var(--text-2); }
.cpu-rating-spark { width: 80px; height: 28px; flex-shrink: 0; }
.cpu-rating-spark polyline { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cpu-rating-spark.up polyline { stroke: var(--good); }
.cpu-rating-spark.down polyline { stroke: var(--bad); }
.tr-rating { position: relative; display: inline-flex; align-items: center; gap: 6px; margin: 0.6rem auto 0; font: 700 0.875rem var(--font-main); color: var(--text-2); }
.tr-rating .ic { width: 16px; height: 16px; }
.tr-rating b { color: #fff; font-weight: 800; }
.tr-rating em { font-style: normal; font-weight: 800; padding: 0.1rem 0.4rem; border-radius: 6px; }
.tr-rating.up em { color: #fff; background: var(--good); }
.tr-rating.down em { color: #fff; background: var(--bad); }
.tr-card .tr-prize + .tr-rating { display: flex; justify-content: center; }

/* ── Friends today (daily game results) ── */
.ft { width: 100%; margin: 0.9rem 0 0.8rem; padding: 0.75rem 0.85rem; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); text-align: left; }
.ft-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; font: 800 0.9375rem var(--font-main); margin-bottom: 0.35rem; }
.ft-head small { font: 700 0.75rem var(--font-main); color: var(--text-3); }
.ft-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; animation: riseIn 0.35s var(--ease) calc(var(--i) * 0.05s) both; }
.ft-row + .ft-row { border-top: 1px solid var(--line); }
.ft-face { width: 28px; height: 28px; flex-shrink: 0; }
.ft-face .face { width: 100%; height: 100%; display: block; border-radius: 50%; }
.ft-name { flex: 1; min-width: 0; font: 700 0.875rem var(--font-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-score { font: 800 0.875rem var(--font-main); color: var(--good); font-variant-numeric: tabular-nums; }
.ft-score.miss { color: var(--text-3); }
.ft-empty, .ft-more { font: 600 0.8125rem/1.4 var(--font-main); color: var(--text-3); margin: 0.2rem 0 0; }
@media (prefers-reduced-motion: reduce) { .ft-row { animation: none; } }
.ft-rank { width: 18px; flex-shrink: 0; font: 800 0.8125rem var(--font-main); color: var(--text-3); text-align: center; }
.ft-row.me { margin: 0 -0.45rem; padding-left: 0.45rem; padding-right: 0.45rem; border-radius: 10px; background: rgba(var(--blue-rgb),0.16); box-shadow: inset 0 0 0 2px rgba(var(--blue-rgb),0.5); }
.ft-row.me + .ft-row, .ft-row + .ft-row.me { border-top-color: transparent; }
.ls-shove-spot .ls-bb { font: 800 0.8125rem var(--font-main); color: var(--gold); background: rgba(245,184,61,0.14); border-radius: 999px; padding: 0.2rem 0.6rem; }
.review-footer { display: flex; gap: 0.6rem; }
.review-footer .btn { flex: 1; min-width: 0; }
.review-footer .btn.hidden { display: none; }
.review-footer .btn { font-size: 1.0625rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 0.6rem; padding-right: 0.6rem; }

/* ── Profile: what you've won ── */
.me-cabinet { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 0 0 1rem; }
.me-cab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0.65rem 0.25rem 0.6rem; border: none; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font-family: var(--font-main); cursor: pointer; min-width: 0; text-align: center; transition: transform 0.12s ease, box-shadow 0.12s ease; animation: riseIn 0.4s var(--ease) both; }
.me-cab:nth-child(2) { animation-delay: 0.04s; } .me-cab:nth-child(3) { animation-delay: 0.08s; } .me-cab:nth-child(4) { animation-delay: 0.12s; }
.me-cab:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.me-cab-art { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 0.25rem; color: var(--gold); }
.me-cab-art .ic { width: 26px; height: 26px; }
.me-cab-art .spot { width: 34px; height: 34px; }
.me-cab-art .lg-badge { width: 26px; height: 36px; }
.me-cab strong { font: 800 1rem/1.15 var(--font-main); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-cab small { font: 700 0.6875rem/1.2 var(--font-main); color: var(--text-3); }
@media (prefers-reduced-motion: reduce) { .me-cab { animation: none; } }

/* ── Hand of the Day: how everyone answered ── */
.hd-crowd { margin: 0.9rem 0 0.4rem; padding: 0.75rem 0.85rem; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); text-align: left; }
.hd-crowd > small { font: 600 0.8125rem var(--font-main); color: var(--text-3); }
.hd-crowd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.hd-crowd-head strong { font: 800 0.9375rem var(--font-main); }
.hd-crowd-head small { font: 700 0.75rem var(--font-main); color: var(--text-3); }
.hd-crowd-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 2.6rem; align-items: center; gap: 0.5rem; padding: 0.3rem 0; }
.hd-crowd-label { font: 700 0.8125rem var(--font-main); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-crowd-label em { font-style: normal; font-size: 0.6875rem; font-weight: 800; color: #fff; background: var(--blue); border-radius: 5px; padding: 0.05rem 0.3rem; margin-left: 0.25rem; }
.hd-crowd-bar { height: 10px; border-radius: 5px; background: var(--bg-deep); overflow: hidden; }
.hd-crowd-bar i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--tile-2); transition: width 0.9s var(--ease); }
.hd-crowd.in .hd-crowd-bar i { width: var(--w); }
.hd-crowd-row.best .hd-crowd-bar i { background: var(--good); }
.hd-crowd-row.best .hd-crowd-label { color: #fff; }
.hd-crowd-row b { font: 800 0.8125rem var(--font-main); text-align: right; font-variant-numeric: tabular-nums; }
.hd-crowd-note { font: 600 0.8125rem var(--font-main); color: var(--text-2); margin: 0.35rem 0 0; }
@media (prefers-reduced-motion: reduce) { .hd-crowd-bar i { transition: none; } }
#mk-puzzle .hd-crowd, #mk-puzzle .ft { background: var(--bg-deep); box-shadow: none; }

/* ── Puzzles ── */
.duo-card.pz .duo-art { background: rgba(var(--good-rgb),0.16); }
.duo-card.rush .duo-art { background: rgba(255,138,42,0.16); }
.duo-card.rush::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(255,138,42,0.2), transparent 70%); pointer-events: none; }
.duo-card.pz strong { font-variant-numeric: tabular-nums; }

.pzh-body { max-width: 560px; margin: 0 auto; width: 100%; }
.pzh-hero { display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--tile); border-radius: 22px; box-shadow: 0 4px 0 var(--lip); padding: 1rem 1rem 1.1rem; margin-bottom: 1rem; }
.pzh-art { width: 84px; height: 84px; margin-top: -0.2rem; animation: celPop 0.7s var(--spring) both; }
.pzh-art .spot { width: 100%; height: 100%; filter: drop-shadow(0 8px 14px rgba(0,0,0,0.4)); }
.pzh-kicker { font: 800 0.8125rem var(--font-main); color: var(--text-3); margin-top: 0.2rem; }
.pzh-rating { font: 900 3.25rem/1 var(--font-main); color: #fff; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 0.15rem 0 0.4rem; animation: popIn 0.5s var(--spring) 0.15s both; }
.pzh-chart { width: 100%; margin: 0 0 0.5rem; }
.pzh-chart .ch-line { stroke: var(--good); }
.pzh-chart .ch-area { fill: rgba(var(--good-rgb),0.14); }
.pzh-chart .ch-dot, .pzh-chart .ch-focus { fill: var(--good); }
.pzh-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; width: 100%; margin: 0.2rem 0 0.95rem; }
.pzh-facts span { display: flex; flex-direction: column; align-items: center; background: var(--bg-deep); border-radius: 12px; padding: 0.45rem 0.2rem; }
.pzh-facts b { font: 800 1.0625rem var(--font-main); font-variant-numeric: tabular-nums; }
.pzh-facts small { font: 700 0.6875rem var(--font-main); color: var(--text-3); }
.pzh-rush { background: var(--tile); border-radius: 22px; box-shadow: 0 4px 0 var(--lip); padding: 0.95rem 1rem 1rem; margin-bottom: 1rem; position: relative; overflow: hidden; }
.pzh-rush::after { content: ''; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,138,42,0.18), transparent 70%); pointer-events: none; }
.pzh-rush-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.8rem; }
.pzh-rush-art { width: 56px; height: 56px; flex-shrink: 0; }
.pzh-rush-art .spot { width: 100%; height: 100%; }
.pzh-rush-head strong { display: block; font: 800 1.1875rem var(--font-main); }
.pzh-rush-head small { display: block; font: 600 0.8125rem/1.4 var(--font-main); color: var(--text-2); margin-top: 0.1rem; }
.pzh-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; position: relative; z-index: 1; }
.pzh-mode { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0.75rem 0.5rem 0.7rem; border: none; border-radius: 16px; background: var(--orange); color: #fff; box-shadow: 0 4px 0 #C9661A; font-family: var(--font-main); cursor: pointer; transition: transform 0.08s ease, box-shadow 0.08s ease; }
.pzh-mode + .pzh-mode { background: var(--tile-2); box-shadow: 0 4px 0 var(--lip); }
.pzh-mode:active { transform: translateY(3px); box-shadow: 0 1px 0 #C9661A; }
.pzh-mode-ic .ic { width: 24px; height: 24px; }
.pzh-mode strong { font: 800 1rem var(--font-main); }
.pzh-mode small { font: 700 0.75rem var(--font-main); opacity: 0.85; }

/* Rated puzzles: your rating in the bar, and what moved it */
.pz-top-mid { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; min-height: 40px; }
.pzr-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem 0.35rem 0.55rem; border-radius: 999px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); }
.pzr-chip .ic { width: 20px; height: 20px; color: var(--good); }
.pzr-chip b { font: 800 1.125rem var(--font-main); font-variant-numeric: tabular-nums; }
.pzr-delta { font: 800 0.875rem var(--font-main); opacity: 0; transform: translateY(6px); }
.pzr-delta.in { animation: pzrDelta 0.5s var(--spring) both; }
.pzr-delta.up { color: var(--good); }
.pzr-delta.down { color: var(--bad-text); }
@keyframes pzrDelta { from { opacity: 0; transform: translateY(8px) scale(0.6); } to { opacity: 1; transform: none; } }
.pzr-run { display: inline-flex; align-items: center; gap: 2px; padding: 0.3rem 0.6rem 0.3rem 0.45rem; border-radius: 999px; background: rgba(255,138,42,0.16); color: var(--orange); font: 800 0.9375rem var(--font-main); }
.pzr-run .ic { width: 18px; height: 18px; }
.pzr-run.bump { animation: popIn 0.45s var(--spring) both; }
.pzr-after { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; margin-top: 0.75rem; }
.pzr-after:empty { display: none; }
.pzr-after > span { display: flex; flex-direction: column; background: var(--bg-deep); border-radius: 12px; padding: 0.5rem 0.7rem; }
.pzr-after small { font: 800 0.6875rem var(--font-main); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.pzr-after b { font: 800 1rem var(--font-main); }
.pzr-after em { font: 600 0.75rem/1.35 var(--font-main); font-style: normal; color: var(--text-2); margin-top: 1px; }
.pzr-rated { align-items: flex-end; text-align: right; }
.pzr-rated b { font-variant-numeric: tabular-nums; }

/* Puzzle Rush */
.overlay.rush-screen { padding: 0; background: var(--bg); align-items: stretch; animation: fadeIn 0.2s ease both; }
.rush-card { max-width: 560px; width: 100%; height: 100%; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; animation: scrInF 0.34s var(--ease) both; }
.rush-top { display: flex; align-items: center; gap: 0.7rem; padding: calc(0.6rem + var(--safe-top)) 1rem 0.3rem; }
.rush-clock { flex: 1; text-align: center; font: 900 1.75rem var(--font-main); font-variant-numeric: tabular-nums; color: #fff; }
.rush-clock.survival { display: flex; align-items: center; justify-content: center; gap: 0.35rem; font-size: 1.125rem; color: var(--text-2); }
.rush-clock.survival .ic { width: 20px; height: 20px; color: var(--bad); }
.rush-clock.low { color: var(--bad-text); animation: rushPulse 1s ease-in-out infinite; }
@keyframes rushPulse { 0%, 100% { transform: none; } 50% { transform: scale(1.08); } }
.rush-strikes { display: flex; gap: 5px; }
.rush-strikes i { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-deep); box-shadow: inset 0 2px 0 rgba(0,0,0,0.3); display: grid; place-items: center; }
.rush-strikes i.x { background: var(--bad); box-shadow: 0 2px 0 var(--bad-lip); animation: popIn 0.35s var(--spring) both; }
.rush-strikes i .ic { width: 14px; height: 14px; color: #fff; }
.rush-strikes.shake { animation: shake 0.45s ease both; }
.rush-score { display: flex; align-items: baseline; justify-content: center; gap: 0.35rem; margin: 0 0 0.3rem; }
.rush-score b { font: 900 2.25rem/1 var(--font-main); color: var(--orange); font-variant-numeric: tabular-nums; }
.rush-score b.bump { animation: rushBump 0.4s var(--spring) both; }
@keyframes rushBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.rush-score small { font: 800 0.875rem var(--font-main); color: var(--text-3); }
.rush-screen.done .rush-score { display: none; }
.rush-screen.done .rush-clock { opacity: 0.35; }
.rush-stage { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0.2rem 1rem 0.6rem; overscroll-behavior: contain; }
.rush-puzzle { position: relative; transition: transform 0.26s var(--ease), opacity 0.26s ease; }
.rush-puzzle.enter { transform: translateX(48px); opacity: 0; }
.rush-puzzle.leave { position: absolute; left: 1rem; right: 1rem; top: 0.2rem; transform: translateX(-48px); opacity: 0; pointer-events: none; }
.rush-puzzle .pz-head { margin-bottom: 0.6rem; }
.rush-puzzle .pz-head h2 { font-size: 1.1875rem; }
.rush-flash { position: absolute; left: 50%; top: 38%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; display: grid; place-items: center; pointer-events: none; z-index: 3; animation: rushFlash 0.9s var(--ease) both; }
.rush-flash.ok { background: var(--good); box-shadow: 0 6px 0 var(--good-lip), 0 0 0 10px rgba(var(--good-rgb),0.25); }
.rush-flash.no { background: var(--bad); box-shadow: 0 6px 0 var(--bad-lip), 0 0 0 10px rgba(229,72,77,0.25); }
.rush-flash .ic { width: 52px; height: 52px; color: #fff; }
@keyframes rushFlash { 0% { opacity: 0; transform: scale(0.4); } 25% { opacity: 1; transform: scale(1.1); } 45% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(0.9); } }
.rush-count { display: grid; place-items: center; min-height: 50vh; }
.rush-count b { font: 900 6rem var(--font-main); color: var(--orange); animation: rushCount 0.65s var(--ease) both; }
@keyframes rushCount { 0% { opacity: 0; transform: scale(1.8); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0.2; transform: scale(0.85); } }
.rush-trail { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 0.3rem 1rem calc(0.6rem + var(--safe-bottom)); min-height: 22px; }
.rush-trail i { width: 12px; height: 12px; border-radius: 3px; animation: popIn 0.3s var(--spring) both; }
.rush-trail i.ok { background: var(--good); }
.rush-trail i.no { background: var(--bad); }
.rush-result { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0.4rem 0 1rem; animation: riseIn 0.4s var(--ease) both; }
.rush-result-art { width: 96px; height: 96px; animation: celPop 0.7s var(--spring) both; }
.rush-result-art .spot { width: 100%; height: 100%; filter: drop-shadow(0 10px 18px rgba(0,0,0,0.45)); }
.rush-kicker { font: 800 0.9375rem var(--font-main); color: var(--text-2); margin-top: 0.3rem; }
.rush-big { display: flex; flex-direction: column; align-items: center; margin: 0.1rem 0 0.5rem; }
.rush-big b { font: 900 4.5rem/1 var(--font-main); color: #fff; font-variant-numeric: tabular-nums; }
.rush-big small { font: 800 0.875rem var(--font-main); color: var(--text-3); margin-top: 0.15rem; }
.rush-best { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.9rem; border-radius: 999px; background: var(--tile); font: 800 0.9375rem var(--font-main); color: var(--text-2); margin-bottom: 1rem; }
.rush-best .ic { width: 18px; height: 18px; color: var(--gold); }
.rush-best.new { background: var(--gold); color: #3A2A08; box-shadow: 0 3px 0 var(--gold-lip); animation: popIn 0.5s var(--spring) 0.5s both; }
.rush-best.new .ic { color: #3A2A08; }
.rush-review { width: 100%; background: var(--tile); border-radius: 18px; box-shadow: 0 3px 0 var(--lip); padding: 0.7rem 0.8rem 0.8rem; margin-bottom: 1rem; }
.rush-review > small { display: block; font: 700 0.75rem var(--font-main); color: var(--text-3); margin-bottom: 0.5rem; }
.rush-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.rush-chip { display: inline-flex; align-items: center; gap: 3px; padding: 0.3rem 0.55rem 0.3rem 0.4rem; border: none; border-radius: 10px; font: 800 0.8125rem var(--font-main); color: #fff; cursor: pointer; font-variant-numeric: tabular-nums; }
.rush-chip.ok { background: var(--good); box-shadow: 0 2px 0 var(--good-lip); }
.rush-chip.no { background: var(--bad); box-shadow: 0 2px 0 var(--bad-lip); }
.rush-chip .ic { width: 14px; height: 14px; }
.rush-actions { width: 100%; display: flex; flex-direction: column; gap: 0.55rem; }
@media (prefers-reduced-motion: reduce) {
    .rush-puzzle, .rush-flash, .rush-count b, .rush-score b.bump, .rush-clock.low, .pzh-art, .pzh-rating, .rush-result-art, .rush-best.new, .pzr-delta.in { animation: none !important; transition: none !important; }
    .pzr-delta.in { opacity: 1; transform: none; }
}
#mk-puzzle { z-index: 110; }
.pz-options.n4 { grid-template-columns: 1fr 1fr; }
.pz-opt.also { opacity: 1; box-shadow: 0 4px 0 var(--lip), inset 0 0 0 3px var(--good); }   /* above Puzzle Rush, for going back through a run */

/* ── Install: get the app onto the home screen ── */
.inst-card { display: flex; align-items: center; gap: 0.75rem; max-width: 560px; margin: -0.6rem auto 1.4rem; padding: 0.75rem 0.6rem 0.75rem 0.8rem; border-radius: 18px; background: linear-gradient(135deg, rgba(var(--blue-rgb),0.2), rgba(var(--blue-rgb),0.06)), var(--tile); box-shadow: 0 3px 0 var(--lip); animation: riseIn 0.4s var(--ease) both; transition: opacity 0.22s ease, transform 0.22s ease; }
.inst-card.hidden { display: none; }
.inst-card.leaving { opacity: 0; transform: scale(0.96); }
.inst-icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; box-shadow: 0 3px 0 rgba(0,0,0,0.35); }
.inst-text { flex: 1; min-width: 0; }
.inst-text strong { display: block; font: 800 1rem var(--font-main); }
.inst-text small { display: block; font: 600 0.75rem/1.35 var(--font-main); color: var(--text-2); margin-top: 1px; }
.inst-go { flex-shrink: 0; white-space: nowrap; }
.inst-x { flex-shrink: 0; width: 32px; height: 32px; margin-left: -0.2rem; }
.inst-x .ic { width: 16px; height: 16px; }
.inst-steps { list-style: none; margin: 0.2rem 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; text-align: left; }
.inst-steps li { display: flex; align-items: center; gap: 0.75rem; font: 600 0.9375rem/1.35 var(--font-main); color: var(--text-2); }
.inst-steps b { color: var(--text); }
.inst-step-ic { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; background: var(--tile-2); color: var(--blue-hi); }
.inst-step-ic .ic { width: 22px; height: 22px; }
.inst-step-ic.inst-app { background: none; }
.inst-step-ic img { width: 40px; height: 40px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .inst-card { animation: none; transition: none; } }
.pzh-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin: 0.4rem 0.2rem 0.6rem; }
.pzh-sec-head strong { font: 800 1.125rem var(--font-main); }
.pzh-sec-head small { font: 700 0.75rem var(--font-main); color: var(--text-3); }
.pzh-friends:empty, .pzh-themes:empty { display: none; }
.pzh-friends, .pzh-themes { margin-bottom: 1rem; }
.pzh-ft { margin: 0; }
.pzh-ft-rush { display: inline-flex; align-items: center; gap: 2px; font: 800 0.8125rem var(--font-main); color: var(--orange); margin-right: 0.5rem; }
.pzh-ft-rush .ic { width: 14px; height: 14px; }
.pzh-theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.pzh-theme { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0.7rem 0.75rem 0.75rem; border: none; border-radius: 15px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer; animation: riseIn 0.35s var(--ease) calc(var(--i, 0) * 30ms) both; transition: transform 0.08s ease, box-shadow 0.08s ease; }
.pzh-theme:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.pzh-theme strong { font: 800 0.9375rem/1.2 var(--font-main); }
.pzh-theme small { font: 700 0.75rem var(--font-main); color: var(--text-3); }
.pzh-bar { width: 100%; height: 6px; margin-top: 0.35rem; border-radius: 3px; background: var(--bg-deep); overflow: hidden; }
.pzh-bar i { display: block; height: 100%; min-width: 3px; border-radius: 3px; background: var(--good); }
.pzt-chip .ic { color: var(--blue-hi); }
.pzt-chip b { font-size: 0.9375rem; }
@media (prefers-reduced-motion: reduce) { .pzh-theme { animation: none; } }

/* ── Hand replay ── */
.overlay.rp-screen { padding: 0; background: var(--bg); align-items: stretch; z-index: 120; animation: fadeIn 0.2s ease both; }
.overlay.rp-screen.closing { animation: fadeOut 0.2s ease both; }
.rp-card-wrap { max-width: 560px; width: 100%; height: 100%; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; animation: scrInF 0.34s var(--ease) both; }
.rp-top { display: flex; align-items: center; gap: 0.7rem; padding: calc(0.6rem + var(--safe-top)) 1rem 0.5rem; }
.rp-title { flex: 1; min-width: 0; }
.rp-title small { display: block; font: 800 0.75rem var(--font-main); color: var(--blue-hi); }
.rp-title strong { display: block; font: 800 1.0625rem var(--font-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-net { font: 800 0.9375rem var(--font-main); padding: 0.3rem 0.65rem; border-radius: 999px; background: var(--tile); font-variant-numeric: tabular-nums; }
.rp-net.up { color: var(--good); }
.rp-net.down { color: var(--bad-text); }
.rp-table { margin: 0.2rem 1rem 0.6rem; padding: 0.8rem 0.6rem 0.9rem; border-radius: 22px; background: radial-gradient(120% 90% at 50% 40%, #2F2C29 0%, #242220 75%); box-shadow: inset 0 3px 0 rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 0.7rem; touch-action: pan-y; }
.rp-others { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 0.85rem 0.45rem; padding-bottom: 0.3rem; }
.rp-others.n1 { grid-template-columns: minmax(0, 220px); justify-content: center; }
.rp-seat { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 0.3rem 0.45rem; padding: 0.45rem 0.5rem 0.5rem; border-radius: 14px; background: rgba(0,0,0,0.22); transition: opacity 0.25s ease, box-shadow 0.25s ease, transform 0.25s var(--spring); }
.rp-seat.active { box-shadow: 0 0 0 2px var(--blue-hi); transform: translateY(-1px); }
.rp-seat.won { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(245,184,61,0.35); }
.rp-seat.folded { opacity: 0.4; }
.rp-face { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: block; background: var(--tile-2); }
.rp-face svg, .rp-face .face { width: 100%; height: 100%; display: block; }
.rp-info { min-width: 0; }
.rp-name { display: block; font: 800 0.8125rem var(--font-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-stack { display: block; font: 700 0.75rem var(--font-main); color: var(--text-3); font-variant-numeric: tabular-nums; }
.rp-cards { grid-column: 1 / -1; display: flex; gap: 3px; min-height: 0; }
.rp-cards:empty { display: none; }
.rp-cards .rp-card { --w: 30px; width: 30px; }
.rp-cards img.rp-back { width: 30px; height: 42px; border-radius: 4px; display: block; }
.rp-cards.flip-in .rp-card { animation: popIn 0.4s var(--spring) both; }
.rp-bet { position: absolute; right: 8px; bottom: -11px; z-index: 1; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 3px; border-radius: 999px; background: rgba(0,0,0,0.45); font: 800 0.75rem var(--font-main); color: #fff; opacity: 0; transform: scale(0.6); transition: opacity 0.2s ease, transform 0.25s var(--spring); pointer-events: none; }
.rp-bet.on { opacity: 1; transform: none; }
.rp-bet i.chip { width: 15px; height: 16px; }
.rp-act { position: absolute; left: 8px; bottom: -9px; z-index: 1; transform: translateY(4px); padding: 1px 8px; border-radius: 7px; font: 800 0.6875rem var(--font-main); color: #fff; background: var(--tile-2); opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease; white-space: nowrap; }
.rp-act.on { opacity: 1; transform: none; }
.rp-act.fold { background: #5E5A55; }
.rp-act.check, .rp-act.call { background: #F2EFE9; color: #25231F; }
.rp-act.bet, .rp-act.raise { background: var(--blue); }
.rp-mid { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.rp-board { display: flex; justify-content: center; gap: 5px; }
.rp-slot { width: min(14vw, 52px); aspect-ratio: 1 / 1.4; border-radius: 12% / 8.57%; background: rgba(0,0,0,0.2); box-shadow: inset 0 3px 0 rgba(0,0,0,0.25); }
.rp-slot.filled { background: none; box-shadow: none; }
.rp-slot .pc { --w: 100%; width: 100%; height: 100%; }
.rp-pot { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 6px; border-radius: 999px; background: rgba(0,0,0,0.3); font: 700 0.8125rem var(--font-main); color: var(--text-3); transition: opacity 0.2s ease; }
.rp-pot.empty { opacity: 0.35; }
.rp-pot i.chip { width: 18px; height: 19px; }
.rp-pot b { font: 800 0.9375rem var(--font-main); color: #fff; font-variant-numeric: tabular-nums; }
.rp-seat.hero { grid-template-columns: auto 1fr auto; width: min(100%, 300px); margin: 0.4rem auto 0; background: rgba(var(--blue-rgb),0.12); }
.rp-seat.hero .rp-cards { grid-column: 3; grid-row: 1 / span 2; }
.rp-seat.hero .rp-cards .rp-card { --w: 44px; width: 44px; }
.rp-seat.hero .rp-bet { bottom: auto; top: -12px; right: auto; left: 12px; }
.rp-caption { margin: 0 1rem; padding: 0.55rem 0.8rem; border-radius: 14px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); }
.rp-caption small { display: block; font: 800 0.6875rem var(--font-main); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.rp-caption strong { display: block; font: 800 1rem/1.3 var(--font-main); }
.rp-caption.pop { animation: rpPop 0.3s var(--ease) both; }
@keyframes rpPop { from { opacity: 0.4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.rp-note { margin: 0.55rem 1rem 0; padding: 0; max-height: 0; overflow: hidden; border-radius: 14px; background: var(--tile); transition: max-height 0.3s var(--ease), padding 0.3s var(--ease); }
.rp-note.on { max-height: 40vh; overflow-y: auto; padding: 0.7rem 0.85rem 0.8rem; box-shadow: inset 4px 0 0 var(--g, var(--blue)); }
.rp-note-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; }
.rp-note-head .grade-icon { width: 30px; height: 30px; min-width: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--g); }
.rp-note-head .grade-icon .ic { width: 17px; height: 17px; }
.rp-note-head small { display: block; font: 800 0.75rem var(--font-main); color: var(--g); }
.rp-note-head strong { display: block; font: 800 0.9375rem var(--font-main); }
.rp-note p { font: 500 0.875rem/1.45 var(--font-main); color: var(--text-2); margin: 0.2rem 0 0; }
.rp-note .rp-top { color: var(--text); }
.rp-controls { margin-top: auto; padding: 0.7rem 1rem calc(0.8rem + var(--safe-bottom)); }
.rp-line { position: relative; height: 8px; border-radius: 4px; background: var(--bg-deep); margin: 0.3rem 0.4rem 0.9rem; }
.rp-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--blue); transition: width 0.25s var(--ease); }
.rp-mark { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; padding: 0; border: 2px solid var(--bg); border-radius: 50%; background: var(--g); cursor: pointer; }
.rp-buttons { display: flex; justify-content: center; align-items: center; gap: 0.6rem; }
.rp-btn { width: 48px; height: 48px; border: none; border-radius: 14px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); display: grid; place-items: center; grid-auto-flow: column; cursor: pointer; transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s ease; }
.rp-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.rp-btn:disabled { opacity: 0.35; cursor: default; }
.rp-btn .ic { width: 20px; height: 20px; }
.rp-btn.rp-first .ic, .rp-btn.rp-last .ic { width: 15px; height: 15px; margin: 0 -4px; }
.rp-btn.big { width: 64px; height: 56px; background: var(--blue); box-shadow: 0 4px 0 var(--blue-lip); color: #fff; }
.rp-btn.big .ic { width: 24px; height: 24px; }

/* Session review: hands to replay */
.gr-hands { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 0.5rem; }
.gr-hand { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.55rem 0.75rem; border: none; border-radius: 14px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer; transition: transform 0.08s ease, box-shadow 0.08s ease; }
.gr-hand:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.gr-hand-cards { display: flex; gap: 2px; flex-shrink: 0; }
.gr-hand-cards .gr-mini-card { --w: 28px; width: 28px; }
.gr-hand-info { flex: 1; min-width: 0; }
.gr-hand-info strong { display: block; font: 800 0.9375rem var(--font-main); }
.gr-hand-info small { display: block; font: 700 0.75rem var(--font-main); color: var(--text-3); }
.gr-hand-net { font: 800 0.9375rem var(--font-main); font-variant-numeric: tabular-nums; }
.gr-hand-net.up { color: var(--good); }
.gr-hand-net.down { color: var(--bad-text); }
.rv-replay { margin-bottom: 0.8rem; }
.rv-replay .ic { width: 18px; height: 18px; margin-right: 0.35rem; }
@media (prefers-reduced-motion: reduce) { .rp-card-wrap, .rp-caption.pop, .rp-cards.flip-in .rp-card { animation: none !important; } .rp-seat, .rp-bet, .rp-act, .rp-note, .rp-fill { transition: none; } }

/* ── Friend challenges ── */
.invite-banners:empty { display: none; }
.ch-banner { position: relative; }
.ch-banner .invite-banner-icon { position: relative; overflow: visible; }
.ch-banner .invite-banner-icon .face { border-radius: 50%; overflow: hidden; }
.ch-badge { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); box-shadow: 0 0 0 2px var(--tile); color: #fff; }
.ch-badge .ic { width: 13px; height: 13px; }
.ch-banner.result .ch-badge { background: var(--bad); }
.ch-banner.result.won .ch-badge { background: var(--gold); color: #3A2A08; }
.ch-banner .invite-banner-actions { align-items: center; }
.ch-banner .ch-go { white-space: nowrap; }
.ch-outcome { display: flex; align-items: center; gap: 0.7rem; width: 100%; margin: 0 0 1rem; padding: 0.7rem 0.85rem; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); text-align: left; animation: popIn 0.45s var(--spring) both; }
.ch-outcome-ic { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; background: var(--tile-2); color: var(--text-2); }
.ch-outcome-ic .ic { width: 22px; height: 22px; }
.ch-outcome.win { background: linear-gradient(135deg, rgba(245,184,61,0.22), rgba(245,184,61,0.06)), var(--tile); }
.ch-outcome.win .ch-outcome-ic { background: var(--gold); color: #3A2A08; }
.ch-outcome.loss .ch-outcome-ic { color: var(--bad-text); }
.ch-outcome strong { display: block; font: 800 1rem var(--font-main); }
.ch-outcome small { display: block; font: 600 0.8125rem var(--font-main); color: var(--text-2); }
.ch-slot:empty { display: none; }
.ch-pick { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.2rem 0 1rem; max-height: 46vh; overflow-y: auto; text-align: left; }
.ch-friend { display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.5rem 0.6rem; border: none; border-radius: 14px; background: var(--tile-2); color: var(--text); font-family: var(--font-main); cursor: pointer; transition: background 0.2s ease, transform 0.08s ease; }
.ch-friend:active { transform: scale(0.98); }
.ch-face { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.ch-face .face { width: 100%; height: 100%; display: block; }
.ch-name { flex: 1; min-width: 0; text-align: left; font: 800 0.9375rem var(--font-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-send { font: 800 0.8125rem var(--font-main); color: #fff; background: var(--orange); padding: 0.35rem 0.7rem; border-radius: 10px; }
.ch-friend.sent { background: rgba(var(--good-rgb),0.16); }
.ch-friend.sent .ch-send { background: var(--good); }
.ch-friend:disabled { cursor: default; }
#btn-rush-challenge .ic, #dc-challenge-btn .ic { width: 18px; height: 18px; margin-right: 0.35rem; color: var(--orange); }
@media (prefers-reduced-motion: reduce) { .ch-outcome { animation: none; } }

/* ── What's new ── */
.wn-dialog .dialog-card { max-width: 400px; }
.wn-list { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.2rem 0 1rem; text-align: left; }
.wn-item { display: flex; align-items: center; gap: 0.7rem; width: 100%; padding: 0.6rem 0.65rem; border: none; border-radius: 14px; background: var(--tile-2); color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer; animation: riseIn 0.35s var(--ease) calc(var(--i, 0) * 70ms + 120ms) both; transition: transform 0.08s ease; }
.wn-item:active { transform: scale(0.98); }
.wn-text { flex: 1; min-width: 0; }
.wn-text strong { display: block; font: 800 0.9375rem var(--font-main); }
.wn-text small { display: block; font: 600 0.8125rem/1.35 var(--font-main); color: var(--text-2); margin-top: 1px; }
@media (prefers-reduced-motion: reduce) { .wn-item { animation: none; } }

/* ── Monthly challenge ── */
.mo-card { display: flex; align-items: center; gap: 0.75rem; width: 100%; margin-top: 0.7rem; padding: 0.7rem 0.85rem; border: none; border-radius: 18px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.mo-card:empty { display: none; }
.mo-card:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.mo-badge { width: 48px; height: 51px; flex-shrink: 0; }
.mo-badge .medal { width: 100%; height: 100%; }
.mo-badge.locked .medal { filter: grayscale(0.85) brightness(0.75); opacity: 0.8; }
.mo-card.done .mo-badge .medal { animation: popIn 0.5s var(--spring) both; }
.mo-info { flex: 1; min-width: 0; }
.mo-info small { display: block; font: 800 0.75rem var(--font-main); color: var(--gold); text-transform: uppercase; letter-spacing: 0.04em; }
.mo-info strong { display: block; font: 800 0.9375rem/1.25 var(--font-main); margin: 1px 0 0.35rem; }
.mo-bar { display: block; height: 8px; border-radius: 4px; background: var(--bg-deep); overflow: hidden; }
.mo-bar i { display: block; height: 100%; min-width: 4px; border-radius: 4px; background: var(--gold); transition: width 0.6s var(--ease); }
.mo-bar.big { height: 12px; border-radius: 6px; margin: 0.6rem 0 0.35rem; }
.mo-count { flex-shrink: 0; text-align: right; }
.mo-count b { display: block; font: 800 0.9375rem var(--font-main); font-variant-numeric: tabular-nums; }
.mo-count small { display: block; font: 700 0.6875rem var(--font-main); color: var(--text-3); }
.mo-card.done .mo-count b { color: var(--good); }
.mo-sheet { text-align: center; margin-bottom: 1rem; }
.mo-sheet-badge { width: 96px; height: 102px; margin: 0 auto 0.4rem; }
.mo-sheet-badge .medal { width: 100%; height: 100%; }
.mo-sheet-badge.locked .medal { filter: grayscale(0.85) brightness(0.75); opacity: 0.8; }
.mo-sheet-text { font: 600 0.9375rem/1.45 var(--font-main); color: var(--text-2); margin: 0; }
.mo-sheet-count { font: 700 0.8125rem var(--font-main); color: var(--text-3); margin: 0; }
.mo-h { font: 800 1rem var(--font-main); margin: 1rem 0 0.5rem; text-align: left; }
.mo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.mo-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0.4rem 0.2rem; border-radius: 12px; background: var(--tile-2); }
.mo-cell .medal { width: 40px; height: 43px; }
.mo-cell small { font: 700 0.6875rem var(--font-main); color: var(--text-2); }
.mo-empty { font: 600 0.875rem var(--font-main); color: var(--text-3); margin: 0; text-align: left; }
.me-cab-art.dim .medal { filter: grayscale(0.85) brightness(0.75); opacity: 0.7; }
.cel-mo-art { width: 150px; height: 160px; margin: 0.3rem auto 0.6rem; animation: celPop 0.8s var(--spring) 0.15s both; }
.cel-mo-art .medal { width: 100%; height: 100%; filter: drop-shadow(0 12px 22px rgba(0,0,0,0.45)); }
@media (prefers-reduced-motion: reduce) { .mo-card.done .mo-badge .medal, .cel-mo-art { animation: none; } .mo-bar i { transition: none; } }
/* Pinch-zoom stays available (accessibility); double-tap zoom doesn't get in the way of fast taps */
html { touch-action: manipulation; }
.pz-scroll:focus { outline: none; }
.pz-scroll:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: -2px; }

/* ── Your face (avatar-maker.js) ─────────────────── */
.profile-avatar-sm.has-face { padding: 0; background: var(--tile-2); }
.profile-avatar-sm.has-face .face { width: 100%; height: 100%; display: block; }
button.me-avatar { position: relative; border: none; padding: 0; cursor: pointer; display: block; color: inherit; font: inherit; transition: transform 0.12s ease; }
button.me-avatar:active { transform: scale(0.96); }
.me-avatar .face { display: block; }
.me-avatar-edit {
    position: absolute; right: 5px; bottom: 5px; width: 26px; height: 26px; border-radius: 50%;
    background: var(--tile); box-shadow: 0 2px 0 var(--lip); display: grid; place-items: center; color: var(--text);
}
.me-avatar-edit .ic { width: 15px; height: 15px; }
.overlay.av-screen { padding: 0; background: var(--bg); align-items: stretch; z-index: 120; animation: fadeIn 0.2s ease both; }
.overlay.av-screen.closing { animation: fadeOut 0.2s ease both; pointer-events: none; }
.av-card { max-width: 560px; width: 100%; height: 100%; margin: 0 auto; display: flex; flex-direction: column; animation: scrInU 0.32s var(--ease) both; }
.av-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: calc(0.6rem + var(--safe-top)) 1rem 0.2rem; }
.av-top strong { font: 800 1.125rem var(--font-main); }
.av-preview { width: 148px; height: 148px; margin: 0.4rem auto 0.9rem; border-radius: 50%; box-shadow: 0 6px 0 var(--lip), 0 0 0 5px var(--tile); flex-shrink: 0; }
.av-preview .face { width: 100%; height: 100%; display: block; border-radius: 50%; }
.av-preview.pop { animation: avPop 0.38s var(--spring) both; }
@keyframes avPop { 0% { transform: scale(0.9); } 60% { transform: scale(1.05); } 100% { transform: none; } }
.av-tabs { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.2rem 1rem 0.6rem; scrollbar-width: none; flex-shrink: 0; }
.av-tabs::-webkit-scrollbar { display: none; }
.av-tab {
    flex-shrink: 0; border: none; border-radius: 999px; padding: 0.5rem 0.95rem; background: var(--tile); color: var(--text-2);
    font: 800 0.875rem var(--font-main); box-shadow: 0 3px 0 var(--lip); cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease;
}
.av-tab.on { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-lip); }
.av-options { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; padding: 0.3rem 1rem 1rem; align-content: start; }
.av-opt {
    position: relative; aspect-ratio: 1; border: none; padding: 0; border-radius: 18px; overflow: hidden; cursor: pointer;
    background: var(--tile); box-shadow: 0 3px 0 var(--lip); transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.av-options.fresh .av-opt { animation: riseIn 0.3s var(--ease) both; animation-delay: calc(var(--i) * 22ms); }
.av-opt .face { width: 100%; height: 100%; display: block; }
.av-opt:active { transform: scale(0.95); }
.av-opt { overflow: visible; }
.av-opt .face { border-radius: 18px; }
.av-opt.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #fff; }
.av-opt.on::after {
    content: ''; position: absolute; right: -7px; top: -7px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
    box-shadow: 0 0 0 3px var(--bg); animation: popIn 0.3s var(--spring) both;
}
.av-opt.locked .face { filter: grayscale(0.9) brightness(0.55); }
.av-lock { position: absolute; inset: 0; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; text-align: center; padding: 4px; }
.av-lock .ic { width: 20px; height: 20px; }
.av-lock small { font: 800 0.625rem/1.15 var(--font-main); text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.av-foot { padding: 0.6rem 1rem calc(0.8rem + var(--safe-bottom)); flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) { .av-card, .av-options.fresh .av-opt, .av-preview.pop { animation: none; } }
.me-face-btn { margin-top: 0.5rem; }
.me-face-btn.hidden { display: none; }
/* Learn this: the lesson behind a missed puzzle */
.pzr-learn {
    display: flex; align-items: center; gap: 0.7rem; width: 100%; margin-top: 0.6rem; padding: 0.65rem 0.8rem; border: none; border-radius: 14px;
    background: var(--tile-2); box-shadow: 0 3px 0 var(--lip); color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.pzr-learn > .ic:first-child { width: 26px; height: 26px; color: var(--purple, #8B6CFF); flex-shrink: 0; }
.pzr-learn span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pzr-learn small { font: 800 0.6875rem var(--font-main); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.pzr-learn b { font: 800 0.9375rem var(--font-main); }
.pzr-learn > .ic:last-child { width: 18px; height: 18px; color: var(--text-3); }
.pzr-learn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
#ls-cta .ls-practise { margin-bottom: 0.6rem; }
#ls-cta .ls-practise .ic { width: 20px; height: 20px; margin-right: 0.4rem; vertical-align: -4px; }
/* How close you are to an achievement */
.me-medal { position: relative; }
.me-medal-bar { display: block; width: 46px; height: 5px; border-radius: 3px; background: var(--bg-deep); overflow: hidden; margin-top: -1px; }
.me-medal-bar b { display: block; height: 100%; border-radius: 3px; background: var(--gold); }
.me-near { margin: 0 0 1.3rem; }
.me-near h4 { margin: 0.2rem 0.25rem 0.6rem; font: 800 0.875rem var(--font-main); color: var(--text-2); }
.me-near-row {
    display: flex; align-items: center; gap: 0.75rem; width: 100%; margin-bottom: 0.5rem; padding: 0.6rem 0.8rem; border: none; border-radius: 16px;
    background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.me-near-row:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.medal.me-near-medal { width: 40px; height: 43px; flex-shrink: 0; }
.me-near-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.me-near-text strong { font: 800 0.9375rem var(--font-main); }
.me-near-text small { font: 600 0.75rem/1.3 var(--font-main); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-near-bar { display: block; height: 8px; border-radius: 4px; background: var(--bg-deep); overflow: hidden; margin-top: 0.35rem; }
.me-near-bar i { display: block; height: 100%; min-width: 6px; border-radius: 4px; background: var(--gold); animation: barGrow 0.9s var(--ease) 0.15s both; transform-origin: left; }
.me-near-count { flex-shrink: 0; font: 800 1rem var(--font-main); font-variant-numeric: tabular-nums; }
.me-near-count small { font-weight: 700; font-size: 0.75rem; color: var(--text-3); }
.ach-progress { margin: -0.3rem 0 1rem; }
.ach-progress small { display: block; margin-top: 0.4rem; font: 700 0.8125rem var(--font-main); color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { .me-near-bar i { animation: none; } }
/* Win a streak back */
.today-repair-bar { display: block; height: 8px; border-radius: 4px; background: var(--bg-deep); overflow: hidden; margin-top: 0.45rem; }
.today-repair-bar i { display: block; height: 100%; min-width: 6px; border-radius: 4px; background: #FF8A2A; transition: width 0.6s var(--ease); }
.today-card.repair { box-shadow: 0 3px 0 var(--lip), inset 0 0 0 2px rgba(255,138,42,0.55); }

/* ── Home in tabs ───────────────────────────────── */
.home-tab { max-width: 560px; margin: 0 auto; }
.home-tab.hidden { display: none; }
.home-tab.from-right { animation: tabInR 0.32s var(--ease) both; }
.home-tab.from-left { animation: tabInL 0.32s var(--ease) both; }
@keyframes tabInR { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes tabInL { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.home-tab.now > * { animation: riseIn 0.42s var(--ease) both; }
.home-tab.now > *:nth-child(2) { animation-delay: 0.04s; }
.home-tab.now > *:nth-child(3) { animation-delay: 0.08s; }
.home-tab.now > *:nth-child(4) { animation-delay: 0.12s; }
.home-tab.now > *:nth-child(n+5) { animation-delay: 0.16s; }
.home-tab-title { font: 800 1.25rem var(--font-main); margin: 0.35rem 0.1rem 0.75rem; }
.home-tab-title ~ .home-tab-title { margin-top: 1.4rem; }
.home-tab .home-duo { margin-bottom: 0.75rem; }
#tab-play .home-duo { grid-template-rows: auto auto; }
.wide-card { margin-bottom: 0.75rem; min-height: 76px; }
.daily-tiles { margin-bottom: 0.25rem; }
.duo-card.cpu .duo-art { background: rgba(var(--blue-rgb),0.16); }
.duo-card.cpu .duo-face .face { width: 100%; height: 100%; }
.duo-card.online .duo-art { background: rgba(var(--blue-rgb),0.12); }
.lessons-card { margin-bottom: 0.75rem; }
#tab-learn .tile-pair { margin-bottom: 0.25rem; }
.drill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.drill {
    display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 0.6rem; align-items: center;
    padding: 0.65rem 0.75rem; border: none; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip);
    color: var(--text); text-align: left; cursor: pointer; font-family: var(--font-main); transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.drill:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.drill .spot { grid-row: 1 / span 2; width: 40px; height: 40px; }
.drill strong { font: 800 0.875rem/1.2 var(--font-main); }
.drill small { font: 600 0.75rem/1.25 var(--font-main); color: var(--text-2); }

/* The bar */
.home-tabs {
    flex-shrink: 0; display: flex; justify-content: center; gap: 0.25rem;
    padding: 0.35rem 0.5rem calc(0.4rem + var(--safe-bottom)); background: var(--bg-deep);
    box-shadow: 0 -1px 0 rgba(255,255,255,0.04), 0 -8px 24px rgba(0,0,0,0.25); position: relative; z-index: 2;
}
.home-tabbtn {
    position: relative; flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 0.4rem 0.2rem 0.3rem; border: none; border-radius: 14px; background: none; color: var(--text-3); cursor: pointer;
    font: 800 0.6875rem var(--font-main); transition: color 0.15s ease, background-color 0.15s ease;
}
.home-tabbtn .ic { width: 26px; height: 26px; transition: transform 0.25s var(--spring); }
.home-tabbtn.on { color: var(--text); background: var(--tile); }
.home-tabbtn.on .ic { color: var(--blue-hi); }
.home-tabbtn .ic.pop { animation: tabPop 0.4s var(--spring) both; }
@keyframes tabPop { 0% { transform: scale(0.8); } 60% { transform: scale(1.15); } 100% { transform: none; } }
.home-tabbtn:active .ic { transform: scale(0.9); }
.tab-badge {
    position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--bad); color: #fff; font: 800 0.6875rem/18px var(--font-main); font-style: normal; text-align: center;
    box-shadow: 0 0 0 2px var(--bg-deep);
}
.tab-badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 6px; left: calc(50% + 8px); background: #FF8A2A; }
.tab-badge.hidden { display: none; }
.home-body { padding-bottom: 1.2rem; }
@media (prefers-reduced-motion: reduce) { .home-tab.from-right, .home-tab.from-left, .home-tab.now > * { animation: none; } }
/* Home tab: a compact Play card (the Play tab has the rest) */
#tab-home .play-hero { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 0.75rem; padding: 0.85rem 0.95rem 0.95rem; margin-bottom: 0.9rem; }
#tab-home .play-hero-faces { grid-column: 1 / -1; height: 50px; margin-bottom: 0.55rem; }
#tab-home .play-hero-faces .face { width: 42px; height: 42px; }
#tab-home .play-hero-faces .face:nth-child(2), #tab-home .play-hero-faces .face:nth-child(4) { width: 45px; height: 45px; }
#tab-home .play-hero-faces .face:nth-child(3) { width: 48px; height: 48px; }
#tab-home .play-hero-faces .face:nth-child(6) { width: 40px; height: 40px; }
#tab-home .play-hero h2 { font-size: 1.3125rem; margin: 0; }
#tab-home .play-hero p { grid-column: 1; margin: 0.1rem 0 0; font-size: 0.8125rem; }
#tab-home .play-hero .btn { grid-column: 2; grid-row: 2 / span 2; width: auto; min-width: 104px; padding: 0.8rem 1.4rem; font-size: 1.0625rem; }
#tab-home .today-card { margin-bottom: 1.1rem; }
#tab-home .ms-row { padding: 0.4rem 0.5rem; gap: 0.6rem; }
#tab-home .ms-ic { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 2px 0 var(--lip); }
#tab-home .ms-ic .ic { width: 19px; height: 19px; }
#tab-home .ms-info strong { font-size: 0.875rem; line-height: 1.25; }
#tab-home .ms-track { margin-top: 0.25rem; }
#tab-home .ms-bar { height: 6px; }
#tab-home .ms-xp { font-size: 0.75rem; padding: 0.2rem 0.45rem; }
#tab-home .ms-foot { padding: 0.45rem 0.6rem; font-size: 0.75rem; }
#tab-home .home-section-head { margin-bottom: 0.45rem; }
#tab-home .home-section-title { font-size: 1.1875rem; }
@media (max-width: 999px) {
    #tab-home .play-hero-faces { height: 40px; margin-bottom: 0.4rem; }
    #tab-home .play-hero-faces .face, #tab-home .play-hero-faces .face:nth-child(n) { width: 36px; height: 36px; }
    #tab-home .play-hero-faces .face:nth-child(3) { width: 40px; height: 40px; }
    #tab-home .today-top { padding-bottom: 0.6rem; }
}
#tab-home .home-section { margin-bottom: 1.1rem; }
/* The Daily Challenge's bonus hand (the Hand of the Day) */
.dc-bonus {
    display: flex; align-items: center; gap: 0.8rem; width: 100%; margin: 0.4rem 0 1rem; padding: 0.75rem 0.85rem; border: none; border-radius: 18px;
    background: var(--tile-2); box-shadow: 0 3px 0 var(--lip), inset 0 0 0 2px rgba(var(--blue-rgb),0.5); color: var(--text); text-align: left; cursor: pointer; font-family: var(--font-main);
}
.dc-bonus:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.dc-bonus.done { box-shadow: 0 3px 0 var(--lip); }
.dc-bonus-art .spot { width: 46px; height: 46px; }
.dc-bonus-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dc-bonus-text small { font: 800 0.6875rem var(--font-main); color: var(--blue-hi); text-transform: uppercase; letter-spacing: 0.04em; }
.dc-bonus-text strong { font: 800 1rem var(--font-main); }
.dc-bonus-text em { font: 600 0.8125rem var(--font-main); font-style: normal; color: var(--text-2); }

/* ── Poker Squares: swap the cards ──────────────── */
.sq-cell.filled { cursor: grab; touch-action: none; background: none; box-shadow: none; transition: transform 0.15s var(--spring); }
.sq-cell.filled .pc { transition: box-shadow 0.15s ease, transform 0.15s ease; }
.sq-cell.sel .pc { transform: translateY(-4px) scale(1.05); box-shadow: 0 0 0 3px var(--blue-hi), 0 8px 16px rgba(0,0,0,0.45); }
.sq-cell.lifted .pc { opacity: 0.25; }
.sq-cell.drop .pc { box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(0,0,0,0.4); transform: scale(0.96); }
.sq-cell.hint .pc { animation: sqHint 1.4s ease 2; }
@keyframes sqHint { 0%, 100% { box-shadow: 0 2px 0 #CFC8BC; } 40% { box-shadow: 0 0 0 3px var(--good), 0 0 18px rgba(129,182,76,0.7); transform: translateY(-3px); } }
.pc.sq-ghost { box-shadow: 0 16px 30px rgba(0,0,0,0.55); transition: none; }
.sq-grid.over .sq-cell.filled { cursor: default; }
.sq-line { position: relative; }
.sq-line.up { animation: sqUp 0.5s var(--spring) both; }
.sq-line.up strong { color: var(--good); }
.sq-line.down { animation: shake 0.35s ease both; }
@keyframes sqUp { 0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: none; } }
.sq-line em { position: absolute; top: -4px; right: 2px; font: 800 0.625rem var(--font-main); font-style: normal; color: var(--good); animation: sqPlus 1.1s ease both; pointer-events: none; }
@keyframes sqPlus { from { opacity: 1; transform: translateY(4px); } to { opacity: 0; transform: translateY(-12px); } }
.sq-meta { align-items: center; }
.sq-meta > span { display: inline-flex; align-items: center; gap: 0.35rem; }
/* How close to the best grid: a bar to 100% (par marked on today's deal) */
.sq-goal { margin: 0 0.2rem 0.6rem; }
.sq-goal-bar { position: relative; height: 10px; border-radius: 999px; background: var(--bg-deep); box-shadow: inset 0 1px 0 rgba(0,0,0,0.35); }
.sq-goal-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--blue-hi)); transition: width 0.45s var(--ease); }
.sq-goal-par { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); box-shadow: 0 0 0 2px var(--bg); }
.sq-goal > span { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.35rem; font: 700 0.8125rem var(--font-main); color: var(--text-2); }
.sq-goal > span strong { color: var(--text); font-weight: 800; }
.sq-goal > span .ic { width: 15px; height: 15px; color: var(--gold); }
.sq-goal.finding .sq-goal-bar { background: linear-gradient(90deg, var(--bg-deep) 30%, var(--tile-2) 50%, var(--bg-deep) 70%); background-size: 200% 100%; animation: sqFinding 1.2s linear infinite; }
@keyframes sqFinding { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sq-goal.perfect .sq-goal-bar i { background: linear-gradient(90deg, var(--gold), #FFD66B); }
.sq-final { flex-wrap: wrap; }
.sq-final > div:first-child { flex: 1 1 100%; }
.sq-final-btns { flex-direction: row; width: 100%; }
.sq-final-btns .btn { flex: 1; min-width: 0; white-space: nowrap; font-size: 0.875rem; padding: 0.6rem 0.4rem; }
.sq-away { color: var(--gold); font-weight: 800; }
.sq-goal.replay .sq-goal-bar i { background: linear-gradient(90deg, var(--gold), #FFD66B); }
.sq-showing { text-align: center; font: 800 0.75rem var(--font-main); letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.4rem; }
.sq-grid.best .sq-cell .pc { box-shadow: 0 0 0 2px rgba(245,184,61,0.55); }
.sq-par .ic { width: 15px; height: 15px; color: var(--gold); }
.sq-par.beat { color: var(--gold); }
.sq-par.beat strong { color: var(--gold); }
.sq-actions { background: var(--tile); border-radius: 18px; padding: 0.7rem 0.8rem; box-shadow: 0 3px 0 var(--lip); }
.sq-howto { margin: 0 0 0.55rem; font: 700 0.875rem var(--font-main); color: var(--text-2); text-align: center; }
.sq-btns { display: flex; gap: 0.5rem; }
.sq-btns .btn { flex: 1; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.7rem 0.9rem; }
.sq-btns .btn .ic { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .sq-line.up, .sq-line.down, .sq-cell.hint .pc, .sq-line em { animation: none; } }
/* The rim under a face you made: a darker shade of its background */
.profile-avatar-sm.has-face { background: var(--face-bg, var(--tile-2)); box-shadow: 0 3px 0 var(--face-lip, var(--blue-lip)); }
.me-avatar { background: var(--face-bg, var(--blue)); box-shadow: 0 4px 0 var(--face-lip, var(--blue-lip)); }
.av-preview { box-shadow: 0 6px 0 var(--face-lip, var(--lip)); }
.av-opt:not(.locked) { box-shadow: 0 3px 0 var(--face-lip, var(--lip)); }
.av-opt.on { box-shadow: 0 3px 0 var(--face-lip, var(--lip)), 0 0 0 3px var(--bg), 0 0 0 6px #fff; }

/* ── A phone on its side: turn it upright ───────── */
.rotate-note { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (hover: none) and (pointer: coarse) {
    .rotate-note {
        display: flex; position: fixed; inset: 0; z-index: 9999; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
        background: var(--bg); color: var(--text); text-align: center; padding: 1rem;
    }
    .rotate-note strong { font: 800 1.25rem var(--font-main); }
    .rotate-note small { font: 600 0.875rem var(--font-main); color: var(--text-2); }
    .rotate-phone { width: 44px; height: 74px; border-radius: 10px; border: 4px solid var(--text); position: relative; margin-bottom: 0.6rem; animation: turnUp 1.8s var(--ease) infinite; }
    .rotate-phone span { position: absolute; left: 50%; bottom: 4px; width: 10px; height: 3px; margin-left: -5px; border-radius: 2px; background: var(--text); }
}
@keyframes turnUp { 0%, 20% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0); } }

/* ── Tablets and computers: a sidebar, wider grids, a bigger table ── */
@media (min-width: 1000px) {
    #home-screen { padding-left: 232px; }
    .home-tabs {
        position: absolute; left: 0; top: 0; bottom: 0; width: 232px; flex-direction: column; justify-content: flex-start; gap: 0.3rem;
        padding: calc(80px + var(--safe-top)) 0.75rem 1rem; box-shadow: 1px 0 0 rgba(255,255,255,0.04);
    }
    .home-tabbtn { max-width: none; flex: none; flex-direction: row; gap: 0.8rem; padding: 0.75rem 0.9rem; font-size: 1rem; justify-content: flex-start; }
    .home-tabbtn .ic { width: 28px; height: 28px; }
    .tab-badge { position: static; margin-left: auto; }
    .tab-badge.dot { margin-left: auto; }
    .home-header { position: absolute; left: 0; top: 0; width: 232px; padding: calc(1rem + var(--safe-top)) 1rem 0.5rem 1.25rem; z-index: 3; }
    .home-header .home-header-actions { position: fixed; top: calc(0.9rem + var(--safe-top)); right: 1.5rem; }
    .home-body { padding: calc(1.2rem + var(--safe-top)) 2rem 2rem; }
    .home-tab { max-width: 980px; }
    .home-tab-title { font-size: 1.5rem; margin-right: 12rem; }
    /* Home: two columns */
    #tab-home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 1.25rem; align-items: start;
        grid-template-areas: "inv inv" "chl chl" "hero miss" "today miss" "inst miss" "league miss"; }
    #invite-banners { grid-area: inv; } #challenge-banners { grid-area: chl; }
    #tab-home .play-hero { grid-area: hero; max-width: none; margin-right: 0; margin-left: 0; }
    #tab-home .today-card { grid-area: today; max-width: none; width: auto; margin-left: 0; margin-right: 0; }
    #tab-home #install-card { grid-area: inst; }
    #tab-home #missions-section { grid-area: miss; max-width: none; margin: 0; }
    #tab-home #card-league { grid-area: league; max-width: none; }
    #tab-home .play-hero { margin-top: 3.2rem; }
    #tab-home #missions-section { margin-top: 3.2rem; }
    /* Play, Puzzles, Learn: more tiles to a row */
    .home-tab .home-duo { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; }
    #tab-drills .home-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .daily-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .daily-tiles > .game-card:nth-child(3):last-child { grid-column: auto; flex-direction: column; align-items: flex-start; }
    .drill-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .drill { grid-template-columns: 1fr; justify-items: start; row-gap: 0.3rem; padding: 0.9rem; }
    .drill .spot { grid-row: auto; width: 52px; height: 52px; }
}
/* The table: wider, with bigger cards, on a landscape tablet or a computer */
@media (min-width: 900px) and (min-height: 600px) {
    .tv { max-width: min(1180px, 165vh); }
    .tv-slot { --fw: clamp(64px, 11vh, 108px); }
    .tv-board { gap: 10px; }
    .tv-hero-cards { --fw: clamp(88px, 14vh, 128px); }
    .tv-avatar { width: 68px; height: 68px; }
    .tv-pod { width: 120px; }
    .tv-name, .tv-stack { font-size: 0.9375rem; }
}

/* Your position in the coach's hints and feedback */
.pos-line { display: flex; align-items: center; gap: 0.5rem; margin: 0.45rem 0; font: 600 0.8125rem/1.35 var(--font-main); color: var(--text-2); }
.pos-line b { flex: none; min-width: 34px; padding: 0.15rem 0.4rem; border-radius: 7px; background: rgba(0,0,0,0.45); color: #fff; font: 800 0.6875rem var(--font-main); letter-spacing: 0.04em; text-align: center; box-shadow: 0 0 0 1px rgba(255,255,255,0.15); }

/* ── Learn tab: your coach and the lessons ── */
.coach-card { position: relative; display: flex; align-items: center; gap: 0.85rem; width: 100%; margin: 0 0 1.3rem; padding: 0.85rem 0.9rem; border: none; border-radius: 20px;
    background: linear-gradient(135deg, rgba(var(--blue-rgb),0.26), rgba(var(--blue-rgb),0.08)), var(--tile); box-shadow: 0 3px 0 var(--lip), inset 0 0 0 2px rgba(var(--blue-rgb),0.35);
    color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer; transition: transform 0.12s ease; }
.coach-card:active { transform: translateY(2px); }
.coach-card-face { width: 62px; height: 62px; flex: none; border-radius: 50%; overflow: hidden; background: var(--bg-deep); box-shadow: 0 3px 0 var(--lip); }
.coach-card-face svg, .coach-card-face .face { width: 100%; height: 100%; display: block; }
.coach-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.coach-card-text strong { font: 800 1.1875rem/1.2 var(--font-main); }
.coach-card-text span { font: 600 0.8125rem/1.35 var(--font-main); color: var(--text-2); }
.coach-card .set-chev { flex: none; color: var(--text-3); }
.coach-card-badge { position: absolute; top: 8px; left: 58px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--bad); color: #fff; font: 800 0.6875rem/20px var(--font-main); text-align: center; font-style: normal; box-shadow: 0 0 0 2px var(--tile); }
.coach-card-badge.hidden { display: none; }

.ls-continue.tab { width: 100%; border: none; color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer; margin-bottom: 0.8rem; }
.ls-continue.tab .ls-continue-art .spot { width: 48px; height: 48px; }
.ls-continue.tab .ls-continue-text strong { font-size: 1.0625rem; }
.ls-level.tab { margin-bottom: 0.55rem; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); overflow: hidden; }
.ls-level.tab .ls-level-head { width: 100%; margin: 0; padding: 0.6rem 0.8rem; border: none; background: none; color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer; }
.ls-level.tab .ls-level-medal { width: 38px; height: 41px; }
.ls-level.tab .ls-level-title strong { font-size: 1rem; }
.ls-level.tab .ls-level-bar { height: 6px; margin-top: 0.3rem; }
.ls-level.tab .ls-level-count { align-self: center; margin: 0; }
.ls-level.tab .ls-path { padding: 0 0.6rem 0.7rem; }
.ls-level.tab .ls-path::before { left: 36px; }
.ls-level.tab.open { box-shadow: 0 3px 0 var(--lip), inset 0 0 0 2px color-mix(in srgb, var(--lc) 55%, transparent); }
.tab-lessons { margin-bottom: 1rem; }

/* ── Your coach (screen) ── */
.co-hello { display: flex; align-items: flex-start; gap: 0.75rem; margin: 0.2rem 0 1.2rem; }
.co-face { width: 64px; height: 64px; flex: none; border-radius: 50%; overflow: hidden; background: var(--tile); box-shadow: 0 3px 0 var(--lip); }
.co-face svg, .co-face .face { width: 100%; height: 100%; display: block; }
.co-bubble { position: relative; flex: 1; margin: 0.3rem 0 0; padding: 0.75rem 0.9rem; border-radius: 4px 16px 16px 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); font: 600 0.9375rem/1.45 var(--font-main); }
.co-h { font: 800 0.8125rem var(--font-main); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin: 1.1rem 0 0.55rem; }
.co-plan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.co-step { display: flex; gap: 0.75rem; padding: 0.85rem; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); animation: riseIn 0.42s var(--ease) calc(0.08s + var(--i) * 0.06s) both; }
.co-num { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font: 800 0.875rem var(--font-main); box-shadow: 0 2px 0 var(--blue-lip); }
.co-step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.co-step-text strong { font: 800 1rem/1.25 var(--font-main); }
.co-step-text small { font: 600 0.8125rem/1.4 var(--font-main); color: var(--text-2); }
.co-step-btns { display: flex; gap: 0.5rem; margin-top: 0.35rem; }
.co-step-btns .btn { width: auto; margin: 0; }
.co-bar { height: 8px; border-radius: 4px; background: var(--bg-deep); overflow: hidden; margin-top: 0.2rem; }
.co-bar i { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.co-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.co-tile { padding: 0.7rem 0.6rem; border-radius: 14px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); display: flex; flex-direction: column; gap: 2px; }
.co-tile small { font: 700 0.6875rem var(--font-main); color: var(--text-3); }
.co-tile strong { font: 800 1.375rem var(--font-main); }
.co-tile span { font: 700 0.6875rem var(--font-main); color: var(--text-3); }
.co-tile span.up { color: var(--good); }
.co-tile span.down { color: var(--bad-text); }
.co-style { padding: 0.9rem; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); }
.co-style > strong { display: block; font: 800 1.125rem var(--font-main); margin-bottom: 0.25rem; }
.co-style p { margin: 0 0 0.6rem; font: 600 0.875rem/1.45 var(--font-main); color: var(--text-2); }
.co-fair { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.6rem 0.7rem; border-radius: 12px; background: rgba(var(--good-rgb),0.1); }
.co-fair .ic { width: 18px; height: 18px; flex: none; color: var(--good); margin-top: 1px; }
.co-fair span { font: 600 0.8125rem/1.4 var(--font-main); color: var(--text-2); }
.co-style .btn { width: auto; margin: 0; }
.co-all { display: flex; align-items: center; gap: 0.75rem; width: 100%; margin: 1.2rem 0 1rem; padding: 0.85rem; border: none; border-radius: 16px; background: var(--tile); box-shadow: 0 3px 0 var(--lip); color: var(--text); font-family: var(--font-main); text-align: left; cursor: pointer; }
.co-all > .ic:first-child { width: 26px; height: 26px; color: var(--blue-hi); flex: none; }
.co-all span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.co-all strong { font: 800 1rem var(--font-main); }
.co-all small { font: 600 0.75rem/1.35 var(--font-main); color: var(--text-3); }
.co-all > .ic:last-child { width: 18px; height: 18px; color: var(--text-3); flex: none; }
#coach-body { max-width: 560px; margin: 0 auto; width: 100%; }
#tab-drills .drill-grid + .wide-card { margin-top: 0.75rem; }
@media (min-width: 1000px) {
    #tab-learn .coach-card { width: calc(100% - 150px); }
}

/* Installed to the home screen: fill the whole screen (iOS can leave a strip at the bottom
   of a fixed full-screen layer) and keep the bottom bars just clear of the home bar */
@media (display-mode: standalone) {
    html, body { height: 100vh; height: 100lvh; }
    body { padding-bottom: 0; }
    .screen { bottom: auto; height: 100vh; height: 100lvh; }
    :root { --safe-bottom: max(0px, calc(env(safe-area-inset-bottom, 0px) - 12px)); }
}

/* Online Sit & Go */
.tn-h { font: 800 0.8125rem var(--font-main); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin: 1.2rem 0 0.6rem; }
.tn-live { display: inline-flex; align-items: center; gap: 4px; color: #2BB3A3 !important; font-weight: 800 !important; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.6875rem !important; }
.tn-live .ic { width: 13px; height: 13px; }
.tn-online-note { margin: 0.2rem 0 0.6rem; font: 600 0.8125rem/1.4 var(--font-main); color: var(--text-2); }
.sng-prize { display: flex; align-items: center; gap: 0.5rem; justify-content: center; margin: 0 0 0.8rem; padding: 0.55rem 0.8rem; border-radius: 12px; background: rgba(245,184,61,0.14); }
.sng-prize .ic { width: 20px; height: 20px; color: var(--gold); }
.sng-prize strong { font: 800 1.125rem var(--font-main); color: var(--gold); }
.sng-prize span { font: 700 0.8125rem var(--font-main); color: var(--text-2); }
