/**
 * Robo-Skip Styles
 * ================
 * Ice-themed dark design. Crystal blue + gold accents.
 * Fibonacci timing. Glass morphism. 8px grid.
 */

/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Void palette */
    --void: #07060B;
    --void-warm: #0D0A0F;
    --obsidian: #12101A;
    --void-light: #1A1820;
    --carbon: #252330;
    --surface-elevated: #1F1D24;

    /* Ice palette */
    --ice: #67D4E4;
    --ice-dim: #4BA8B5;
    --ice-bright: #8EE5F0;
    --ice-glow: rgba(103, 212, 228, 0.15);
    --ice-glow-strong: rgba(103, 212, 228, 0.3);

    /* Gold / forge */
    --gold: #D4AF37;
    --gold-dim: #B8962E;
    --gold-glow: rgba(212, 175, 55, 0.15);

    /* Stone colors */
    --stone-red: #E74C3C;
    --stone-red-dim: #C0392B;
    --stone-red-glow: rgba(231, 76, 60, 0.25);
    --stone-yellow: #F1C40F;
    --stone-yellow-dim: #D4AC0D;
    --stone-yellow-glow: rgba(241, 196, 15, 0.25);

    /* Status */
    --positive: #4ADE80;
    --negative: #F87171;
    --warning: #FBBF24;
    --positive-glow: rgba(74, 222, 128, 0.15);
    --negative-glow: rgba(248, 113, 113, 0.15);

    /* Accent — puzzle / capture */
    --accent-purple: #c084fc;
    --accent-purple-bright: #A855F7;
    --accent-purple-glow: rgba(168, 85, 247, 0.15);

    /* Text */
    --text-primary: #F5F0E8;
    --text-secondary: #D0CBC6;
    --text-tertiary: #ADA8A3;
    --text-disabled: #706B66;

    /* Glass */
    --glass-bg: rgba(18, 16, 26, 0.85);
    --glass-border: rgba(103, 212, 228, 0.08);
    --glass-hover: rgba(103, 212, 228, 0.04);
    --glass-blur: 20px;

    /* Spacing (8px grid) */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Radius */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 9999px;

    /* Fibonacci timing */
    --t-instant: 89ms;
    --t-fast: 144ms;
    --t-normal: 233ms;
    --t-slow: 377ms;
    --t-slower: 610ms;
    --t-slowest: 987ms;
    --t-glacial: 1597ms;
    --t-breathing: 2584ms;

    /* Easing */
    --ease-snap: cubic-bezier(0.7, 0, 0.3, 1);
    --ease-sharp: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.2, 0.64, 1);
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);

    /* Typography */
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
    --font-display: 'Cormorant Garamond', Georgia, serif;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow-ice: 0 0 20px rgba(103, 212, 228, 0.2);
    --shadow-glow-gold: 0 0 20px rgba(212, 175, 55, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--void);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation; /* no 300ms tap delay */
    -webkit-tap-highlight-color: transparent;
    -moz-osx-font-smoothing: grayscale;
}

/* Grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: overlay;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--carbon); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--ice-dim); }

/* Focus */
:focus-visible {
    outline: 2px solid var(--ice);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* Selection */
::selection {
    background: var(--ice-glow-strong);
    color: var(--text-primary);
}

/* Skip link */
.skip-link {
    position: fixed;
    top: -100%;
    left: var(--sp-4);
    z-index: 10000;
    padding: var(--sp-2) var(--sp-4);
    background: var(--ice);
    color: var(--void);
    font-weight: 600;
    border-radius: var(--r-md);
    text-decoration: none;
    transition: top var(--t-fast) var(--ease-snap);
}
.skip-link:focus { top: var(--sp-4); }

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 48px;
}

.header__brand {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.header__logo svg {
    display: block;
}

.header__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.header__subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Mode toggle (segmented control) ── */
.mode-toggle {
    position: relative;
    display: flex;
    gap: 0;
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: 3px;
    margin: 0 auto;
}
.mode-toggle__btn {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    border-radius: calc(var(--r-lg) - 3px);
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color var(--t-fast) var(--ease-smooth);
    white-space: nowrap;
}
.mode-toggle__btn svg { flex-shrink: 0; opacity: 0.6; transition: opacity var(--t-fast); }
.mode-toggle__btn:hover { color: var(--text-secondary); }
.mode-toggle__btn:hover svg { opacity: 0.8; }
.mode-toggle__btn.active { color: #fff; }
.mode-toggle__btn.active svg { opacity: 1; }

/* Sliding pill behind the active button */
.mode-toggle__slider {
    position: absolute;
    top: 3px; left: 3px;
    height: calc(100% - 6px);
    border-radius: calc(var(--r-lg) - 3px);
    transition: transform var(--t-normal) var(--ease-bounce), width var(--t-normal) var(--ease-bounce), background var(--t-normal);
    pointer-events: none;
    z-index: 0;
    /* default: AI color */
    background: rgba(103, 212, 228, 0.2);
    border: 1px solid rgba(103, 212, 228, 0.35);
}
.mode-toggle.pvp .mode-toggle__slider {
    background: rgba(241, 196, 15, 0.18);
    border-color: rgba(241, 196, 15, 0.35);
}
.mode-toggle.puzzle .mode-toggle__slider {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.35);
}

/* Context badge (replay/loaded) — only shown outside free play */
.header__mode-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: var(--r-full);
    transition: all var(--t-normal) var(--ease-smooth);
}
.header__mode-badge.mode--replay {
    background: rgba(74, 222, 128, 0.12);
    color: var(--positive);
    border: 1px solid rgba(74, 222, 128, 0.3);
}
.header__mode-badge.mode--capture {
    background: var(--accent-purple-glow);
    color: var(--accent-purple-bright);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Turn banner */
.turn-banner {
    position: absolute;
    top: var(--sp-3);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    z-index: 5;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(7, 6, 11, 0.92);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--r-full);
    backdrop-filter: blur(12px);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: all var(--t-normal) var(--ease-smooth);
    pointer-events: none;
    opacity: 0;
}
.turn-banner.visible {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) scale(1);
}
.turn-banner__dot {
    width: 12px; height: 12px;
    border-radius: var(--r-full);
    background: var(--negative);
    transition: background var(--t-normal);
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.5);
}
.turn-banner__dot.yellow {
    background: #F1C40F;
    box-shadow: 0 0 6px rgba(241, 196, 15, 0.5);
}
.turn-banner.ai-thinking {
    border-color: rgba(103, 212, 228, 0.4);
    animation: pulse-border 1s ease-in-out infinite;
}
.turn-banner.pvp-red {
    border-color: rgba(231, 76, 60, 0.35);
}
.turn-banner.pvp-yellow {
    border-color: rgba(241, 196, 15, 0.35);
}
@keyframes pulse-border {
    0%, 100% { border-color: rgba(103, 212, 228, 0.35); }
    50% { border-color: rgba(103, 212, 228, 0.7); }
}

/* PvP turn handoff flash */
.turn-banner.handoff {
    animation: handoff-flash 0.5s ease-out;
}
@keyframes handoff-flash {
    0% { transform: translateX(-50%) scale(1.15); box-shadow: 0 0 20px rgba(255,255,255,0.15); }
    100% { transform: translateX(-50%) scale(1); box-shadow: none; }
}

.header__controls {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

/* Header action buttons */
.header-action {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-3);
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-full);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-sharp);
    position: relative;
    height: 32px;
}
.header-action:hover {
    background: var(--carbon);
    color: var(--text-primary);
    border-color: var(--ice-dim);
}
.header-action:active {
    opacity: 0.7;
}
.header-action__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.header-action__label {
    white-space: nowrap;
}
.header-action__badge {
    width: 6px;
    height: 6px;
    border-radius: var(--r-full);
    background: var(--warning);
    animation: pulse-dot 1.5s ease-in-out infinite;
    flex-shrink: 0;
}
.header-action__badge.live {
    background: var(--positive);
    animation: none;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}
