        /* =====================================================================
         * THEME TOKENS — Change colors here, they cascade everywhere
         * ===================================================================== */
        :root {
            --bg-color: #12161a;
            --panel-bg: #222831;
            --accent-yellow: #FFD200;
            --accent-red: #FF4136;
            --accent-blue: #0074D9;
            --text-light: #F5F5F5;

            --tile-neutral: #00A3E0;
            --tile-challenge: #FF851B;
            --tile-item: #2ECC40;
            --tile-trivia: #B10DC9;
            --tile-unlucky: #FF4136;
        }

        body {
            font-family: 'Fredoka', sans-serif;
            background-color: var(--bg-color);
            color: var(--text-light);
            margin: 0;
            padding: 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            user-select: none;
            overflow-x: hidden; /* prevent horizontal scroll from the wide board canvas */
			overflow-y: auto;   /* allow vertical scroll on small screens */
        }

        h1 {
            font-family: 'Sniglet', cursive;
            color: var(--accent-yellow);
            text-shadow: 3px 3px 0px #000;
            margin: 5px 0 10px 0;
            font-size: 2rem;
            text-align: center;
            letter-spacing: 2px;
        }

		.game-container {
			display: grid;
			grid-template-columns: 380px 1fr;
			gap: 15px;
			width: 100%;
			max-width: 1600px;
			height: calc(100vh - 70px);
		}

		@media (max-width: 900px) {
			.game-container {
				grid-template-columns: 1fr;   /* single column */
				grid-template-rows: auto auto;
				height: auto;                 /* let content size itself */
			}

			.sidebar {
				max-height: 45vh;             /* don't let it eat the whole screen */
				order: 2;                     /* board first, sidebar below it */
			}

			.board-wrapper {
				order: 1;
				height: 55vh;                 /* give the board a real height to scroll/pan inside */
			}
		}

        .sidebar {
            background-color: var(--panel-bg);
            border: 4px solid #393E46;
            border-radius: 15px;
            padding: 15px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            overflow-y: auto;
            box-shadow: 5px 5px 0px #000;
        }

        .panel-section {
            background: rgba(0,0,0,0.2);
            border-radius: 10px;
            padding: 12px;
            border-left: 5px solid var(--accent-yellow);
        }

        .panel-section h2 {
            margin: 0 0 8px 0;
            font-size: 1.1rem;
            color: var(--accent-yellow);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .player-status-card {
            background: #2d343f;
            border: 3px solid #393E46;
            border-radius: 8px;
            padding: 8px;
            margin-bottom: 6px;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .player-status-card.active {
            border-color: var(--accent-yellow);
            box-shadow: 0 0 8px var(--accent-yellow);
        }

        .player-header {
            display: flex;
            justify-content: space-between;
            font-weight: 900;
        }

        .player-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            font-size: 0.85rem;
            color: #ccc;
        }
		
		.drink-counter-row {
			display: grid;
			grid-template-columns: 1fr 1fr;
			gap: 4px;
			margin-top: 6px;
		}
		.drink-counter-mini {
			display: flex;
			align-items: center;
			justify-content: space-between;
			background: rgba(0,0,0,0.25);
			border-radius: 6px;
			padding: 2px 4px;
			font-size: 0.72rem;
		}
		.drink-counter-icon { flex-shrink: 0; }
		.drink-counter-val { min-width: 1.4ch; text-align: center; font-weight: 900; }
		.drink-counter-btn {
			width: 18px; height: 18px; padding: 0; font-size: 0.8rem;
			border-bottom-width: 2px; line-height: 1; border-radius: 4px;
		}

        button {
            font-family: 'Fredoka', sans-serif;
            background-color: var(--accent-blue);
            color: white;
            border: none;
            border-bottom: 4px solid rgba(0,0,0,0.4);
            border-radius: 8px;
            padding: 10px 12px;
            font-size: 0.95rem;
            font-weight: bold;
            cursor: pointer;
        }
		@media (max-width: 500px) {
			button {
				padding: 12px 14px;
				font-size: 1rem;
			}
		}
        button:active {
            transform: translateY(2px);
            border-bottom-width: 2px;
        }
        button:disabled {
            background-color: #555 !important;
            border-bottom: 2px solid #333;
            cursor: not-allowed;
        }

        .action-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

        .btn-roll { background-color: var(--accent-red); position: relative; }
        .btn-trade { background-color: var(--tile-item); }

        .board-wrapper {
            background-color: var(--panel-bg);
            border: 4px solid #393E46;
            border-radius: 15px;
            box-shadow: 5px 5px 0px #000;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }

        .board-header-info {
            background: rgba(0,0,0,0.4);
            padding: 8px;
            display: flex;
            justify-content: space-around;
            font-size: 0.85rem;
            border-bottom: 2px solid #393E46;
            flex-wrap: wrap;
            gap: 5px;
        }

        .legend-item { display: flex; align-items: center; gap: 4px; }
        .legend-dot { width: 12px; height: 12px; border-radius: 3px; }

        .find-player-bar {
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 8px;
            padding: 8px;
            background: rgba(0,0,0,0.25);
            border-bottom: 2px solid #393E46;
        }

        .find-player-btn {
            font-family: 'Fredoka', sans-serif;
            font-weight: 900;
            font-size: 0.85rem;
            padding: 7px 14px;
            border: none;
            border-bottom: 4px solid rgba(0,0,0,0.4);
            border-radius: 8px;
            color: #12161a;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .find-player-btn:active {
            transform: translateY(2px);
            border-bottom-width: 2px;
        }
        .find-player-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
        .find-player-btn .fpb-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: rgba(0,0,0,0.35);
            flex-shrink: 0;
        }

        .settings-menu-wrapper {
            position: fixed;
            top: 12px;
            right: 12px;
            z-index: 200;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .settings-gear-btn {
            background-color: var(--panel-bg);
            border: 3px solid #393E46;
            border-radius: 50%;
            width: 44px;
            height: 44px;
            font-size: 1.3rem;
            padding: 0;
            line-height: 1;
            box-shadow: 3px 3px 0px #000;
        }

        .settings-dropdown {
            display: none;
            position: absolute;
            top: 52px;
            right: 0;
            background-color: var(--panel-bg);
            border: 3px solid #393E46;
            border-radius: 10px;
            box-shadow: 5px 5px 0px #000;
            padding: 10px;
            min-width: 200px;
            flex-direction: column;
            gap: 8px;
        }

        .settings-dropdown.open { display: flex; }

        .settings-dropdown-item {
            width: 100%;
            background-color: var(--accent-red);
            text-align: center;
        }

        .board-scroll-container {
            flex: 1;
            overflow: auto;
            padding: 20px;
            position: relative;
            background: #161a22;
        }

        .board-canvas-layer {
            position: relative;
            display: inline-block;
        }

        .board-svg {
            display: block;
        }

        .token-fly-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        /* =====================================================================
         * SVG BOARD TILES — neon-style nodes. Each tile is a <g id="{tileId}">
         * translated to its (x,y) center, containing a landing ring, the base
         * circle (fill + glow via CSS classes keyed to tile type), an icon,
         * a small label, and a nested <g id="box_{tileId}"> for player tokens.
         * ===================================================================== */
        .board-tile-node .tile-base {
            stroke: #000;
            stroke-width: 2px;
            transition: fill 0.2s;
        }
        .tile-fill-START     { fill: #444; }
        .tile-fill-FINISH    { fill: gold; }
        .tile-fill-neutral   { fill: var(--tile-neutral); }
        .tile-fill-challenge { fill: var(--tile-challenge); }
        .tile-fill-item      { fill: var(--tile-item); }
        .tile-fill-trivia    { fill: var(--tile-trivia); }
        .tile-fill-unlucky   { fill: var(--tile-unlucky); }

        .tile-glow-START     { filter: drop-shadow(0 0 5px #888); }
        .tile-glow-FINISH    { filter: drop-shadow(0 0 9px gold) drop-shadow(0 0 3px gold); }
        .tile-glow-neutral   { filter: drop-shadow(0 0 6px var(--tile-neutral)); }
        .tile-glow-challenge { filter: drop-shadow(0 0 6px var(--tile-challenge)); }
        .tile-glow-item      { filter: drop-shadow(0 0 6px var(--tile-item)); }
        .tile-glow-trivia    { filter: drop-shadow(0 0 6px var(--tile-trivia)); }
        .tile-glow-unlucky   { filter: drop-shadow(0 0 6px var(--tile-unlucky)); }

        .tile-icon-text {
            font-size: 22px;
            text-anchor: middle;
            dominant-baseline: central;
            pointer-events: none;
            user-select: none;
        }
        .tile-label-text {
            font-size: 9px;
            fill: #aaa;
            text-anchor: middle;
            font-family: 'Fredoka', sans-serif;
            pointer-events: none;
            user-select: none;
        }

        /* Edges connecting tiles — dim by default, glow gold + "flow" when lit
         * as part of a movement preview. */
        .edge-line {
            stroke: rgba(255,255,255,0.14);
            stroke-width: 4;
            stroke-linecap: round;
        }
        .edge-line.edge-lit {
            stroke: var(--accent-yellow);
            filter: drop-shadow(0 0 6px var(--accent-yellow)) drop-shadow(0 0 14px var(--accent-yellow));
            stroke-dasharray: 6 8;
            animation: edgeFlow 1s linear infinite;
        }
        @keyframes edgeFlow { to { stroke-dashoffset: -28; } }

        /* Pulsing landing ring — shown on tile(s) a player could/will land on
         * while a move is actively animating. */
        .landing-ring-el {
            fill: none;
            stroke: var(--accent-yellow);
            stroke-width: 3;
            opacity: 0;
            pointer-events: none;
        }
        .landing-ring-el.tile-landing-pulse {
            animation: landingRingPulse 1s ease-in-out infinite;
        }
        @keyframes landingRingPulse {
            0%, 100% { r: 40; opacity: 1; }
            50%      { r: 46; opacity: 0.4; }
        }

        /* Player token dots, rendered on top of whichever tile they occupy. */
        .player-token-svg {
            stroke: #fff;
            stroke-width: 3px;
            /* Two stacked black drop-shadows act as a hard dark rim around the
               token so it stays readable against bright neon tile glow; the
               third adds a soft grounding shadow underneath. */
            filter:
                drop-shadow(0 0 2px rgba(0,0,0,0.9))
                drop-shadow(0 0 2px rgba(0,0,0,0.9))
                drop-shadow(0 2px 4px rgba(0,0,0,0.7));
            transform-box: fill-box;
            transform-origin: center;
            animation: tokenPulse 1.3s ease-in-out infinite;
        }
        .player-token-svg.token-hidden { opacity: 0; }
        @keyframes tokenPulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50%      { transform: scale(1.12); opacity: 1; }
        }

        /* =====================================================================
         * SWITCH-PLACES ANIMATION — flying tokens, tile glow, and a banner so
         * a position swap is obvious without reading the log or step count.
         * ===================================================================== */
        .swap-banner {
            position: absolute;
            top: 14px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 160;
            display: none;
            align-items: center;
            gap: 10px;
            background: var(--panel-bg);
            color: var(--text-light);
            border: 3px solid var(--accent-yellow);
            border-radius: 50px;
            padding: 8px 20px;
            box-shadow: 4px 4px 0px #000;
            font-family: 'Sniglet', cursive;
            font-size: 1rem;
            pointer-events: none;
            white-space: nowrap;
        }
        .swap-banner.visible { display: flex; animation: swapBannerPulse 0.9s ease-in-out infinite; }
        .swap-banner .swap-icon { font-size: 1.3rem; display: inline-block; animation: swapIconSpin 0.8s linear infinite; }
        @keyframes swapIconSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
        @keyframes swapBannerPulse {
            0%, 100% { box-shadow: 4px 4px 0px #000; }
            50%      { box-shadow: 4px 4px 0px #000, 0 0 18px 4px var(--accent-yellow); }
        }

        .board-tile-node.swap-glow {
            animation: swapTileGlow 0.6s ease-in-out infinite;
        }
        .board-tile-node.swap-glow .tile-base {
            transform-box: fill-box;
            transform-origin: center;
        }
        @keyframes swapTileGlow {
            0%, 100% { filter: drop-shadow(0 0 0px var(--glow-color, #fff)); }
            50%      { filter: drop-shadow(0 0 16px var(--glow-color, #fff)) drop-shadow(0 0 6px var(--glow-color, #fff)); }
        }
        @keyframes swapTileGlowScale {
            0%, 100% { transform: scale(1); }
            50%      { transform: scale(1.08); }
        }
        .board-tile-node.swap-glow .tile-base { animation: swapTileGlowScale 0.6s ease-in-out infinite; }

        .swap-flying-token {
            position: absolute;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            border: 3px solid white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 900;
            color: #12161a;
            z-index: 50;
            pointer-events: none;
            transition: left 0.85s cubic-bezier(.34,1.56,.64,1), top 0.85s cubic-bezier(.34,1.56,.64,1);
            box-shadow: 0 0 10px 3px rgba(255,255,255,0.5);
        }
        .swap-flying-token.flying { animation: swapHopArc 0.85s ease-in-out; }
        @keyframes swapHopArc {
            0%   { transform: translateY(0) scale(1); }
            50%  { transform: translateY(-46px) scale(1.15); }
            100% { transform: translateY(0) scale(1); }
        }

        .modal-overlay {
            position: absolute;
            top: 110px; right: 20px; /* clears .board-header-info + .find-player-bar */
            width: 380px;
            max-width: calc(100% - 40px);
            background: transparent;
            backdrop-filter: none;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 100;
            opacity: 0; pointer-events: none;
            transition: opacity 0.2s ease;
        }
		@media (max-width: 500px) {
			.modal-overlay {
				left: 10px;
				right: 10px;
				top: 90px;
				width: auto;
			}
		}
        .modal-overlay.open { opacity: 1; pointer-events: auto; }

        .card-popup {
            background: rgba(34, 40, 49, 0.98);
            color: #fff;
            width: 100%;
            border-radius: 16px;
            padding: 20px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0,0,0,0.7);
            border: 4px solid var(--accent-yellow);
            transform: scale(0.9);
            transition: transform 0.2s ease;
        }
        .modal-overlay.open .card-popup { transform: scale(1); }

        .card-type-banner {
            font-size: 1.2rem; font-weight: 900; color: white;
            padding: 6px; border-radius: 8px; margin-bottom: 12px;
            text-shadow: 1px 1px 2px #000;
        }
        .card-text { font-size: 1rem; margin-bottom: 15px; line-height: 1.4; font-weight: 700; }

        .modal-buttons {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .game-logs {
            flex: 1; background: rgba(0,0,0,0.4); border-radius: 8px;
            padding: 8px; font-size: 0.8rem; font-family: monospace;
            overflow-y: auto; max-height: 140px; border: 1px solid #393E46;
            color: #adfa1d;
        }
        .log-entry { margin-bottom: 4px; border-bottom: 1px solid #2d343f; padding-bottom: 2px; }

        .setup-screen {
            position: fixed; top:0; left:0; right:0; bottom:0;
            background: #161a22; z-index: 200;
            display: flex; flex-direction: column; justify-content: flex-start; align-items: center;
            overflow-y: auto; box-sizing: border-box; padding: 30px 10px;
        }
        .setup-box {
            background: var(--panel-bg); border: 4px solid var(--accent-yellow);
            border-radius: 15px; padding: 25px; width: 440px; max-width: 100%;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
            box-sizing: border-box;
        }
		@media (max-width: 500px) {
			.setup-box {
				padding: 16px;
			}
			h1 {
				font-size: 1.4rem;
			}
		}
        .setup-box input, .setup-box select {
            width: 100%; padding: 8px; margin: 6px 0 14px 0;
            border-radius: 6px; border: 2px solid #555; background: #12161a; color: white;
            box-sizing: border-box; font-family: 'Fredoka';
        }

        /* =====================================================================
         * CHALLENGE CUSTOMIZATION (setup screen)
         * ===================================================================== */
        .challenge-cat-block {
            background: rgba(0,0,0,0.2);
            border-radius: 10px;
            margin-bottom: 8px;
            overflow: hidden;
        }
        .challenge-cat-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 8px 10px; border-left: 4px solid var(--accent-yellow);
            gap: 8px;
        }
        .cat-toggle-switch { display: flex; align-items: flex-start; gap: 8px; flex: 1; }
        .cat-toggle-switch input[type="checkbox"] { width: auto; margin: 3px 0 0 0; flex-shrink: 0; }
        .challenge-cat-title { font-weight: 900; font-size: 0.9rem; }
        .challenge-cat-sub { font-size: 0.72rem; color: #aaa; font-weight: 400; line-height: 1.3; margin-top: 2px; }
        .challenge-cat-expand-btn {
            padding: 4px 9px; font-size: 0.75rem; border-bottom-width: 3px; flex-shrink: 0;
        }
        .challenge-list { padding: 6px 10px 10px 10px; }
        .select-all-row { display: flex; gap: 6px; margin-bottom: 8px; }
        .select-all-row button {
            flex: 1; font-size: 0.7rem; padding: 5px; background: #3a4149;
            border-bottom: 2px solid rgba(0,0,0,0.4);
        }
        .challenge-item-row {
            display: flex; align-items: flex-start; gap: 8px; padding: 5px 2px;
            font-size: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.06);
        }
        .challenge-item-row:last-of-type { border-bottom: none; }
        .challenge-item-row input[type="checkbox"] { width: auto; margin: 3px 0 0 0; flex-shrink: 0; }
        .challenge-item-row label { flex: 1; cursor: pointer; line-height: 1.35; }
        .remove-custom-btn {
            background: var(--accent-red); border: none; color: white; border-radius: 5px;
            width: 22px; height: 22px; line-height: 1; cursor: pointer; font-size: 0.75rem;
            padding: 0; flex-shrink: 0; border-bottom: 2px solid rgba(0,0,0,0.4);
        }
        .add-challenge-row { display: flex; gap: 6px; margin-top: 8px; }
        .add-challenge-row input { flex: 1; margin: 0; padding: 6px 8px; font-size: 0.78rem; }
        .add-challenge-row button { padding: 6px 10px; font-size: 0.75rem; white-space: nowrap; }
        .challenge-customize-intro { font-size: 0.8rem; color: #aaa; margin: 0 0 12px 0; text-align: center; line-height: 1.4; }

        .dice-visualizer {
            display: inline-block;
            width: 40px;
            height: 40px;
            line-height: 40px;
            background: white;
            color: black;
            border-radius: 8px;
            font-size: 1.5rem;
            font-weight: 900;
            margin-bottom: 10px;
            box-shadow: 0 4px 0px #ccc;
        }
        .rolling {
            animation: shake 0.15s infinite alternate;
        }
        @keyframes shake {
            0% { transform: rotate(-10deg); }
            100% { transform: rotate(10deg); }
        }

        /* =====================================================================
         * MARIO-PARTY STYLE DICE MERGE ANIMATION
         * Used for: multiple dice (Double/Triple Dice) combining into a total,
         * and Mushroom bonus (+5) merging into a die roll.
         * ===================================================================== */
        .dice-merge-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            min-height: 70px;
            margin-bottom: 6px;
        }
        .dice-merge-die {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 50px;
            height: 50px;
            background: white;
            color: #222;
            border-radius: 10px;
            font-size: 1.6rem;
            font-weight: 900;
            box-shadow: 0 4px 0px #ccc;
            transition: transform 0.4s ease, opacity 0.4s ease;
        }
        .dice-merge-die.mushroom-die {
            background: linear-gradient(180deg, #ff5b5b 0%, #e63946 60%);
            color: white;
            box-shadow: 0 4px 0px #a12630;
        }
        .dice-merge-plus {
            font-size: 1.8rem;
            font-weight: 900;
            color: var(--accent-yellow, #ffcc33);
            transition: opacity 0.3s ease;
        }
        .dice-merge-die.merging {
            animation: mergeFly 0.5s ease forwards;
        }
        .dice-merge-plus.merging-out {
            animation: fadeShrink 0.4s ease forwards;
        }
        @keyframes mergeFly {
            0%   { transform: translateX(0) scale(1); }
            60%  { transform: translateX(var(--merge-x, 0px)) scale(1.15); }
            100% { transform: translateX(var(--merge-x, 0px)) scale(0); opacity: 0; }
        }
        @keyframes fadeShrink {
            0%   { transform: scale(1); opacity: 1; }
            100% { transform: scale(0.2); opacity: 0; }
        }
        .dice-merge-total {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 64px;
            height: 64px;
            background: var(--accent-yellow, #ffcc33);
            color: #222;
            border-radius: 12px;
            font-size: 2rem;
            font-weight: 900;
            box-shadow: 0 5px 0px #b8901c;
            transform: scale(0);
            animation: popIn 0.35s ease forwards;
        }
        @keyframes popIn {
            0%   { transform: scale(0); }
            70%  { transform: scale(1.2); }
            100% { transform: scale(1); }
        }

        /* =====================================================================
         * STEP COUNTER — Mario-Party-style "steps remaining" badge that
         * floats above the board while a player is moving.
         * ===================================================================== */
        .step-counter-badge {
            position: absolute;
            top: 14px;
            left: 50%;
            transform: translateX(-50%) scale(1);
            z-index: 150;
            display: none;
            align-items: center;
            gap: 8px;
            background: var(--accent-yellow);
            color: #12161a;
            border: 3px solid #000;
            border-radius: 50px;
            padding: 6px 18px 6px 10px;
            box-shadow: 4px 4px 0px #000;
            font-family: 'Sniglet', cursive;
            pointer-events: none;
        }
        .step-counter-badge.visible { display: flex; }
        .step-counter-badge .step-counter-boot { font-size: 1.3rem; }
        .step-counter-badge .step-counter-value {
            font-size: 1.6rem;
            min-width: 1.4ch;
            text-align: center;
            display: inline-block;
        }
        .step-counter-badge .step-counter-label {
            font-family: 'Fredoka', sans-serif;
            font-size: 0.75rem;
            font-weight: 900;
            color: #12161a;
            opacity: 0.75;
            letter-spacing: 1px;
        }
        .step-counter-badge.pop .step-counter-value {
            animation: stepCounterPop 0.28s ease-out;
        }
        @keyframes stepCounterPop {
            0%   { transform: scale(1.6); color: var(--accent-red); }
            100% { transform: scale(1); color: #12161a; }
        }
        .step-counter-badge.entering {
            animation: stepCounterEnter 0.22s ease-out;
        }
        @keyframes stepCounterEnter {
            0%   { transform: translateX(-50%) scale(0.4); opacity: 0; }
            100% { transform: translateX(-50%) scale(1); opacity: 1; }
        }
        /* =====================================================================
         * EXPANSION PACKS (setup screen) — sits alongside CHALLENGE CUSTOMIZATION,
         * same visual language (dark card, yellow accents) so it doesn't feel
         * bolted on.
         * ===================================================================== */
        .pack-card {
            background: rgba(0,0,0,0.2);
            border-radius: 10px;
            border-left: 4px solid var(--accent-yellow);
            padding: 10px 12px;
            margin-bottom: 10px;
        }
        .pack-card.pack-unlocked { border-left-color: var(--tile-item); }
        .pack-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 10px;
        }
        .pack-title { font-weight: 900; font-size: 0.9rem; }
        .pack-price { color: var(--accent-yellow); font-weight: 900; font-size: 0.8rem; margin-left: 4px; }
        .pack-desc { font-size: 0.72rem; color: #aaa; margin-top: 3px; line-height: 1.3; }
        .pack-unlocked-badge {
            background: var(--tile-item);
            color: #12161a;
            font-size: 0.65rem;
            font-weight: 900;
            padding: 3px 8px;
            border-radius: 20px;
            white-space: nowrap;
        }
		.pack-content-toggle {
			display: flex;
			align-items: center;
			gap: 6px;
			font-size: 0.75rem;
			color: #ccc;
			margin-top: 8px;
			cursor: pointer;
		}
		.pack-content-toggle input[type="checkbox"] {
			width: auto;
			margin: 0;
		}
        .pack-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 10px;
        }
        .pack-buy-btn {
            display: inline-flex;
            align-items: center;
            background-color: var(--accent-blue);
            color: white;
            font-family: 'Fredoka', sans-serif;
            font-weight: bold;
            font-size: 0.8rem;
            padding: 7px 12px;
            border-radius: 8px;
            border-bottom: 3px solid rgba(0,0,0,0.4);
            text-decoration: none;
            flex-shrink: 0;
        }
        .pack-code-input {
            flex: 1;
            min-width: 140px;
            padding: 7px 8px;
            margin: 0 !important;
            border-radius: 6px;
            border: 2px solid #555;
            background: #12161a;
            color: white;
            box-sizing: border-box;
            font-family: 'Fredoka';
            font-size: 0.8rem;
        }
        .pack-unlock-status {
            font-size: 0.72rem;
            color: var(--accent-yellow);
            margin-top: 6px;
            min-height: 1em;
        }
        .pack-entry-badge {
            font-size: 0.62rem;
            color: var(--accent-yellow);
            opacity: 0.85;
        }
		.pack-sample-preview {
			background: rgba(0,0,0,0.25);
			border-radius: 8px;
			padding: 8px 10px;
			margin-top: 8px;
		}
		.pack-sample-label {
			font-size: 0.7rem;
			font-weight: 900;
			color: var(--accent-yellow);
			margin-bottom: 4px;
		}
		.pack-sample-list {
			margin: 0;
			padding-left: 18px;
			font-size: 0.75rem;
			color: #ddd;
			line-height: 1.4;
		}
		.pack-sample-list li { margin-bottom: 3px; }
		.pack-sample-more {
			font-size: 0.68rem;
			color: #aaa;
			margin-top: 4px;
			font-style: italic;
		}
		.bundle-card {
			border: 2px solid #FFB000;
			border-left-width: 4px;
			background: rgba(255,176,0,0.08);
		}
		.bundle-buy-btn {
			background-color: #FFB000 !important;
			color: #12161a !important;
			font-weight: 900;
		}
		
	/* =====================================================================
         * DONATION LINK
         * ===================================================================== */
        .donate-btn {
            display: inline-block;
            text-decoration: none;
            text-align: center;
            font-family: 'Fredoka', sans-serif;
            font-weight: bold;
            cursor: pointer;
        }

        /* Floating beer button, sits to the left of the gear icon, always
           visible during gameplay (same fixed-position wrapper as the gear). */
        .donate-floating-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 44px;
            height: 44px;
            background-color: #FFB000;
            border: 3px solid #393E46;
            border-radius: 50%;
            font-size: 1.3rem;
            box-shadow: 3px 3px 0px #000;
            text-decoration: none;
            cursor: pointer;
        }
        .donate-floating-btn:active {
            transform: translateY(2px);
            box-shadow: 1px 1px 0px #000;
        }

        .donate-btn-standalone {
            display: inline-block;
            text-decoration: none;
            text-align: center;
            font-family: 'Fredoka', sans-serif;
            font-weight: bold;
            cursor: pointer;
            background-color: #FFB000;
            color: #12161a;
            border-radius: 8px;
            border-bottom: 4px solid rgba(0,0,0,0.4);
            padding: 10px 16px;
            font-size: 0.9rem;
        }
        .donate-btn-standalone:active {
            transform: translateY(2px);
            border-bottom-width: 2px;
        }
		/* =====================================================================
		 * SITE MODALS (first-time prompt + rules) — full-screen overlays that sit
		 * above even the setup screen (z-index above .setup-screen's 200).
		 * ===================================================================== */
		.site-modal-overlay {
			position: fixed;
			top: 0; left: 0; right: 0; bottom: 0;
			background: rgba(0,0,0,0.75);
			z-index: 300;
			display: none;
			justify-content: center;
			align-items: center;
			padding: 20px;
			box-sizing: border-box;
		}
		.site-modal-overlay.open { display: flex; }
		.site-modal-box {
			background: var(--panel-bg);
			border: 4px solid var(--accent-yellow);
			border-radius: 15px;
			padding: 25px;
			width: 480px;
			max-width: 100%;
			max-height: 85vh;
			overflow-y: auto;
			box-shadow: 0 10px 30px rgba(0,0,0,0.5);
			box-sizing: border-box;
		}
		.site-modal-box p  { line-height: 1.5; }
		.site-modal-box ul { padding-left: 20px; margin: 6px 0 14px 0; }
		.site-modal-box li { margin-bottom: 6px; line-height: 1.4; }