/* ============================================
   FORTRESS RUN - VPN EDITION
   Complete Game Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    /* Core Colors */
    --bg-dark: #0a0e14;
    --bg-darker: #050709;
    --bg-light: #1a1e24;
    
    /* VPN Colors */
    --vpn-on: #00ff88;
    --vpn-on-glow: rgba(0, 255, 136, 0.5);
    --vpn-off: #ff4444;
    --vpn-off-glow: rgba(255, 68, 68, 0.5);
    
    /* Accent Colors */
    --cyan: #00d4ff;
    --purple: #a855f7;
    --orange: #ff6b35;
    --yellow: #fbbf24;
    
    /* UI Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --border-color: rgba(0, 255, 136, 0.3);
    
    /* Fonts */
    --font-display: 'Orbitron', monospace;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    
    /* Sizing */
    --hud-height: 80px;
    --mobile-controls-height: 180px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
}

.fortress-icon {
    font-size: 5rem;
    animation: fortressPulse 2s ease-in-out infinite;
}

@keyframes fortressPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px var(--vpn-on-glow)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 40px var(--vpn-on)); }
}

.loader-content h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--vpn-on), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1rem 0 0.5rem;
}

.loader-content h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 8px;
}

.loader-bar,
.loading-bar {
    width: 300px;
    height: 4px;
    background: var(--bg-light);
    border-radius: 2px;
    margin: 2rem auto 1rem;
    overflow: hidden;
}

.loader-progress,
.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--vpn-on), var(--cyan));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.loader-text {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--vpn-on);
}

/* ============================================
   SCREENS (Menu, Levels, Tutorial, etc.)
   ============================================ */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    overflow-y: auto;
    z-index: 100;
}

.screen-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--border-color);
}

.screen-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--vpn-on);
}

.back-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--vpn-on);
}

/* ============================================
   MAIN MENU
   ============================================ */
.menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 0% 100%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    animation: menuBgPulse 10s ease-in-out infinite;
}

@keyframes menuBgPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.menu-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 2rem;
    z-index: 1;
}

.menu-logo {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--vpn-on-glow) 0%, transparent 70%);
    opacity: 0.3;
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.menu-logo h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 4rem);
    background: linear-gradient(135deg, var(--vpn-on), var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    position: relative;
}

.menu-logo h2 {
    font-family: var(--font-display);
    font-size: clamp(0.75rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    letter-spacing: 10px;
}

.menu-tagline {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
    text-align: center;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 300px;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.2), transparent);
    transition: 0.5s;
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--vpn-on);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.2);
}

.menu-btn.primary {
    background: linear-gradient(135deg, var(--vpn-on), var(--cyan));
    border: none;
    color: var(--bg-dark);
    font-weight: 700;
}

.menu-btn.primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 255, 136, 0.4);
}

.btn-icon {
    font-size: 1.25rem;
}

.menu-footer {
    margin-top: 3rem;
}

.menu-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.menu-footer a:hover {
    color: var(--vpn-on);
}

/* ============================================
   LEVEL SELECT
   ============================================ */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.level-card {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05), rgba(0, 212, 255, 0.02));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--vpn-on), var(--cyan));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-card:hover {
    transform: translateY(-5px);
    border-color: var(--vpn-on);
    box-shadow: 0 15px 40px rgba(0, 255, 136, 0.2);
}

.level-card:hover::before {
    opacity: 1;
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-card.locked:hover {
    transform: none;
    box-shadow: none;
}

.level-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.level-icon {
    font-size: 2.5rem;
}

.level-info h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    color: var(--vpn-on);
}

.level-info span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.level-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.level-difficulty {
    display: flex;
    gap: 0.25rem;
}

.difficulty-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-light);
}

.difficulty-dot.active {
    background: var(--vpn-on);
    box-shadow: 0 0 10px var(--vpn-on-glow);
}