.header-action__badge.hidden { display: none; }
.header-action--icon {
    padding: var(--sp-1);
    width: 32px;
    justify-content: center;
}
.header-action--icon .header-action__icon {
    width: 18px;
    height: 18px;
}
/* Keyboard icon dot rendering */
.header-action--icon svg line {
    stroke-width: 3;
    stroke-linecap: round;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.app {
    display: grid;
    grid-template-columns: 1fr 360px;
    height: calc(100vh - 48px);
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ICE PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.ice-panel {
    position: relative;
    background: linear-gradient(180deg, var(--void) 0%, var(--void-warm) 50%, var(--obsidian) 100%);
    overflow: hidden;
}

.ice-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.ice-container:has(.puzzle-prompt.visible) {
    top: 36px;
}

.ice-container canvas {
    position: absolute;
    cursor: crosshair;
    touch-action: none; /* prevent browser gestures on the canvas */
}

/* Stacking order: bg (1) → main interactive (2) → overlay effects (3) */
#ice-bg      { z-index: 1; pointer-events: none; }
#ice-main    { z-index: 2; /* receives all pointer events */ }
#ice-overlay { z-index: 3; pointer-events: none; }

/* Stone color selector */
.stone-selector {
    position: absolute;
    top: var(--sp-4);
    left: var(--sp-4);
    display: flex;
    gap: var(--sp-2);
    z-index: 10;
}

.stone-sel {
    width: 40px;
    height: 40px;
    border-radius: var(--r-full);
    border: 2px solid transparent;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast) var(--ease-bounce);
    position: relative;
}
.stone-sel__dot {
    width: 20px;
    height: 20px;
    border-radius: var(--r-full);
    transition: transform var(--t-fast) var(--ease-bounce), box-shadow var(--t-fast) var(--ease-sharp);
}
.stone-sel--red .stone-sel__dot {
    background: var(--stone-red);
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
}
.stone-sel--yellow .stone-sel__dot {
    background: var(--stone-yellow);
    box-shadow: 0 0 0 0 rgba(241, 196, 15, 0);
}
.stone-sel:hover { transform: scale(1.1); }
.stone-sel:active { transform: scale(0.95); }
.stone-sel.active { border-color: var(--ice); box-shadow: var(--shadow-glow-ice); }
.stone-sel.active .stone-sel__dot { transform: scale(1.15); }
.stone-sel--red.active .stone-sel__dot { box-shadow: 0 0 12px rgba(231, 76, 60, 0.4); }
.stone-sel--yellow.active .stone-sel__dot { box-shadow: 0 0 12px rgba(241, 196, 15, 0.4); }

/* Stone selector switch animation */
.stone-sel.just-activated .stone-sel__dot {
    animation: stone-sel-pop var(--t-normal) var(--ease-bounce);
}
@keyframes stone-sel-pop {
    0% { transform: scale(1.15); }
    40% { transform: scale(1.4); }
    100% { transform: scale(1.15); }
}

/* Ghost confirm bar */
.ghost-confirm {
    position: absolute;
    bottom: calc(var(--sp-5) + 40px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    z-index: 12;
    display: none;
    align-items: center;
    gap: var(--sp-1);
    padding: 4px;
    background: rgba(7, 6, 11, 0.94);
    border: 1px solid rgba(103, 212, 228, 0.2);
    border-radius: var(--r-full);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity var(--t-fast) var(--ease-smooth), transform var(--t-fast) var(--ease-bounce);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.ghost-confirm.visible {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.ghost-confirm__hint {
    font-size: 0.72rem;
    color: var(--text-secondary);
    padding: 0 var(--sp-2);
    white-space: nowrap;
}
.ghost-confirm__btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border: none;
    border-radius: var(--r-full);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-smooth);
}
.ghost-confirm__btn--cancel {
    background: rgba(248, 113, 113, 0.1);
    color: var(--negative);
    padding: 8px 10px;
}
.ghost-confirm__btn--cancel:hover { background: rgba(248, 113, 113, 0.2); }
.ghost-confirm__btn--place {
    background: rgba(103, 212, 228, 0.15);
    color: var(--ice);
    border: 1px solid rgba(103, 212, 228, 0.3);
}
.ghost-confirm__btn--place:hover {
    background: rgba(103, 212, 228, 0.25);
    border-color: var(--ice);
    box-shadow: 0 0 16px rgba(103, 212, 228, 0.25);
}
.ghost-confirm__btn--place:active {
    transform: scale(0.95);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DAILY PUZZLE
   ═══════════════════════════════════════════════════════════════════════════ */

.puzzle-prompt {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    z-index: 15;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 var(--sp-4);
    background: var(--void-warm);
    border-bottom: 1px solid rgba(168, 85, 247, 0.12);
    pointer-events: none;
}
.puzzle-prompt.visible { display: flex; }
.puzzle-prompt__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent-purple);
    background: var(--accent-purple-glow);
    padding: 2px 8px;
    border-radius: var(--r-full);
    flex-shrink: 0;
}
.puzzle-prompt__text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.puzzle-prompt__meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--ice-dim);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Puzzle result overlay */
.puzzle-result {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 25;
    background: rgba(7, 6, 11, 0.8);
    backdrop-filter: blur(8px);
    place-items: center;
}
.puzzle-result.visible { display: grid; }
.puzzle-result__card {
    background: linear-gradient(
        135deg,
        rgba(20, 18, 30, 0.95) 0%,
        rgba(30, 25, 50, 0.95) 50%,
        rgba(20, 18, 30, 0.95) 100%
    );
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    text-align: center;
    max-width: 320px;
    width: 92%;
    animation: puzzleCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(168, 85, 247, 0.08);
}
@keyframes puzzleCardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.puzzle-result__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: var(--sp-1);
    transition: color 0.3s;
}
.puzzle-result__score {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--sp-4);
    letter-spacing: -0.5px;
}
.puzzle-result__details {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--sp-4);
}
.puzzle-blocks {
    font-size: 20px;
    letter-spacing: 3px;
    margin-bottom: var(--sp-3);
}
.puzzle-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
    text-align: center;
}
.puzzle-stat__val {
    display: block;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.puzzle-stat__label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.puzzle-rating-dist {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    height: 32px;
    margin-bottom: var(--sp-3);
}
.puzzle-rating-bar {
    width: 18px;
    height: var(--h, 4%);
    min-height: 4px;
    background: rgba(103, 212, 228, 0.15);
    border-radius: 3px 3px 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: height 0.4s var(--ease-bounce);
    position: relative;
}
.puzzle-rating-bar span {
    position: absolute;
    bottom: -14px;
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-disabled);
}
.puzzle-rating-bar.active {
    background: var(--ice);
}
.puzzle-rating-bar.active span {
    color: var(--ice);
    font-weight: 700;
}

.puzzle-player-shot {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 6px 10px;
    background: rgba(103, 212, 228, 0.06);
    border-radius: var(--r-sm);
    border-left: 2px solid var(--ice-dim);
}
.puzzle-player-shot strong { color: var(--ice); }
.puzzle-result__best {
    font-size: 12px;
    color: var(--text-secondary);
    padding: var(--sp-3);
    background: rgba(7, 6, 11, 0.5);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-4);
    text-align: left;
    line-height: 1.5;
}
.puzzle-result__best strong { color: var(--ice); }
.puzzle-optimal {
    margin-bottom: var(--sp-2);
}
.puzzle-optimal__label {
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--positive);
    margin-bottom: 4px;
}
.puzzle-optimal__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.puzzle-optimal__wp {
    font-size: 11px;
    color: var(--ice-dim);
    margin-top: 2px;
}
.puzzle-alternatives {
    border-top: 1px solid rgba(103, 212, 228, 0.08);
    padding-top: var(--sp-2);
    margin-top: var(--sp-2);
}
.puzzle-alt {
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 2px 0;
    display: flex;
    justify-content: space-between;
}
.puzzle-alt span { color: var(--ice-dim); font-family: var(--font-mono); font-size: 10px; }
.puzzle-result__actions {
    display: flex;
    gap: var(--sp-3);
    justify-content: center;
}
.puzzle-result__btn {
    padding: 11px 28px;
    border-radius: var(--r-full);
    border: 1px solid rgba(168, 85, 247, 0.3);
    background: var(--accent-purple-glow);
    color: var(--accent-purple);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}
.puzzle-result__btn:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-1px);
}
.puzzle-result__btn:active { transform: scale(0.96); }
.puzzle-result__btn--share {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(34, 197, 94, 0.10));
    border-color: rgba(74, 222, 128, 0.4);
    color: var(--positive);
    min-width: 110px;
    font-size: 14px;
    padding: 12px 32px;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.1);
}
.puzzle-result__btn--share:hover {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.25), rgba(34, 197, 94, 0.18));
    border-color: rgba(74, 222, 128, 0.6);
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.15);
    transform: translateY(-1px);
}
.puzzle-result__btn--share:active { transform: scale(0.96); }

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE SHOTS OVERLAY (floats on ice panel)
   ═══════════════════════════════════════════════════════════════════════════ */

.mobile-shots {
    display: none; /* shown only on mobile via media query */
    position: absolute;
    top: var(--sp-2);
    right: var(--sp-2);
    z-index: 14;
    min-width: 180px;
    max-width: 240px;
    background: rgba(7, 6, 11, 0.92);
    border: 1px solid rgba(103, 212, 228, 0.15);
    border-radius: var(--r-md);
    backdrop-filter: blur(16px);
    overflow: hidden;
    transition: all var(--t-fast) var(--ease-smooth);
}
.mobile-shots.has-shots {
    border-color: rgba(103, 212, 228, 0.25);
}
.mobile-shots__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.mobile-shots__title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--ice);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.mobile-shots__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    color: var(--ice-dim);
    cursor: pointer;
    transition: transform var(--t-fast);
    padding: 0;
}
.mobile-shots.collapsed .mobile-shots__toggle {
    transform: rotate(180deg);
}
.mobile-shots__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 4px 4px;
    max-height: 260px;
    overflow-y: auto;
    transition: max-height var(--t-normal) var(--ease-smooth);
}
.mobile-shots.collapsed .mobile-shots__list {
    max-height: 0;
    padding: 0 4px;
    overflow: hidden;
}
.mobile-shot-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border-left: 2px solid var(--type-color, transparent);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background var(--t-fast);
    user-select: none;
    -webkit-user-select: none;
    min-height: 38px;
}
.mobile-shot-item:active {
    background: rgba(103, 212, 228, 0.1);
    transform: scale(0.97);
}
.mobile-shot-item__tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--type-color);
    width: 32px;
    text-align: center;
    opacity: 0.8;
    flex-shrink: 0;
}
.mobile-shot-item:first-child .mobile-shot-item__tag {
    opacity: 1;
}
.mobile-shot-item__pct {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    width: 28px;
    text-align: right;
}
.mobile-shot-item__name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mobile-shot-item__wp {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}
.mobile-shot-item__wp--positive { color: var(--positive); }
.mobile-shot-item__wp--negative { color: var(--negative); }
.mobile-shot-item__wp--neutral { color: var(--text-tertiary); }

