        html, body {
            margin: 0;
            padding: 0;
            overflow: hidden;
            background: #000;
            font-family: var(--font-body);
            /* iOS Safari: Prevent overscroll bounce */
            overscroll-behavior: none;
            -webkit-overflow-scrolling: touch;
            /* iOS: Fix 100vh including address bar — dvh adapts to toolbar visibility */
            height: 100%;
            height: 100dvh;
            height: -webkit-fill-available;
        }

        #video {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100dvh;
            /* object-fit: contain shows the full camera FOV instead of
               cropping to fill the screen. The user-reported (2026-06-06)
               "game video is super zoomed in" symptom was caused by
               `cover` on portrait phones with 4:3 cameras — `cover`
               crops the horizontal edges, making the camera look much
               more zoomed than it is. `contain` shows everything the
               camera sees and lets kids reach in from the edges
               visibly. Black bars at top/bottom on mismatched aspect
               are an acceptable trade for the visibility win. */
            object-fit: contain;
            background: #000; /* fills the contain letterbox */
            /* iOS Safari: webkit prefix for older versions */
            -webkit-filter: brightness(0.7);
            filter: brightness(0.7);
            z-index: 1;
            /* Mirror like a selfie — use scale3d for GPU acceleration */
            transform: scale3d(-1, 1, 1);
            -webkit-transform: scale3d(-1, 1, 1);
            transform-origin: center center;
            -webkit-transform-origin: center center;
            /* iOS: Prevent tap highlight */
            -webkit-tap-highlight-color: transparent;
        }

        #gameCanvas {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 2;
            /* iOS: Canvas steals touch events even behind higher z-index.
               Disable until game starts; main.ts enables via .active class */
            pointer-events: none;
            /* iOS: Prevent tap highlight */
            -webkit-tap-highlight-color: transparent;
        }
        #gameCanvas.active {
            pointer-events: auto;
        }

        #ui {
            position: fixed;
            /* iOS: Safe area support for notch/Dynamic Island */
            top: max(10px, env(safe-area-inset-top, 10px));
            left: max(10px, env(safe-area-inset-left, 10px));
            z-index: 3;
            color: white;
            max-width: 95vw;
            display: flex;
            flex-direction: column;
            gap: 6px;
            /* iOS: Prevent tap highlight */
            -webkit-tap-highlight-color: transparent;
        }

        #ui button {
            padding: 6px 12px;
            margin-right: 8px;
            font-size: 14px;
            cursor: pointer;
        }

        #modeControls {
            margin-top: 6px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            flex-wrap: wrap;
        }

        #modeControls select {
            padding: 4px 6px;
            font-size: 14px;
        }

        #colorPicker {
            width: 36px;
            height: 24px;
            padding: 0;
            border: 1px solid #ccc;
            background: transparent;
            cursor: pointer;
        }

        #statusText {
            font-size: 14px;
            margin-top: 4px;
        }

        #scoreText {
            font-size: 20px;
            font-weight: bold;
            margin-top: 8px;
        }

        #modeControls input[type="range"] {
            vertical-align: middle;
        }

        #powerBar {
            position: fixed;
            /* iOS: Safe area support */
            bottom: max(12px, env(safe-area-inset-bottom, 12px));
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 10px;
            z-index: 3;
        }

        @media (max-width: 768px) {
            #ui button,
            #modeControls label,
            #advancedControls label {
                font-size: 12px;
            }
            #modeControls {
                gap: 6px;
            }
        }

        #advancedControls {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            align-items: center;
        }

        #powerToggles {
            position: fixed;
            /* iOS: Safe area support */
            bottom: max(12px, env(safe-area-inset-bottom, 12px));
            right: max(12px, env(safe-area-inset-right, 12px));
            display: flex;
            flex-direction: column;
            gap: 4px;
            background: rgba(0,0,0,0.5);
            padding: 8px;
            border-radius: 8px;
            z-index: 4;
            color: #fff;
            font-size: 12px;
        }

        #powerGuide {
            position: fixed;
            /* iOS: Safe area support */
            bottom: max(12px, env(safe-area-inset-bottom, 12px));
            left: max(12px, env(safe-area-inset-left, 12px));
            padding: 8px 10px;
            background: rgba(0,0,0,0.55);
            color: #fff;
            font-size: 12px;
            border-radius: 8px;
            z-index: 4;
            line-height: 1.4;
            max-width: 200px;
        }
        #powerGuide .icon { margin-right: 6px; }

        .powerCard {
            padding: 8px 12px;
            border-radius: 12px;
            background: rgba(0, 0, 0, 0.6);
            border: 2px solid rgba(255,255,255,0.35);
            min-width: 110px;
            color: #fff;
            text-align: center;
            box-shadow: 0 0 10px rgba(0,0,0,0.4);
            font-weight: 600;
        }

        .powerCard .icon {
            font-size: 22px;
            display: block;
        }

        .powerCard .label {
            font-size: 14px;
        }

        .powerCard .timer {
            font-size: 13px;
            opacity: 0.9;
        }

        .hidden {
            display: none !important;
        }

        #tutorialOverlay {
            position: fixed;
            top: 14%;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.65);
            color: #fff;
            padding: 14px 18px;
            border-radius: 14px;
            font-size: 16px;
            box-shadow: 0 0 16px rgba(0,0,0,0.5);
            z-index: 5;
            text-align: center;
        }

        #recapOverlay {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.7);
            color: #fff;
            padding: 18px 22px;
            border-radius: 16px;
            box-shadow: 0 0 24px rgba(0,0,0,0.6);
            z-index: 6;
            text-align: center;
            min-width: 260px;
        }

        #recapOverlay h3 {
            margin: 0 0 8px;
            font-size: 18px;
        }

        #recapOverlay button {
            margin-top: 10px;
            padding: 8px 14px;
            font-size: 15px;
            cursor: pointer;
        }

        body.kids-mode #powerToggles,
        body.kids-mode #powerBar,
        body.kids-mode #powerGuide {
            display: none !important;
        }
    </style>
