/* ============================================
   DRIVE MAD - Game Screen Styles
   ============================================ */

/* ============================================
   GAME SCREEN LAYOUT
   ============================================ */

#game-screen {
    background: #1a1a2e;
    display: none;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 10;
}

#game-screen.active {
    display: flex;
}

/* ============================================
   HUD
   ============================================ */

.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
    pointer-events: none;
}

.hud-left,
.hud-center,
.hud-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 4px 10px;
    backdrop-filter: blur(4px);
}

.hud-label {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 2px;
    font-weight: 600;
    line-height: 1;
}

.hud-value {
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    font-weight: 800;
    color: white;
    letter-spacing: 1px;
    line-height: 1.2;
}

.pause-btn {
    position: absolute;
    top: 8px;
    right: 16px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.15s ease;
    backdrop-filter: blur(4px);
}

.pause-btn:hover {
    background: rgba(255,255,255,0.15);
}

.pause-btn:active {
    transform: scale(0.9);
}

/* ============================================
   CHECKPOINT INDICATOR
   ============================================ */

.checkpoint-indicator {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    background: linear-gradient(135deg, rgba(6,214,160,0.9), rgba(6,180,130,0.9));
    border: 2px solid rgba(6,214,160,0.5);
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: white;
    box-shadow: 0 4px 20px rgba(6,214,160,0.4);
    animation: slideDown 0.3s ease, fadeOut 0.5s ease 1.5s forwards;
    pointer-events: none;
}

/* ============================================
   CANVAS
   ============================================ */

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    touch-action: none;
}

/* ============================================
   TOUCH CONTROLS
   ============================================ */

.touch-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    pointer-events: none;
    /* Hidden by default — shown only on mobile via responsive.css */
    display: none;
}

.touch-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.touch-btn {
    pointer-events: all;
    width: clamp(80px, 22vw, 120px);
    height: clamp(70px, 18vw, 100px);
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: background 0.1s ease, border-color 0.1s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    user-select: none;
}

.touch-btn:active,
.touch-btn.pressed {
    background: rgba(255,107,53,0.35);
    border-color: rgba(255,107,53,0.7);
    transform: scale(0.95);
}

.touch-left {
    border-color: rgba(100,150,255,0.3);
}

.touch-jump {
    border-color: rgba(6,214,160,0.5);
    background: rgba(6,214,160,0.12);
    font-size: 1.1rem;
}

.touch-jump:active,
.touch-jump.active {
    background: rgba(6,214,160,0.35);
    border-color: rgba(6,214,160,0.8);
    transform: scale(0.93);
}

.touch-left:active,
.touch-left.pressed {
    background: rgba(100,150,255,0.25);
    border-color: rgba(100,150,255,0.7);
}

.touch-btn-icon {
    font-size: clamp(1.4rem, 5vw, 2rem);
    line-height: 1;
}

.touch-btn-label {
    font-size: clamp(0.55rem, 1.8vw, 0.7rem);
    font-weight: 700;
    letter-spacing: 1.5px;
    opacity: 0.7;
}

/* ============================================
   PAUSE MENU
   ============================================ */

#pause-menu .overlay-content {
    border-color: rgba(124,58,237,0.3);
}

#pause-menu .overlay-title {
    color: var(--color-accent2, #ffd166);
}

/* ============================================
   LEVEL COMPLETE
   ============================================ */

#level-complete .overlay-content {
    border-color: rgba(6,214,160,0.3);
}

#level-complete .overlay-title {
    color: var(--color-accent, #06d6a0);
    text-shadow: 0 0 20px rgba(6,214,160,0.4);
}

/* ============================================
   CRASH SCREEN
   ============================================ */

#crash-screen .overlay-content {
    border-color: rgba(239,35,60,0.3);
}

/* ============================================
   SPEED LINES EFFECT (canvas overlay)
   ============================================ */

.speed-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.speed-overlay.active {
    opacity: 1;
}