/* ============================================
   THE GARAGE TOUR - Premium Stylesheet
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --concrete-1: #3a3a3e;
    --concrete-2: #2d2d32;
    --concrete-3: #454549;
    --concrete-edge: #252528;
    --lane: #525258;
    --lane-dark: #424246;
    --lane-light: #5e5e64;
    --wall: #4a4a50;
    --wall-dark: #2a2a30;
    --wall-light: #6a6a70;
    --oil: #1a1a1e;
    --oil-light: #2a2a30;
    --oil-deep: #0a0a10;
    --pillar: #5e5e64;
    --pillar-top: #6b7280;
    --pillar-light: #9ca3af;
    --pillar-shadow: #3a3a40;
    --amber: #f59e0b;
    --amber-dark: #d97706;
    --amber-soft: #fbbf24;
    --steel: #e5e7eb;
    --steel-dark: #9ca3af;
    --text-dark: #1a1a22;
    --text-light: #f3f4f6;
    --text-muted: #9ca3af;
    --rare-glow: #ef4444;
    --common-glow: #22c55e;
    --red-accent: #dc2626;
    --red-dark: #991b1b;
    --font-pixel: 'Press Start 2P', cursive;
    --font-body: 'Rajdhani', sans-serif;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: #0a0a0f;
}

.hidden {
    display: none !important;
}

/* ===== WELCOME SCREEN ===== */
#welcome-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: radial-gradient(ellipse at 50% 30%, #1a1a28 0%, #0f0f18 40%, #08080e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#welcome-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.welcome-particle {
    position: absolute;
    font-size: 20px;
    opacity: 0;
    animation: floatUp 6s linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    85% {
        opacity: 0.4;
    }

    100% {
        transform: translateY(-50px) rotate(360deg);
        opacity: 0;
    }
}

.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 1;
    animation: fadeSlideIn 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
    max-width: 560px;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.welcome-frame {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--amber);
    padding: 3px;
    background: linear-gradient(135deg, var(--amber), var(--amber-dark));
    box-shadow: 0 0 40px rgba(245, 158, 11, 0.25), 0 0 80px rgba(245, 158, 11, 0.1);
    animation: portraitGlow 4s ease-in-out infinite alternate;
}

@keyframes portraitGlow {
    from {
        box-shadow: 0 0 30px rgba(245, 158, 11, 0.25);
    }

    to {
        box-shadow: 0 0 50px rgba(245, 158, 11, 0.4), 0 0 100px rgba(245, 158, 11, 0.15);
    }
}

.welcome-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: brightness(1.05) saturate(1.1);
}

.welcome-text-box {
    text-align: center;
    width: 100%;
}

.welcome-title {
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--amber);
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.5), 2px 2px 0 rgba(0, 0, 0, 0.8);
    margin-bottom: 18px;
    line-height: 2;
    letter-spacing: 1px;
}

.dialogue-box {
    background: rgba(10, 10, 18, 0.8);
    border: 2px solid rgba(245, 158, 11, 0.4);
    border-radius: 8px;
    padding: 20px 22px;
    position: relative;
    margin-bottom: 18px;
    min-height: 80px;
    text-align: left;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(245, 158, 11, 0.1), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dialogue-box p {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-light);
    line-height: 1.7;
    letter-spacing: 0.3px;
}

.dialogue-cursor {
    position: absolute;
    bottom: 6px;
    right: 10px;
    color: var(--amber);
    animation: blink 0.8s steps(2) infinite;
    font-size: 10px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.pixel-btn {
    font-family: var(--font-pixel);
    font-size: 9px;
    padding: 14px 32px;
    letter-spacing: 0.5px;
    background: linear-gradient(180deg, var(--red-accent), var(--red-dark));
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 0 #6b1010, 0 4px 20px rgba(220, 38, 38, 0.3);
    transition: all 0.15s;
}

.pixel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #6b1010, 0 6px 28px rgba(220, 38, 38, 0.4);
}

.pixel-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #6b1010;
}

/* ===== GAME VIEWPORT ===== */
#viewport {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #1a1a22;
    display: none;
}

