/* MERGE-BLOCK: world.css */
#game-wrap canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  touch-action: none;
  /* Geen width/height 100% — canvas moet 1:1 met renderer.setSize blijven (geen stippellijnen). */
}

        #touch-controls {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 28px;
            height: 38vh;
            max-height: 260px;
            z-index: 35;
            display: none;
            pointer-events: none;
            padding: 14px;
            padding-bottom: max(14px, env(safe-area-inset-bottom));
            box-sizing: border-box;
            justify-content: center;
            align-items: flex-end;
        }

        #touch-arrows {
            pointer-events: auto;
            display: grid;
            grid-template-columns: minmax(88px, 1fr) 56px minmax(88px, 1fr);
            grid-template-rows: 96px;
            gap: 12px;
            width: 100%;
            max-width: 340px;
            margin: 0 auto;
            touch-action: none;
            user-select: none;
        }

        .arrow-btn {
            width: 100%;
            height: 96px;
            border-radius: 16px;
            border: 2px solid rgba(0, 255, 255, 0.45);
            background: rgba(0, 255, 255, 0.08);
            box-shadow: 0 0 18px rgba(0, 255, 255, 0.12);
            display: grid;
            place-items: center;
            font-family: 'Courier New', Courier, monospace;
            font-weight: bold;
            font-size: 28px;
            color: rgba(255, 255, 255, 0.95);
            letter-spacing: 2px;
            touch-action: none;
            cursor: pointer;
        }

        #btn-left {
            justify-self: end;
            max-width: 132px;
        }

        #btn-right {
            justify-self: start;
            max-width: 132px;
        }

        .drive-btn {
            width: 56px;
            height: 96px;
            justify-self: center;
            font-size: 12px;
            letter-spacing: 0;
            line-height: 1.15;
            padding: 6px 4px;
            box-sizing: border-box;
            border-color: rgba(0, 255, 120, 0.55);
            background: rgba(0, 255, 120, 0.12);
            box-shadow: 0 0 18px rgba(0, 255, 120, 0.14);
        }

        .drive-btn.is-driving {
            border-color: rgba(255, 80, 80, 0.65);
            background: rgba(255, 80, 80, 0.14);
            box-shadow: 0 0 18px rgba(255, 80, 80, 0.16);
        }

        .arrow-btn:active {
            transform: scale(0.98);
        }

        body.touch-controls-on #touch-controls {
            display: flex;
        }

        @media (min-width: 900px) {
            body {
                background-color: #030008;
                background-image:
                    radial-gradient(circle at 12% 18%, rgba(255, 0, 255, 0.06) 0%, transparent 42%),
                    radial-gradient(circle at 88% 82%, rgba(0, 255, 255, 0.05) 0%, transparent 40%);
            }

            #app {
                box-shadow: 0 0 0 1px rgba(0, 255, 255, 0.08), 0 0 48px rgba(0, 0, 0, 0.65);
            }
        }

        .go-actions {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 10px;
        }

        .go-actions .btn {
            width: 100%;
        }

        #game-over {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 5000;
            backdrop-filter: blur(10px);
        }

        .go-card {
            background: rgba(20, 20, 40, 0.95);
            border: 2px solid #ff0055;
            box-shadow: 0 0 30px #ff0055;
            padding: 40px;
            border-radius: 12px;
            text-align: center;
            max-width: 400px;
            width: 90%;
        }

        .go-card h2 {
            margin: 0 0 20px;
            font-size: 32px;
            color: #ff0055;
            text-shadow: 0 0 10px #ff0055;
        }

        .go-stats {
            margin: 25px 0;
            font-size: 20px;
            line-height: 1.6;
            color: #fff;
        }

        .go-stats b {
            color: #00ffff;
            font-size: 24px;
        }

        .final-record-delta {
            display: inline-block;
            margin-top: 4px;
            font-size: 17px;
            font-weight: 800;
            letter-spacing: 0.02em;
        }

        .final-record-delta.delta-ahead {
            color: #00ff88;
            text-shadow: 0 0 10px rgba(0, 255, 136, 0.45);
        }

        .final-record-delta.delta-behind {
            color: #ff5566;
            text-shadow: 0 0 10px rgba(255, 68, 102, 0.4);
        }

        .final-record-delta.delta-even {
            color: #ffdd55;
        }

        .final-record-delta.delta-first {
            color: #66ccff;
        }

        /* Split flash / countdown overlay */
        #countdown-overlay {
            position: fixed;
            top: 16%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: clamp(44px, 10vw, 76px);
            font-weight: 900;
            color: #ff0055;
            text-shadow: 0 0 16px currentColor, 0 0 32px currentColor;
            pointer-events: none;
            z-index: 6000;
            display: none;
            font-family: 'Courier New', Courier, monospace;
            letter-spacing: -0.02em;
            white-space: nowrap;
        }

        #countdown-overlay.split-ahead {
            color: #00ff88;
        }

        #countdown-overlay.split-behind {
            color: #ff4466;
        }

        #finish-fade {
            position: fixed;
            inset: 0;
            opacity: 0;
            pointer-events: none;
            z-index: 5500;
            background:
                radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 26%),
                linear-gradient(180deg, rgba(6, 10, 30, 0.1), rgba(0, 0, 0, 0.95));
            transition: opacity 120ms linear;
        }

        .countdown-animate {
            animation: countdown-pulse 0.65s ease-out forwards;
            display: block !important;
        }

        .split-flash-animate {
            animation: split-flash-pulse 1.6s ease-out forwards;
            display: block !important;
        }

        @keyframes countdown-pulse {
            0% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.5);
            }

            20% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1.1);
            }

            80% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1.0);
            }

            100% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(1.2);
            }
        }

        @keyframes split-flash-pulse {
            0% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.88);
            }

            10% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }

            70% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }

            100% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(1.04);
            }
        }
/* END-MERGE-BLOCK */