.mobile-shots__empty {
    font-size: 0.68rem;
    color: var(--text-disabled);
    text-align: center;
    padding: 6px 8px 8px;
}
.mobile-shots__analyzing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 8px;
    font-size: 0.68rem;
    color: var(--ice-dim);
}
.mobile-shots__analyzing::before {
    content: '';
    width: 8px;
    height: 8px;
    border: 1.5px solid var(--ice-dim);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 610ms linear infinite;
}

/* Mobile shots: shown via ≤768px media query in MOBILE section below */

/* Action buttons on ice */
.ice-actions {
    position: absolute;
    bottom: var(--sp-4);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--sp-2);
    z-index: 10;
}

.action-btn {
    position: relative;
    padding: 6px var(--sp-4);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-full);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-sharp);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-secondary);
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 4px;
}
.action-btn:hover {
    color: var(--text-primary);
    border-color: var(--ice-dim);
}
.action-btn:active { transform: translateY(0) scale(0.97); box-shadow: none; }
.action-btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; transform: none; }

.action-btn--primary {
    background: linear-gradient(135deg, rgba(103, 212, 228, 0.15), rgba(103, 212, 228, 0.05));
    border-color: rgba(103, 212, 228, 0.2);
    color: var(--ice);
}
.action-btn--primary:hover {
    background: linear-gradient(135deg, rgba(103, 212, 228, 0.25), rgba(103, 212, 228, 0.1));
    border-color: var(--ice-dim);
    box-shadow: 0 0 16px rgba(103, 212, 228, 0.2), 0 3px 12px rgba(0,0,0,0.3);
}

.action-btn__pulse {
    display: none;
}

/* Analyzing state: single subtle shimmer */
.action-btn--primary.analyzing {
    border-color: rgba(103, 212, 228, 0.4);
}
.action-btn--primary.analyzing::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent 0%, rgba(103, 212, 228, 0.12) 50%, transparent 100%);
    animation: analyze-shimmer 2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes analyze-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.action-btn--ai {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(168, 85, 247, 0.04));
    border-color: rgba(168, 85, 247, 0.2);
    color: #C084FC;
    gap: 4px;
}
.action-btn--ai:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(168, 85, 247, 0.08));
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.2), 0 3px 10px rgba(0,0,0,0.3);
    color: #D8B4FE;
}
.action-btn--ai svg { width: 14px; height: 14px; flex-shrink: 0; }

.action-btn--share {
    display: none; /* shown on mobile only */
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.2);
    color: var(--positive);
}
.action-btn--share:hover {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.4);
}
.action-btn--share svg { width: 14px; height: 14px; flex-shrink: 0; }

.action-btn--ghost {
    background: rgba(18, 16, 26, 0.6);
}

/* Destructive action glow (clear/undo) */
.action-btn--ghost:hover {
    border-color: rgba(248, 113, 113, 0.2);
}

/* Team switch button */
.action-btn--team {
    display: flex; align-items: center; gap: 4px;
    padding: var(--sp-2) var(--sp-3);
    background: rgba(18, 16, 26, 0.7);
}
.action-btn__dot {
    width: 10px; height: 10px; border-radius: var(--r-full);
    transition: transform 0.2s, opacity 0.2s;
}
.action-btn__dot--red { background: var(--stone-red); }
.action-btn__dot--yellow { background: var(--stone-yellow); }
.action-btn--team[data-active="red"] .action-btn__dot--red {
    transform: scale(1.4); box-shadow: 0 0 6px var(--stone-red);
}
.action-btn--team[data-active="red"] .action-btn__dot--yellow {
    opacity: 0.4; transform: scale(0.8);
}
.action-btn--team[data-active="yellow"] .action-btn__dot--yellow {
    transform: scale(1.4); box-shadow: 0 0 6px var(--stone-yellow);
}
.action-btn--team[data-active="yellow"] .action-btn__dot--red {
    opacity: 0.4; transform: scale(0.8);
}

/* Empty state */
.empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    pointer-events: none;
    z-index: 5;
    transition: opacity var(--t-slow) var(--ease-sharp);
}
.empty-state.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.empty-state__icon {
    opacity: 0.5;
    animation: gentle-bob 3s ease-in-out infinite;
}
@keyframes gentle-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.empty-state__text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}

@keyframes breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */

.dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-2);
    background: var(--void-warm);
    border-left: 1px solid var(--glass-border);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

/* Dashboard cards */
.dash-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: var(--sp-3);
    transition: border-color var(--t-fast) var(--ease-sharp);
}
.dash-card:hover {
    border-color: rgba(103, 212, 228, 0.12);
}

.dash-card__title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: var(--sp-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WIN PROBABILITY GAUGE
   ═══════════════════════════════════════════════════════════════════════════ */

.dash-card--wp {
    padding: var(--sp-2) var(--sp-3) var(--sp-1);
}

.wp-gauge {
    text-align: center;
    position: relative;
}

.wp-gauge__svg {
    width: 180px;
    height: 108px;
    display: block;
    margin: 0 auto;
}

.wp-gauge__svg path {
    transition: stroke-dasharray var(--t-slow) var(--ease-smooth),
                stroke var(--t-slow) var(--ease-sharp);
}

.wp-gauge__value {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.wp-gauge__number {
    font-family: var(--font-mono);
    font-size: 2.25rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
    transition: color var(--t-slow) var(--ease-sharp);
}

.wp-gauge__percent {
    font-size: 1rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.wp-gauge__label {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: var(--sp-1);
    font-weight: 500;
}

.wp-gauge__teams {
    display: flex;
    justify-content: space-between;
    margin-top: var(--sp-1);
    padding: 0 var(--sp-3);
}

.wp-gauge__team {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.wp-gauge__team--red { color: var(--stone-red); }
.wp-gauge__team--yellow { color: var(--stone-yellow); }

/* Shimmer effect for big WP changes */
.wp-gauge.shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--gold-glow), transparent);
    animation: shimmer-sweep 610ms var(--ease-smooth) forwards;
    pointer-events: none;
    border-radius: var(--r-lg);
}

@keyframes shimmer-sweep {
    0% { opacity: 0; transform: translateX(-100%); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME STATE
   ═══════════════════════════════════════════════════════════════════════════ */

.dash-card--state {
    padding: var(--sp-2) var(--sp-3);
}

.game-state__score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-2);
}

.score-team {
    text-align: center;
    flex: 1;
}

.score-team__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--sp-1);
}
.score-team--red .score-team__label { color: var(--stone-red); }
.score-team--yellow .score-team__label { color: var(--stone-yellow); }

.score-team__value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease-bounce);
    user-select: none;
}
.score-team__value:hover {
    opacity: 0.85;
    transform: scale(1.05);
}
.score-team__value:active {
    transform: scale(0.95);
}

.score-team__value.bump {
    animation: score-bump 233ms var(--ease-bounce);
}

@keyframes score-bump {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.score-divider {
    display: flex;
    align-items: center;
}

.score-divider__vs {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
    font-weight: 300;
}

/* Meta items row */
.game-state__meta {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-2);
}

.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-1);
    flex: 1;
}

.meta-item__label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.meta-item__value {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.meta-item__select {
    appearance: none;
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-sm);
    padding: 2px var(--sp-5) 2px var(--sp-2);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    cursor: pointer;
    text-align: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 4l3 3 3-3' fill='none' stroke='%239E9994' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    transition: border-color var(--t-fast) var(--ease-sharp);
}
.meta-item__select:hover { border-color: var(--ice-dim); }

/* Hammer button */
.hammer-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 3px var(--sp-2);
    border-radius: var(--r-sm);
    border: 1px solid var(--glass-border);
    background: var(--surface-elevated);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-sharp);
}
.hammer-btn:hover {
    border-color: var(--gold-dim);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.15);
}
.hammer-btn:active { transform: scale(0.95); }

.hammer-btn--red { color: var(--stone-red); }
.hammer-btn--yellow { color: var(--stone-yellow); }

.hammer-btn__label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color var(--t-fast) var(--ease-sharp);
}

/* Hammer flip animation */
.hammer-btn.flipping svg {
    animation: hammer-flip var(--t-normal) var(--ease-bounce);
}
@keyframes hammer-flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   POSITION SUMMARY
   ═══════════════════════════════════════════════════════════════════════════ */

.position-summary {
    font-size: 0.75rem;
}

.position-summary__empty {
    color: var(--text-disabled);
    font-style: italic;
}

.position-summary__counting {
    font-weight: 600;
    margin-bottom: var(--sp-2);
}
.position-summary__counting--red { color: var(--stone-red); }
.position-summary__counting--yellow { color: var(--stone-yellow); }
.position-summary__counting--blank { color: var(--text-tertiary); }

.position-summary__table {
    width: 100%;
    border-collapse: collapse;
}

.position-summary__table th {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-disabled);
    text-align: left;
    padding: var(--sp-1) 6px var(--sp-1) 0;
    border-bottom: 1px solid var(--glass-border);
}

.position-summary__table td {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 4px 6px 4px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(37, 35, 48, 0.5);
}

.position-summary__table .counting-row {
    color: var(--text-primary);
    font-weight: 500;
}