#viewport.active {
    display: block;
}

#world {
    position: absolute;
    width: 2400px;
    height: 1800px;
    background-color: var(--concrete-1);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(69, 69, 73, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(45, 45, 50, 0.3) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 80%, rgba(69, 69, 73, 0.25) 0%, transparent 40%),
        radial-gradient(circle, var(--concrete-2) 1px, transparent 1px),
        radial-gradient(circle, var(--concrete-3) 0.8px, transparent 0.8px),
        radial-gradient(circle, rgba(80, 80, 86, 0.3) 0.6px, transparent 0.6px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 20px 20px, 14px 14px, 32px 32px;
    background-position: 0 0, 0 0, 0 0, 0 0, 7px 7px, 3px 15px;
    image-rendering: auto;
}

/* Cool overhead fluorescent light effect */
#world::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(200, 220, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(200, 210, 240, 0.06) 0%, transparent 40%);
    z-index: 50;
}

/* Subtle vignette */
#world::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0, 0, 5, 0.2) 100%);
    z-index: 50;
}

/* ===== TILES ===== */
.tile-path {
    position: absolute;
    background-color: var(--lane);
    background-image:
        radial-gradient(ellipse at 25% 25%, var(--lane-light) 0%, transparent 45%),
        radial-gradient(ellipse at 75% 75%, var(--lane-dark) 0%, transparent 35%),
        radial-gradient(circle at 15% 60%, rgba(80, 80, 86, 0.4) 2px, transparent 2px),
        radial-gradient(circle at 55% 30%, rgba(70, 70, 76, 0.3) 3px, transparent 3px),
        radial-gradient(circle at 80% 80%, rgba(75, 75, 81, 0.35) 2px, transparent 2px),
        radial-gradient(circle at 40% 85%, rgba(85, 85, 91, 0.25) 1.5px, transparent 1.5px);
    background-size: 100% 100%, 100% 100%, 60px 60px, 80px 80px, 45px 45px, 55px 55px;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.05), inset 0 -2px 6px rgba(0, 0, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Yellow lane markings */
.tile-path::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 20px,
        rgba(245, 158, 11, 0.15) 20px,
        rgba(245, 158, 11, 0.15) 22px
    );
    pointer-events: none;
    border-radius: 4px;
}

.tile-wall {
    position: absolute;
    z-index: 5;
    background: linear-gradient(180deg, var(--wall-light) 0%, var(--wall) 40%, var(--wall-dark) 100%);
    background-image:
        repeating-linear-gradient(90deg, transparent, transparent 22px, rgba(0, 0, 0, 0.1) 22px, rgba(0, 0, 0, 0.1) 24px),
        linear-gradient(180deg, var(--wall-light) 0%, var(--wall) 40%, var(--wall-dark) 100%);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.15), inset 0 -2px 0 rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

.tile-wall::before,
.tile-wall::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--wall-dark);
}

.tile-wall::before {
    top: 35%;
}

.tile-wall::after {
    top: 65%;
}

.tile-oilpit {
    position: absolute;
    border-radius: 8px;
    z-index: 2;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 35% 30%, rgba(40, 40, 50, 0.5) 0%, transparent 50%),
        linear-gradient(135deg, var(--oil-deep), var(--oil), var(--oil-light));
    box-shadow: inset 0 3px 15px rgba(0, 0, 0, 0.5), inset 0 -2px 8px rgba(60, 60, 80, 0.15), 0 0 24px rgba(20, 20, 30, 0.3), 0 2px 6px rgba(0, 0, 0, 0.2);
    animation: oilShimmer 4s ease-in-out infinite alternate;
}

.tile-oilpit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 40%;
    border: 1px solid rgba(100, 100, 120, 0.15);
    border-radius: 50%;
    animation: oilRipple 3s ease-in-out infinite;
}

@keyframes oilRipple {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.6;
    }

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

.tile-oilpit::after {
    content: '🛢️';
    position: absolute;
    top: 20%;
    left: 30%;
    font-size: 16px;
    animation: oilFloat 6s ease-in-out infinite;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

@keyframes oilFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0);
    }

    50% {
        transform: translate(5px, 3px) rotate(10deg);
    }
}

