/* ===================================
   ACCESSIBILITY
   =================================== */

/* Screen reader only class for accessible labels */
.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;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ===================================
   CSS VARIABLES & RESET
   =================================== */

:root {
    /* Enhanced Color Palette - More Vibrant & Distinct */
    --red: linear-gradient(135deg, #FF4444, #E63946);
    --blue: linear-gradient(135deg, #1E90FF, #4169E1);  /* Clear blue, not cyan */
    --green: linear-gradient(135deg, #2ECC40, #27AE60);  /* True green, not teal */
    --yellow: linear-gradient(135deg, #FFD700, #FFC107);
    --purple: linear-gradient(135deg, #9B59B6, #8E44AD);
    --orange: linear-gradient(135deg, #FF8C00, #FF6347);
    --pink: linear-gradient(135deg, #FF69B4, #FF1493);
    --cyan: linear-gradient(135deg, #00CED1, #40E0D0);

    /* Flat colors for triangles */
    --red-flat: #FF4444;
    --blue-flat: #1E90FF;
    --green-flat: #2ECC40;
    --yellow-flat: #FFD700;
    --purple-flat: #9B59B6;
    --orange-flat: #FF8C00;
    --pink-flat: #FF69B4;
    --cyan-flat: #00CED1;

    /* UI Colors - Monster Truck Theme */
    --bg-sky: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 100%);
    --ground: linear-gradient(180deg, #A0714D 0%, #8B6239 50%, #6B4E35 100%);
    --dirt-shadow: rgba(101, 67, 33, 0.4);
    --truck-body: linear-gradient(135deg, #4CAF50, #45a049);
    --truck-cabin: linear-gradient(135deg, #64B5F6, #42A5F5);
    --white: #FFFFFF;
    --black: #000000;

    /* Sizes */
    --size-large: 120px;
    --size-small: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    width: 100vw;
    height: 100vh;
}

body {
    font-family: var(--font-family);
    background: url('assets/background.png') center center / cover no-repeat fixed;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-text-size-adjust: 100%;
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Dark theme overlay for background image */
html[data-theme="dark"] body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    pointer-events: none;
    z-index: 0;
}

body::before {
    display: none;
}

body::after {
    display: none;
}

@keyframes cloudFloat {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(100px);
    }
}

/* ===================================
   TOP NAV (hub + theme + language)
   =================================== */

/* Hide top navigation during splash screen */
body:has(#splash-screen:not(.hidden)) .top-nav {
    opacity: 0;
    pointer-events: none;
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30000;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 12px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.top-nav > *,
.top-nav .top-nav__right {
    pointer-events: auto;
}

.top-nav__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Navigation buttons using unified design system */
.hub-link {
    text-decoration: none;
}

.hub-link,
.theme-select,
.language-selector select {
    /* Inherit from .game-btn in shared-design-tokens.css */
    display: inline-flex;
    align-items: center;
    padding: var(--space-sm) var(--space-lg);
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-family);
    color: var(--text-inverse);
    border: 3px solid var(--border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-toy), var(--shadow-inset);
    text-shadow:
        2px 2px 0px #000000,
        -1px -1px 0px #000000,
        1px -1px 0px #000000,
        -1px 1px 0px #000000;
    transition: all 0.2s ease;
    touch-action: manipulation;
    user-select: none;
}

.hub-link:hover,
.theme-select:hover,
.language-selector select:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover), var(--shadow-inset);
}

.hub-link:active,
.theme-select:active,
.language-selector select:active {
    transform: scale(0.96);
    box-shadow: var(--shadow-toy-soft), var(--shadow-inset);
}

/* Individual button colors from design tokens */
.hub-link {
    background: var(--btn-primary);
}

.theme-select {
    background: var(--btn-secondary);
    padding-right: 40px; /* Extra space for dropdown arrow */
}

.theme-select option {
    background: #0369a1;
    color: #ffffff;
    font-weight: 700;
}

html[data-theme="dark"] .theme-select option {
    background: #0ea5e9;
    color: #0f172a;
}

.language-selector {
    position: static;
}

.language-selector select {
    background: var(--btn-accent);
    padding-right: 40px; /* Extra space for dropdown arrow */
}

.language-selector select option {
    background: #6d28d9;
    color: #ffffff;
    font-weight: 700;
}

html[data-theme="dark"] .language-selector select option {
    background: #8b5cf6;
    color: #0f172a;
}

/* ===================================
   SPLASH SCREEN
   =================================== */

/* Splash screen using unified design system */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: var(--splash-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: fadeIn 0.3s ease;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.splash-screen.hidden {
    display: none;
}

.splash-content {
    text-align: center;
    padding: var(--space-2xl);
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.splash-title {
    font-size: clamp(36px, 8vw, 64px);
    font-weight: 800;
    color: var(--splash-title-color);
    text-shadow:
        3px 3px 0px #000000,
        -1px -1px 0px #000000,
        1px -1px 0px #000000,
        -1px 1px 0px #000000,
        0 0 20px rgba(255, 215, 0, 0.6);
    margin-bottom: var(--space-lg);
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4));
    animation: gentleBounce 2s ease-in-out infinite;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
    padding: 0 15px;
    text-align: center;
    width: 100%;
}

.splash-subtitle {
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 700;
    color: var(--splash-subtitle-color);
    text-shadow:
        2px 2px 0px #000000,
        -1px -1px 0px #000000,
        1px -1px 0px #000000,
        -1px 1px 0px #000000;
    margin-bottom: var(--space-2xl);
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
    padding: 0 15px;
    text-align: center;
    width: 100%;
}

.splash-truck {
    width: 300px;
    height: auto;
    display: block;
    margin: 0 auto var(--space-2xl) auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    animation: iconFloat 2s ease-in-out infinite;
}

.start-game-button {
    min-width: 300px;
    max-width: 400px;
    min-height: 100px;
    padding: var(--space-lg) var(--space-xl);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    color: var(--text-inverse);
    background: var(--btn-success);
    border: 6px solid var(--border-medium);
    border-radius: var(--radius-xl);
    cursor: pointer;
    touch-action: none;
    box-shadow:
        var(--shadow-lifted),
        inset 0 -4px 8px rgba(0,0,0,0.2);
    text-shadow:
        2px 2px 0px #000000,
        -1px -1px 0px #000000,
        1px -1px 0px #000000,
        -1px 1px 0px #000000;
    transition: all 0.2s ease;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    text-align: center;
    font-family: var(--font-family);
}

.start-game-button:hover {
    transform: scale(1.05);
    box-shadow:
        0 15px 30px rgba(0,0,0,0.35),
        inset 0 -4px 8px rgba(0,0,0,0.2);
}

.start-game-button:active {
    transform: scale(0.95);
    box-shadow:
        0 8px 16px rgba(0,0,0,0.3),
        inset 0 -2px 4px rgba(0,0,0,0.2);
}

/* ===================================
   GAME CONTAINER
   =================================== */

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#game-container::before {
    display: none;
}

#game-container::after {
    display: none;
}

.level-display {
    position: absolute;
    top: 72px;
    left: 20px;
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: var(--space-sm) 28px;
    border-radius: var(--radius-lg);
    text-shadow:
        2px 2px 0px rgba(255,255,255,0.8),
        3px 3px 0px rgba(0,0,0,0.3);
    box-shadow:
        var(--shadow-toy),
        inset 0 2px 4px rgba(255,255,255,0.5),
        0 0 20px rgba(255, 215, 0, 0.6);
    z-index: 10;
    border: 4px solid #000;
    animation: levelPulse 2s ease-in-out infinite;
    font-family: var(--font-family);
    letter-spacing: 1px;
}

html[data-theme="dark"] .level-display {
    background: linear-gradient(135deg, #FDE047 0%, #FACC15 100%);
    border-color: #1e3a5f;
    text-shadow:
        2px 2px 0px rgba(255,255,255,0.6),
        3px 3px 0px rgba(0,0,0,0.5);
}

@keyframes levelPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===================================
   TRUCK AREA (60%)
   =================================== */

.truck-area {
    flex: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.truck-area::before {
    display: none;
}

.truck-area::after {
    display: none;
}

@keyframes flagWave {
    0%, 100% {
        transform: rotate(-5deg) translateY(0px);
    }
    50% {
        transform: rotate(5deg) translateY(-10px);
    }
}

@keyframes horizonDrift {
    0%, 100% {
        transform: translateX(0) scale(0.9);
    }
    50% {
        transform: translateX(30px) scale(0.95);
    }
}

.monster-truck {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.monster-truck.driving-off {
    animation: driveOff 1s ease-in-out forwards;
}

@keyframes driveOff {
    to {
        transform: translateX(150vw);
    }
}

.truck-body {
    position: relative;
    width: 300px;
    height: 100px;
    background: transparent;
    margin: 0 auto;
}

.truck-body::before {
    display: none;
}

.truck-cabin {
    display: none;
}

.truck-cabin::before {
    display: none;
}

.truck-bed {
    display: none;
}

.truck-bed::before {
    display: none;
}

.truck-wheels {
    display: none;
}

.wheel {
    display: none;
}

/* ===================================
   SLOTS CONTAINER
   =================================== */

.slots-container {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
}

.slot {
    position: relative;
    border: 8px dashed rgba(255, 255, 255, 1);
    border-radius: 20px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.85),
        rgba(255, 255, 255, 0.7)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
    min-width: 120px;
    min-height: 120px;
    backdrop-filter: blur(10px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 -4px 8px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(255, 255, 255, 0.8);
}

.slot.filled {
    border: 8px solid rgba(255, 215, 0, 1);
    animation: fillSuccess 0.5s ease;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.95),
        rgba(255, 240, 200, 0.9)
    );
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 -4px 8px rgba(255, 215, 0, 0.3),
        0 0 40px rgba(255, 215, 0, 0.8);
}

.slot.hover-highlight {
    border: 6px solid rgba(255, 215, 0, 0.9);
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.4),
        rgba(255, 215, 0, 0.2)
    );
    box-shadow:
        0 0 40px rgba(255, 215, 0, 0.8),
        0 0 80px rgba(255, 215, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.slot.filled .slot-outline {
    display: none;
}

.slot-outline {
    opacity: 0.5;
    pointer-events: none;
    filter: brightness(0.7) saturate(1.2) drop-shadow(0 0 4px rgba(0,0,0,0.5));
    transform: scale(0.85);
}

@keyframes pulse {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(255, 255, 255, 0.6),
            0 0 60px rgba(255, 215, 0, 0.4),
            inset 0 2px 4px rgba(255, 255, 255, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 50px rgba(255, 255, 255, 0.9),
            0 0 100px rgba(255, 215, 0, 0.6),
            inset 0 2px 4px rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }
}

@keyframes fillSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
        filter: brightness(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* ===================================
   INVENTORY AREA (40%)
   =================================== */

.inventory-area {
    flex: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 20px;
    position: relative;
}

.inventory-area::before {
    display: none;
}

.inventory-items {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: 90vw;
    padding: 20px;
    background: rgba(217, 184, 134, 0.4);
    border-radius: 20px;
    backdrop-filter: blur(3px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 2px 8px rgba(255, 255, 255, 0.2),
        inset 0 -2px 8px rgba(139, 111, 71, 0.3);
    border: 3px solid rgba(139, 111, 71, 0.6);
}

/* ===================================
   DRAGGABLE ITEMS & SHAPES
   =================================== */

.draggable-item {
    cursor: grab;
    touch-action: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5));
}

.draggable-item:hover {
    transform: scale(1.1) rotate(5deg);
    filter: brightness(1.2);
}

.draggable-item:active {
    cursor: grabbing;
}

.draggable-item.dragging {
    opacity: 0.9;
    z-index: 1000;
    /* Removed transform - it interferes with drag positioning */
    /* transform: scale(1.2) rotate(10deg); */
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.5))
            drop-shadow(0 0 30px rgba(255,215,0,0.6));
    cursor: grabbing;
    /* Removed wiggle animation - causes position jitter during drag */
    /* animation: wiggle 0.3s ease infinite; */
    /* GPU acceleration for smooth dragging */
    will-change: transform;
    /* Disable transitions during drag */
    transition: none;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: scale(1.2) rotate(8deg);
    }
    50% {
        transform: scale(1.2) rotate(12deg);
    }
}

.draggable-item.snapping {
    animation: snapIn 0.3s ease;
}

@keyframes snapIn {
    0% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.draggable-item.bouncing {
    animation: bounceBack 0.5s ease;
}

@keyframes bounceBack {
    0% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-20px);
    }
    70% {
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Shape Classes */
.shape {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 24px;
    transition: all 0.3s ease;
    position: relative;
}

.shape:hover {
    transform: translateY(-4px);
    filter: brightness(1.1);
}

/* PNG Tire Base System - solid color shapes behind tire (shows through transparent rim) */

/* Circle - circular solid color */
.circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    height: 55%;
    background: var(--rim-color);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

/* Square - square solid color with rounded corners */
.square::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54%;
    height: 54%;
    background: var(--rim-color);
    border-radius: 15%;
    z-index: 1;
    pointer-events: none;
}

/* Triangle - triangular solid color */
.triangle::before {
    content: '';
    position: absolute;
    top: 51%;
    left: 52%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 69px solid var(--rim-color);
    z-index: 1;
    pointer-events: none;
}

/* Star - star-shaped using clip-path */
.star::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88%;
    height: 88%;
    background: var(--rim-color);
    clip-path: polygon(
        50% 0%,
        61% 35%,
        98% 35%,
        68% 57%,
        79% 91%,
        50% 70%,
        21% 91%,
        32% 57%,
        2% 35%,
        39% 35%
    );
    z-index: 1;
    pointer-events: none;
}

/* Heart - heart-shaped using clip-path */
.heart::before {
    content: '';
    position: absolute;
    top: 53%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 78%;
    height: 78%;
    background: var(--rim-color);
    clip-path: path('M50,85 C20,60 5,45 5,30 C5,18 12,10 23,10 C32,10 40,15 50,25 C60,15 68,10 77,10 C88,10 95,18 95,30 C95,45 80,60 50,85 Z');
    z-index: 1;
    pointer-events: none;
}

/* Hexagon - hexagonal solid color */
.hexagon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    height: 63%;
    background: var(--rim-color);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: 1;
    pointer-events: none;
}

/* Diamond - diamond solid color */
.diamond::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 50%;
    height: 50%;
    background: var(--rim-color);
    z-index: 1;
    pointer-events: none;
}