.level-stars {
    display: flex;
    gap: 0.25rem;
    margin-top: 1rem;
}

.level-stars .star {
    font-size: 1.25rem;
    opacity: 0.3;
}

.level-stars .star.earned {
    opacity: 1;
}

.level-lock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.5;
}

/* ============================================
   TUTORIAL
   ============================================ */
.tutorial-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.tutorial-section {
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tutorial-section h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--vpn-on);
    margin-bottom: 1rem;
}

.tutorial-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.controls-grid {
    display: grid;
    gap: 1rem;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.key {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--vpn-on);
}

.mechanic-demo {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.demo-state {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.demo-packet {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    animation: packetPulse 1s ease-in-out infinite;
}

.demo-packet.red {
    background: var(--vpn-off);
    box-shadow: 0 0 20px var(--vpn-off-glow);
}

.demo-packet.green {
    background: var(--vpn-on);
    box-shadow: 0 0 20px var(--vpn-on-glow);
}

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

.demo-state span {
    color: var(--text-secondary);
}

.enemies-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.enemy-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.enemy-info span:first-child {
    font-size: 1.5rem;
}

/* ============================================
   HIGHSCORES
   ============================================ */
.highscores-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
}

.highscore-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.highscore-rank {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--yellow);
    min-width: 40px;
}

.highscore-rank:nth-child(1) { color: #ffd700; }

.highscore-info {
    flex: 1;
}

.highscore-level {
    font-family: var(--font-display);
    color: var(--vpn-on);
}

.highscore-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.highscore-score {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--cyan);
}

.no-scores {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
}

/* ============================================
   GAME CONTAINER & CANVAS
   ============================================ */
#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================
   HUD (Heads-Up Display)
   ============================================ */
.hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 50;
}

.hud-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.hud-left, .hud-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.hud-item {
    text-align: center;
}

.hud-label {
    display: block;
    font-size: 0.625rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 0.25rem;
}

.hud-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--vpn-on);
}

.hud-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.vpn-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--vpn-off);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.vpn-status.active {
    border-color: var(--vpn-on);
    box-shadow: 0 0 20px var(--vpn-on-glow);
}

.vpn-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--vpn-off);
    transition: all 0.3s ease;
}

.vpn-status.active .vpn-indicator {
    background: var(--vpn-on);
    box-shadow: 0 0 10px var(--vpn-on);
}

.vpn-text {
    font-family: var(--font-display);
    font-size: 0.875rem;
    color: var(--vpn-off);
    transition: color 0.3s ease;
}

.vpn-status.active .vpn-text {
    color: var(--vpn-on);
}

.hud-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.hud-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--vpn-on);
}

.hud-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-icon {
    font-size: 1rem;
}

/* ============================================
   MOBILE CONTROLS
   ============================================ */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-controls-height);
    padding: 1rem;
    pointer-events: none;
    z-index: 60;
}

@media (max-width: 768px), (pointer: coarse) {
    .mobile-controls {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }
    
    .hud-bottom {
        bottom: var(--mobile-controls-height);
    }
}

.joystick-container {
    pointer-events: auto;
}

.joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.joystick-stick {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--vpn-on), var(--cyan));
    border-radius: 50%;
    position: absolute;
    transition: transform 0.1s ease;
    box-shadow: 0 0 20px var(--vpn-on-glow);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: auto;
}

.action-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vpn-btn {
    background: rgba(0, 255, 136, 0.2);
    color: var(--vpn-on);
}

.vpn-btn.active {
    background: var(--vpn-on);
    color: var(--bg-dark);
    box-shadow: 0 0 30px var(--vpn-on-glow);
}

.killswitch-btn {
    background: rgba(255, 68, 68, 0.2);
    color: var(--vpn-off);
}

.killswitch-btn:active {
    background: var(--vpn-off);
    color: var(--bg-dark);
}

/* ============================================
   DIALOGUE BOX
   ============================================ */
