/* Aim Trainer - FPS Aesthetic */
:root {
    --bg-primary: #0a0b0f;
    --bg-secondary: #11131a;
    --bg-card: rgba(17, 19, 26, 0.95);
    --accent-red: #ff4757;
    --accent-red-glow: rgba(255, 71, 87, 0.4);
    --accent-orange: #f7a600;
    --accent-green: #2ed573;
    --accent-blue: #1e90ff;
    --accent-purple: #a855f7;
    --text-primary: #f9fafb;
    --text-secondary: #a0a9b8;
    --text-muted: #6b7280;
    --font-family: 'Plus Jakarta Sans', sans-serif;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-fast: 100ms ease;
    --transition-base: 250ms ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Navigation */
.game-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 11, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 71, 87, 0.1);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}
.back-link svg { width: 20px; height: 20px; }
.back-link:hover { color: var(--accent-red); }

.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-red);
}

.nav-spacer { width: 100px; }

/* Container */
.game-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Screens */
.screen { 
    display: none; 
    width: 100%; 
    height: 100%;
    animation: fadeIn 0.3s ease; 
}
.screen.active { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.screen-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 71, 87, 0.15);
    text-align: center;
    max-width: 480px;
    width: 90%;
}

/* Intro Screen */
.game-icon { font-size: 4rem; margin-bottom: 1rem; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.intro-screen h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-red);
    margin-bottom: 0.5rem;
}

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

/* Mode Selector */
.mode-selector { margin-bottom: 2rem; }
.mode-selector h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.mode-options { display: flex; flex-direction: column; gap: 0.75rem; }
.mode-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
    text-align: left;
}
.mode-btn:hover { border-color: var(--accent-red); }
.mode-btn.active { border-color: var(--accent-red); background: rgba(255, 71, 87, 0.1); }
.mode-icon { font-size: 1.5rem; }
.mode-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); flex: 1; }
.mode-desc { font-size: 0.8rem; color: var(--text-muted); }

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--accent-red) 0%, #ff6b6b 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 9999px;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
    box-shadow: 0 0 20px var(--accent-red-glow);
}
.btn-primary svg { width: 20px; height: 20px; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 40px var(--accent-red-glow); }

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid var(--text-muted);
    color: var(--text-secondary);
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
}
.btn-secondary:hover { border-color: var(--accent-red); color: var(--accent-red); }

.best-score {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.best-score .label { display: block; font-size: 0.85rem; color: var(--text-muted); }
.best-score .value { font-size: 2rem; font-weight: 800; color: var(--accent-orange); }

/* Game Screen */
.game-screen.active {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.game-hud {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    padding: 1rem 2rem;
    background: rgba(10, 11, 15, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hud-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.hud-value { font-size: 1.5rem; font-weight: 800; color: var(--accent-red); }
.timer-item .hud-value { color: var(--accent-orange); }

/* Game Arena */
.game-arena {
    flex: 1;
    position: relative;
    min-height: 300px;
    background: 
        radial-gradient(circle at center, rgba(255, 71, 87, 0.02) 0%, transparent 60%),
        linear-gradient(to bottom, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    cursor: crosshair;
    overflow: hidden;
}

/* Crosshair */
.crosshair {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    display: none;
}
.game-arena:hover .crosshair { display: block; }

/* Target */
.target {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    transform: scale(0);
    animation: targetSpawn 0.15s ease forwards;
    box-shadow: 0 0 20px var(--accent-red-glow);
    z-index: 10;
}
@keyframes targetSpawn { to { transform: scale(1); } }

.target-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ff6b6b 0%, var(--accent-red) 50%, #cc3939 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.target-ring {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
}
.target-ring:nth-child(1) { width: 80%; height: 80%; }
.target-ring:nth-child(2) { width: 50%; height: 50%; }
.target-ring:nth-child(3) { width: 20%; height: 20%; background: white; }

.target.hit {
    animation: targetHit 0.2s ease forwards;
}
@keyframes targetHit {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); }
    100% { transform: scale(0); opacity: 0; }
}

.target.moving {
    transition: left 0.5s linear, top 0.5s linear;
}

/* Hit indicator */
.hit-indicator {
    position: absolute;
    pointer-events: none;
    color: var(--accent-green);
    font-weight: 800;
    font-size: 1.25rem;
    animation: hitFloat 0.5s ease forwards;
    text-shadow: 0 0 10px rgba(46, 213, 115, 0.5);
    z-index: 20;
}
@keyframes hitFloat {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-30px); }
}

/* Miss indicator */
.miss-indicator {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
    animation: missShow 0.3s ease forwards;
    z-index: 20;
}
.miss-indicator::before,
.miss-indicator::after {
    content: '';
    position: absolute;
    background: var(--accent-red);
    width: 100%;
    height: 3px;
    top: 50%;
    left: 0;
    transform-origin: center;
}
.miss-indicator::before { transform: rotate(45deg); }
.miss-indicator::after { transform: rotate(-45deg); }
@keyframes missShow {
    0% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1); }
}

/* Results Screen */
.results-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.results-screen h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-green);
    margin-bottom: 1.5rem;
}

.accuracy-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
}
.accuracy-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-secondary); stroke-width: 10; }
.ring-fill {
    fill: none;
    stroke: var(--accent-green);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 326.7;
    stroke-dashoffset: 326.7;
    transition: stroke-dashoffset 1s ease;
}
.accuracy-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.accuracy-value { font-size: 2.5rem; font-weight: 800; color: var(--text-primary); }
.accuracy-label { font-size: 1rem; color: var(--text-muted); margin-left: 2px; }

.results-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}
.stat-item { text-align: center; }
.stat-item .stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--accent-blue); }
.stat-item .stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }

.new-record {
    background: rgba(247, 166, 0, 0.1);
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.results-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Responsive */
@media (max-width: 768px) {
    .game-nav { padding: 0.75rem 1rem; }
    .game-title { font-size: 1rem; }
    .nav-spacer { display: none; }
    .screen-content { padding: 1.5rem; }
    .game-hud { gap: 1rem; padding: 0.75rem 1rem; flex-wrap: wrap; }
    .hud-value { font-size: 1.25rem; }
    .mode-options { gap: 0.5rem; }
    .mode-btn { padding: 0.75rem 1rem; }
}
