/* =============================================
   FLAPPY MODI - Classic Edition
   Clean Retro Style (like flappybird.io)
   ============================================= */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sky-top: #4ec0ca;
    --sky-bottom: #9be2fe;
    --ground-top: #ded895;
    --ground-bottom: #d7c058;
    --pipe-green: #73bf2e;
    --pipe-dark: #558b22;
    --pipe-light: #8ee04a;
    --text-dark: #542700;
    --text-shadow: #e8e0b0;
    --white: #ffffff;
    --orange: #ff6b35;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    background: var(--sky-top);
}

/* -------- Game Container -------- */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}

canvas#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* -------- HUD - Simple Score -------- */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s;
}

#hud.visible {
    opacity: 1;
}

.hud-left, .hud-right {
    display: none;
}

.score-box {
    background: transparent;
    border: none;
    padding: 0;
}

.hud-label {
    display: none;
}

.hud-value {
    font-family: 'Press Start 2P', monospace;
    font-size: 3rem;
    font-weight: bold;
    color: var(--white);
    text-shadow: 
        2px 2px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000;
}

/* -------- Shared Overlay Styles -------- */
#start-screen,
#gameover-screen,
#ready-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s, visibility 0.3s;
}

#start-screen.hidden,
#gameover-screen.hidden,
#ready-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.screen-content {
    text-align: center;
    max-width: 400px;
    padding: 20px;
}

/* -------- Start Screen - Clean Retro -------- */
#start-screen {
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}

.logo-container {
    margin-bottom: 40px;
}

.game-title {
    font-family: 'Press Start 2P', monospace;
    font-weight: bold;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.title-line {
    display: block;
    font-size: clamp(2rem, 8vw, 3.5rem);
    color: var(--white);
    text-shadow: 
        3px 3px 0 #000,
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000;
}

.title-top {
    color: var(--white);
}

.title-bottom {
    color: var(--orange);
}

.subtitle {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    color: var(--white);
    margin-top: 15px;
    text-shadow: 1px 1px 0 #000;
}

/* Character Showcases */
.character-showcase {
    position: relative;
    display: inline-block;
    margin: 20px 0;
}

.showcase-ring {
    display: none;
}

.preview-character {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--white);
    box-shadow: 0 4px 0 rgba(0,0,0,0.3);
    animation: float 1.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.vs-badge {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.2rem;
    color: var(--orange);
    margin: 10px 0;
    text-shadow: 2px 2px 0 #000;
}

.enemy-showcase {
    margin-bottom: 30px;
}

.preview-enemy {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--pipe-green);
    box-shadow: 0 4px 0 rgba(0,0,0,0.3);
}

/* Simple Button */
.neon-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: var(--white);
    background: var(--orange);
    border: none;
    border-radius: 8px;
    padding: 15px 30px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 
        0 6px 0 #c44a1a,
        0 8px 10px rgba(0,0,0,0.3);
    transition: all 0.1s;
    outline: none;
    position: relative;
}

.neon-btn:hover {
    transform: translateY(2px);
    box-shadow: 
        0 4px 0 #c44a1a,
        0 6px 10px rgba(0,0,0,0.3);
}

.neon-btn:active {
    transform: translateY(6px);
    box-shadow: 
        0 0 0 #c44a1a,
        0 2px 5px rgba(0,0,0,0.3);
}

.btn-shine {
    display: none;
}

.pulse-btn {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.controls-hint {
    margin-top: 30px;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    color: var(--white);
    text-shadow: 1px 1px 0 #000;
}

.controls-hint kbd {
    display: inline-block;
    padding: 4px 8px;
    background: var(--white);
    color: var(--text-dark);
    border-radius: 4px;
    font-size: 0.5rem;
    margin: 0 3px;
    box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}

/* -------- Game Over Screen - Clean -------- */
#gameover-screen {
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
}

#gameover-screen.visible {
    opacity: 1;
    visibility: visible;
}

.gameover-title {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(2rem, 7vw, 3rem);
    color: var(--orange);
    text-shadow: 
        3px 3px 0 #000,
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000;
    margin-bottom: 20px;
}

.skull-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.scores-panel {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    background: var(--ground-top);
    padding: 20px;
    border-radius: 8px;
    border: 3px solid var(--white);
    box-shadow: 
        0 4px 0 var(--ground-bottom),
        inset 0 2px 5px rgba(0,0,0,0.1);
}

.score-card {
    text-align: center;
}

.card-label {
    display: block;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    color: var(--orange);
    margin-bottom: 8px;
}

.card-value {
    display: block;
    font-family: 'Press Start 2P', monospace;
    font-size: 1.5rem;
    color: var(--white);
    text-shadow: 2px 2px 0 #000;
}

.card-value.cyan {
    color: var(--sky-top);
}

.card-value.gold {
    color: var(--orange);
}

.medal-display {
    font-size: 3rem;
    margin-bottom: 15px;
}

.death-msg {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    color: var(--white);
    text-shadow: 1px 1px 0 #000;
    margin-bottom: 20px;
    min-height: 20px;
}

.restart-btn-style {
    background: var(--pipe-green);
    box-shadow: 
        0 6px 0 var(--pipe-dark),
        0 8px 10px rgba(0,0,0,0.3);
}

.restart-btn-style:hover {
    box-shadow: 
        0 4px 0 var(--pipe-dark),
        0 6px 10px rgba(0,0,0,0.3);
}

.restart-btn-style:active {
    box-shadow: 
        0 0 0 var(--pipe-dark),
        0 2px 5px rgba(0,0,0,0.3);
}

/* -------- Ready Overlay -------- */
#ready-overlay {
    background: rgba(0, 0, 0, 0.3);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
}

#ready-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.ready-content {
    text-align: center;
}

.ready-text {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(1.5rem, 5vw, 2rem);
    color: var(--white);
    text-shadow: 
        2px 2px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000;
    margin-bottom: 20px;
}

.tap-icon {
    font-size: 2.5rem;
    animation: tap 0.8s ease-in-out infinite;
}

@keyframes tap {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.ready-hint {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    color: var(--white);
    text-shadow: 1px 1px 0 #000;
    margin-top: 15px;
}

/* -------- Score Pop Animation -------- */
@keyframes scorePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.score-pop {
    animation: scorePop 0.2s ease-out;
}

/* -------- Screen Shake -------- */
@keyframes screenShake {
    0%, 100% { transform: translate(0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-5px, 5px); }
    20%, 40%, 60%, 80% { transform: translate(5px, -5px); }
}

.shake {
    animation: screenShake 0.4s ease-out;
}

/* -------- Background Particles -------- */
#bg-particles {
    display: none;
}

/* -------- Responsive -------- */
@media (max-width: 600px) {
    .title-line { font-size: 2rem; }
    .subtitle { font-size: 0.5rem; }
    .preview-character { width: 60px; height: 60px; }
    .preview-enemy { width: 45px; height: 45px; }
    .neon-btn { padding: 12px 24px; font-size: 0.7rem; }
    .hud-value { font-size: 2rem; }
    .scores-panel { flex-direction: column; gap: 15px; }
    .gameover-title { font-size: 1.8rem; }
    .ready-text { font-size: 1.2rem; }
}
