/* ========================================
   Dino Run: MemoryPing Edition
   Retro pixel-art endless runner
   Chrome Dino style - Theater View
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #1a1a2e;
    --bg-ground: #16213e;
    --text-white: #ffffff;
    --text-cyan: #00fff5;
    --text-green: #00ff00;
    --accent-pink: #ff2e63;
    --accent-yellow: #ffd700;
    --obstacle-color: #e94560;
    --cloud-color: rgba(255, 255, 255, 0.3);
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a15;
    font-family: 'Press Start 2P', monospace;
    color: var(--text-white);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Game Container - Theater View
   ======================================== */

#game-container {
    position: relative;
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-dark);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 255, 245, 0.15);
}

#game-canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background: var(--bg-dark);
    border-radius: 4px;
}

/* Day/Night Cycle (Negative Mode) */
.negative-mode {
    filter: invert(1);
}

/* ========================================
   HUD
   ======================================== */

#hud {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 12px 12px 0 0;
}

#score-display,
#hi-display {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-label {
    font-size: 6px;
    color: #888888;
    margin-bottom: 2px;
}

#score-value {
    font-size: 14px;
    color: var(--text-cyan);
}

#hi-value {
    font-size: 12px;
    color: var(--accent-yellow);
}

#mute-btn {
    background: transparent;
    border: 1px solid #444;
    font-size: 14px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
}

#mute-btn:active {
    background: #333;
}

/* ========================================
   Touch Area
   ======================================== */

#touch-area {
    width: 100%;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 0 0 12px 12px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.tap-hint {
    font-size: 10px;
    color: #666;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ========================================
   Overlay Screens
   ======================================== */

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 21, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#overlay.hidden {
    display: none;
}

.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.screen.hidden {
    display: none;
}

/* Ready Screen */
#ready-screen h1 {
    font-size: 24px;
    color: var(--text-cyan);
    margin-bottom: 8px;
    text-shadow: 0 0 10px var(--text-cyan);
}

#ready-screen h2 {
    font-size: 10px;
    color: #888888;
    margin-bottom: 20px;
}

#hero-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    image-rendering: pixelated;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

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

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

.instruction {
    font-size: 8px;
    color: #888888;
    margin-bottom: 30px;
    line-height: 1.8;
}

#start-btn,
#restart-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 12px 30px;
    background: var(--text-cyan);
    color: var(--bg-dark);
    border: none;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.2s;
}

#start-btn:hover,
#restart-btn:hover {
    background: var(--accent-yellow);
    transform: scale(1.05);
}

#start-btn:active,
#restart-btn:active {
    background: #00cccc;
    transform: scale(0.95);
}

.high-score-display {
    font-size: 8px;
    color: var(--accent-yellow);
}

/* Countdown Screen */
#countdown-screen {
    display: flex;
    align-items: center;
    justify-content: center;
}

#countdown-number {
    font-size: 60px;
    color: var(--text-cyan);
    text-shadow: 0 0 20px var(--text-cyan);
    animation: countPulse 1s ease-in-out infinite;
}

@keyframes countPulse {

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

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

/* End Screen */
#end-screen h1 {
    font-size: 20px;
    color: var(--accent-pink);
    margin-bottom: 25px;
    text-shadow: 0 0 10px var(--accent-pink);
}

#final-stats {
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    width: 200px;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 8px;
    color: #888888;
}

.stat-value {
    font-size: 12px;
    color: var(--text-cyan);
}

.sending-text {
    font-size: 6px;
    color: #888888;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.3;
    }
}

/* ========================================
   Responsive
   ======================================== */

@media (min-width: 600px) {

    /* Hide tap hint on desktop */
    .tap-hint {
        display: none;
    }

    #touch-area {
        height: 40px;
    }
}

@media (max-height: 500px) {
    #ready-screen h1 {
        font-size: 18px;
    }

    #hero-logo {
        width: 50px;
        height: 50px;
    }

    .instruction {
        font-size: 7px;
        margin-bottom: 20px;
    }
}