/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #1a1a2e;
    color: #fff;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* ===== SCREEN MANAGEMENT ===== */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* ===== MENU SCREEN ===== */
#menu {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

.menu-content {
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

.game-title {
    font-size: clamp(48px, 15vw, 72px);
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: pulse 2s ease-in-out infinite;
}

.tagline {
    font-size: clamp(14px, 4vw, 18px);
    opacity: 0.9;
    margin-bottom: 60px;
    font-weight: 300;
    letter-spacing: 2px;
}

.high-score-display {
    margin-top: 40px;
    font-size: 20px;
    opacity: 0.8;
}

.high-score-display .label {
    opacity: 0.7;
    font-size: 14px;
    margin-right: 10px;
}

/* ===== BUTTONS ===== */
.btn-primary, .btn-secondary {
    font-size: 18px;
    font-weight: 700;
    padding: 18px 48px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-primary {
    background: #fff;
    color: #0f3460;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.btn-primary:active {
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    margin-top: 15px;
}

.btn-secondary:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.1);
}

/* ===== GAME SCREEN ===== */
#game {
    background: #0f3460;
    justify-content: flex-start;
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0,0,0,0.3);
}

.score-container, .lives-container, .level-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.level-container {
    flex: 1;
}

.level-value {
    font-size: 24px;
    font-weight: 700;
    color: #f9ca24;
}

.label {
    font-size: 12px;
    opacity: 0.7;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.score-value, .lives-value {
    font-size: 24px;
    font-weight: 700;
}

#gameCanvas {
    flex: 1;
    width: 100%;
    max-width: 100%;
    background: #16213e;
    display: block;
    cursor: none;
}

.game-footer {
    width: 100%;
    padding: 15px;
    text-align: center;
    background: rgba(0,0,0,0.3);
}

.instruction {
    font-size: 14px;
    opacity: 0.7;
    letter-spacing: 1px;
}

/* ===== GAME OVER SCREEN ===== */
#gameOver {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

.game-over-content {
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

.game-over-title {
    font-size: clamp(36px, 10vw, 54px);
    font-weight: 900;
    margin-bottom: 30px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.final-score {
    margin: 30px 0;
}

.final-score .label {
    display: block;
    font-size: 16px;
    opacity: 0.7;
    margin-bottom: 10px;
}

.big-score {
    font-size: clamp(48px, 12vw, 72px);
    font-weight: 900;
    display: block;
}

.new-record {
    font-size: 24px;
    color: #ffd700;
    margin: 20px 0;
    animation: pulse 1s ease-in-out infinite;
}

.new-record.hidden {
    display: none;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 40px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