.circle {
    width: var(--size-large);
    height: var(--size-large);
}

.circle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/tires/tire_circle.png');
    background-size: 170%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}

.square {
    width: var(--size-large);
    height: var(--size-large);
}

.square::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/tires/tire_square.png');
    background-size: 170%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}

.triangle {
    width: var(--size-large);
    height: var(--size-large);
}

.triangle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/tires/tire_triangle.png');
    background-size: 170%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}

.star {
    width: var(--size-large);
    height: var(--size-large);
}

.star::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/tires/tire_star.png');
    background-size: 170%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}

.heart {
    width: var(--size-large);
    height: var(--size-large);
}

.heart::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/tires/tire_heart.png');
    background-size: 170%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}

.pentagon {
    width: var(--size-large);
    height: var(--size-large);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.pentagon.color-red { background-image: url('assets/images/tires/pentagon-red.svg'); }
.pentagon.color-blue { background-image: url('assets/images/tires/pentagon-blue.svg'); }
.pentagon.color-green { background-image: url('assets/images/tires/pentagon-green.svg'); }
.pentagon.color-yellow { background-image: url('assets/images/tires/pentagon-yellow.svg'); }
.pentagon.color-purple { background-image: url('assets/images/tires/pentagon-purple.svg'); }
.pentagon.color-orange { background-image: url('assets/images/tires/pentagon-orange.svg'); }
.pentagon.color-pink { background-image: url('assets/images/tires/pentagon-pink.svg'); }
.pentagon.color-cyan { background-image: url('assets/images/tires/pentagon-cyan.svg'); }
.pentagon.color-brown { background-image: url('assets/images/tires/pentagon-brown.svg'); }
.pentagon.color-lime { background-image: url('assets/images/tires/pentagon-lime.svg'); }

.hexagon {
    width: var(--size-large);
    height: var(--size-large);
}

.hexagon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/tires/tire_hexagon.png');
    background-size: 170%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}

