/* ==================== ZULU STRIKE — Sniper Campaign ==================== */
/* Reset and Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-dark: #0a0e1a;
    --bg-panel: rgba(12, 20, 35, 0.96);
    --border: rgba(100, 150, 200, 0.3);
    --primary: #4a9eff;
    --secondary: #ff6b6b;
    --success: #4ecdc4;
    --warning: #ffa94d;
    --danger: #ff4757;
    --text: #e8f0fe;
    --text-muted: #8b9db5;
    --reticle: #ff4757;
    --reticle-glow: rgba(255, 71, 87, 0.5);
    --gold: #ffd700;
    --star-empty: #3a3a4a;
}

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
}

#gameContainer { position: relative; width: 100%; height: 100%; }
#gameCanvas { display: block; width: 100%; height: 100%; cursor: crosshair; }

/* ==================== IN-GAME HUD ==================== */
#hud {
    position: absolute; top: 0; left: 0; right: 0;
    pointer-events: none; z-index: 10;
}
.hud-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 15px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
}
.score-panel { display: flex; gap: 25px; flex-wrap: wrap; }
.score-item { display: flex; flex-direction: column; align-items: flex-start; }
.score-item .label {
    font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
    color: var(--text-muted); margin-bottom: 3px;
}
.score-item .value {
    font-size: 22px; font-weight: 800; color: var(--primary);
    text-shadow: 0 0 10px rgba(74, 158, 255, 0.5);
}
.timer-value { color: #ffe08a !important; }

.weapon-panel { text-align: right; }
.weapon-name {
    display: block; font-size: 11px; font-weight: 700;
    letter-spacing: 2px; color: var(--text-muted); margin-bottom: 5px;
}
.ammo-display { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.ammo { font-size: 28px; font-weight: 800; color: var(--success); }
.separator { font-size: 20px; color: var(--text-muted); }
.magazine { font-size: 18px; color: var(--text-muted); }

.hud-bottom {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 15px 20px;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    display: flex; align-items: center; gap: 20px;
}
.health-panel { flex: 1; display: flex; align-items: center; gap: 10px; }
.health-bar {
    width: 150px; height: 8px; background: rgba(255,255,255,0.1);
    border-radius: 10px; overflow: hidden;
}
.health-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger), var(--warning), var(--success));
    width: 100%; transition: width 0.3s ease;
}
.health-text { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--text-muted); }

.reload-indicator {
    display: none; flex-direction: column; align-items: center; gap: 5px;
    padding: 10px 20px; background: var(--bg-panel);
    border-radius: 8px; border: 1px solid var(--border);
}
.reload-indicator.active { display: flex; }
.reload-indicator span {
    font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--warning);
}
.reload-progress-bar {
    width: 80px; height: 4px; background: rgba(255,255,255,0.1);
    border-radius: 2px; overflow: hidden;
}
.reload-progress {
    height: 100%; background: var(--warning); width: 0%;
    transition: width 0.1s linear;
}
.hud-btn {
    pointer-events: auto;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: var(--text); padding: 10px 15px; border-radius: 8px;
    font-size: 16px; cursor: pointer; transition: all 0.2s ease;
}
.hud-btn:hover { background: rgba(255,255,255,0.2); }

/* ==================== OBJECTIVE HUD ==================== */
#objectiveHUD {
    position: absolute; top: 100px; left: 15px;
    z-index: 15; pointer-events: none;
}
.objective-panel {
    background: rgba(5,10,20,0.85); border: 1px solid rgba(100,150,200,0.25);
    border-radius: 10px; padding: 12px 16px; min-width: 220px;
}
.objective-title {
    font-size: 10px; font-weight: 700; letter-spacing: 2px;
    color: var(--warning); margin-bottom: 8px;
}
.objective-list { list-style: none; }
.objective-list li {
    font-size: 12px; color: var(--text-muted); padding: 3px 0;
    transition: color 0.3s ease;
}
.objective-list li.obj-complete {
    color: var(--success); text-decoration: line-through;
}
.objective-list li.obj-complete::before { content: '✓ '; }
.objective-list li.obj-failed {
    color: var(--danger);
}
.objective-list li.obj-failed::before { content: '✗ '; }