.stone-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    margin-right: var(--sp-1);
    vertical-align: middle;
}
.stone-dot--red { background: var(--stone-red); }
.stone-dot--yellow { background: var(--stone-yellow); }

.counting-badge {
    font-size: 0.5rem;
    color: var(--positive);
    vertical-align: middle;
}
.counting-row .counting-badge {
    color: var(--positive);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHOT RECOMMENDATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.dash-card--shots {
    flex: 1;
    min-height: 160px;
    display: flex;
    flex-direction: column;
}

.shots-status {
    font-size: 0.625rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ice-dim);
}

.shots-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.shots-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}
.shots-empty kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 var(--sp-1);
    background: var(--surface-elevated);
    border: 1px solid var(--carbon);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--ice-dim);
    margin: 0 3px;
}

/* Shot card */
/* ── Shot Cards — Redesigned ─────────────────────────────────────────── */

.shot-card {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: var(--sp-2);
    align-items: center;
    padding: 8px 10px;
    background: var(--surface-elevated);
    border: 1px solid transparent;
    border-left: 3px solid var(--type-color, transparent);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-sharp);
    position: relative;
    opacity: 0;
    transform: translateY(6px);
    animation: shot-card-in var(--t-normal) var(--ease-smooth) forwards;
}
.shot-card:nth-child(1) { animation-delay: 0ms; }
.shot-card:nth-child(2) { animation-delay: 40ms; }
.shot-card:nth-child(3) { animation-delay: 80ms; }
.shot-card:nth-child(4) { animation-delay: 120ms; }
.shot-card:nth-child(5) { animation-delay: 160ms; }

@keyframes shot-card-in {
    to { opacity: 1; transform: translateY(0); }
}

.shot-card:hover {
    border-color: color-mix(in srgb, var(--type-color, var(--ice-dim)) 30%, transparent);
    background: var(--carbon);
}
.shot-card:first-child {
    border-left-width: 3px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--type-color) 6%, transparent), var(--surface-elevated));
}
.shot-card:active { opacity: 0.85; }
.shot-card.active {
    border-color: var(--ice);
    box-shadow: 0 0 12px rgba(103, 212, 228, 0.15);
}

/* Left column: type tag + success ring */
.shot-card__left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.shot-card__tag {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--type-color);
    opacity: 0.8;
    line-height: 1;
}

.success-ring {
    display: block;
}

/* Center: name + insight */
.shot-card__info {
    min-width: 0;
}

.shot-card__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.shot-card__insight {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right: WP delta + resulting WP */
.shot-card__right {
    text-align: right;
    min-width: 50px;
}

.shot-card__wp {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
}
.shot-card__wp--positive { color: var(--positive); }
.shot-card__wp--negative { color: var(--negative); }
.shot-card__wp--neutral { color: var(--text-tertiary); }

.shot-card__wp-after {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--text-disabled);
    line-height: 1;
    margin-top: 1px;
}

.shot-card__shortcut {
    position: absolute;
    top: 2px;
    right: 5px;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: var(--text-disabled);
    opacity: 0;
    transition: opacity var(--t-fast) var(--ease-sharp);
}
.shot-card:hover .shot-card__shortcut { opacity: 0.7; }

/* ═══════════════════════════════════════════════════════════════════════════
   ANALYSIS DETAIL
   ═══════════════════════════════════════════════════════════════════════════ */

.dash-card--detail {
    cursor: default;
}

.dash-card__title--toggle {
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 0;
    margin: 0;
}
.dash-card__title--toggle::-webkit-details-marker { display: none; }
.dash-card__title--toggle::before {
    content: '▸';
    display: inline-block;
    margin-right: var(--sp-2);
    transition: transform var(--t-fast) var(--ease-sharp);
    font-size: 0.75rem;
}
.dash-card--detail[open] .dash-card__title--toggle::before {
    transform: rotate(90deg);
}

.analysis-detail {
    margin-top: var(--sp-2);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.detail-section__title {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-disabled);
    margin-bottom: var(--sp-2);
}

/* Scoring distribution chart */
.score-dist-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 60px;
    padding: 0 var(--sp-1);
}

.score-dist-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.score-dist-bar__fill {
    width: 100%;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    transition: height var(--t-normal) var(--ease-smooth);
}

.score-dist-bar__label {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    color: var(--text-disabled);
}

/* Strategic factors */
.strategic-factors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
}

.factor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-1) var(--sp-2);
    background: var(--surface-elevated);
    border-radius: var(--r-sm);
    font-size: 0.6875rem;
}

.factor-item__label { color: var(--text-tertiary); }
.factor-item__value {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-primary);
}
.factor-item__value--positive { color: var(--positive); }
.factor-item__value--negative { color: var(--negative); }

/* Blank analysis */
.blank-analysis {
    padding: var(--sp-2) var(--sp-3);
    background: var(--surface-elevated);
    border-radius: var(--r-md);
    font-size: 0.8125rem;
}

.blank-analysis__verdict {
    font-weight: 600;
    margin-bottom: var(--sp-1);
}
.blank-analysis__verdict--blank { color: var(--ice); }
.blank-analysis__verdict--score { color: var(--gold); }

.blank-analysis__detail {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════════════════════════
   KEYBOARD SHORTCUTS OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

.shortcuts-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 6, 11, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-normal) var(--ease-sharp);
}
.shortcuts-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.shortcuts-overlay__panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: var(--sp-6);
    max-width: 440px;
    width: 90%;
    position: relative;
    transform: scale(0.95);
    transition: transform var(--t-normal) var(--ease-bounce);
}
.shortcuts-overlay.visible .shortcuts-overlay__panel {
    transform: scale(1);
}

.shortcuts-overlay__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--sp-4);
    color: var(--text-primary);
}

.shortcuts-overlay__close {
    position: absolute;
    top: var(--sp-4);
    right: var(--sp-4);
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--t-fast) var(--ease-sharp), background var(--t-fast) var(--ease-sharp);
}
.shortcuts-overlay__close:hover {
    color: var(--text-primary);
    background: var(--carbon);
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2) var(--sp-6);
}

.shortcut {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) 0;
}

.shortcut kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 var(--sp-2);
    background: var(--surface-elevated);
    border: 1px solid var(--carbon);
    border-bottom-width: 2px;
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--ice-dim);
}

.shortcut span {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 56px;
    right: var(--sp-3);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    pointer-events: none;
}

.toast {
    padding: 5px var(--sp-3);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--r-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
    pointer-events: auto;
    box-shadow: var(--shadow-md);
    animation: toast-in var(--t-normal) var(--ease-bounce) forwards;
    max-width: 280px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.toast::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: var(--r-full);
    flex-shrink: 0;
}
.toast--positive { border-color: rgba(74, 222, 128, 0.15); }
.toast--positive::before { background: var(--positive); box-shadow: 0 0 6px rgba(74, 222, 128, 0.5); }
.toast--negative { border-color: rgba(248, 113, 113, 0.15); }
.toast--negative::before { background: var(--negative); box-shadow: 0 0 6px rgba(248, 113, 113, 0.5); }
.toast--info { border-color: rgba(103, 212, 228, 0.15); }
.toast--info::before { background: var(--ice); box-shadow: 0 0 6px rgba(103, 212, 228, 0.5); }

.toast.dismissing {
    animation: toast-out var(--t-slow) var(--ease-sharp) forwards;
}