.diamond {
    width: var(--size-large);
    height: var(--size-large);
}

.diamond::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/images/tires/tire_diamond.png');
    background-size: 130%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    pointer-events: none;
}

/* Size Modifiers */
.size-large {
    --size-large: 120px;
    --size-small: 60px;
}

.size-small {
    --size-large: 80px;
    --size-small: 40px;
    transform: scale(0.7);
}

/* Adjust background-size for small tires to prevent overflow */
.size-small.circle::after,
.size-small.square::after,
.size-small.triangle::after,
.size-small.star::after,
.size-small.heart::after,
.size-small.hexagon::after {
    background-size: 140%;
}

.size-small.diamond::after {
    background-size: 110%;
}

/* Scale down colored shapes for small tires */
.size-small.circle::before,
.size-small.square::before,
.size-small.hexagon::before,
.size-small.star::before,
.size-small.heart::before {
    transform: translate(-50%, -50%) scale(0.8);
}

/* Diamond needs to preserve rotation */
.size-small.diamond::before {
    transform: translate(-50%, -50%) rotate(45deg) scale(0.8);
}

/* Triangle uses fixed pixels, needs specific scaling */
.size-small.triangle::before {
    border-left: 32px solid transparent;
    border-right: 32px solid transparent;
    border-bottom: 55px solid var(--rim-color);
}