@keyframes oilShimmer {
    0% {
        filter: brightness(0.9);
    }

    100% {
        filter: brightness(1.1);
    }
}

.tile-pillar {
    position: absolute;
    width: 80px;
    height: 96px;
    z-index: 8;
}

.tile-pillar .pillar-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 36px;
    background: linear-gradient(90deg, #404048, var(--pillar), #606068, #505058);
    border-radius: 2px;
    box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
}

/* Ground shadow beneath pillar */
.tile-pillar::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 10px;
    background: radial-gradient(ellipse, rgba(0, 0, 10, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.tile-pillar .pillar-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 58px;
    border-radius: 6px;
    background: radial-gradient(circle at 38% 32%, var(--pillar-light) 0%, var(--pillar-top) 45%, var(--pillar-shadow) 100%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 -10px 20px rgba(0, 0, 0, 0.15), inset 4px 4px 8px rgba(140, 150, 170, 0.1);
}

/* Shelf highlight */
.tile-pillar .pillar-top::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 18px;
    width: 16px;
    height: 12px;
    background: radial-gradient(ellipse, rgba(150, 160, 180, 0.25) 0%, transparent 70%);
    border-radius: 50%;
}

.tile-parkingbay {
    position: absolute;
    border-radius: 6px;
    z-index: 1;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(60, 60, 66, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(40, 40, 46, 0.3) 0%, transparent 45%),
        linear-gradient(145deg, #353538, #3e3e42, #333336);
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.15), inset 0 -3px 8px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(245, 158, 11, 0.15), 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(245, 158, 11, 0.2);
}

.tile-parkingbay::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 4px;
    background: radial-gradient(circle at 50% 50%, rgba(60, 60, 66, 0.15) 0%, transparent 60%);
    border: 1px dashed rgba(245, 158, 11, 0.15);
    pointer-events: none;
}

.car-lift {
    position: absolute;
    z-index: 3;
}

.lift-base {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, rgba(180, 180, 190, 0.5) 0%, transparent 40%),
        linear-gradient(145deg, #808088, #606068 30%, #505058 70%, #404048);
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.4), inset 0 -2px 6px rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.35), 0 0 30px rgba(245, 158, 11, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(80, 80, 90, 0.4);
}

.lift-base::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.lift-platform {
    width: 55%;
    height: 55%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, var(--amber-soft) 0%, var(--amber) 60%, var(--amber-dark) 100%);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    animation: liftPulse 2s ease-in-out infinite alternate;
}

@keyframes liftPulse {
    from {
        transform: scale(1);
        box-shadow: 0 0 18px rgba(245, 158, 11, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    }

    to {
        transform: scale(1.06);
        box-shadow: 0 0 28px rgba(245, 158, 11, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    }
}

.garage-sign {
    position: absolute;
    z-index: 10;
    background: linear-gradient(180deg, #505058, var(--wall-light), var(--wall));
    border: 2px solid var(--wall-dark);
    border-radius: 4px;
    padding: 8px 16px;
    font-family: var(--font-pixel);
    font-size: 6px;
    color: var(--amber);
    text-align: center;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 12px rgba(245, 158, 11, 0.1);
}

.garage-sign::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 10px;
    background: var(--wall-dark);
    border-radius: 0 0 2px 2px;
}

.garage-gate {
    position: absolute;
    z-index: 6;
    border: 3px solid var(--wall-dark);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12px;
    background: linear-gradient(180deg, rgba(74, 74, 80, 0.5) 0%, rgba(74, 74, 80, 0.2) 40%, transparent 80%);
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.15), inset 0 2px 0 rgba(245, 158, 11, 0.1);
}

/* Roller shutter effect */
.garage-gate::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px 8px 0 0;
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 6px,
        rgba(0, 0, 0, 0.08) 6px,
        rgba(0, 0, 0, 0.08) 8px
    );
    pointer-events: none;
}

