/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --bg-dark: #0a0e27;
    --bg-darker: #04070f;
    --primary: #00d4ff;
    --secondary: #ff00ff;
    --accent: #ffea00;
    --success: #00ff88;
    --danger: #ff0055;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-glow: linear-gradient(135deg, #00d4ff 0%, #ff00ff 100%);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    
    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    background: var(--bg-darker);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ===== BACKGROUND EFFECTS ===== */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.orb1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #667eea, transparent);
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.orb2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #f5576c, transparent);
    bottom: -200px;
    right: -200px;
    animation-delay: 7s;
}

.orb3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #00d4ff, transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -100px) scale(1.1); }
    66% { transform: translate(-100px, 100px) scale(0.9); }
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: 1400px;
    padding: 2rem;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    margin-bottom: 3rem;
}

.game-title {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 1rem;
    display: inline-flex;
    gap: 0.5rem;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.title-letter {
    display: inline-block;
    animation: letterFloat 3s ease-in-out infinite;
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-letter:nth-child(1) { animation-delay: 0s; }
.title-letter:nth-child(2) { animation-delay: 0.1s; }
.title-letter:nth-child(3) { animation-delay: 0.2s; }
.title-letter:nth-child(4) { animation-delay: 0.3s; }
.title-letter:nth-child(5) { animation-delay: 0.4s; }
.title-letter:nth-child(6) { animation-delay: 0.5s; }

@keyframes letterFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===== GAME CONTAINER ===== */
.game-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
}

/* ===== PANELS ===== */
.stats-panel,
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    min-width: 200px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
    border-color: var(--primary);
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-color: var(--secondary);
}

.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== GAME BOARD ===== */
.game-board-container {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--glass-shadow), 0 0 40px rgba(0, 212, 255, 0.2);
}

#gameCanvas {
    display: block;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.game-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.overlay-content {
    text-align: center;
    padding: 2rem;
}

.overlay-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

.overlay-message {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== NEXT PIECE & CONTROLS ===== */
.next-piece-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    text-align: center;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    color: var(--primary);
}

#nextPieceCanvas {
    display: block;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.controls-info {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
}

.control-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.control-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.key-icon {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    min-width: 60px;
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
}

.key-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-panel,
    .info-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .game-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
        letter-spacing: 0.5rem;
    }
    
    .stat-card {
        min-width: 150px;
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}