/* Color Classes - Set rim colors for tires */
.color-red {
    --rim-color: #FF4444;
    --rim-color-dark: #CC3333;
}
.color-blue {
    --rim-color: #1E90FF;
    --rim-color-dark: #1565C0;
}
.color-green {
    --rim-color: #2ECC40;
    --rim-color-dark: #27AE60;
}
.color-yellow {
    --rim-color: #FFD700;
    --rim-color-dark: #FFA500;
}
.color-purple {
    --rim-color: #9B59B6;
    --rim-color-dark: #7D3C98;
}
.color-orange {
    --rim-color: #FF8C00;
    --rim-color-dark: #E67E00;
}
.color-pink {
    --rim-color: #FF69B4;
    --rim-color-dark: #E91E63;
}
.color-cyan {
    --rim-color: #00CED1;
    --rim-color-dark: #00ACC1;
}
.color-brown {
    --rim-color: #8B4513;
    --rim-color-dark: #654321;
}
.color-lime {
    --rim-color: #32CD32;
    --rim-color-dark: #228B22;
}

/* Triangle and other shapes now use tire styling with colored rims */

/* ===================================
   CONFETTI
   =================================== */

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    animation: fall 3s linear forwards;
    box-shadow:
        0 0 10px currentColor,
        0 0 20px currentColor;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 1;
        transform: translateY(50vh) rotate(360deg) scale(1.5);
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