@keyframes toast-in {
    0% { opacity: 0; transform: translateX(20px) scale(0.95); }
    60% { transform: translateX(-3px) scale(1.01); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
    0% { opacity: 1; transform: translateX(0) scale(1); }
    100% { opacity: 0; transform: translateX(20px) scale(0.95); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .app {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 1024px) {
    .app {
        grid-template-columns: 1fr 280px;
    }
    .header__subtitle { display: none; }
    .wp-gauge__svg { width: 160px; height: 96px; }
    .wp-gauge__number { font-size: 2rem; }
}

@media (max-width: 900px) and (min-width: 769px) {
    .app {
        grid-template-columns: 1fr 260px;
    }
    .shot-card { grid-template-columns: 28px 1fr auto; gap: var(--sp-1); padding: 6px 8px; }
    .shot-card__name { font-size: 0.78rem; }
    .wp-gauge__svg { width: 140px; height: 84px; }
    .wp-gauge__number { font-size: 1.75rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE — Full-viewport layout with fixed bottom toolbar
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    :root {
        --mobile-header-h: 48px;
        --mobile-toolbar-h: 60px;
    }

    /* ── Full-viewport flex column ────────────────────────────── */
    .app {
        display: flex;
        flex-direction: column;
        height: calc(100vh - var(--mobile-header-h));
        height: calc(100dvh - var(--mobile-header-h));
        overflow: hidden;
    }

    /* ── Ice panel fills ALL remaining space ───────────────────── */
    .ice-panel {
        flex: 1 1 0%;
        min-height: 200px;
        position: relative;
        padding-bottom: var(--mobile-toolbar-h);
    }

    .ice-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: var(--mobile-toolbar-h);
    }

    /* When puzzle prompt is showing, push the entire ice area down */
    .ice-panel:has(.puzzle-prompt.visible) .ice-container {
        top: 38px;
    }

    /* ── Dashboard: HIDDEN on mobile (desktop only) ────────────── */
    .dashboard {
        display: none;
    }

    /* ── Header: compact but readable ─────────────────────────── */
    .header {
        height: var(--mobile-header-h);
        padding: var(--sp-2) var(--sp-3);
        gap: var(--sp-2);
    }
    .header__subtitle { display: none; }
    .header__title { font-size: 1rem; }
    .header-action__label { display: none; }
    .header__brand { gap: var(--sp-2); }
    .header__logo svg { width: 26px; height: 26px; }
    .header__controls { gap: var(--sp-1); }
    .header-action {
        height: 38px;
        padding: var(--sp-1) var(--sp-2);
        min-width: 38px;
    }
    .header-action--icon { width: 38px; }
    .header-action__icon { width: 18px; height: 18px; }

    /* Mode toggle: compact pill — keep short labels visible */
    .mode-toggle {
        padding: 2px;
        gap: 0;
    }
    .mode-toggle__btn {
        padding: 5px 10px;
        min-height: 34px;
        font-size: 0.72rem;
    }
    .mode-toggle__btn svg { width: 14px; height: 14px; }
    .mode-toggle__btn span { font-size: 0.68rem; }

    /* Hide desktop-only */
    .shortcuts-grid { grid-template-columns: 1fr; }
    #btn-shortcuts { display: none; }
    #btn-share { display: none; }
    .data-provenance { display: none; }
    .onboarding__remember { display: none; }

    /* ── Ice actions → fixed bottom toolbar ────────────────────── */
    .ice-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        height: var(--mobile-toolbar-h);
        z-index: 50;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--sp-2);
        padding: 0 var(--sp-3);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(7, 6, 11, 0.96);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-top: 1px solid rgba(103, 212, 228, 0.1);
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.3);
    }

    .action-btn {
        flex: 1;
        max-width: 130px;
        padding: var(--sp-2) var(--sp-3);
        font-size: 0.75rem;
        font-weight: 600;
        min-height: 44px;
        justify-content: center;
        text-align: center;
        border-radius: var(--r-md);
        display: flex;
        align-items: center;
        gap: 4px;
    }
    .action-btn:hover { transform: none; }
    .action-btn--team {
        flex: 0;
        min-width: 44px;
        max-width: 44px;
        padding: var(--sp-2);
    }
    .action-btn--ai { flex: 1; }
    .action-btn--ai svg { width: 14px; height: 14px; }
    .action-btn--ai .action-btn__label { display: inline; }
    .action-btn--share {
        display: flex;
        flex: 0;
        min-width: 44px;
        max-width: 44px;
        padding: var(--sp-2);
    }
    .action-btn--share svg { width: 16px; height: 16px; }
    .action-btn--ghost { font-size: 0.72rem; }

    /* ── Mobile shots → bottom sheet above toolbar ─────────────── */
    .mobile-shots {
        display: block;
        position: fixed;
        bottom: var(--mobile-toolbar-h);
        left: 0;
        right: 0;
        top: auto;
        z-index: 45;
        min-width: auto;
        max-width: none;
        width: 100%;
        background: rgba(7, 6, 11, 0.97);
        border: none;
        border-top: 1px solid rgba(103, 212, 228, 0.15);
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        max-height: 42vh;
        overflow: hidden;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
    }
    .mobile-shots.has-shots {
        transform: translateY(0);
        border-color: rgba(103, 212, 228, 0.25);
    }
    .mobile-shots.collapsed.has-shots {
        transform: translateY(calc(100% - 36px));
    }

    .mobile-shots__header {
        padding: 10px 16px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        display: flex;
        align-items: center;
        gap: var(--sp-2);
    }
    .mobile-shots__title {
        font-size: 0.75rem;
        letter-spacing: 0.1em;
    }
    .mobile-shots__toggle {
        width: 24px;
        height: 24px;
    }
    .mobile-shots__list {
        padding: 6px 10px 10px;
        max-height: 36vh;
        gap: 6px;
    }

    .mobile-shot-item {
        padding: 10px 14px;
        min-height: 48px;
        border-radius: var(--r-md);
        gap: 8px;
        border-left-width: 3px;
        background: rgba(255, 255, 255, 0.02);
        transition: background var(--t-fast);
    }
    .mobile-shot-item:first-child {
        background: rgba(103, 212, 228, 0.04);
    }
    .mobile-shot-item:active {
        background: rgba(103, 212, 228, 0.08);
    }
    .mobile-shot-item__tag {
        width: 36px;
        font-size: 0.65rem;
        font-weight: 700;
        opacity: 0.85;
    }
    .mobile-shot-item__name {
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--text-primary);
    }
    .mobile-shot-item__pct {
        font-size: 0.72rem;
        color: var(--text-secondary);
    }
    .mobile-shot-item__wp {
        font-size: 0.82rem;
        font-weight: 700;
    }

    .mobile-shots__empty {
        font-size: 0.75rem;
        padding: 10px 12px 14px;
        color: var(--text-tertiary);
    }
    .mobile-shots__analyzing {
        font-size: 0.75rem;
        padding: 10px 12px 14px;
    }

    /* ── Ghost confirm → above toolbar ─────────────────────────── */
    .ghost-confirm {
        bottom: calc(var(--mobile-toolbar-h) + var(--sp-4));
    }
    .ghost-confirm__btn {
        min-height: 44px;
        padding: 10px 20px;
        font-size: 0.82rem;
    }
    .ghost-confirm__hint {
        font-size: 0.78rem;
        color: var(--text-secondary);
    }

    /* ── Turn banner ───────────────────────────────────────────── */
    .turn-banner {
        font-size: 0.82rem;
        padding: 8px 16px;
        top: var(--sp-2);
    }
    .turn-banner__dot {
        width: 10px;
        height: 10px;
    }

    /* ── Puzzle prompt → fixed bar between header and ice, no overlap ── */
    .puzzle-prompt {
        position: fixed;
        top: var(--mobile-header-h);
        left: 0;
        right: 0;
        transform: none;
        height: 38px;
        display: none;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 0 16px;
        max-width: none;
        width: 100%;
        z-index: 40;
        pointer-events: none;
        border-radius: 0;
        background: var(--void-warm);
        border: none;
        border-bottom: 1px solid rgba(168, 85, 247, 0.15);
        box-shadow: none;
        text-align: center;
    }
    .puzzle-prompt.visible {
        display: flex;
    }
    .puzzle-prompt__badge { display: none; }
    .puzzle-prompt__text {
        font-size: 0.75rem;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .puzzle-prompt__meta {
        font-size: 0.6rem;
        line-height: 1;
        opacity: 0.7;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: none;
    }

    /* ── Puzzle result → scrollable on small screens ───────────── */
    .puzzle-result {
        position: fixed;
        inset: 0;
        z-index: 200;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: var(--sp-6) var(--sp-3);
    }
    .puzzle-result__card {
        max-width: 360px;
        width: 94%;
        padding: var(--sp-5);
        margin: 0 auto;
    }
    .puzzle-result__title { font-size: 20px; }
    .puzzle-result__score { font-size: 28px; }
    .puzzle-result__actions {
        flex-direction: column;
        gap: var(--sp-3);
    }
    .puzzle-result__btn {
        width: 100%;
        min-height: 48px;
        font-size: 14px;
    }

    /* ── Game browser ──────────────────────────────────────────── */
    .game-browser-overlay__panel {
        width: 96%;
        max-height: 90vh;
        padding: var(--sp-4);
        border-radius: var(--r-lg);
    }

    /* ── Empty state → account for toolbar ─────────────────────── */
    .empty-state {
        padding-bottom: var(--mobile-toolbar-h);
    }
    .empty-state__text {
        font-size: 0.9rem;
        color: var(--text-tertiary);
    }

    /* ── Onboarding → full-width on mobile ─────────────────────── */
    .onboarding-overlay__panel {
        width: 94%;
        max-width: 400px;
        padding: var(--sp-6) var(--sp-5) var(--sp-5);
    }
    .onboarding__title { font-size: 1.5rem; }
    .onboarding__subtitle { font-size: 0.82rem; }
    .onboarding-step { padding: var(--sp-3); }
    .onboarding-step__text { font-size: 0.85rem; }
    .onboarding__start-btn {
        min-height: 48px;
        font-size: 1rem;
    }
}

/* ── Small phones (≤480px) ─────────────────────────────────────── */
@media (max-width: 480px) {
    :root {
        --mobile-header-h: 44px;
    }
    .header {
        padding: var(--sp-1) var(--sp-2);
        gap: var(--sp-1);
        height: var(--mobile-header-h);
    }
    .header__title { font-size: 0.92rem; }
    .header__controls { gap: 1px; }
    .header-action { height: 36px; padding: 4px 8px; min-width: 36px; }
    .header-action--icon { width: 36px; }
    .header__logo svg { width: 22px; height: 22px; }

    .mode-toggle__btn {
        padding: 4px 8px;
        min-height: 32px;
        min-width: 32px;
    }
    .mode-toggle__btn span { display: none; }
    .mode-toggle__btn svg { width: 16px; height: 16px; }

    .action-btn {
        font-size: 0.72rem;
        min-height: 42px;
        padding: var(--sp-2);
    }
    .action-btn__label { font-size: 0.68rem; }

    .mobile-shot-item { padding: 8px 12px; min-height: 44px; }
    .mobile-shot-item__name { font-size: 0.78rem; }
    .mobile-shot-item__wp { font-size: 0.78rem; }

    .turn-banner { font-size: 0.75rem; padding: 6px 14px; }

    .puzzle-prompt { height: 34px; padding: 0 12px; }
    .puzzle-prompt__text { font-size: 0.7rem; }
    .ice-panel:has(.puzzle-prompt.visible) .ice-container { top: 34px; }

    .ghost-confirm__btn { min-height: 42px; padding: 8px 16px; font-size: 0.78rem; }
}

