/* Base reset & typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #050b14;
    font-family: 'Rajdhani', 'Poppins', sans-serif;
    color: #ffffff;
}

/* ThreeJS Canvas */
#game-container {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    cursor: crosshair;
}

/* UI Overlay Layer */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Enable pointer events for interactive HUD elements */
.scoreboard-container,
.environmental-badge,
.floating-controls,
.menu-card {
    pointer-events: auto;
}

/* Scoreboard Styling */
.scoreboard-container {
    margin: 20px auto 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(10, 20, 38, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 255, 204, 0.25);
    border-radius: 16px;
    padding: 10px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 204, 0.15);
}

.score-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-flag {
    font-size: 26px;
}

.team-info {
    display: flex;
    flex-direction: column;
}

.team-info.text-right {
    text-align: right;
}

.team-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #94a3b8;
}

.score {
    font-family: 'Teko', sans-serif;
    font-size: 40px;
    line-height: 1;
    font-weight: 700;
    color: #00ffcc;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.6);
}

.match-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.stage-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffaa00;
    text-transform: uppercase;
}

/* Attempts Indicator Dots */
.attempts-indicator {
    display: flex;
    gap: 6px;
    margin: 4px 0;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.dot.pending {
    background: rgba(255, 255, 255, 0.1);
}

.dot.goal {
    background: #00ff88;
    border-color: #00ff88;
    box-shadow: 0 0 10px #00ff88;
}

.dot.miss {
    background: #ff3366;
    border-color: #ff3366;
    box-shadow: 0 0 10px #ff3366;
}

.wind-indicator {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Environmental Badge */
.environmental-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.badge-item {
    background: rgba(5, 15, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.text-yellow {
    color: #ffd700;
}

/* Floating Controls (Top Right) */
.floating-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 255, 204, 0.4);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.icon-btn:hover {
    background: #00ffcc;
    color: #0f172a;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.8);
    transform: scale(1.08);
}

/* Aim Guide & Swipe Hint */
.aim-guide-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    animation: bounce 2s infinite;
}

.swipe-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 255, 204, 0.2);
    border: 2px solid #00ffcc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ffcc;
    font-size: 20px;
}

@keyframes bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -12px); }
}

/* FX Announcer Overlay */
#announcer-overlay {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    text-align: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#announcer-overlay.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

#announcer-overlay.hidden {
    display: none;
}

#announcer-title {
    font-family: 'Teko', sans-serif;
    font-size: 96px;
    line-height: 0.9;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #ffffff 0%, #00ffcc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 25px rgba(0, 255, 204, 0.8));
}

#announcer-subtitle {
    font-size: 20px;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

/* Glass Panels & Modals */
#menu-overlay, #gameover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 10, 20, 0.85);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.4s ease;
}

#menu-overlay.hidden, #gameover-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.glass-panel {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 24px;
    padding: 40px;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 255, 204, 0.2);
}

.logo-container {
    margin-bottom: 24px;
}

.game-logo-icon {
    font-size: 48px;
    color: #00ffcc;
    filter: drop-shadow(0 0 15px #00ffcc);
    margin-bottom: 10px;
}

.game-title {
    font-family: 'Teko', sans-serif;
    font-size: 44px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 2px;
}

.highlight {
    color: #00ffcc;
    text-shadow: 0 0 15px rgba(0, 255, 204, 0.6);
}

.game-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
}

.settings-group {
    margin: 20px 0;
    text-align: left;
}

.settings-group label {
    font-size: 13px;
    font-weight: 700;
    color: #cbd5e1;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 8px;
}

.difficulty-select {
    display: flex;
    gap: 10px;
}

.diff-btn {
    flex: 1;
    padding: 10px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.diff-btn:hover {
    border-color: #00ffcc;
    color: #00ffcc;
}

.diff-btn.active {
    background: linear-gradient(135deg, #00ffcc, #0099ff);
    color: #0a101d;
    border: none;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.5);
}

.instructions-box {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 16px;
    text-align: left;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.instructions-box h3 {
    font-size: 14px;
    color: #ffaa00;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.instructions-box ul {
    list-style: none;
    font-size: 12.5px;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instructions-box li i {
    color: #00ffcc;
    width: 20px;
}

.glow-btn {
    width: 100%;
    padding: 16px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #050b14;
    background: linear-gradient(90deg, #00ffcc, #00ff88);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(0, 255, 204, 0.6);
    transition: all 0.2s ease;
}

.glow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(0, 255, 204, 0.9);
}

/* Match Stats Display */
.final-score-display {
    font-family: 'Teko', sans-serif;
    font-size: 72px;
    line-height: 1;
    color: #00ffcc;
    margin: 10px 0;
    text-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
}

.match-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0 30px 0;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-val {
    font-size: 20px;
    font-weight: 800;
    color: #ffd700;
}

.stat-lbl {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .scoreboard-container {
        padding: 8px 14px;
        margin-top: 10px;
    }
    
    .team-flag {
        font-size: 20px;
    }

    .score {
        font-size: 32px;
    }

    .glass-panel {
        padding: 24px;
    }

    .game-title {
        font-size: 36px;
    }
}