/* ==================== SCOPE OVERLAY ==================== */
#scopeOverlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.8) 70%);
    pointer-events: none; z-index: 5;
}
#scopeOverlay.hidden { display: none; }
.scope-reticle {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 300px; height: 300px; opacity: 0.9;
}
.reticle-dot { fill: var(--reticle); }
.reticle-ring { fill: none; stroke: var(--reticle); stroke-width: 1; }
.reticle-line { stroke: var(--reticle); stroke-width: 0.5; }
.reticle-circle { stroke: var(--reticle); stroke-width: 0.3; stroke-dasharray: 2 1; }
.scope-info {
    position: absolute; bottom: 80px; left: 20px;
    display: flex; flex-direction: column; gap: 8px;
    font-family: 'Courier New', monospace; font-size: 12px;
    color: var(--reticle); text-shadow: 0 0 5px var(--reticle-glow);
}

/* ==================== OVERLAY MENUS ==================== */
.overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(5, 10, 20, 0.95);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; pointer-events: auto;
}
.overlay.hidden { display: none; }

.menu-container {
    max-width: 500px; width: 90%; padding: 40px;
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 20px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.game-title { margin-bottom: 30px; }
.title-main {
    font-size: 48px; font-weight: 900;
    background: linear-gradient(135deg, var(--danger), var(--warning), #f1c40f);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin-bottom: 5px; letter-spacing: 2px;
}
.title-sub {
    font-size: 16px; font-weight: 700; color: var(--text-muted);
    letter-spacing: 6px;
}
.briefing { margin-bottom: 30px; color: var(--text-muted); line-height: 1.6; }
.briefing-tip { margin-top: 12px; font-size: 13px; }

.menu-btn {
    width: 100%; padding: 15px 25px; margin-bottom: 12px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    color: var(--text); font-size: 14px; font-weight: 700;
    letter-spacing: 1.5px; border-radius: 12px; cursor: pointer;
    transition: all 0.3s ease;
}
.menu-btn:hover { background: rgba(255,255,255,0.1); border-color: var(--primary); transform: translateY(-2px); }
.menu-btn.primary { background: linear-gradient(135deg, var(--primary), #2d7ed9); border-color: transparent; color: white; }
.menu-btn.primary:hover { box-shadow: 0 10px 30px rgba(74, 158, 255, 0.4); }
.menu-btn.danger { background: linear-gradient(135deg, var(--danger), #d63031); border-color: transparent; color: white; }

.menu-btn.apk-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: transparent; color: #04130a; text-decoration: none; margin-top: 6px;
}
.menu-btn.apk-btn:hover { box-shadow: 0 10px 30px rgba(46, 204, 113, 0.35); transform: translateY(-2px); }
.apk-icon { font-size: 16px; }
.apk-note { margin-top: 4px; font-size: 11px; color: var(--text-muted); line-height: 1.5; }

.menu-title { font-size: 28px; font-weight: 800; margin-bottom: 25px; color: var(--text); }
.menu-title.success { color: var(--success); }
.menu-title.danger { color: var(--danger); }

/* ==================== MISSION SELECT ==================== */
.mission-select-container {
    max-width: 620px; width: 92%; max-height: 90vh;
    padding: 30px;
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow-y: auto; animation: fadeIn 0.3s ease;
}
.ms-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}
.ms-title-section { text-align: center; }
.back-btn, .reset-btn {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    color: var(--text); padding: 8px 16px; border-radius: 8px;
    font-size: 13px; cursor: pointer; transition: all 0.2s ease;
}
.back-btn:hover, .reset-btn:hover { background: rgba(255,255,255,0.15); }
.campaign-progress { margin: 8px 0 4px; }
.campaign-stars-label { font-size: 13px; color: var(--text-muted); }
.campaign-stars-value { font-size: 22px; font-weight: 800; color: var(--gold); }
.campaign-stats-sub { font-size: 12px; color: var(--text-muted); }

.mission-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.mission-tile {
    position: relative;
    padding: 18px 16px; background: rgba(255,255,255,0.04);
    border: 2px solid rgba(255,255,255,0.08); border-radius: 12px;
    cursor: pointer; transition: all 0.3s ease;
}
.mission-tile:hover { background: rgba(255,255,255,0.08); border-color: var(--primary); transform: translateY(-2px); }
.mission-tile.locked { opacity: 0.45; cursor: not-allowed; }
.mission-tile.locked:hover { border-color: rgba(255,255,255,0.08); transform: none; }
.mission-tile.completed { border-color: rgba(46, 204, 113, 0.3); }
.mission-number {
    font-size: 22px; font-weight: 900; color: var(--primary);
    margin-bottom: 4px;
}
.mission-tile.locked .mission-number { color: var(--text-muted); }
.mission-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.mission-type {
    font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
    color: var(--warning); margin-bottom: 2px;
}
.mission-diff {
    font-size: 10px; color: var(--text-muted);
    margin-bottom: 6px;
}
.mission-stars { display: flex; gap: 4px; }
.star { font-size: 16px; }
.star.earned { color: var(--gold); text-shadow: 0 0 6px rgba(255,215,0,0.4); }
.star.empty { color: var(--star-empty); }
.mission-best { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.mission-lock-overlay {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); font-size: 28px;
    pointer-events: none;
}

/* ==================== MISSION BRIEFING ==================== */
.briefing-container {
    max-width: 520px; width: 90%; padding: 35px;
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}
.briefing-header { text-align: center; margin-bottom: 20px; }
.briefing-badge {
    display: inline-block; padding: 5px 16px;
    background: rgba(255,71,87,0.2); border: 1px solid rgba(255,71,87,0.4);
    border-radius: 20px; font-size: 11px; font-weight: 800;
    letter-spacing: 2px; color: var(--danger); margin-bottom: 12px;
}
.briefing-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.briefing-location { font-size: 13px; color: var(--text-muted); letter-spacing: 1px; }
.briefing-body { margin-bottom: 25px; text-align: left; }
.briefing-intel {
    font-size: 11px; font-weight: 700; letter-spacing: 2px;
    color: var(--warning); margin-bottom: 8px;
}
.briefing-story { color: var(--text-muted); line-height: 1.7; font-size: 14px; margin-bottom: 16px; }
.briefing-time-info {
    font-size: 16px; font-weight: 700; color: var(--danger);
    margin: 12px 0; text-align: center;
}
.briefing-objectives-section { margin-top: 8px; }
.briefing-obj-list {
    list-style: none; padding-left: 0;
}
.briefing-obj-list li {
    padding: 6px 0; font-size: 13px; color: var(--text);
}
.briefing-obj-list li::before { content: '▸ '; color: var(--primary); }

/* ==================== MISSION COMPLETE ==================== */
.mission-result { max-width: 460px; }
.mission-result-name {
    font-size: 14px; color: var(--text-muted);
    margin-bottom: 16px; letter-spacing: 1px;
}
.star-rating {
    display: flex; justify-content: center; gap: 12px;
    margin-bottom: 20px;
}
.star-rating .star { font-size: 42px; transition: all 0.3s ease; }
.star-rating .star.earned {
    color: var(--gold); text-shadow: 0 0 20px rgba(255,215,0,0.5);
    animation: starPop 0.4s ease;
}

@keyframes starPop {
    0% { transform: scale(0.3); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.score-breakdown {
    background: rgba(0,0,0,0.3); border-radius: 12px;
    padding: 16px; margin-bottom: 18px;
}
.bd-row {
    display: flex; justify-content: space-between;
    padding: 6px 0; font-size: 13px; color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.bd-row.total {
    border-bottom: none; padding-top: 10px;
    font-size: 16px; font-weight: 800; color: var(--primary);
}

.weapon-unlock-alert {
    background: linear-gradient(135deg, rgba(241,196,15,0.15), rgba(243,156,18,0.15));
    border: 1px solid rgba(241,196,15,0.4); border-radius: 10px;
    padding: 12px 16px; margin-bottom: 16px; font-size: 14px;
    font-weight: 700; color: var(--gold);
}

.mission-result-buttons { display: flex; flex-direction: column; gap: 8px; }

/* ==================== MISSION FAILED ==================== */
.fail-reason {
    font-size: 18px; font-weight: 700; color: var(--danger);
    margin-bottom: 12px;
}
.fail-stats {
    font-size: 14px; color: var(--text-muted);
    margin-bottom: 25px;
}

/* ==================== WEAPONS MENU ==================== */
.weapons-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px; margin-bottom: 12px;
}
.weapon-card {
    padding: 16px;
    background: rgba(255,255,255,0.04);
    border: 2px solid transparent;
    border-radius: 12px; cursor: pointer;
    transition: all 0.3s ease; text-align: left;
}
.weapon-card:hover { background: rgba(255,255,255,0.08); border-color: var(--primary); }
.weapon-card.selected { background: rgba(74, 158, 255, 0.15); border-color: var(--primary); }
.weapon-card.locked { opacity: 0.5; cursor: not-allowed; }
.weapon-card.locked:hover { border-color: transparent; }

.weapon-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.weapon-card h3 { font-size: 14px; font-weight: 800; }
.lock-badge { font-size: 11px; color: var(--text-muted); }

.weapon-card .stats { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-muted); }
.weapon-card .stat { display: flex; justify-content: space-between; align-items: center; }
.weapon-card .stat-bar { width: 55px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.weapon-card .stat-fill { height: 100%; background: var(--success); }

.weapon-desc { font-size: 11px; color: var(--text-muted); margin-top: 8px; line-height: 1.4; }
.unlock-hint { font-size: 10px; color: var(--warning); margin-top: 6px; }
.weapon-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* ==================== INSTRUCTIONS ==================== */
.instructions { text-align: left; margin-bottom: 25px; }
.instruction-section { margin-bottom: 20px; }
.instruction-section h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--primary); }
.instruction-section p, .instruction-section li { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.instruction-section ul { list-style: none; padding-left: 0; }
.instruction-section li { margin-bottom: 8px; padding-left: 20px; position: relative; }
.instruction-section li::before { content: '•'; position: absolute; left: 0; color: var(--primary); }

/* ==================== MOBILE CONTROLS ==================== */
#mobileControls {
    display: none;
    position: absolute; bottom: 80px; left: 0; right: 0;
    padding: 0 20px; pointer-events: none; z-index: 20;
}
.mobile-btn {
    pointer-events: auto;
    width: 70px; height: 70px;
    background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%; font-size: 24px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease; margin: 0 5px;
}
.mobile-btn:active { background: rgba(255,255,255,0.2); transform: scale(0.95); }
.mobile-btn.scope-btn { position: absolute; left: 20px; bottom: 0; }
.mobile-btn.reload-btn { position: absolute; right: 20px; bottom: 0; }
.mobile-btn.shoot-btn {
    position: absolute; left: 50%; transform: translateX(-50%);
    bottom: 0; width: 90px; height: 90px;
    background: rgba(255, 71, 87, 0.3); border-color: var(--danger);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.reload-indicator.active span { animation: pulse 1s infinite; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .title-main { font-size: 34px; }
    .title-sub { font-size: 12px; letter-spacing: 4px; }
    .menu-container { padding: 25px; max-width: 100%; }
    .mission-grid { grid-template-columns: 1fr; }
    .weapons-grid { grid-template-columns: 1fr; }

    .hud-top { padding: 10px 15px; }
    .score-panel { gap: 14px; }
    .score-item .value { font-size: 17px; }
    .weapon-name { font-size: 9px; }
    .ammo { font-size: 20px; }
    .magazine { font-size: 14px; }
    #mobileControls { display: block; }
    .scope-reticle { width: 200px; height: 200px; }
    .mission-select-container { padding: 20px; }
    .briefing-container { padding: 25px; }
    .briefing-title { font-size: 18px; }
}

@media (max-width: 480px) {
    .scope-reticle { width: 200px; height: 200px; }
    .menu-btn { padding: 12px 20px; font-size: 13px; }
    .score-panel { gap: 10px; }
    .score-item .value { font-size: 15px; }
    .star-rating .star { font-size: 32px; }
    .objective-panel { min-width: 160px; padding: 10px 12px; }
    .objective-list li { font-size: 11px; }
}
