/* ==========================================================================
   Arcade Games Styles (Snake, Neon Drift, Flappy Pixel)
   ========================================================================== */

/* --- Common Game Layout & Header --- */
.snake-mode,
.flappy-mode,
.neon-drift-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.snake-header,
.game-header {
    width: 400px;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 30px;
    margin-bottom: 10px;
}

.snake-header h1,
.game-header h1 {
    margin: 0;
    font-size: clamp(1.3rem, 5vw, 2rem);
    line-height: 1;
}

.score-display {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: bold;
    min-width: 120px;
    text-align: right;
    white-space: nowrap;
}

/* --- Game Canvas & Overlay --- */
.canvas-container {
    position: relative;
    border: 4px solid var(--neon-green);
    box-shadow: 0 0 15px var(--neon-green), inset 0 0 10px var(--neon-green);
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    background: #000;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.game-overlay p {
    font-size: 1.5rem;
    margin: 10px 0;
    text-align: center;
}

/* --- Mobile Controls & D-Pad --- */
.mobile-controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.d-pad-row {
    display: flex;
    gap: 10px;
}

.d-pad-btn {
    width: 50px;
    height: 50px;
    background-color: #222;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 0 5px var(--neon-green) inset;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.d-pad-btn:active {
    background-color: var(--neon-green);
    color: #000;
}

.mobile-start-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #222;
    border: 2px solid var(--neon-yellow);
    color: var(--neon-yellow);
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 5px var(--neon-yellow) inset;
}

.mobile-start-btn:active {
    background-color: var(--neon-yellow);
    color: #000;
}

.mobile-action-btn {
    width: 100%;
    max-width: 300px;
    margin-top: 20px;
    padding: 20px;
    background-color: #222;
    border: 2px solid var(--neon-red);
    color: var(--neon-red);
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-red) inset;
    border-radius: 10px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-action-btn:active {
    background-color: var(--neon-red);
    color: #000;
}

/* --- Difficulty Selection Buttons --- */
.difficulty-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    z-index: 10;
    width: 95%;
    flex-wrap: wrap;
}

.difficulty-btns .diff-btn {
    width: auto;
    margin-top: 0;
    padding: clamp(4px, 1.2vw, 8px) clamp(8px, 2vw, 12px);
    font-size: clamp(0.75rem, 3.2vw, 0.95rem);
    text-transform: uppercase;
}

/* ==========================================================================
   Neon Drift Game Styles
   ========================================================================== */
.neon-drift-mode .game-header h1 {
    color: #0FF;
    text-shadow: 0 0 10px #0FF, 0 0 20px #0FF;
}

.neon-drift-mode .score-display {
    color: #F0F;
    text-shadow: 0 0 10px #F0F;
}

.neon-canvas-container {
    border: 4px solid #F0F;
    box-shadow: 0 0 15px #F0F, inset 0 0 10px #F0F;
}

.neon-drift-btn-left,
.neon-drift-btn-right {
    width: 70px;
    height: 50px;
    border-color: #F0F;
    box-shadow: 0 0 5px #F0F inset;
    color: #F0F;
}

.neon-drift-btn-left:active,
.neon-drift-btn-right:active {
    background-color: #F0F;
    color: #000;
}

.neon-drift-start-btn {
    border-color: #0FF;
    color: #0FF;
    box-shadow: 0 0 5px #0FF inset;
}

.neon-drift-start-btn:active {
    background-color: #0FF;
    color: #000;
}

/* --- Neon Drift Theme Selector --- */
.drift-theme-selector {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 20;
    width: 95%;
}

.drift-theme-label {
    font-size: 0.6rem;
    color: #FFF;
    letter-spacing: 1.5px;
    opacity: 0.85;
}

.drift-theme-btns {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.drift-mode-btn {
    position: relative;
    width: auto;
    margin: 0;
    padding: clamp(5px, 1.2vw, 8px) clamp(8px, 2vw, 12px);
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: clamp(0.6rem, 2.2vw, 0.75rem);
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #555;
    background-color: #222;
    color: #888;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Sunset Run Button */
.drift-mode-sunset {
    border-color: rgba(255, 0, 136, 0.4);
    color: #888;
    background-color: rgba(10, 5, 15, 0.85);
    box-shadow: none;
    opacity: 0.65;
}

.drift-mode-sunset.active {
    border-color: #FF0088;
    color: #FF00FF;
    background-color: rgba(255, 0, 136, 0.2);
    box-shadow: 0 0 10px rgba(255, 0, 136, 0.6), inset 0 0 6px rgba(255, 0, 136, 0.4);
    text-shadow: none;
    opacity: 1;
}

.drift-mode-sunset:hover:not(.active) {
    border-color: rgba(255, 0, 136, 0.8);
    color: #FF88CC;
    opacity: 0.9;
}

.drift-mode-sunset:active {
    background-color: #FF0088;
    color: #000;
}

/* Neon Tunnel Button */
.drift-mode-tunnel {
    border-color: rgba(0, 255, 255, 0.4);
    color: #888;
    background-color: rgba(5, 15, 20, 0.85);
    box-shadow: none;
    opacity: 0.65;
}

.drift-mode-tunnel.active {
    border-color: #00FFFF;
    color: #00FFFF;
    background-color: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6), inset 0 0 6px rgba(0, 255, 255, 0.4);
    text-shadow: none;
    opacity: 1;
}

.drift-mode-tunnel:hover:not(.active) {
    border-color: rgba(0, 255, 255, 0.8);
    color: #88FFFF;
    opacity: 0.9;
}

.drift-mode-tunnel:active {
    background-color: #00FFFF;
    color: #000;
}

#overlaySubtext:empty {
    display: none;
}

/* ==========================================================================
   Flappy Pixel Game Styles
   ========================================================================== */
.flappy-mode .game-header h1 {
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow), 0 0 20px var(--neon-yellow);
}

.flappy-mode .score-display {
    color: var(--neon-red);
    text-shadow: 0 0 10px var(--neon-red);
}

.flappy-canvas-container {
    border: 4px solid var(--neon-yellow);
    box-shadow: 0 0 15px var(--neon-yellow), inset 0 0 10px var(--neon-yellow);
}
