        :root,
        body[data-theme="light"] {
            --paper: #fafaf9;
            --surface: #ffffff;
            --ink: #1c1f22;
            --ink-soft: #4d5359;
            --accent: #2f6f5e;
            --accent-soft: #dcebe6;
            --danger: #b3433c;
            --danger-soft: #f5e2e0;
            --muted: #9aa0a6;
            --line: #e7e5e1;
            --overlay: rgba(250, 250, 249, 0.92);
            --modal-shadow: rgba(28, 31, 34, 0.16);
        }

        body[data-theme="dusk"] {
            --paper: #14171a;
            --surface: #1a1e22;
            --ink: #eceeef;
            --ink-soft: #a8afb6;
            --accent: #5fb8a0;
            --accent-soft: #203833;
            --danger: #e0796f;
            --danger-soft: #3a2422;
            --muted: #666e76;
            --line: #2a2f34;
            --overlay: rgba(10, 12, 14, 0.82);
            --modal-shadow: rgba(0, 0, 0, 0.5);
        }

        body[data-theme="sepia"] {
            --paper: #f4ecdc;
            --surface: #faf4e8;
            --ink: #382f24;
            --ink-soft: #6b5d47;
            --accent: #a8652f;
            --accent-soft: #ecd9bd;
            --danger: #a13f34;
            --danger-soft: #e9d3ca;
            --muted: #a2937a;
            --line: #e0d2b4;
            --overlay: rgba(244, 236, 220, 0.92);
            --modal-shadow: rgba(56, 47, 36, 0.2);
        }

        body[data-theme="mono"] {
            --paper: #f2f2f0;
            --surface: #ffffff;
            --ink: #0d0d0d;
            --ink-soft: #454545;
            --accent: #0d0d0d;
            --accent-soft: #dcdcda;
            --danger: #0d0d0d;
            --danger-soft: #dcdcda;
            --muted: #9a9a97;
            --line: #d8d8d5;
            --overlay: rgba(242, 242, 240, 0.92);
            --modal-shadow: rgba(13, 13, 13, 0.18);
        }

        :root {
            --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            background-color: var(--paper);
            color: var(--ink);
            font-family: var(--font-sans);
            height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            align-items: center;
            transition: background-color 0.25s ease, color 0.25s ease;
        }

        #game-container {
            position: relative;
            width: 100%;
            height: 100%;
            background:
                radial-gradient(var(--line) 1px, transparent 1px);
            background-size: 22px 22px;
            background-color: var(--surface);
            overflow: hidden;
        }

        #stats {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            align-items: start;
            z-index: 10;
            pointer-events: none;
            padding: 16px 22px;
            gap: 6px;
            background: linear-gradient(to bottom, var(--surface) 65%, transparent);
            border-bottom: 1px solid var(--line);
        }

        .stat-box { text-align: center; min-width: 0; }
        .stat-label {
            font-family: var(--font-mono);
            font-size: 0.6rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--muted);
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .stat-value {
            font-family: var(--font-mono);
            font-size: 1.08rem;
            font-weight: 500;
            color: var(--ink);
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
        }
        .stat-value.goal { color: var(--accent); font-weight: 700; }
        .stat-value.wpm { color: var(--ink); font-weight: 700; }
        .stat-sub {
            font-family: var(--font-mono);
            font-size: 0.58rem;
            color: var(--muted);
            margin-top: 3px;
            white-space: nowrap;
        }
        .stat-sub .stat-sub-num { color: var(--accent); font-weight: 600; }
        .stat-value.immunity-active { color: var(--accent); }
        .stat-value.zoomies-active { color: var(--danger); }

        .word {
            position: absolute;
            font-family: var(--font-sans);
            font-size: 1.15rem;
            font-weight: 500;
            color: var(--ink-soft);
            white-space: nowrap;
            padding: 4px 10px;
            border-radius: 6px;
            transition: color 0.1s;
        }

        .word span.typed {
            color: var(--accent);
            border-bottom: 2px solid var(--accent);
        }

        @keyframes explode {
            0% { transform: scale(1); opacity: 1; }
            100% { transform: scale(1.8); opacity: 0; filter: blur(6px); }
        }

        .exploding {
            animation: explode 0.35s forwards ease-out;
            color: var(--accent) !important;
        }

        #input-display {
            position: absolute;
            bottom: 76px;
            left: 50%;
            transform: translateX(-50%);
            font-family: var(--font-mono);
            font-size: 1.9rem;
            font-weight: 500;
            color: var(--ink);
            min-height: 3rem;
            min-width: 240px;
            text-align: center;
            border-bottom: 2px solid var(--line);
            padding: 0 24px 8px;
            letter-spacing: 1px;
        }

        .overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--overlay);
            backdrop-filter: blur(3px);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 100;
            text-align: center;
            padding: 20px;
        }

        .hidden { display: none !important; }

        .eyebrow {
            font-family: var(--font-mono);
            font-size: 0.7rem;
            letter-spacing: 2px;
            text-transform: uppercase;
            color: var(--accent);
            margin-bottom: 14px;
        }

        h1 {
            font-family: var(--font-sans);
            font-weight: 600;
            font-size: 2.75rem;
            margin-bottom: 10px;
            letter-spacing: -1px;
            color: var(--ink);
        }

        .subtext {
            color: var(--ink-soft);
            font-size: 0.95rem;
            max-width: 380px;
            line-height: 1.5;
        }

        .subtext.small {
            font-size: 0.8rem;
            color: var(--muted);
            margin-top: 8px;
        }

        button {
            font-family: var(--font-mono);
            background: var(--ink);
            color: var(--surface);
            border: none;
            padding: 13px 34px;
            font-size: 0.85rem;
            font-weight: 600;
            letter-spacing: 0.5px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s ease;
            margin-top: 28px;
        }

        button:hover {
            background: var(--accent);
            transform: translateY(-1px);
            box-shadow: 0 4px 14px rgba(47, 111, 94, 0.25);
        }

        button:active { transform: translateY(0); }

        /* ---- Floating health indicator (bottom-left, floating) ---- */
        #health-float {
            position: absolute;
            bottom: 24px;
            left: 22px;
            z-index: 60;
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: 20px;
            padding: 9px 16px 9px 12px;
            box-shadow: 0 10px 26px var(--modal-shadow);
        }
        #health-heart {
            color: var(--danger);
            font-size: 1rem;
            line-height: 1;
            filter: drop-shadow(0 0 2px rgba(179,67,60,0.3));
        }
        #health-float-track {
            width: 120px;
            height: 8px;
            border-radius: 6px;
            background: var(--line);
            overflow: hidden;
        }
        #health-float-fill {
            height: 100%;
            background: var(--danger);
            transition: width 0.3s ease-out, background 0.3s ease;
            width: 100%;
        }

        .summary-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin: 28px 0 6px;
            width: 100%;
            max-width: 360px;
        }

        .summary-item {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 16px;
            background: var(--paper);
            border: 1px solid var(--line);
            border-radius: 8px;
        }
        .summary-label {
            font-family: var(--font-mono);
            font-size: 0.65rem;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: var(--muted);
        }
        .summary-value {
            font-family: var(--font-mono);
            font-size: 1.6rem;
            font-weight: 700;
            color: var(--ink);
        }

        /* ---- Settings trigger ---- */
        #settings-btn {
            position: absolute;
            top: 14px;
            right: 16px;
            z-index: 20;
            width: 34px;
            height: 34px;
            padding: 0;
            margin: 0;
            border-radius: 8px;
            background: transparent;
            color: var(--ink-soft);
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
            box-shadow: none;
        }
        #settings-btn:hover {
            background: var(--accent-soft);
            color: var(--accent);
            transform: none;
            box-shadow: none;
        }
        #settings-btn svg { width: 18px; height: 18px; }

        /* ---- Modal card (settings, pause) ---- */
        .modal-card {
            width: 100%;
            max-width: 400px;
            max-height: 86vh;
            overflow-y: auto;
            text-align: left;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: 18px;
            box-shadow: 0 24px 60px var(--modal-shadow);
            padding: 30px 30px 26px;
        }

        .settings-group {
            margin-top: 20px;
            background: var(--paper);
            border: 1px solid var(--line);
            border-radius: 12px;
            padding: 16px 16px 14px;
        }
        .settings-group:first-of-type { margin-top: 26px; }

        .settings-group-label {
            font-family: var(--font-mono);
            font-size: 0.65rem;
            letter-spacing: 1.2px;
            text-transform: uppercase;
            color: var(--muted);
            margin-bottom: 12px;
        }

        .option-row {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
        }

        .option-btn {
            font-family: var(--font-mono);
            font-size: 0.75rem;
            font-weight: 500;
            background: var(--surface);
            color: var(--ink-soft);
            border: 1px solid var(--line);
            border-radius: 6px;
            padding: 9px 4px;
            cursor: pointer;
            transition: all 0.15s ease;
            margin: 0;
            letter-spacing: 0;
        }
        .option-btn:hover {
            border-color: var(--accent);
            color: var(--accent);
            transform: none;
            box-shadow: none;
            background: var(--surface);
        }
        .option-btn.active {
            background: var(--ink);
            color: var(--surface);
            border-color: var(--ink);
        }

        .theme-swatch {
            display: flex;
            align-items: center;
            gap: 6px;
            justify-content: center;
        }
        .theme-dot {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            display: inline-block;
            box-shadow: 0 0 0 1px var(--line);
        }

        .toggle-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 10px 0;
            border-bottom: 1px solid var(--line);
        }
        .toggle-row:last-child { border-bottom: none; }

        .toggle-row-label {
            font-size: 0.88rem;
            font-weight: 500;
            color: var(--ink);
        }
        .toggle-row-desc {
            font-size: 0.74rem;
            color: var(--muted);
            margin-top: 2px;
            line-height: 1.3;
        }

        .switch {
            position: relative;
            width: 40px;
            height: 22px;
            flex-shrink: 0;
            border-radius: 20px;
            background: var(--line);
            cursor: pointer;
            transition: background 0.15s ease;
        }
        .switch.on { background: var(--accent); }
        .switch-knob {
            position: absolute;
            top: 2px;
            left: 2px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--surface);
            transition: transform 0.15s ease;
            box-shadow: 0 1px 3px rgba(0,0,0,0.3);
        }
        .switch.on .switch-knob { transform: translateX(18px); }

        #settings-close {
            margin-top: 26px;
            width: 100%;
        }

        #settings-screen h1, #pause-screen h1 { font-size: 1.6rem; }
        #settings-screen .eyebrow, #pause-screen .eyebrow { text-align: left; }
        #settings-screen h1 { text-align: left; margin-bottom: 4px; }

        /* ---- Pause modal ---- */
        #pause-screen .modal-card {
            text-align: center;
            padding: 34px 30px 30px;
        }
        #pause-screen .eyebrow { text-align: center; }
        #pause-screen h1 { text-align: center; }
        .pause-hint {
            margin-top: 18px;
            font-family: var(--font-mono);
            font-size: 0.72rem;
            color: var(--muted);
            letter-spacing: 0.3px;
        }
        .pause-hint kbd {
            font-family: var(--font-mono);
            background: var(--paper);
            border: 1px solid var(--line);
            border-radius: 4px;
            padding: 1px 6px;
            color: var(--ink-soft);
        }
        #pause-continue { width: 100%; margin-top: 24px; }

        .pause-actions {
            display: flex;
            gap: 10px;
            margin-top: 24px;
        }
        .pause-actions button { flex: 1; margin-top: 0; }
        #pause-restart, #pause-settings {
            background: var(--paper);
            color: var(--ink);
            border: 1px solid var(--line);
        }
        #pause-restart:hover, #pause-settings:hover {
            background: var(--accent-soft);
            color: var(--accent);
            box-shadow: none;
        }

        /* ---- Wider settings modal ---- */
        #settings-screen .modal-card { max-width: 620px; }
        #settings-screen .option-row.wide-row { grid-template-columns: repeat(4, 1fr); }
        #settings-screen .option-row.three-col { grid-template-columns: repeat(3, 1fr); }

        /* ---- Countdown overlay ---- */
        #countdown-overlay {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            z-index: 150;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0,0,0,0);
            pointer-events: none;
            transition: background 0.35s ease;
        }
        #countdown-overlay.dark { background: rgba(0,0,0,0.55); }
        #countdown-text {
            font-family: var(--font-mono);
            font-weight: 700;
            font-size: 5rem;
            color: #fff;
            text-shadow: 0 4px 30px rgba(0,0,0,0.5);
            opacity: 0;
            transform: scale(0.6);
        }
        #countdown-text.show {
            animation: countdownPop 0.9s cubic-bezier(.2,1.4,.4,1) forwards;
        }
        #countdown-text.go {
            color: var(--accent);
            animation: countdownGo 0.7s ease forwards;
        }
        @keyframes countdownPop {
            0% { opacity: 0; transform: scale(0.4); }
            30% { opacity: 1; transform: scale(1.15); }
            60% { transform: scale(1); }
            100% { opacity: 1; transform: scale(1); }
        }
        @keyframes countdownGo {
            0% { opacity: 0; transform: scale(0.5); }
            40% { opacity: 1; transform: scale(1.2); }
            70% { transform: scale(1); }
            100% { opacity: 0; transform: scale(1.05); }
        }

        /* ---- Panda companion (start screen) ---- */
        #panda-companion {
            position: absolute;
            top: 58%;
            right: 6%;
            transform: translateY(-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 14px;
            max-width: 320px;
        }
        #panda-avatar-wrap {
            width: 108px;
            height: 108px;
            flex-shrink: 0;
            cursor: pointer;
            filter: drop-shadow(0 8px 20px rgba(0,0,0,0.22));
            transition: transform 0.2s ease;
        }
        #panda-avatar-wrap:hover { transform: scale(1.06) rotate(-3deg); }
        #panda-avatar-wrap img { width: 100%; height: 100%; display: block; }
        #panda-avatar-wrap.bounce { animation: pandaBounce 0.6s ease; }
        @keyframes pandaBounce {
            0%, 100% { transform: translateY(0); }
            30% { transform: translateY(-8px); }
            60% { transform: translateY(2px); }
        }
        #panda-bubble {
            max-width: 340px;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: 14px 14px 14px 4px;
            padding: 12px 16px;
            font-size: 0.78rem;
            line-height: 1.4;
            color: var(--ink);
            box-shadow: 0 8px 24px var(--modal-shadow);
            pointer-events: auto;
            opacity: 0;
            transform: translateY(6px) scale(0.96);
            transition: opacity 0.25s ease, transform 0.25s ease;
        }
        #panda-bubble.show { opacity: 1; transform: translateY(0) scale(1); }
        #panda-bubble.hidden-bubble { display: none; }
        #panda-bubble { cursor: pointer; text-align: left; }
        #panda-bubble .panda-name {
            display: block;
            font-family: var(--font-mono);
            font-size: 0.62rem;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: var(--accent);
            margin-bottom: 4px;
        }
        #panda-dots {
            display: flex;
            gap: 6px;
            justify-content: center;
            margin-top: 2px;
        }
        #panda-dots .pdot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--line);
            transition: background 0.2s ease, transform 0.2s ease;
        }
        #panda-dots .pdot.active { background: var(--accent); transform: scale(1.3); }

        /* ---- Zoomies flash / big panda moment ---- */
        #zoomies-flash {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            z-index: 200;
            background: #000;
            opacity: 0;
            pointer-events: none;
        }
        #zoomies-flash.blinking { animation: zoomiesBlink 1.4s steps(1, end) 1; }
        @keyframes zoomiesBlink {
            0% { opacity: 0; } 12% { opacity: 0.85; } 24% { opacity: 0; }
            36% { opacity: 0.85; } 48% { opacity: 0; } 60% { opacity: 0.7; }
            72% { opacity: 0; } 100% { opacity: 0; }
        }
        #zoomies-panda {
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%) scale(0.4);
            z-index: 210;
            text-align: center;
            opacity: 0;
            pointer-events: none;
        }
        #zoomies-panda img { width: 130px; height: 130px; filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5)); }
        #zoomies-panda.appear { animation: zoomiesPandaIn 1.4s steps(6, end) forwards; }
        @keyframes zoomiesPandaIn {
            0% { opacity: 0; transform: translate(-50%,-50%) scale(0.4); }
            15% { opacity: 1; }
            25% { opacity: 0.2; }
            35% { opacity: 1; }
            45% { opacity: 0.2; }
            55% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
            100% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
        }
        #zoomies-panda.leave { animation: zoomiesPandaOut 0.5s ease forwards; }
        @keyframes zoomiesPandaOut {
            0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
            100% { opacity: 0; transform: translate(-50%,-50%) scale(0.5); }
        }
        #zoomies-text {
            margin-top: 14px;
            font-family: var(--font-mono);
            font-weight: 700;
            font-size: 1.3rem;
            color: #fff;
            text-shadow: 0 3px 20px rgba(0,0,0,0.6);
            opacity: 0;
            max-width: 340px;
            background: rgba(10, 10, 12, 0.72);
            padding: 10px 18px;
            border-radius: 12px;
            box-shadow: 0 6px 20px rgba(0,0,0,0.45);
        }
        #zoomies-text.show { animation: fadeInUp 0.4s ease forwards; }
        @keyframes fadeInUp {
            0% { opacity: 0; transform: translateY(8px); }
            100% { opacity: 1; transform: translateY(0); }
        }

        /* ---- Zoomies countdown progress bar (bottom left) ---- */
        #zoomies-bar-wrap {
            position: absolute;
            bottom: 14px;
            left: 18px;
            z-index: 55;
            width: 190px;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: 10px;
            padding: 9px 12px;
            box-shadow: 0 8px 22px var(--modal-shadow);
            opacity: 0;
            transform: translateY(10px);
            transition: opacity 0.25s ease, transform 0.25s ease;
            pointer-events: none;
        }
        #zoomies-bar-wrap.show { opacity: 1; transform: translateY(0); }
        #zoomies-bar-label {
            font-family: var(--font-mono);
            font-size: 0.62rem;
            letter-spacing: 0.8px;
            text-transform: uppercase;
            color: var(--danger);
            display: flex;
            justify-content: space-between;
            margin-bottom: 6px;
        }
        #zoomies-bar-track {
            width: 100%;
            height: 6px;
            border-radius: 4px;
            background: var(--line);
            overflow: hidden;
        }
        #zoomies-bar-fill {
            height: 100%;
            width: 100%;
            background: var(--danger);
            transition: width 0.2s linear;
        }
        #zoomies-bar-fill.immune { background: var(--accent); }

        /* ---- Health pack toast ---- */
        #pack-toast {
            position: absolute;
            top: 74px;
            left: 50%;
            transform: translateX(-50%) translateY(-8px);
            z-index: 70;
            background: var(--ink);
            color: var(--surface);
            font-family: var(--font-mono);
            font-size: 0.78rem;
            font-weight: 600;
            padding: 9px 18px;
            border-radius: 20px;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease, transform 0.3s ease;
        }
        #pack-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

        /* ---- Start screen footer links ---- */
        #footer-links {
            position: absolute;
            bottom: 22px;
            left: 26px;
            display: flex;
            align-items: center;
            gap: 10px;
            pointer-events: auto;
        }
        .footer-link-btn {
            font-family: var(--font-mono);
            background: transparent;
            color: var(--muted);
            border: none;
            padding: 4px 2px;
            margin: 0;
            font-size: 0.72rem;
            letter-spacing: 0.6px;
            text-transform: uppercase;
            cursor: pointer;
            box-shadow: none;
        }
        .footer-link-btn:hover {
            background: transparent;
            color: var(--accent);
            transform: none;
            box-shadow: none;
        }
        .footer-dot { color: var(--line); font-size: 0.7rem; }

        /* ---- Info panels (About / Updates / Support) ---- */
        .info-panel {
            position: absolute;
            bottom: 68px;
            left: 26px;
            z-index: 120;
            max-width: 380px;
        }
        .info-panel-card {
            position: relative;
            background: var(--surface);
            border: 1px solid var(--line);
            border-radius: 16px 16px 16px 4px;
            box-shadow: 0 20px 50px var(--modal-shadow);
            padding: 22px 22px 18px;
            text-align: left;
            transform-origin: bottom left;
            animation: bubbleIn 0.32s cubic-bezier(.2,1.2,.4,1) forwards;
        }
        @keyframes bubbleIn {
            0% { opacity: 0; transform: scale(0.85) translateY(10px); }
            60% { opacity: 1; }
            100% { opacity: 1; transform: scale(1) translateY(0); }
        }
        .info-panel-close {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 26px;
            height: 26px;
            padding: 0;
            margin: 0;
            border-radius: 50%;
            background: var(--paper);
            color: var(--ink-soft);
            font-size: 0.7rem;
            box-shadow: none;
        }
        .info-panel-close:hover { background: var(--accent-soft); color: var(--accent); transform: none; box-shadow: none; }
        .info-panel-eyebrow {
            font-family: var(--font-mono);
            font-size: 0.65rem;
            letter-spacing: 1.4px;
            text-transform: uppercase;
            color: var(--accent);
            margin-bottom: 10px;
            padding-right: 20px;
        }
        .info-panel-text {
            font-size: 0.82rem;
            line-height: 1.55;
            color: var(--ink-soft);
            margin-bottom: 10px;
        }
        .info-panel-text:last-child { margin-bottom: 0; }
        .info-panel-text a { color: var(--accent); font-weight: 600; text-decoration: underline; }

        .updates-card { width: 420px; max-width: 88vw; max-height: 60vh; overflow-y: auto; }
        .updates-tabs {
            display: flex;
            gap: 6px;
            margin-bottom: 14px;
            border-bottom: 1px solid var(--line);
            padding-bottom: 10px;
        }
        .updates-tab {
            font-family: var(--font-mono);
            font-size: 0.68rem;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            background: var(--paper);
            color: var(--ink-soft);
            border: 1px solid var(--line);
            border-radius: 20px;
            padding: 6px 14px;
            margin: 0;
            cursor: pointer;
            box-shadow: none;
        }
        .updates-tab:hover { background: var(--accent-soft); color: var(--accent); transform: none; box-shadow: none; }
        .updates-tab.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
        .updates-list { padding-left: 18px; }
        .updates-list li { font-size: 0.82rem; line-height: 1.55; color: var(--ink-soft); margin-bottom: 9px; }

        .heart-card { text-align: center; border-radius: 24px 24px 24px 24px; }
        .heart-shape {
            font-size: 2.4rem;
            line-height: 1;
            margin-bottom: 8px;
            animation: heartBeat 1.1s ease-in-out infinite;
        }
        @keyframes heartBeat {
            0%, 100% { transform: scale(1); }
            25% { transform: scale(1.12); }
            40% { transform: scale(0.98); }
            60% { transform: scale(1.08); }
        }
        .heart-card .info-panel-eyebrow { text-align: center; }
        .heart-card .info-panel-text { text-align: left; }

        /* ---- Special falling words ---- */
        .word.special-gold {
            color: #8a6d1a;
            font-weight: 700;
            background: linear-gradient(180deg, rgba(255,215,90,0.28), rgba(255,215,90,0.12));
            box-shadow: 0 0 10px 2px rgba(255, 205, 60, 0.55), 0 0 22px 4px rgba(255, 205, 60, 0.28);
            animation: goldPulse 1.1s ease-in-out infinite;
        }
        body[data-theme="dusk"] .word.special-gold { color: #ffe08a; }
        @keyframes goldPulse {
            0%, 100% { box-shadow: 0 0 10px 2px rgba(255, 205, 60, 0.55), 0 0 22px 4px rgba(255, 205, 60, 0.28); }
            50% { box-shadow: 0 0 16px 4px rgba(255, 205, 60, 0.85), 0 0 30px 8px rgba(255, 205, 60, 0.4); }
        }
        .word.special-risk {
            color: #b3433c;
            font-weight: 700;
            background: rgba(179, 67, 60, 0.12);
            box-shadow: 0 0 0 1px rgba(179, 67, 60, 0.4);
        }
        .word.special-freeze {
            color: #2b7fd4;
            font-weight: 700;
            background: linear-gradient(180deg, rgba(90,170,255,0.22), rgba(90,170,255,0.1));
            box-shadow: 0 0 10px 2px rgba(90, 170, 255, 0.45);
        }
        .word.special-gold span.typed,
        .word.special-risk span.typed,
        .word.special-freeze span.typed { color: inherit; border-bottom-color: currentColor; }

        #freeze-banner {
            position: absolute;
            top: 84px;
            left: 50%;
            transform: translateX(-50%) translateY(-6px);
            z-index: 65;
            background: #2b7fd4;
            color: #fff;
            font-family: var(--font-mono);
            font-size: 0.75rem;
            font-weight: 600;
            padding: 7px 16px;
            border-radius: 20px;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease, transform 0.3s ease;
        }
        #freeze-banner.show { opacity: 1; transform: translateX(-50%) translateY(0); }

        /* =========================================================
           Responsive layout — tablet and small-screen adjustments
           ========================================================= */

        /* ---- Tablet / narrow desktop (<=900px) ---- */
        @media (max-width: 900px) {
            #stats {
                grid-template-columns: repeat(4, 1fr);
                row-gap: 12px;
                padding: 12px 14px;
            }
            #panda-companion {
                right: 3%;
                max-width: 240px;
            }
            #panda-avatar-wrap { width: 86px; height: 86px; }
            #panda-bubble { max-width: 220px; font-size: 0.72rem; }
        }

        /* ---- Tablet / small window (<=768px) ---- */
        @media (max-width: 768px) {
            h1 { font-size: 2.1rem; }
            .subtext { font-size: 0.85rem; max-width: 320px; }
            button { padding: 11px 26px; font-size: 0.8rem; }

            #stats {
                grid-template-columns: repeat(4, 1fr);
                gap: 4px 8px;
                padding: 10px 10px;
            }
            .stat-label { font-size: 0.54rem; }
            .stat-value { font-size: 0.92rem; }
            .stat-sub { font-size: 0.52rem; }

            #settings-btn { top: 10px; right: 10px; width: 30px; height: 30px; }

            .word { font-size: 1rem; padding: 3px 8px; }

            #input-display {
                bottom: 66px;
                font-size: 1.5rem;
                min-width: 180px;
                min-height: 2.4rem;
            }

            #health-float { bottom: 18px; left: 14px; padding: 7px 12px 7px 10px; }
            #health-float-track { width: 88px; }

            #zoomies-bar-wrap { width: 160px; bottom: 12px; left: 14px; }

            .modal-card { padding: 22px 20px 20px; max-width: 92vw; }
            .settings-group { padding: 12px 12px 10px; }
            .option-row { gap: 6px; }
            .option-btn { font-size: 0.68rem; padding: 8px 3px; }

            #panda-companion {
                top: auto;
                bottom: 84px;
                right: 50%;
                transform: translateX(50%);
                flex-direction: row-reverse;
                align-items: flex-end;
                max-width: 92vw;
            }
            #panda-avatar-wrap { width: 60px; height: 60px; }
            #panda-bubble { max-width: 200px; font-size: 0.7rem; padding: 10px 12px; }
            #panda-dots { display: none; }

            #footer-links { bottom: 16px; left: 50%; transform: translateX(-50%); }

            .info-panel { left: 12px; right: 12px; max-width: none; bottom: 60px; }
            .info-panel-card { padding: 18px 18px 16px; }
            .updates-card { width: 100%; }

            .summary-grid { max-width: 320px; gap: 12px; }
            .summary-value { font-size: 1.3rem; }
        }

        /* ---- Mobile-width windows (<=480px) ---- */
        @media (max-width: 480px) {
            h1 { font-size: 1.7rem; }
            .eyebrow { font-size: 0.62rem; margin-bottom: 10px; }
            .subtext { font-size: 0.78rem; max-width: 260px; }

            #stats {
                grid-template-columns: repeat(4, 1fr);
                gap: 8px 6px;
                padding: 8px 8px;
            }
            .stat-label { font-size: 0.48rem; letter-spacing: 0.5px; }
            .stat-value { font-size: 0.78rem; }
            .stat-sub { display: none; }

            .word { font-size: 0.88rem; padding: 2px 6px; }

            #input-display {
                bottom: 58px;
                font-size: 1.2rem;
                min-width: 140px;
                min-height: 2rem;
                padding: 0 12px 6px;
            }

            #health-float { bottom: 14px; left: 10px; gap: 7px; padding: 6px 10px 6px 8px; }
            #health-float-track { width: 64px; height: 6px; }
            #health-heart { font-size: 0.85rem; }

            #zoomies-bar-wrap { width: 130px; bottom: 10px; left: 10px; padding: 7px 9px; }
            #zoomies-bar-label { font-size: 0.55rem; }

            #zoomies-panda img { width: 90px; height: 90px; }
            #zoomies-text { font-size: 1rem; max-width: 260px; padding: 8px 12px; }

            .modal-card { padding: 18px 14px 16px; border-radius: 14px; }
            h1 + .eyebrow, .eyebrow { margin-bottom: 8px; }
            .settings-group { margin-top: 14px; padding: 10px 10px 8px; }
            .settings-group:first-of-type { margin-top: 18px; }
            .option-row { grid-template-columns: repeat(2, 1fr); }
            #settings-screen .option-row.three-col { grid-template-columns: 1fr; }
            .toggle-row-label { font-size: 0.85rem; }
            .toggle-row-desc { font-size: 0.72rem; }

            #panda-companion { bottom: 74px; }
            #panda-avatar-wrap { width: 48px; height: 48px; }
            #panda-bubble { max-width: 160px; font-size: 0.64rem; padding: 8px 10px; }

            #footer-links { gap: 6px; }
            .footer-link-btn { font-size: 0.62rem; }

            .summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; max-width: 280px; }
            .summary-item { padding: 12px; }
            .summary-value { font-size: 1.1rem; }
            .summary-label { font-size: 0.58rem; }

            button { padding: 10px 22px; font-size: 0.75rem; margin-top: 20px; }
        }

        /* ---- Very small heights (short windows / landscape phones) ---- */
        @media (max-height: 480px) {
            #panda-companion { display: none; }
            .modal-card { max-height: 92vh; }
            h1 { font-size: 1.5rem; margin-bottom: 6px; }
            .subtext { display: none; }
        }