/* Tablet landscape (768-1024px, landscape) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .app {
        grid-template-columns: 1fr 280px;
        grid-template-rows: 1fr;
        height: calc(100vh - 48px);
    }
    .ice-panel { min-height: 100%; }
    .dashboard {
        max-height: calc(100vh - 48px);
        overflow-y: auto;
    }
    .wp-gauge__svg { width: 140px; height: 84px; }
    .wp-gauge__number { font-size: 1.75rem; }
    .mode-toggle__btn span { display: inline; font-size: 0.72rem; }
    .shot-card__name { font-size: 0.78rem; }
    .shot-card { padding: 6px 8px; }
}

/* Mobile landscape */
@media (max-height: 500px) and (orientation: landscape) {
    :root {
        --mobile-header-h: 36px;
        --mobile-toolbar-h: 44px;
    }
    .app {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 36px);
        height: calc(100dvh - 36px);
        overflow: hidden;
    }
    .ice-panel {
        flex: 1 1 0%;
        min-height: 120px;
        padding-bottom: 44px;
    }
    .ice-container {
        position: absolute;
        inset: 0;
        padding-bottom: 44px;
    }
    .dashboard { display: none; }
    .header {
        height: 36px;
        padding: var(--sp-1) var(--sp-3);
    }
    .header__title { font-size: 0.85rem; }
    .header__subtitle { display: none; }
    .header-action__label { display: none; }
    .header-action { height: 32px; min-width: 32px; }
    .header-action--icon { width: 32px; }
    .mode-toggle__btn span { display: none; }

    .turn-banner {
        font-size: 0.72rem;
        padding: 4px 12px;
        top: 4px;
    }
    .puzzle-prompt {
        top: 36px;
        height: 30px;
        padding: 0 12px;
    }
    .puzzle-prompt__text { font-size: 0.65rem; }
    .ice-panel:has(.puzzle-prompt.visible) .ice-container {
        top: 30px;
    }

    .ice-actions {
        height: 44px;
        padding: 0 var(--sp-2);
    }
    .action-btn {
        padding: var(--sp-1) var(--sp-3);
        font-size: 0.72rem;
        min-height: 36px;
    }
    .ghost-confirm { bottom: calc(44px + var(--sp-2)); }

    .mobile-shots {
        bottom: 44px;
        max-height: 50vh;
    }
}

/* Touch device optimizations — 44px minimum tap targets (Apple HIG) */
@media (hover: none) and (pointer: coarse) {
    .shot-card {
        padding: var(--sp-3) var(--sp-3);
        min-height: 54px;
    }
    .shot-card__name { font-size: 0.85rem; }
    .shot-card__insight { font-size: 0.72rem; }
    .shot-card__wp { font-size: 0.92rem; }

    .tournament-card { padding: var(--sp-3) var(--sp-4); min-height: 48px; }
    .game-card { padding: var(--sp-3) var(--sp-4); min-height: 48px; }
    .hammer-btn { padding: var(--sp-2) var(--sp-3); min-height: 44px; }
    .ghost-confirm__btn { min-height: 44px; min-width: 88px; }

    .score-team__value { min-width: 44px; min-height: 44px; line-height: 44px; }

    .meta-item__select { min-height: 40px; font-size: 0.875rem; padding: 4px var(--sp-5) 4px var(--sp-3); }

    .replay-dot { min-width: 40px; min-height: 40px; font-size: 0.72rem; }

    .action-btn__dot { width: 12px; height: 12px; }

    .puzzle-result__btn { min-height: 48px; padding: 14px 28px; font-size: 14px; }
    .puzzle-result__card { padding: var(--sp-5); }

    .mode-toggle__btn { min-height: 36px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOTION PREFERENCES
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING / ANALYZING STATE
   ═══════════════════════════════════════════════════════════════════════════ */

.analyzing .shots-status::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border: 2px solid var(--ice-dim);
    border-top-color: transparent;
    border-radius: var(--r-full);
    animation: spin 610ms linear infinite;
    margin-left: var(--sp-2);
    vertical-align: middle;
}

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

/* Progress bar in shot cards during analysis */
.shot-card__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--ice);
    border-radius: 0 0 var(--r-md) var(--r-md);
    transition: width var(--t-fast) linear;
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME BROWSER OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

.game-browser-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 6, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-normal) var(--ease-sharp);
}
.game-browser-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.game-browser-overlay__panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    max-width: 600px;
    width: 92%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95) translateY(8px);
    transition: transform var(--t-normal) var(--ease-bounce);
}
.game-browser-overlay.visible .game-browser-overlay__panel {
    transform: scale(1) translateY(0);
}

.game-browser__header {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
}

.game-browser__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.game-browser__data-source {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    padding: 2px var(--sp-2);
    background: var(--surface-elevated);
    border-radius: var(--r-full);
}

.data-source__dot {
    width: 6px;
    height: 6px;
    border-radius: var(--r-full);
    background: var(--warning);
    animation: pulse-dot 1.5s ease-in-out infinite;
}
.data-source__dot.connected { background: var(--positive); animation: none; }
.data-source__dot.error { background: var(--negative); animation: none; }

@keyframes pulse-dot {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.game-browser__close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--t-fast), background var(--t-fast);
}
.game-browser__close:hover { color: var(--text-primary); background: var(--carbon); }

.game-browser__loading {
    color: var(--text-disabled);
    font-style: italic;
    text-align: center;
    padding: var(--sp-8) 0;
}

.game-browser__back {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    background: none;
    border: none;
    color: var(--ice-dim);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    cursor: pointer;
    padding: var(--sp-1) 0;
    margin-bottom: var(--sp-3);
    transition: color var(--t-fast);
}
.game-browser__back:hover { color: var(--ice); }

.game-browser__subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-3);
}

/* Tournament cards */
.tournament-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface-elevated);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-sharp);
    margin-bottom: var(--sp-2);
    -webkit-tap-highlight-color: transparent;
}
.tournament-card:hover {
    border-color: var(--ice-dim);
    background: var(--carbon);
}
.tournament-card:active {
    opacity: 0.8;
}
.tournament-card__name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}
.tournament-card__type {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1px 6px;
    background: var(--carbon);
    border-radius: var(--r-sm);
}
.tournament-card__arrow {
    color: var(--text-disabled);
    font-size: 0.75rem;
    transition: transform var(--t-fast) var(--ease-sharp);
}
.tournament-card:hover .tournament-card__arrow {
    color: var(--ice-dim);
}

/* Game cards */
.game-browser__game-cards {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.game-card {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface-elevated);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-sharp);
    -webkit-tap-highlight-color: transparent;
}
.game-card:hover {
    border-color: var(--ice-dim);
    background: var(--carbon);
}
.game-card:active {
    opacity: 0.8;
}
.game-card__team {
    font-size: 0.8125rem;
    font-weight: 500;
}
.game-card__team--left { text-align: right; }
.game-card__team--right { text-align: left; }
.game-card__score {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ice);
    min-width: 60px;
    text-align: center;
}
.game-card__winner { color: var(--positive); }

/* Game detail */
.game-detail__header {
    text-align: center;
    margin-bottom: var(--sp-4);
}
.game-detail__teams {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-1);
}
.game-detail__final {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ice);
}

/* Linescore table */
.game-detail__linescore {
    margin-bottom: var(--sp-4);
    overflow-x: auto;
}
.linescore-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.linescore-table th,
.linescore-table td {
    padding: var(--sp-1) var(--sp-2);
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}
.linescore-table th {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-disabled);
}
.linescore-table td { color: var(--text-secondary); }
.linescore-table td.scored { color: var(--positive); font-weight: 600; }
.linescore-table td.stolen { color: var(--negative); font-weight: 600; }
.linescore-table td.blank { color: var(--text-disabled); }
.linescore-table td.hammer { position: relative; }
.linescore-table td.hammer::after {
    content: '🔨';
    font-size: 0.5rem;
    position: absolute;
    top: 0;
    right: 0;
}
.linescore-table .total { font-weight: 600; color: var(--text-primary); border-left: 2px solid var(--glass-border); }

/* WP chart (mini bar chart per end) */
.game-detail__wp-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 48px;
    margin-bottom: var(--sp-4);
    padding: 0 var(--sp-1);
}
.wp-bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    transition: height var(--t-normal) var(--ease-smooth);
    cursor: pointer;
    position: relative;
}
.wp-bar:hover { opacity: 0.8; }
.wp-bar__tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 6px;
    background: var(--void);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--text-primary);
    white-space: nowrap;
    margin-bottom: 4px;
}
.wp-bar:hover .wp-bar__tooltip { display: block; }