/* ===================================
   CELEBRATION OVERLAY
   =================================== */

.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.celebration-overlay.hidden {
    display: none;
}

.celebration-text {
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 900;
    color: var(--splash-title-color);
    text-shadow:
        3px 3px 0px #000000,
        -1px -1px 0px #000000,
        1px -1px 0px #000000,
        -1px 1px 0px #000000,
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.6);
    animation: bounce 0.6s ease infinite;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5));
    letter-spacing: 0.05em;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
    padding: 0 15px;
    max-width: 90%;
    text-align: center;
    margin: 0 auto;
    font-family: var(--font-family);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1) rotate(-3deg);
    }
    50% {
        transform: scale(1.2) rotate(3deg);
    }
}


/* ===================================
   INTERMISSION CONTAINER
   =================================== */

.intermission-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 10000;
}

.intermission-container.hidden {
    display: none;
}

.mini-game {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mini-game.hidden {
    display: none;
}

.mini-game-title {
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 900;
    color: var(--splash-title-color);
    text-shadow:
        3px 3px 0px #000000,
        -1px -1px 0px #000000,
        1px -1px 0px #000000,
        -1px 1px 0px #000000,
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 30px rgba(255, 215, 0, 0.5);
    margin-bottom: var(--space-lg);
    animation: gentleBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5));
    letter-spacing: 0.05em;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
    padding: 0 10px;
    text-align: center;
    width: 100%;
    font-family: var(--font-family);
}

