/* ============================================
   TOWER JUMP - Stylesheet
   Endless Platform Climber
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 480px;
    height: 640px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.3),
        0 0 80px rgba(0, 255, 255, 0.1),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
    border: 3px solid #00ffff;
    margin: 0 auto;
}

/* Canvas */
#gameCanvas {
    display: block;
    background: linear-gradient(180deg, 
        #0a0a1a 0%, 
        #1a1a3a 30%, 
        #2a2a5a 60%, 
        #3a3a7a 100%);
}

/* ============================================
   SCREENS (Start, Game Over, Pause)
   ============================================ */

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(10, 10, 30, 0.95);
    z-index: 100;
    text-align: center;
    color: white;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 40px #00ffff;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff; }
    to { text-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff, 0 0 60px #00ffff; }
}

.subtitle {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 30px;
    font-style: italic;
}

.controls-info {
    background: rgba(0, 255, 255, 0.1);
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.controls-info p {
    margin: 8px 0;
    font-size: 1rem;
    color: #ccc;
}

/* Buttons */
.game-btn {
    padding: 15px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #0a0a1a;
    background: linear-gradient(180deg, #00ffff 0%, #00cccc 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
}

.game-btn:active {
    transform: scale(0.98);
}

.game-btn.secondary {
    background: linear-gradient(180deg, #666 0%, #444 100%);
    color: white;
}

.game-btn.secondary:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.highscore-display {
    margin-top: 30px;
    font-size: 1.2rem;
    color: #ffd700;
}

/* ============================================
   HUD (Heads Up Display)
   ============================================ */

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 15px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    z-index: 50;
    pointer-events: none;
}

#hud > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

#hud .label {
    font-size: 0.7rem;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 2px;
}

#score-display #score {
    font-size: 1.8rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

#height-display #height {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
}

#combo-display #combo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
    transition: all 0.2s ease;
}

#combo-display #combo.active {
    transform: scale(1.3);
    color: #ff6600;
}

#biome-info {
    position: absolute;
    left: 50%;
    bottom: -45px;
    transform: translateX(-50%);
}

#biome-display {
    font-size: 0.9rem;
    font-weight: bold;
    color: #a78bfa;
    text-shadow: 0 0 8px #a78bfa;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 12px;
    border-radius: 15px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    white-space: nowrap;
    animation: biomePulse 3s ease-in-out infinite;
}

@keyframes biomePulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; transform: scale(1.05); }
}

/* ============================================
   GAME OVER SCREEN
   ============================================ */

.final-stats {
    background: rgba(0, 0, 0, 0.5);
    padding: 25px 40px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.final-stats p {
    font-size: 1.3rem;
    margin: 10px 0;
    color: #ccc;
}

.final-stats span {
    color: #00ffff;
    font-weight: bold;
}

.new-highscore {
    color: #ffd700 !important;
    font-size: 1.5rem !important;
    animation: pulse 0.5s ease-in-out infinite alternate;
    margin-top: 15px !important;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* ============================================
   PAUSE SCREEN
   ============================================ */

#pause-screen {
    background: rgba(10, 10, 30, 0.9);
}

#pause-screen h1 {
    font-size: 4rem;
}

#pause-screen p {
    color: #888;
    font-size: 1.1rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 500px) {
    #game-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    .screen h1 {
        font-size: 2.2rem;
    }
    
    .controls-info {
        padding: 15px 20px;
        margin: 0 10px 30px 10px;
    }
    
    .game-btn {
        padding: 12px 30px;
        font-size: 1.1rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen:not(.hidden) h1 {
    animation: slideIn 0.5s ease-out;
}

/* Combo Text Animation */
@keyframes comboPopup {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

.combo-popup {
    animation: comboPopup 0.3s ease-out;
}