.game-detail__load-btn {
    width: 100%;
    text-align: center;
    padding: var(--sp-3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DATA PROVENANCE INDICATOR
   ═══════════════════════════════════════════════════════════════════════════ */

.data-provenance {
    position: fixed;
    bottom: var(--sp-2);
    left: var(--sp-2);
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px var(--sp-2);
    background: rgba(7, 6, 11, 0.6);
    border: 1px solid transparent;
    border-radius: var(--r-full);
    font-size: 0.5625rem;
    color: var(--text-disabled);
    z-index: 50;
    transition: all var(--t-normal) var(--ease-sharp);
    cursor: default;
    max-width: 120px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0.6;
}
.data-provenance:hover {
    color: var(--text-tertiary);
    border-color: var(--glass-border);
    max-width: 300px;
    opacity: 1;
    background: rgba(18, 16, 26, 0.95);
}

.data-provenance__dot {
    width: 5px;
    height: 5px;
    border-radius: var(--r-full);
    background: var(--warning);
    flex-shrink: 0;
    transition: all var(--t-fast) var(--ease-sharp);
}
.data-provenance__dot.live {
    background: var(--positive);
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}
.data-provenance__dot.model { background: var(--ice-dim); }

/* ═══════════════════════════════════════════════════════════════════════════
   MICRODELIGHTS — Logo, crystals, glows, staggers, springs
   ═══════════════════════════════════════════════════════════════════════════ */

/* Logo — static, no breathing animation */
.header__logo svg {
    opacity: 0.85;
}

/* Header action press feedback */
.header-action::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--ice);
    opacity: 0;
    transition: opacity var(--t-instant);
    pointer-events: none;
}
.header-action:active::after { opacity: 0.08; }

/* WP arc glow halo transition */
#wp-arc-glow {
    transition: stroke-dasharray var(--t-slow) var(--ease-smooth),
                stroke var(--t-slow) var(--ease-sharp),
                opacity var(--t-slow) var(--ease-sharp);
}

/* WP number extreme glow */
.wp-gauge__number[data-glow="high"] {
    text-shadow: 0 0 16px rgba(74, 222, 128, 0.4);
}
.wp-gauge__number[data-glow="low"] {
    text-shadow: 0 0 16px rgba(248, 113, 113, 0.4);
}

/* Ice crystal empty state */
@keyframes crystal-arm-pulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.35; }
}

/* Shot card keyboard focus */
.shot-card:focus-visible {
    outline: 2px solid var(--ice);
    outline-offset: 2px;
    border-color: var(--ice);
}

/* Score value hover glow */
.score-team--red .score-team__value:hover {
    text-shadow: 0 0 10px var(--stone-red-glow);
}
.score-team--yellow .score-team__value:hover {
    text-shadow: 0 0 10px var(--stone-yellow-glow);
}

/* Hammer button hover glow */
.hammer-btn--red:hover { box-shadow: 0 0 10px rgba(231, 76, 60, 0.2); }
.hammer-btn--yellow:hover { box-shadow: 0 0 10px rgba(241, 196, 15, 0.2); }

/* Stagger animations for tournament and game cards */
@keyframes card-slide-in {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes game-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tournament card resets for button usage */
button.tournament-card {
    font: inherit;
    text-align: left;
    width: 100%;
}
button.game-card {
    font: inherit;
    text-align: left;
    width: 100%;
}

/* Tournament card entrance stagger */
.tournament-card {
    opacity: 0;
    animation: card-slide-in var(--t-normal) var(--ease-smooth) forwards;
}
.tournament-card:nth-child(1) { animation-delay: 0ms; }
.tournament-card:nth-child(2) { animation-delay: 40ms; }
.tournament-card:nth-child(3) { animation-delay: 80ms; }
.tournament-card:nth-child(4) { animation-delay: 120ms; }
.tournament-card:nth-child(5) { animation-delay: 160ms; }
.tournament-card:nth-child(6) { animation-delay: 200ms; }

/* Game card entrance stagger */
.game-card {
    opacity: 0;
    animation: game-card-in var(--t-normal) var(--ease-smooth) forwards;
}
.game-card:nth-child(1) { animation-delay: 0ms; }
.game-card:nth-child(2) { animation-delay: 30ms; }
.game-card:nth-child(3) { animation-delay: 60ms; }
.game-card:nth-child(4) { animation-delay: 90ms; }
.game-card:nth-child(5) { animation-delay: 120ms; }
.game-card:nth-child(6) { animation-delay: 150ms; }
.game-card:nth-child(7) { animation-delay: 180ms; }
.game-card:nth-child(8) { animation-delay: 210ms; }

/* Analyze button — no ambient shimmer, clean static state */

/* Dashboard cards: no entrance animation to avoid re-render flicker */

/* Shortcut kbd hover */
.shortcut kbd {
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.shortcut:hover kbd {
    border-color: var(--ice-dim);
    box-shadow: 0 0 6px rgba(103, 212, 228, 0.15);
}

/* End select focus ring */
.meta-item__select:focus-visible {
    outline: 2px solid var(--ice);
    outline-offset: 2px;
}

/* Analyzing glow for shots card */
.dash-card--shots.analyzing {
    border-color: rgba(103, 212, 228, 0.15);
    box-shadow: 0 0 20px rgba(103, 212, 228, 0.06);
}

/* Analysis detail expand */
.dash-card--detail[open] .analysis-detail {
    animation: detail-expand var(--t-normal) var(--ease-smooth);
}
@keyframes detail-expand {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Score dist bar hover */
.score-dist-bar:hover .score-dist-bar__fill {
    filter: brightness(1.2);
    transform: scaleY(1.05);
    transform-origin: bottom;
}
.score-dist-bar__fill {
    transition: height var(--t-normal) var(--ease-smooth), filter var(--t-fast), transform var(--t-fast);
}

/* Factor item hover */
.factor-item {
    transition: background var(--t-fast);
}
.factor-item:hover {
    background: var(--carbon);
}

/* Stone selector active shadow */
.stone-sel.active {
    box-shadow: var(--shadow-glow-ice);
}
.stone-sel--red.active { box-shadow: 0 0 12px rgba(231, 76, 60, 0.25); }
.stone-sel--yellow.active { box-shadow: 0 0 12px rgba(241, 196, 15, 0.25); }

/* Data provenance smooth expand */
.data-provenance {
    transition: all var(--t-normal) var(--ease-smooth);
}

/* Overlay spring transitions */
.game-browser-overlay__panel,
.shortcuts-overlay__panel {
    transition: transform var(--t-normal) var(--ease-bounce), opacity var(--t-normal) var(--ease-sharp);
}

/* WP bar hover */
.wp-bar {
    transition: height var(--t-normal) var(--ease-smooth), filter var(--t-fast), transform var(--t-fast);
}
.wp-bar:hover {
    filter: brightness(1.2);
    transform: scaleY(1.03);
    transform-origin: bottom;
}

/* Game detail load button hover */
.game-detail__load-btn:hover {
    box-shadow: 0 0 20px rgba(103, 212, 228, 0.2), 0 4px 16px rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DELETE DELIGHT — Satisfying stone removal
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes poof-burst {
    0% { transform: scale(0.5); opacity: 1; }
    60% { opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes sparkle-drift {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--drift-x, 20px), var(--drift-y, -30px)) scale(0); opacity: 0; }
}

.toast--delete {
    border-color: rgba(212, 175, 55, 0.2);
}
.toast--delete::before {
    background: var(--gold);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   END-BY-END REPLAY CONTROLS
   ═══════════════════════════════════════════════════════════════════════════ */

.game-detail__replay {
    margin-bottom: var(--sp-4);
    padding: var(--sp-3);
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
}

.replay-controls {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-3);
}

.replay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--glass-border);
    border-radius: var(--r-full);
    background: var(--glass-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-sharp);
    flex-shrink: 0;
}
.replay-btn:hover:not(:disabled) {
    border-color: var(--ice-dim);
    color: var(--ice);
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(103, 212, 228, 0.15);
}
.replay-btn:active:not(:disabled) {
    transform: scale(0.95);
}
.replay-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.replay-info {
    flex: 1;
    text-align: center;
}
.replay-info__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}
.replay-info__detail {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Replay timeline dots */
.replay-timeline {
    display: flex;
    justify-content: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.replay-dot {
    width: 28px;
    height: 28px;
    border-radius: var(--r-full);
    border: 1.5px solid var(--glass-border);
    background: var(--surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-bounce);
}
.replay-dot:hover {
    border-color: var(--ice-dim);
    color: var(--text-primary);
    transform: scale(1.15);
}
.replay-dot.active {
    border-color: var(--ice);
    background: rgba(103, 212, 228, 0.12);
    color: var(--ice);
    box-shadow: 0 0 8px rgba(103, 212, 228, 0.2);
    transform: scale(1.1);
}
.replay-dot.scored { border-color: rgba(74, 222, 128, 0.3); }
.replay-dot.stolen { border-color: rgba(248, 113, 113, 0.3); }
.replay-dot.blank { border-color: rgba(158, 153, 148, 0.2); }

/* ═══════════════════════════════════════════════════════════════════════════
   FIRST-USE ONBOARDING
   ═══════════════════════════════════════════════════════════════════════════ */

.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 6, 11, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-slow) var(--ease-sharp);
}
.onboarding-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.onboarding-overlay__panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: var(--sp-6) var(--sp-6) var(--sp-5);
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: scale(0.9) translateY(16px);
    transition: transform var(--t-slow) var(--ease-bounce);
}
.onboarding-overlay.visible .onboarding-overlay__panel {
    transform: scale(1) translateY(0);
}

.onboarding__icon {
    margin-bottom: var(--sp-3);
    animation: logo-pulse var(--t-breathing) ease-in-out infinite;
}

.onboarding__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-1);
}

.onboarding__subtitle {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: var(--sp-4);
}

.onboarding__steps {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
    text-align: left;
}