.garage-gate span {
    font-family: var(--font-pixel);
    font-size: 5px;
    color: var(--amber);
    text-shadow: 1px 1px 0 #000, 0 0 8px rgba(245, 158, 11, 0.5);
    position: relative;
    z-index: 1;
}

/* ===== CHARACTER ===== */
.character {
    position: absolute;
    z-index: 20;
    transition: left 0.06s linear, top 0.06s linear;
    pointer-events: none;
}

/* Character shadow on ground */
.character::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 10px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.35) 0%, transparent 70%);
    border-radius: 50%;
}

.character img {
    width: 64px;
    height: 85px;
    object-fit: cover;
    object-position: center top;
    border-radius: 50% 50% 40% 40%;
    filter: saturate(1.2) contrast(1.05) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    image-rendering: auto;
}

.character.walking img {
    animation: walk 0.25s steps(2) infinite;
}

@keyframes walk {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Direction facing — horizontal flip */
.character.face-left img {
    transform: scaleX(-1);
}

.character.face-right img {
    transform: scaleX(1);
}

.character.face-left.walking img {
    animation: walkLeft 0.25s steps(2) infinite;
}

.character.face-right.walking img {
    animation: walkRight 0.25s steps(2) infinite;
}

@keyframes walkLeft {

    0%,
    100% {
        transform: scaleX(-1) translateY(0);
    }

    50% {
        transform: scaleX(-1) translateY(-5px);
    }
}

@keyframes walkRight {

    0%,
    100% {
        transform: scaleX(1) translateY(0);
    }

    50% {
        transform: scaleX(1) translateY(-5px);
    }
}

.character-name {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-pixel);
    font-size: 5px;
    color: white;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* ===== CARS (Premium) ===== */
.car-spot {
    position: absolute;
    z-index: 10;
    cursor: pointer;
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s;
    width: 62px;
}

.car-spot:hover {
    transform: scale(1.15);
    filter: brightness(1.12) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.car-spot.nearby {
    animation: carPulse 1.2s ease-in-out infinite;
}

@keyframes carPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.car-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s;
    filter: blur(10px);
}

.car-spot.nearby .car-glow {
    opacity: 0.5;
    animation: glowPulse 1.8s ease-in-out infinite;
}

@keyframes glowPulse {

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

    50% {
        opacity: 0.65;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

.car-pedestal {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.car-base {
    width: 40px;
    height: 6px;
    background: linear-gradient(180deg, #505058, #353538);
    border-radius: 3px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.car-display {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    order: -1;
    transition: box-shadow 0.3s;
}

.car-emoji {
    font-size: 28px;
    display: block;
    animation: carIdle 3.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes carIdle {

    0%,
    100% {
        transform: rotate(-3deg);
    }

    50% {
        transform: rotate(3deg);
    }
}

.car-label {
    font-family: var(--font-pixel);
    font-size: 4px;
    color: white;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.5);
    margin-top: 4px;
    white-space: nowrap;
    letter-spacing: 0.3px;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: 8px;
}

.exotic-sparkle {
    position: absolute;
    top: -4px;
    right: -4px;
    color: var(--amber);
    font-size: 12px;
    animation: sparkle 1.5s ease-in-out infinite;
    text-shadow: 0 0 6px var(--amber);
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ===== MOBILE CONTROLS ===== */
#mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    touch-action: none;
}

.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.dpad-mid {
    display: flex;
    gap: 3px;
}

.dpad-btn {
    width: 48px;
    height: 48px;
    background: rgba(10, 10, 18, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    color: var(--amber);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: all 0.1s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dpad-btn:active {
    background: rgba(245, 158, 11, 0.25);
    transform: scale(0.92);
}

.dpad-center {
    background: rgba(220, 38, 38, 0.35);
    border-color: rgba(220, 38, 38, 0.5);
    color: var(--red-accent);
}

.dpad-center:active {
    background: rgba(220, 38, 38, 0.5);
}

/* ===== CAR POPUP ===== */
#car-popup {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.popup-card {
    position: relative;
    background: #1e1e28;
    border-radius: 16px;
    max-width: 460px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(245, 158, 11, 0.1), 0 24px 64px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(245, 158, 11, 0.3);
    animation: popupIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(16px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.popup-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.popup-close-btn:hover {
    background: var(--red-accent);
    color: white;
    transform: scale(1.1);
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 22px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(30, 30, 42, 1), #1e1e28);
    border-radius: 16px 16px 0 0;
}

.popup-emoji {
    font-size: 44px;
    line-height: 1;
}

.popup-header h2 {
    font-family: var(--font-pixel);
    font-size: 10px;
    color: var(--text-light);
    line-height: 1.6;
}

.rarity-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-family: var(--font-pixel);
    font-size: 6px;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.rarity-badge.common {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.rarity-badge.exotic {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.popup-body {
    padding: 18px 22px 22px;
}

.popup-portrait-section {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.popup-portrait {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--amber);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.speech-bubble {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 14px;
    position: relative;
    flex: 1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 18px;
    border: 7px solid transparent;
    border-right-color: rgba(255, 255, 255, 0.06);
    border-left: none;
}

.speech-bubble p {
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-light);
}

.popup-fact {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.04));
    border-radius: 10px;
    padding: 11px 14px;
    border-left: 3px solid var(--amber);
    font-size: 12px;
    color: var(--steel-dark);
    line-height: 1.55;
}

.popup-fact::before {
    content: '🔧 ';
}

/* ===== INTERACTION HINT ===== */
#interaction-hint {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(8px);
    color: white;
    padding: 8px 18px;
    border-radius: 24px;
    font-family: var(--font-pixel);
    font-size: 7px;
    z-index: 50;
    animation: hintFloat 2s ease-in-out infinite;
    pointer-events: none;
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

@keyframes hintFloat {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-4px);
    }
}

#interaction-hint kbd {
    background: rgba(245, 158, 11, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--amber);
    margin: 0 2px;
}

/* ===== FLOATING SPARKS ===== */
.spark {
    position: absolute;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    animation: sparkFall linear infinite;
}

@keyframes sparkFall {
    0% {
        transform: translateY(-20px) rotate(0deg) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    85% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(180px) rotate(720deg) translateX(60px);
        opacity: 0;
    }
}

/* ===== DECORATIVE DETAILS ===== */
.tool-decor {
    animation: toolSway 4s ease-in-out infinite;
}

@keyframes toolSway {

    0%,
    100% {
        transform: rotate(-3deg);
    }

    50% {
        transform: rotate(3deg);
    }
}

@keyframes sparkFloat {
    0% {
        transform: translate(0, 0) rotate(-5deg);
        opacity: 0.7;
    }

    25% {
        transform: translate(15px, -20px) rotate(5deg);
        opacity: 0.9;
    }

    50% {
        transform: translate(30px, -5px) rotate(-3deg);
        opacity: 0.8;
    }

    75% {
        transform: translate(10px, -25px) rotate(8deg);
        opacity: 0.9;
    }

    100% {
        transform: translate(-5px, -10px) rotate(-5deg);
        opacity: 0.7;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    #mobile-controls {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .welcome-frame {
        width: 110px;
        height: 110px;
    }

    .welcome-title {
        font-size: 9px;
    }

    .dialogue-box p {
        font-size: 13px;
    }

    .pixel-btn {
        font-size: 8px;
        padding: 12px 24px;
    }

    .popup-card {
        width: 94%;
        max-height: 80vh;
        border-radius: 12px;
    }

    .popup-header {
        padding: 16px;
    }

    .popup-emoji {
        font-size: 36px;
    }

    .popup-header h2 {
        font-size: 9px;
    }

    .popup-portrait-section {
        flex-direction: row;
        align-items: flex-start;
    }

    .popup-portrait {
        width: 44px;
        height: 44px;
    }

    #interaction-hint {
        bottom: 170px;
        white-space: nowrap;
        font-size: 6.5px;
        padding: 6px 14px;
    }

    .dpad-btn {
        width: 44px;
        height: 44px;
        font-size: 14px;
    }
}