.mini-game-instructions {
    font-size: clamp(18px, 3.5vw, 32px);
    font-weight: 700;
    color: var(--splash-subtitle-color);
    text-shadow:
        2px 2px 0px #000000,
        -1px -1px 0px #000000,
        1px -1px 0px #000000,
        -1px 1px 0px #000000,
        0 0 10px rgba(0, 0, 0, 0.8);
    margin-bottom: var(--space-lg);
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-radius: var(--radius-lg);
    border: 4px solid var(--border-medium);
    font-family: var(--font-family);
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

@keyframes titleBounce {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ===================================
   MUD WASH GAME
   =================================== */

.canvas-container {
    position: relative;
    width: 400px;
    height: 300px;
}

#mud-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    cursor: pointer;
    touch-action: none;
}

.clean-truck {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mud-truck-image {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

.mud-progress-container {
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
}

.mud-progress-label {
    font-size: 24px;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 10px;
    text-align: center;
}

.mud-progress-bar {
    width: 100%;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    border: 4px solid #FFD700;
    overflow: hidden;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.5),
        inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mud-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4ECDC4, #44E5B4, #2ECC71);
    transition: width 0.3s ease;
    box-shadow:
        0 0 20px rgba(78, 205, 196, 0.8),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    animation: progressShine 2s ease infinite;
}

@keyframes progressShine {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

/* Mud wash completion — big visible reward for toddlers */
#mud-wash-game.mud-wash-celebrating .canvas-container {
    animation: mudWashSparkleRing 0.9s ease-in-out infinite;
    border-radius: 16px;
    box-shadow:
        0 0 0 4px rgba(255, 215, 0, 0.85),
        0 0 28px rgba(78, 205, 196, 0.9),
        0 0 48px rgba(255, 215, 0, 0.55);
}

#mud-wash-game.mud-wash-celebrating .mud-truck-image {
    animation: mudWashTruckBounce 0.55s ease-in-out infinite;
}

@keyframes mudWashSparkleRing {
    0%, 100% {
        box-shadow:
            0 0 0 4px rgba(255, 215, 0, 0.85),
            0 0 28px rgba(78, 205, 196, 0.75),
            0 0 48px rgba(255, 215, 0, 0.45);
    }
    50% {
        box-shadow:
            0 0 0 8px rgba(255, 140, 200, 0.75),
            0 0 40px rgba(255, 215, 0, 0.95),
            0 0 64px rgba(68, 229, 180, 0.65);
    }
}

@keyframes mudWashTruckBounce {
    0%, 100% {
        transform: scale(1) rotate(-1deg);
    }
    50% {
        transform: scale(1.08) rotate(1deg);
    }
}

/* ===================================
   STICKER SHOP GAME
   =================================== */

.sticker-truck-area {
    position: relative;
    width: 500px;
    height: 300px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.sticker-truck-area .truck-body.large {
    width: 400px;
    height: 150px;
}

.sticker-inventory {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.sticker {
    font-size: 80px;
    cursor: grab;
    touch-action: none;
    filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.3));
    transition: transform 0.2s ease;
}

.sticker:active {
    cursor: grabbing;
    transform: scale(1.2);
}

.sticker.placed {
    position: absolute;
    cursor: default;
}

/* ===================================
   BIG JUMP GAME
   =================================== */

.jump-scene {
    position: relative;
    width: 100%;
    height: 300px;
    margin-bottom: 50px;
    overflow: hidden;
}

.jump-truck {
    position: absolute;
    bottom: 50px;
    left: -200px;
    animation: driveToRamp 3s ease-in-out forwards;
    transform: none;
}

.jump-truck .truck-image {
    display: block;
    width: 200px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

@keyframes driveToRamp {
    to {
        left: calc(50% - 150px);
    }
}

.jump-truck.jumping {
    animation: backflip 1.5s ease-in-out forwards;
}

@keyframes backflip {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    25% {
        transform: translateX(10vw) translateY(-150px) rotate(-90deg);
    }
    50% {
        transform: translateX(20vw) translateY(-250px) rotate(-180deg);
    }
    75% {
        transform: translateX(30vw) translateY(-150px) rotate(-270deg);
    }
    100% {
        transform: translateX(40vw) translateY(0) rotate(-360deg);
    }
}

/* Ramp removed - no longer needed */

.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.firework {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: explode 1s ease-out forwards;
}

@keyframes explode {
    to {
        transform: translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

/* ===================================
   BUBBLE WRAP GAME
   =================================== */

.bubble-counter {
    font-size: 36px;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 40px;
    border-radius: 20px;
    border: 3px solid rgba(255, 215, 0, 0.6);
}

.bubble-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
    max-width: 600px;
    width: 100%;
}

.bubble {
    aspect-ratio: 1;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(150, 200, 255, 0.3), rgba(100, 150, 255, 0.5));
    border-radius: 50%;
    cursor: pointer;
    box-shadow:
        inset 0 -10px 30px rgba(0, 0, 0, 0.1),
        inset 0 10px 30px rgba(255, 255, 255, 0.8),
        0 5px 20px rgba(100, 150, 255, 0.5);
    position: relative;
    transition: transform 0.1s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.bubble::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 30%;
    height: 30%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9), transparent);
    border-radius: 50%;
    filter: blur(3px);
}

.bubble::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 25%;
    width: 15%;
    height: 15%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6), transparent);
    border-radius: 50%;
    filter: blur(2px);
}

.bubble:hover:not(.popped) {
    transform: scale(1.05);
}

.bubble:active:not(.popped) {
    transform: scale(0.95);
}

.bubble.popped {
    background: radial-gradient(circle, rgba(200, 200, 200, 0.1), rgba(150, 150, 150, 0.05));
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    cursor: default;
    animation: pop 0.3s ease-out;
    border: 2px solid rgba(100, 100, 100, 0.2);
}

.bubble.popped::before,
.bubble.popped::after {
    display: none;
}

@keyframes pop {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
}

/* ===================================
   GIANT BUTTONS
   =================================== */

.giant-button {
    min-width: 300px;
    max-width: min(500px, 90vw);
    min-height: 120px;
    max-height: 150px;
    padding: 25px 40px;
    font-size: clamp(40px, 7vw, 64px);
    font-weight: 800;
    font-family: var(--font-family);
    color: var(--text-inverse);
    background: var(--btn-success);
    border: 8px solid var(--border-medium);
    border-radius: var(--radius-xl);
    cursor: pointer;
    touch-action: none;
    box-shadow:
        var(--shadow-lifted),
        inset 0 4px 8px rgba(255,255,255,0.2);
    transition: all 0.2s ease;
    text-shadow:
        2px 2px 0px #000000,
        -1px -1px 0px #000000,
        1px -1px 0px #000000,
        -1px 1px 0px #000000;
    position: relative;
    overflow: hidden;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    text-align: center;
}

.giant-button:hover {
    transform: scale(1.05);
    box-shadow:
        0 16px 32px rgba(0,0,0,0.4),
        inset 0 4px 8px rgba(255,255,255,0.3);
}

.giant-button:active {
    transform: scale(0.96);
    box-shadow:
        0 10px 20px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.1);
}