.onboarding-step {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    background: var(--surface-elevated);
    border-radius: var(--r-md);
    opacity: 0;
    animation: card-slide-in var(--t-normal) var(--ease-smooth) forwards;
}
.onboarding-step:nth-child(1) { animation-delay: 200ms; }
.onboarding-step:nth-child(2) { animation-delay: 350ms; }
.onboarding-step:nth-child(3) { animation-delay: 500ms; }

.onboarding-step__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--r-full);
    background: rgba(103, 212, 228, 0.12);
    color: var(--ice);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 1px;
}

.onboarding-step__text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.onboarding-step__text strong {
    color: var(--ice-bright);
    font-weight: 600;
}

.onboarding__actions {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    margin-bottom: var(--sp-3);
}

.onboarding__start-btn {
    width: 100%;
    padding: var(--sp-3);
    font-size: 0.9375rem;
    justify-content: center;
}

.onboarding__archive-btn {
    width: 100%;
    font-size: 0.8125rem;
}

.onboarding__remember {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    font-size: 0.6875rem;
    color: var(--text-disabled);
    cursor: pointer;
}
.onboarding__remember input[type="checkbox"] {
    accent-color: var(--ice);
    width: 14px;
    height: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTO-ANALYSIS INDICATOR
   ═══════════════════════════════════════════════════════════════════════════ */

/* Auto-analysis pending: subtle border hint only */
.auto-analysis-pending .action-btn--primary {
    border-color: rgba(103, 212, 228, 0.35);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING SHIMMER
   ═══════════════════════════════════════════════════════════════════════════ */

.shimmer-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 14px 16px;
    overflow: hidden;
    pointer-events: none;
}
.shimmer-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer-slide 1.5s ease-in-out infinite;
    margin-bottom: 8px;
}
.shimmer-line.short { height: 10px; }
@keyframes shimmer-slide {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   REPLAY DOT STATES
   ═══════════════════════════════════════════════════════════════════════════ */

.replay-dot.blank { opacity: 0.4; }
.replay-dot.stolen { 
    border-color: var(--negative);
    background: rgba(231, 76, 60, 0.15);
}
.replay-dot.scored { 
    border-color: var(--positive);
    background: rgba(46, 204, 113, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   POSITION INFO DETAIL (stats display)
   ═══════════════════════════════════════════════════════════════════════════ */

.toast--share {
    border-left: 3px solid var(--ice);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING STATE for GAME BROWSER
   ═══════════════════════════════════════════════════════════════════════════ */

.game-browser__loading {
    text-align: center;
    padding: 24px;
    color: var(--text-tertiary);
    font-style: italic;
}

.tournament-list .shimmer-card,
.game-cards .shimmer-card {
    margin-bottom: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LINESCORE TABLE REFINEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.linescore-table td.scored {
    background: rgba(46, 204, 113, 0.12);
    color: var(--positive);
    font-weight: 600;
}
.linescore-table td.stolen {
    background: rgba(231, 76, 60, 0.12);
    color: var(--negative);
    font-weight: 600;
}
.linescore-table td.blank {
    opacity: 0.4;
}
.linescore-table td.hammer::after {
    content: '🔨';
    font-size: 0.6em;
    position: absolute;
    bottom: 1px;
    right: 2px;
}
.linescore-table td {
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════════
   END SUMMARY CARD — Rich per-end detail in playback mode
   ═══════════════════════════════════════════════════════════════════════════ */

.end-summary {
    margin: var(--sp-3) 0;
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: opacity var(--t-normal) var(--ease-sharp), max-height var(--t-slow) var(--ease-smooth);
}
.end-summary:empty {
    display: none;
}
.end-summary__card {
    background: var(--surface-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    animation: summary-enter var(--t-normal) var(--ease-bounce) forwards;
}
@keyframes summary-enter {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.end-summary__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-3);
}
.end-summary__end-num {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.end-summary__badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: var(--r-full);
}
.end-summary__badge--scored {
    background: rgba(46, 204, 113, 0.15);
    color: var(--positive);
}
.end-summary__badge--stolen {
    background: rgba(231, 76, 60, 0.15);
    color: var(--negative);
}
.end-summary__badge--blank {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
}

.end-summary__score-line {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-2);
}
.end-summary__score-change {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--ice);
}

.end-summary__narrative {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--sp-3);
    font-style: italic;
}

.end-summary__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-2);
}
.end-summary__stat {
    text-align: center;
    padding: var(--sp-2);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--r-md);
}
.end-summary__stat-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.end-summary__stat-label {
    display: block;
    font-size: 0.6rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

/* WP swing indicator */
.end-summary__wp-swing {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    background: rgba(103, 212, 228, 0.04);
    border-radius: var(--r-md);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.end-summary__wp-swing-arrow {
    font-size: 1rem;
}
.end-summary__wp-swing-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
}
.end-summary__wp-swing-fill {
    height: 100%;
    border-radius: 2px;
    transition: width var(--t-slow) var(--ease-smooth);
}
.end-summary__wp-swing-text {
    white-space: nowrap;
}

/* Replay controls enhancement */
.replay-controls {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) 0;
}
.replay-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-md);
    color: var(--text-secondary);
    padding: var(--sp-2);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-sharp);
    display: flex;
    align-items: center;
    justify-content: center;
}
.replay-btn:hover:not(:disabled) {
    background: rgba(103, 212, 228, 0.1);
    border-color: rgba(103, 212, 228, 0.3);
    color: var(--ice);
}
.replay-btn:disabled {
    opacity: 0.25;
    cursor: default;
}
.replay-btn--play {
    background: rgba(103, 212, 228, 0.1);
    border-color: rgba(103, 212, 228, 0.3);
    color: var(--ice);
    font-size: 14px;
    min-width: 36px;
}
.replay-btn--play:hover {
    background: rgba(103, 212, 228, 0.2) !important;
    border-color: var(--ice) !important;
    box-shadow: 0 0 12px rgba(103, 212, 228, 0.2);
}
.replay-info {
    flex: 1;
    text-align: center;
    min-width: 0;
}
.replay-info__label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}
.replay-info__detail {
    display: block;
    font-size: 0.65rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.replay-timeline {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    padding: var(--sp-2) 0;
}
.replay-dot {
    width: 28px;
    height: 28px;
    border-radius: var(--r-full);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-tertiary);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-sharp);
    display: flex;
    align-items: center;
    justify-content: center;
}
.replay-dot:hover {
    background: rgba(103, 212, 228, 0.12);
    border-color: rgba(103, 212, 228, 0.4);
    color: var(--ice);
    transform: scale(1.1);
}
.replay-dot.active {
    background: rgba(103, 212, 228, 0.2);
    border-color: var(--ice);
    color: var(--ice);
    font-weight: 600;
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(103, 212, 228, 0.3);
}

/* WP chart bars */
.wp-bar {
    flex: 1;
    min-width: 0;
    border-radius: 3px 3px 0 0;
    position: relative;
    cursor: pointer;
    transition: opacity var(--t-fast) var(--ease-sharp), transform var(--t-fast) var(--ease-sharp);
}
.wp-bar:hover {
    transform: scaleY(1.05);
    filter: brightness(1.2);
}
.wp-bar__tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.6rem;
    padding: 2px 6px;
    background: var(--surface-elevated);
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-fast);
}
.wp-bar:hover .wp-bar__tooltip {
    opacity: 1;
}
#game-wp-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 80px;
    padding: var(--sp-2) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ═══════════════════════════════════════════════════════════════════════════
   VOICE COACHING OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

.voice-overlay {
    position: fixed;
    bottom: var(--sp-4);
    right: var(--sp-4);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--sp-2);
    pointer-events: none;
}
.voice-overlay > * { pointer-events: auto; }

.voice-toggle {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    background: var(--obsidian);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--r-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-normal);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-family: inherit;
    font-size: 0.75rem;
}
.voice-toggle:hover {
    background: var(--carbon);
    border-color: var(--ice-dim);
    color: var(--ice);
}
.voice-toggle--active {
    background: rgba(103, 212, 228, 0.1);
    border-color: var(--ice-dim);
    color: var(--ice);
}
.voice-toggle__mic { flex-shrink: 0; }
.voice-toggle__status { white-space: nowrap; }

/* State-based mic indicator */
.voice-overlay[data-state="listening"] .voice-toggle {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
    animation: voice-pulse 1.2s ease-in-out infinite;
}
.voice-overlay[data-state="speaking"] .voice-toggle {
    border-color: var(--ice);
    box-shadow: 0 0 12px var(--ice-glow);
}

@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(212, 175, 55, 0.2); }
    50% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.5); }
}

.voice-transcript {
    max-width: 320px;
    max-height: 160px;
    overflow-y: auto;
    background: rgba(7, 6, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--r-md);
    padding: var(--sp-2);
    display: none;
}
.voice-overlay[data-state="ready"] .voice-transcript,
.voice-overlay[data-state="listening"] .voice-transcript,
.voice-overlay[data-state="speaking"] .voice-transcript {
    display: block;
}

.voice-transcript__line {
    font-size: 0.7rem;
    line-height: 1.4;
    padding: 2px 0;
    color: var(--text-secondary);
}
.voice-transcript__line--user { color: var(--gold); }
.voice-transcript__line--assistant { color: var(--ice); }
.voice-transcript__line--system { color: var(--text-muted); font-style: italic; }
.voice-transcript__line--error { color: #F87171; }

/* Hide voice overlay on very small screens */
@media (max-width: 480px) {
    .voice-overlay { bottom: 80px; right: var(--sp-2); }
    .voice-transcript { max-width: 260px; }
}
