﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a12;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #16213e 100%);
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    pointer-events: none;
    z-index: 10;
}

#score-panel {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 200, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.1);
    min-width: 80px;
}

.score-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #00ffc8;
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.8);
    transition: color 0.3s, text-shadow 0.3s;
}

.score-value.rate-fast { color: #00ff00; text-shadow: 0 0 15px rgba(0, 255, 0, 0.8); }
.score-value.rate-slow { color: #ff4444; text-shadow: 0 0 15px rgba(255, 68, 68, 0.8); }

/* Boss Warning */
.boss-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(24px, 5vw, 40px);
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.8), 0 0 40px rgba(0, 255, 0, 0.6);
    animation: bossPulse 0.5s ease-in-out infinite;
    z-index: 50;
    pointer-events: none;
}

@keyframes bossPulse {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.1); }
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 18, 0.95);
    z-index: 100;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.screen-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
    animation: float 3s ease-in-out infinite;
}

.game-title {
    font-size: clamp(28px, 6vw, 48px);
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.8), 0 0 20px rgba(0, 255, 200, 0.6), 0 0 40px rgba(0, 255, 200, 0.4);
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.game-subtitle { font-size: 16px; color: rgba(255, 255, 255, 0.7); margin-bottom: 30px; }

.game-over-title {
    font-size: clamp(24px, 5vw, 40px);
    font-weight: bold;
    color: #ff4466;
    text-shadow: 0 0 10px rgba(255, 68, 102, 0.8), 0 0 20px rgba(255, 68, 102, 0.6);
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.controls-info { background: rgba(255, 255, 255, 0.05); border-radius: 15px; padding: 20px; margin-bottom: 20px; border: 1px solid rgba(255, 255, 255, 0.1); }
.control-group { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.control-group:last-child { border-bottom: none; }
.control-key { background: rgba(0, 255, 200, 0.2); color: #00ffc8; padding: 5px 12px; border-radius: 5px; font-family: monospace; font-size: 14px; font-weight: bold; }
.control-desc { color: rgba(255, 255, 255, 0.7); font-size: 14px; }

.hint-text { font-size: 14px; color: rgba(255, 200, 0, 0.8); margin-bottom: 30px; line-height: 1.5; }

.final-stats { background: rgba(255, 255, 255, 0.05); border-radius: 15px; padding: 20px; margin-bottom: 30px; border: 1px solid rgba(255, 255, 255, 0.1); }
.stat-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8); font-size: 16px; }
.stat-row:last-child { border-bottom: none; }
.stat-value { color: #00ffc8; font-weight: bold; font-size: 20px; text-shadow: 0 0 10px rgba(0, 255, 200, 0.5); }

/* Name Input */
#name-input-container {
    margin-bottom: 20px;
}

#player-name-input {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00ffc8;
    color: #00ffc8;
    padding: 12px 20px;
    font-size: 18px;
    border-radius: 5px;
    text-align: center;
    width: 250px;
    margin-bottom: 15px;
    outline: none;
    transition: all 0.3s ease;
}

#player-name-input:focus {
    box-shadow: 0 0 20px rgba(0, 255, 200, 0.5);
}

#player-name-input::placeholder {
    color: rgba(0, 255, 200, 0.5);
}

/* Highscores */
.highscores-title {
    font-size: 20px;
    color: #00ffc8;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.5);
}

#highscores-list {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.highscore-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.highscore-entry:last-child {
    border-bottom: none;
}

.highscore-entry.highlight {
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.highscore-rank {
    color: rgba(255, 200, 0, 0.8);
    font-weight: bold;
    margin-right: 10px;
}

.highscore-name {
    flex: 1;
    text-align: left;
}

.highscore-score {
    color: #00ffc8;
    font-weight: bold;
}

/* Neon Button */
.neon-btn {
    background: transparent; border: 2px solid #00ffc8; color: #00ffc8; padding: 15px 50px; font-size: 18px; font-weight: bold;
    letter-spacing: 2px; text-transform: uppercase; cursor: pointer; border-radius: 5px; transition: all 0.3s ease; position: relative; overflow: hidden;
    margin: 5px;
}
.neon-btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(0, 255, 200, 0.3), transparent); transition: left 0.5s ease; }
.neon-btn:hover { background: rgba(0, 255, 200, 0.1); box-shadow: 0 0 20px rgba(0, 255, 200, 0.5), inset 0 0 20px rgba(0, 255, 200, 0.1); transform: scale(1.05); }
.neon-btn:hover::before { left: 100%; }
.neon-btn:active { transform: scale(0.98); }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .score-item { padding: 8px 12px; min-width: 70px; }
    .score-value { font-size: 20px; }
    .score-label { font-size: 9px; }
    #score-panel { gap: 10px; }
    #player-name-input { width: 200px; font-size: 16px; }
}