@keyframes buttonShine {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes buttonGloss {
    0% {
        transform: translate(-100%, -100%) rotate(45deg);
    }
    100% {
        transform: translate(100%, 100%) rotate(45deg);
    }
}

.jump-button {
    position: relative;
    margin: 30px auto 0;
}

/* ===================================
   MOBILE OPTIMIZATIONS
   =================================== */

/* Tablets and smaller laptops */
@media (max-width: 1024px) {
    :root {
        --size-large: 100px;
        --size-small: 50px;
    }

    .level-display {
        font-size: 28px;
        padding: 10px 20px;
        top: 10px;
        left: 10px;
    }

    .slots-container {
        gap: 20px;
    }

    .slot {
        min-width: 100px;
        min-height: 100px;
    }

    .inventory-items {
        gap: 20px;
        padding: 15px;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    :root {
        --size-large: 65px;
        --size-small: 32px;
    }

    .level-display {
        font-size: 20px;
        padding: 8px 16px;
        top: 10px;
        left: 10px;
        border-radius: 12px;
        border: 3px solid #000;
    }

    .slots-container {
        gap: 15px;
        max-width: 95%;
        top: 72%;
    }

    .slot {
        min-width: 65px;
        min-height: 65px;
        border: 4px dashed rgba(255, 255, 255, 1);
        border-radius: 12px;
    }

    .slot.filled {
        border: 4px solid rgba(255, 215, 0, 1);
    }

    .inventory-items {
        gap: 15px;
        padding: 12px;
        max-width: 95vw;
    }

    .draggable-item {
        filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
    }

    @keyframes float {
        0%, 100% {
            transform: translateY(0px);
        }
        50% {
            transform: translateY(-4px);
        }
    }

    .mini-game-title {
        font-size: clamp(28px, 5vw, 32px);
    }

    .mini-game-instructions {
        font-size: clamp(16px, 3vw, 20px);
        padding: 10px 20px;
    }

    .giant-button {
        min-width: 200px;
        max-width: 90vw;
        min-height: 80px;
        max-height: 120px;
        padding: 20px 30px;
        font-size: clamp(28px, 5vw, 36px);
        border-radius: 20px;
    }

    .celebration-text {
        font-size: clamp(32px, 6vw, 48px);
    }

    .canvas-container {
        width: 90vw;
        max-width: 350px;
        height: 250px;
    }

    .mud-progress-container {
        max-width: 90vw;
    }

    .mud-progress-label {
        font-size: 20px;
    }

    .mud-progress-bar {
        height: 35px;
    }

    .sticker-truck-area {
        width: 90vw;
        max-width: 400px;
        height: 200px;
    }

    .sticker {
        font-size: 50px;
    }

    .sticker-inventory {
        gap: 15px;
    }

    .bubble-counter {
        font-size: 24px;
        padding: 10px 25px;
        margin-bottom: 20px;
    }

    .bubble-grid {
        gap: 15px;
        padding: 15px;
        max-width: 90vw;
    }

    .splash-title {
        font-size: clamp(32px, 6vw, 40px);
    }

    .splash-subtitle {
        font-size: clamp(18px, 3.5vw, 24px);
    }

    .splash-truck {
        width: 200px;
        margin-bottom: 30px;
    }

    .start-game-button {
        min-width: 250px;
        max-width: 90vw;
        min-height: 80px;
        padding: 15px 25px;
        font-size: clamp(24px, 4vw, 36px);
    }
}

/* Small phones */
@media (max-width: 480px) {
    :root {
        --size-large: 55px;
        --size-small: 28px;
    }

    .level-display {
        font-size: 18px;
        padding: 6px 12px;
    }

    .slots-container {
        gap: 10px;
        top: 68%;
    }

    .slot {
        min-width: 55px;
        min-height: 55px;
        border: 3px dashed rgba(255, 255, 255, 1);
    }

    .slot.filled {
        border: 3px solid rgba(255, 215, 0, 1);
    }

    .inventory-items {
        gap: 10px;
        padding: 10px;
    }

    .mini-game-title {
        font-size: clamp(20px, 4.5vw, 24px);
    }

    .mini-game-instructions {
        font-size: clamp(14px, 2.8vw, 16px);
        padding: 8px 16px;
    }

    .giant-button {
        min-width: 180px;
        max-width: 90vw;
        min-height: 70px;
        max-height: 100px;
        padding: 15px 25px;
        font-size: clamp(20px, 4.5vw, 28px);
    }

    .celebration-text {
        font-size: clamp(28px, 5vw, 36px);
    }

    .sticker {
        font-size: 40px;
    }

    .canvas-container {
        width: 85vw;
        max-width: 300px;
        height: 200px;
    }

    .mud-progress-label {
        font-size: 18px;
    }

    .mud-progress-bar {
        height: 30px;
    }

    .jump-truck .truck-image {
        width: 150px;
    }

    @keyframes backflip {
        0% {
            transform: translateX(0) translateY(0) rotate(0deg);
        }
        25% {
            transform: translateX(10vw) translateY(-80px) rotate(-90deg);
        }
        50% {
            transform: translateX(20vw) translateY(-120px) rotate(-180deg);
        }
        75% {
            transform: translateX(30vw) translateY(-80px) rotate(-270deg);
        }
        100% {
            transform: translateX(40vw) translateY(0) rotate(-360deg);
        }
    }

    .draggable-item {
        filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
    }

    @keyframes float {
        0%, 100% {
            transform: translateY(0px);
        }
        50% {
            transform: translateY(-3px);
        }
    }

    .bubble-counter {
        font-size: 20px;
        padding: 8px 20px;
        margin-bottom: 15px;
    }

    .bubble-grid {
        gap: 12px;
        padding: 12px;
        max-width: 85vw;
    }

    .splash-title {
        font-size: clamp(24px, 5vw, 32px);
    }

    .splash-subtitle {
        font-size: clamp(16px, 3vw, 20px);
    }

    .splash-truck {
        width: 150px;
        margin-bottom: 25px;
    }

    .start-game-button {
        min-width: 200px;
        max-width: 90vw;
        min-height: 70px;
        padding: 12px 20px;
        font-size: clamp(20px, 3.5vw, 28px);
    }
}

/* Very small phones - extra tight spacing */
@media (max-width: 400px) {
    :root {
        --size-large: 50px;
        --size-small: 25px;
    }

    .slots-container {
        gap: 8px;
        top: 65%;
        max-width: 98%;
    }

    .slot {
        min-width: 50px;
        min-height: 50px;
        border: 2px dashed rgba(255, 255, 255, 1);
        border-radius: 8px;
    }

    .slot.filled {
        border: 2px solid rgba(255, 215, 0, 1);
    }

    .inventory-items {
        gap: 8px;
        padding: 8px;
        max-width: 98vw;
    }

    .level-display {
        font-size: 16px;
        padding: 5px 10px;
    }

    .canvas-container {
        width: 90vw;
        max-width: 280px;
        height: 180px;
    }

    .jump-truck .truck-image {
        width: 120px;
    }

    @keyframes backflip {
        0% {
            transform: translateX(0) translateY(0) rotate(0deg);
        }
        25% {
            transform: translateX(10vw) translateY(-100px) rotate(-90deg);
        }
        50% {
            transform: translateX(20vw) translateY(-160px) rotate(-180deg);
        }
        75% {
            transform: translateX(30vw) translateY(-100px) rotate(-270deg);
        }
        100% {
            transform: translateX(40vw) translateY(0) rotate(-360deg);
        }
    }

    .draggable-item {
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    }

    .draggable-item:hover {
        transform: scale(1.05) rotate(3deg);
    }

    @keyframes float {
        0%, 100% {
            transform: translateY(0px);
        }
        50% {
            transform: translateY(-2px);
        }
    }
}

/* Portrait orientation - make it playable instead of blocking */
@media (max-height: 600px) and (orientation: portrait) {
    .truck-area {
        flex: 3;
    }

    .inventory-area {
        flex: 7;
    }

    .slots-container {
        top: 60%;
    }

    .level-display {
        font-size: 16px;
        padding: 4px 10px;
    }
}

/* ===================================
   DARK THEME (toddler-games-theme)
   =================================== */

/* Dark theme: keep the same scenic background image as light mode; UI chrome adjusts below. */

html[data-theme="dark"] .splash-screen {
    background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
}

html[data-theme="dark"] .splash-title {
    color: #fef9c3;
    text-shadow:
        3px 3px 0px #1e1b4b,
        -1px -1px 0px #1e1b4b;
}

html[data-theme="dark"] .splash-subtitle {
    color: #e0e7ff;
}

html[data-theme="dark"] .inventory-items {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.45),
        inset 0 2px 8px rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .intermission-container {
    --bg-color: rgba(15, 23, 42, 0.97);
    background: linear-gradient(165deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}

html[data-theme="dark"] .hub-link {
    background: linear-gradient(135deg, #0369a1 0%, #0c4a6e 100%);
}

html[data-theme="dark"] .theme-select {
    background: linear-gradient(135deg, #1d4ed8 0%, #172554 100%);
}

html[data-theme="dark"] .language-selector select {
    background: linear-gradient(135deg, #5b21b6 0%, #4c1d95 100%);
}

.hidden {
    display: none !important;
}
