/* css/style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600;700&display=swap');

body {
    background: #000;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.screen.active {
    display: flex;
}

/* ---- MENU ---- */
.menu-container, .qr-container, .how-container, .results-container {
    text-align: center;
    padding: 40px;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 6rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px #00f7ff, 0 0 40px #00f7ff, 0 0 80px #0066ff;
    margin-bottom: 10px;
    letter-spacing: 8px;
}

.game-title span {
    color: #ff00aa;
    text-shadow: 0 0 20px #ff00aa, 0 0 40px #ff00aa, 0 0 80px #ff0066;
}

.subtitle {
    font-size: 1.5rem;
    color: #aaa;
    letter-spacing: 6px;
    margin-bottom: 50px;
    font-weight: 400;
}

.menu-btn {
    display: block;
    width: 300px;
    margin: 12px auto;
    padding: 16px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    border: 2px solid #00f7ff;
    background: rgba(0, 247, 255, 0.1);
    color: #00f7ff;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.menu-btn:hover {
    background: rgba(0, 247, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 247, 255, 0.4);
    transform: scale(1.05);
}

.menu-btn.secondary {
    border-color: #666;
    color: #999;
    background: rgba(255,255,255,0.05);
}

.menu-btn.secondary:hover {
    border-color: #00f7ff;
    color: #00f7ff;
    background: rgba(0, 247, 255, 0.1);
}

.menu-btn.small {
    width: 200px;
    font-size: 0.9rem;
    padding: 10px 20px;
}

.connection-info {
    margin-top: 40px;
    padding: 20px;
    border: 1px solid #333;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
}

#ctrl-status {
    color: #ff4444;
}

#ctrl-status.connected {
    color: #44ff44;
}

/* ---- QR ---- */
.qr-container {
    background: rgba(0,0,0,0.9);
    border: 2px solid #00f7ff;
    border-radius: 20px;
    padding: 50px;
}

.qr-container h2 {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 30px;
    color: #00f7ff;
}

#qr-code {
    display: inline-block;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    margin-bottom: 20px;
}

#room-code-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: #ff00aa;
    letter-spacing: 8px;
}

/* ---- HOW TO PLAY ---- */
.how-container {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(0,0,0,0.95);
    border: 2px solid #00f7ff;
    border-radius: 20px;
    padding: 40px;
}

.how-container h2 {
    font-family: 'Orbitron', sans-serif;
    color: #00f7ff;
    margin-bottom: 30px;
}

.instructions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.instruction-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.move-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.calories {
    color: #ff6600;
    font-weight: 700;
    font-size: 0.9rem;
}

.tip {
    color: #888;
    margin-bottom: 20px;
}

/* ---- DIFFICULTY ---- */
.difficulty-buttons {
    margin-top: 30px;
}

.diff-btn {
    width: 400px;
    position: relative;
}

.diff-desc {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    color: #888;
    margin-top: 4px;
    letter-spacing: 1px;
}

/* ---- COUNTDOWN ---- */
#countdown-screen {
    background: rgba(0,0,0,0.9);
    z-index: 100;
}

.countdown-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 12rem;
    font-weight: 900;
    color: #00f7ff;
    text-shadow: 0 0 40px #00f7ff, 0 0 80px #0066ff;
    animation: countPulse 1s ease-in-out infinite;
}

@keyframes countPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ---- GAME HUD ---- */
#game-screen {
    z-index: 1;
}

#game-canvas {
    width: 100%;
    height: 100%;
}

#hud {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 20;
    pointer-events: none;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hud-center {
    text-align: center;
}

.hud-item {
    display: flex;
    flex-direction: column;
}

.hud-label {
    font-size: 0.8rem;
    color: #888;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.hud-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #00f7ff;
    text-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
}

#hud-calories {
    color: #ff6600;
    text-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
}

#hud-combo {
    color: #ff00aa;
}

#hud-move-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #fff;
    letter-spacing: 4px;
}

#hit-feedback {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    min-height: 60px;
    transition: all 0.15s;
}

#hit-feedback.perfect {
    color: #00ff88;
    text-shadow: 0 0 30px #00ff88;
    animation: feedbackPop 0.4s ease-out;
}

#hit-feedback.good {
    color: #ffcc00;
    text-shadow: 0 0 30px #ffcc00;
    animation: feedbackPop 0.4s ease-out;
}

#hit-feedback.miss {
    color: #ff3333;
    text-shadow: 0 0 30px #ff3333;
    animation: feedbackPop 0.4s ease-out;
}

@keyframes feedbackPop {
    0% { transform: scale(1.8); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* ---- MOVE INDICATOR ---- */
#move-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    pointer-events: none;
}

#move-zones {
    display: flex;
    gap: 15px;
}

.zone {
    width: 70px;
    height: 70px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(0,0,0,0.5);
    transition: all 0.15s;
}

.zone.active {
    border-color: #00f7ff;
    background: rgba(0, 247, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 247, 255, 0.5);
    transform: scale(1.15);
}

.zone.hit {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6);
}

/* ---- RESULTS ---- */
#results-screen {
    background: rgba(0,0,0,0.95);
}

.results-container h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: #ffcc00;
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    margin-bottom: 40px;
}

.results-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto 40px;
}

.result-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.result-item.highlight {
    grid-column: span 2;
    border-color: #ff6600;
    background: rgba(255, 102, 0, 0.1);
}

.result-label {
    display: block;
    font-size: 0.85rem;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.result-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #00f7ff;
}

.result-item.highlight .result-value {
    color: #ff6600;
    font-size: 3rem;
}

.result-grade {
    font-family: 'Orbitron', sans-serif;
    font-size: 8rem;
    font-weight: 900;
    margin-bottom: 30px;
    text-shadow: 0 0 40px currentColor;
}

/* Responsive */
@media (max-width: 768px) {
    .game-title { font-size: 3rem; }
    .instructions { grid-template-columns: 1fr; }
    .menu-btn, .diff-btn { width: 260px; }
    #hud { padding: 10px 15px; }
    .hud-value { font-size: 1.3rem; }
}