.dialogue-box {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    width: 90%;
    z-index: 70;
    animation: dialogueSlideIn 0.3s ease;
}

@keyframes dialogueSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.dialogue-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--orange);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.3);
}

.dialogue-avatar {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.dialogue-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ============================================
   KILL SWITCH OVERLAY
   ============================================ */
.killswitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 68, 68, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
    animation: killswitchFlash 0.5s ease;
}

@keyframes killswitchFlash {
    0% { background: rgba(255, 68, 68, 0.5); }
    100% { background: rgba(255, 68, 68, 0.1); }
}

.killswitch-content {
    text-align: center;
}

.killswitch-icon {
    font-size: 5rem;
    animation: killswitchPulse 1s ease-in-out infinite;
}

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

.killswitch-content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--vpn-off);
    margin: 1rem 0 0.5rem;
}

.killswitch-content p {
    color: var(--text-secondary);
}

/* ============================================
   OVERLAYS (Pause, Level Complete, Game Over)
   ============================================ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-content {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 212, 255, 0.05));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: overlayContentSlide 0.4s ease;
}

@keyframes overlayContentSlide {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.overlay-content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--vpn-on);
    margin-bottom: 1.5rem;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Level Complete */
.level-complete-content {
    max-width: 600px;
}

.level-complete-header {
    margin-bottom: 2rem;
}

.stars {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.star {
    font-size: 2.5rem;
    opacity: 0.3;
    transition: all 0.5s ease;
}

.star.earned {
    opacity: 1;
    animation: starPop 0.5s ease;
}

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.level-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: left;
}

.level-stat {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
}

.level-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.level-stat-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--cyan);
}

.level-complete-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Game Over */
.game-over-content {
    border-color: var(--vpn-off);
}

.game-over-glitch h2 {
    color: var(--vpn-off);
    animation: glitch 0.5s ease infinite;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
}

.game-over-reason {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.game-over-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Final Stats */
.final-stats-content {
    max-width: 700px;
}

.final-stats-content h3 {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.final-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.final-stat {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.final-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.final-stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--cyan);
}

.final-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.security-score {
    margin: 2rem 0;
}

.score-circle {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    background: conic-gradient(var(--vpn-on) var(--score-percent, 94%), var(--bg-light) 0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--bg-dark);
    border-radius: 50%;
}

.score-value {
    position: relative;
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--vpn-on);
    z-index: 1;
}

.score-label {
    display: block;
    margin-top: 1rem;
    font-family: var(--font-display);
    color: var(--text-secondary);
    letter-spacing: 3px;
}

.final-message {
    background: rgba(0, 255, 136, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.final-message p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.final-message strong {
    color: var(--vpn-on);
}

.share-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.share-btn {
    flex: 1;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    min-width: 250px;
    animation: toastSlideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-color: var(--vpn-on);
}

.toast.warning {
    border-color: var(--orange);
}

.toast.error {
    border-color: var(--vpn-off);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .hud-top {
        padding: 0.75rem 1rem;
    }
    
    .hud-value {
        font-size: 1rem;
    }
    
    .vpn-status {
        padding: 0.4rem 1rem;
    }
    
    .vpn-text {
        font-size: 0.75rem;
    }
    
    .level-stats,
    .game-over-stats {
        grid-template-columns: 1fr;
    }
    
    .final-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .menu-logo h1 {
        font-size: 1.75rem;
    }
    
    .overlay-content {
        padding: 1.5rem;
    }
    
    .stats-bar {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .final-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-circle::before {
        width: 90px;
        height: 90px;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   ANIMATIONS & EFFECTS
   ============================================ */

/* Scanline effect for retro feel */
.scanlines::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 999;
}

/* Glow effect for important elements */
.glow {
    filter: drop-shadow(0 0 10px currentColor);
}

/* Shake animation for hits */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* Flash animation */
@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.flash {
    animation: flash 0.2s ease 3;
}
