

/* 
================================================================================
   FOKUS PRO // ULTIMATE EDITION
   CODEBASE: CYBERPUNK / GLASSMORPHISM HYBRID
   VERSION: 6.0 (COMMUNITY)
================================================================================ 
*/

:root {
    /* --- COLOR PALETTE: NEON CORE --- */
    --c-bg-void: #02040a;       /* Deepest Black */
    --c-bg-deep: #050a14;       /* Background Base */
    --c-bg-surface: #0b1221;    /* Surface Elements */
    
    --c-primary: #10b981;       /* Neon Emerald */
    --c-primary-bright: #34d399;
    --c-primary-dark: #065f46;
    --c-primary-glow: rgba(16, 185, 129, 0.6);
    --c-primary-dim: rgba(16, 185, 129, 0.15);

    --c-accent: #3b82f6;        /* Electric Blue */
    --c-accent-bright: #60a5fa;
    --c-accent-glow: rgba(59, 130, 246, 0.6);
    --c-accent-dim: rgba(59, 130, 246, 0.15);
    
    --c-danger: #ef4444;        /* Crimson Red */
    --c-danger-bright: #f87171;
    --c-danger-glow: rgba(239, 68, 68, 0.5);

    --c-text-main: #f1f5f9;     /* Off-White */
    --c-text-sec: #94a3b8;      /* Slate Grey */
    --c-text-dim: #475569;      /* Dark Slate */

    /* --- GLASSMORPHISM SYSTEM --- */
    --glass-bg: rgba(13, 22, 40, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-highlight: 1px solid rgba(255, 255, 255, 0.15);
    --glass-shine: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 60%);
    --blur-strong: backdrop-filter: blur(24px);
    --blur-med: backdrop-filter: blur(12px);

    /* --- LAYOUT METRICS --- */
    --nav-height: 85px;
    --header-height: 75px;
    --max-app-width: 500px;
    
    /* --- RADII & SPACING --- */
    --rad-sm: 8px;
    --rad-md: 16px;
    --rad-lg: 24px;
    --rad-full: 9999px;
    
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* --- FONTS --- */
    --font-ui: 'Inter', sans-serif;
    --font-tech: 'JetBrains Mono', monospace;

    /* --- SHADOWS --- */
    --shadow-card: 0 20px 40px -10px rgba(0,0,0,0.6);
    --shadow-neon: 0 0 15px var(--c-primary-glow), 0 0 30px var(--c-primary-dim);
}

/* =============================================================================
   RESET & BASE STYLES
============================================================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    /* Prevent text selection unless explicitly allowed */
    user-select: none;
    -webkit-user-select: none;
}

/* Allow text selection in inputs */
input, textarea { user-select: text; -webkit-user-select: text; }

html {
    font-size: 16px;
    height: 100%;
    width: 100%;
    overflow: hidden; /* Stop scroll */
    overscroll-behavior: none; /* Stop bounce */
}

body {
    background-color: var(--c-bg-void);
    color: var(--c-text-main);
    font-family: var(--font-ui);
    
    /* NUCLEAR OPTION FOR IOS SCROLL LOCK */
    position: fixed; 
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    touch-action: none; /* Disable browser handling of gestures globally */
}

/* IMPORTANT: Scroll Lock Class for Modals */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Re-enable touch action for interactive elements */
button, input, select, textarea, a, .dock-btn, .ex-card-cyber, .ex-detail-card, .chart-col, .stat-filter-btn, .modal-content-area, .com-results-list {
    touch-action: manipulation;
}

/* Utility Classes */
.hidden { display: none !important; }
.highlight { color: var(--c-primary); text-shadow: 0 0 10px var(--c-primary-dim); }
.text-center { text-align: center; }
.full-width { width: 100%; }
.mt-4 { margin-top: 2rem; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Scrollbar Customization */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: var(--rad-full); }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary); }

/* =============================================================================
   VISUAL FX LAYERS
============================================================================= */

.app-root {
    max-width: var(--max-app-width);
    margin: 0 auto;
    height: 100%;
    width: 100%;
    position: relative;
    background: var(--c-bg-deep);
    display: flex; flex-direction: column;
    box-shadow: 0 0 100px rgba(0,0,0,1);
    border-left: 1px solid rgba(255,255,255,0.02);
    border-right: 1px solid rgba(255,255,255,0.02);
    overflow: hidden; /* Ensure nothing spills out */
}

/* Layers - POINTER EVENTS NONE CRITICAL */
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.fx-gradient { 
    background: radial-gradient(circle at 50% 0%, #111e33 0%, var(--c-bg-void) 70%); 
    opacity: 0.8; 
}
.fx-grid {
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
}
.fx-noise {
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}
.fx-vignette {
    position: absolute; inset: 0; pointer-events: none; z-index: 5;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%);
}

/* Floating Orbs */
.fx-orb {
    position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.3; z-index: 0;
    pointer-events: none;
    animation: float 20s infinite alternate ease-in-out;
}
.orb-1 { width: 350px; height: 350px; background: var(--c-primary); top: -150px; left: -100px; }
.orb-2 { width: 400px; height: 400px; background: var(--c-accent); bottom: -150px; right: -100px; animation-delay: -8s; }

@keyframes float { 
    0% { transform: translate(0,0); } 
    50% { transform: translate(-30px, 40px); } 
    100% { transform: translate(20px, -20px); } 
}

/* =============================================================================
   LOADING SYSTEM (NEU / FIX)
============================================================================= */

.loader-terminal {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--c-bg-void);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.5s ease-out;
}
.scan-line {
    position: absolute; top: 0; left: 0; width: 100%; height: 5px;
    background: var(--c-primary); box-shadow: 0 0 15px var(--c-primary);
    animation: scan-down 3s infinite linear; opacity: 0.5; z-index: 10;
}
@keyframes scan-down {
    0% { top: -10%; } 100% { top: 110%; }
}

.loader-content { position: relative; z-index: 2; text-align: center; }

.spinner-construct {
    position: relative; width: 80px; height: 80px; margin: 0 auto 30px;
}
.spin-ring {
    position: absolute; inset: 0; border: 2px solid transparent; border-radius: 50%;
}
.ring-1 {
    border-top-color: var(--c-primary); border-left-color: rgba(16,185,129,0.3);
    animation: spin 1.5s linear infinite;
}
.ring-2 {
    inset: 10px; border-right-color: var(--c-accent); border-bottom-color: rgba(59,130,246,0.3);
    animation: spin 2s linear infinite reverse;
}
.spin-core {
    position: absolute; inset: 25px; background: var(--c-primary);
    border-radius: 50%; box-shadow: 0 0 20px var(--c-primary-glow);
    animation: pulse-core 1.5s infinite ease-in-out;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse-core { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.8); opacity: 0.6; } }

.loader-text-wrapper { display: flex; flex-direction: column; gap: 5px; }
.loader-title {
    font-family: var(--font-tech); font-weight: 900; font-size: 1.2rem;
    letter-spacing: 2px; color: white;
}
.loader-status {
    font-family: var(--font-tech); font-size: 0.7rem; color: var(--c-text-sec);
    letter-spacing: 1px; animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0.4; } }

/* =============================================================================
   AUTH VIEW
============================================================================= */

.view-layer {
    flex: 1; height: 100%; position: relative; z-index: 10;
    display: flex; flex-direction: column;
    animation: fadeIn 0.6s ease-out;
}

.auth-wrapper {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    padding: var(--space-xl); position: relative;
}

.brand-unit { text-align: center; margin-bottom: 50px; }

/* 3D Holo Cube Logo */
.logo-holocube {
    width: 60px; height: 60px; margin: 0 auto 30px;
    position: relative; transform-style: preserve-3d;
    animation: rotate-cube 10s infinite linear;
}
.cube-face {
    position: absolute; width: 60px; height: 60px;
    border: 1px solid var(--c-primary);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.2);
}
.face-front  { transform: translateZ(30px); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--c-primary); text-shadow: 0 0 15px var(--c-primary); }
.face-back   { transform: rotateY(180deg) translateZ(30px); }
.face-right  { transform: rotateY(90deg) translateZ(30px); }
.face-left   { transform: rotateY(-90deg) translateZ(30px); }
.face-top    { transform: rotateX(90deg) translateZ(30px); }
.face-bottom { transform: rotateX(-90deg) translateZ(30px); }

@keyframes rotate-cube { 
    0% { transform: rotateX(-20deg) rotateY(0deg); } 
    100% { transform: rotateX(-20deg) rotateY(360deg); } 
}

.brand-name { font-size: 2.5rem; font-weight: 900; letter-spacing: -1px; margin-bottom: 5px; }
.brand-tagline { font-family: var(--font-tech); font-size: 0.7rem; color: var(--c-text-sec); letter-spacing: 3px; }

.auth-card { padding: 30px !important; }

/* Cyber Inputs */
.input-cyber-group { margin-bottom: 25px; }
.cyber-label { display: block; font-family: var(--font-tech); font-size: 0.7rem; color: var(--c-text-sec); margin-bottom: 8px; letter-spacing: 1px; }
.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--c-text-dim); transition: 0.3s; z-index: 2; }
.cyber-input {
    width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--c-text-dim);
    border-radius: 8px; padding: 16px 16px 16px 45px;
    color: white; font-family: var(--font-tech); font-size: 0.95rem;
    transition: 0.3s;
}
.cyber-input:focus { outline: none; border-color: var(--c-primary); background: rgba(0,0,0,0.5); }
.input-active-line {
    position: absolute; bottom: 0; left: 50%; width: 0; height: 2px;
    background: var(--c-primary); transition: 0.3s; transform: translateX(-50%);
    box-shadow: 0 0 10px var(--c-primary);
}
.cyber-input:focus ~ .input-active-line { width: 100%; }
.cyber-input:focus ~ .input-icon { color: var(--c-primary); }

.auth-actions { display: flex; flex-direction: column; gap: 15px; margin-top: 10px; }

/* System Message */
.system-message {
    margin-top: 20px; font-family: var(--font-tech); font-size: 0.75rem;
    color: var(--c-danger); text-align: center; min-height: 20px;
}

/* =============================================================================
   MAIN APP: HEADER & NAV
============================================================================= */

/* HUD Header */
.hud-header {
    height: var(--header-height); flex: 0 0 auto;
    padding: 0 var(--space-lg);
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(5, 10, 20, 0.85);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 50;
    position: relative;
}
.hud-header::after {
    content: ''; position: absolute; bottom: -1px; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--c-primary-dim), transparent);
}

.hud-left { display: flex; align-items: center; gap: 15px; }

.avatar-hex-wrapper {
    width: 48px; height: 48px; position: relative;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    display: flex; align-items: center; justify-content: center;
    background: #000; cursor: pointer; transition: 0.2s;
}
.avatar-hex-wrapper:hover { transform: scale(1.05); }

.hex-border {
    position: absolute; inset: 0; background: var(--c-primary);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    z-index: 0; opacity: 0.5;
}
.avatar-img {
    width: 44px; height: 44px; object-fit: cover; z-index: 1;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: var(--c-bg-surface);
}

.user-stats-block { display: flex; flex-direction: column; gap: 4px; min-width: 80px; }
.stat-row { display: flex; justify-content: space-between; font-family: var(--font-tech); font-size: 0.75rem; color: var(--c-text-sec); }
.stat-val { font-weight: 700; }

.xp-progress-track {
    width: 100%; height: 6px; background: rgba(255,255,255,0.1);
    border-radius: 2px; overflow: hidden; position: relative;
}
.xp-progress-bar {
    height: 100%; width: 0%; background: var(--c-accent);
    position: relative; box-shadow: 0 0 10px var(--c-accent-glow);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.xp-glare {
    position: absolute; top: 0; right: 0; width: 10px; height: 100%;
    background: #fff; opacity: 0.5; box-shadow: 0 0 5px #fff;
}

.hud-right { display: flex; align-items: center; }

.streak-module {
    display: flex; align-items: center; gap: 10px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 6px 14px; border-radius: 20px;
    color: #f59e0b;
}
.streak-icon { font-size: 1rem; filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.4)); }
.streak-data { display: flex; flex-direction: column; line-height: 1; text-align: right;}
.streak-label { font-size: 0.55rem; font-weight: 800; letter-spacing: 1px; opacity: 0.8; display: flex; gap: 5px; align-items: center; justify-content: flex-end;}
.streak-mult { color: var(--c-primary); background: rgba(16, 185, 129, 0.1); padding: 1px 4px; border-radius: 3px; }
.streak-number { font-family: var(--font-tech); font-weight: 700; font-size: 0.9rem; }

/* Navigation Dock */
.nav-dock {
    height: var(--nav-height); flex: 0 0 auto;
    position: relative; width: 100%; z-index: 100;
    padding-bottom: 10px; /* Safe area */
}
.nav-glass-bg {
    position: absolute; inset: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.05);
    z-index: 0;
}
.nav-items {
    position: relative; z-index: 1; height: 100%;
    display: grid; 
}
/* Column Layouts */
.nav-items.four-col { grid-template-columns: repeat(4, 1fr); }
.nav-items.five-col { grid-template-columns: repeat(5, 1fr); } /* Added for Community */

.dock-btn {
    background: none; border: none; color: var(--c-text-dim);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; cursor: pointer; transition: 0.3s; position: relative;
}
.btn-icon { font-size: 1.4rem; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.btn-label { font-size: 0.6rem; font-weight: 700; letter-spacing: 1px; transition: 0.3s; }
.btn-indicator {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 40px; height: 2px; background: var(--c-primary);
    box-shadow: 0 0 15px var(--c-primary);
    opacity: 0; transition: 0.3s;
}

.dock-btn.active { color: #fff; }
.dock-btn.active .btn-icon { color: var(--c-primary); transform: translateY(-5px); text-shadow: 0 0 20px var(--c-primary-glow); }
.dock-btn.active .btn-indicator { opacity: 1; top: 0; }

/* =============================================================================
   MAIN CONTENT AREA
============================================================================= */

.viewport-area { flex: 1; position: relative; overflow: hidden; }

.tab-content {
    position: absolute; inset: 0; 
    display: none; flex-direction: column;
    animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    height: 100%;
}
.tab-content.active { display: flex; }
/* IMPORTANT: This is where scrolling happens */
.tab-content.scrollable { 
    overflow-y: auto; 
    padding-bottom: 20px; 
    -webkit-overflow-scrolling: touch; 
    touch-action: pan-y;
}
.content-padding { padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-lg); }

/* --- DASHBOARD (One Screen Layout - CENTERED) --- */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center vertically */
    align-items: center; /* Center horizontally */
    height: 100%;
    padding: var(--space-md);
    gap: 40px; /* Space between timer and controls */
}

/* NEW: DASHBOARD OPTIONS */
.dash-options-wrapper {
    position: absolute; top: 20px; right: 20px; z-index: 50;
}
.btn-icon-only {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: var(--c-text-sec); width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.2s; font-size: 1.2rem;
}
.btn-icon-only:hover { background: rgba(255,255,255,0.1); color: white; transform: rotate(90deg); }

.dash-dropdown {
    position: absolute; top: 50px; right: 0; width: 220px;
    background: rgba(13, 22, 40, 0.95); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
    padding: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; gap: 5px;
    transform-origin: top right; animation: zoomIn 0.2s ease-out;
}
.dd-item {
    background: transparent; border: none; padding: 12px; text-align: left;
    color: var(--c-text-main); font-family: var(--font-ui); font-size: 0.85rem;
    font-weight: 600; cursor: pointer; border-radius: 8px; display: flex; align-items: center; gap: 10px;
    transition: 0.2s;
}
.dd-item:hover { background: rgba(255,255,255,0.08); }
.dd-item i { width: 20px; text-align: center; color: var(--c-text-sec); }

.dash-section { width: 100%; max-width: 400px; position: relative; }

/* Mission Card */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding: 0 4px; }
.header-label { font-size: 0.7rem; color: var(--c-text-sec); letter-spacing: 2px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.action-link { background: none; border: none; color: var(--c-text-dim); font-size: 0.7rem; cursor: pointer; transition: 0.2s; font-weight: 600; }
.action-link:hover { color: var(--c-text-main); text-shadow: 0 0 5px white; }

.cyber-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--rad-md);
    padding: 20px; position: relative;
    box-shadow: var(--shadow-card);
}
.cyber-card::before { content: ''; position: absolute; inset: 0; background: var(--glass-shine); pointer-events: none; border-radius: var(--rad-md); }

/* Decorative Card Corners */
.card-deco-corner { position: absolute; width: 15px; height: 15px; border: 2px solid var(--c-primary-dim); transition: 0.3s; pointer-events: none; }
.top-left { top: -1px; left: -1px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.bottom-right { bottom: -1px; right: -1px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }
.cyber-card:hover .card-deco-corner { border-color: var(--c-primary); width: 20px; height: 20px; }

/* --- EXERCISES TAB STYLES --- */
.plan-header-card {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ph-label { font-size: 0.65rem; color: var(--c-text-dim); letter-spacing: 2px; font-weight: 800; }
.ph-date { font-size: 1.1rem; color: white; font-weight: 800; }
.btn-cyber-text { background: none; border: none; color: var(--c-text-sec); font-size: 0.7rem; cursor: pointer; font-weight: 700; border: 1px solid rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 20px; transition: 0.2s; }
.btn-cyber-text:hover { border-color: var(--c-primary); color: var(--c-primary); background: rgba(16,185,129,0.1); }

/* SEARCH & FILTER TOOLBAR */
.filter-toolbar {
    margin-bottom: 20px;
    display: flex; flex-direction: column; gap: 12px;
}
.search-wrap { position: relative; }
.search-wrap i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--c-text-dim); }
.search-wrap input {
    width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 12px 12px 12px 40px; color: white; font-size: 0.9rem;
    transition: 0.3s;
}
.search-wrap input:focus { outline: none; border-color: var(--c-primary); background: rgba(0,0,0,0.5); }

.filter-scroll {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px;
    scrollbar-width: none; /* Firefox */
}
.filter-scroll::-webkit-scrollbar { display: none; } /* Chrome */

.filter-chip {
    flex: 0 0 auto; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: var(--c-text-sec); padding: 6px 14px; border-radius: 20px; font-size: 0.7rem;
    font-weight: 700; cursor: pointer; transition: 0.2s;
}
.filter-chip:hover { border-color: var(--c-text-main); color: var(--c-text-main); }
.filter-chip.active { background: var(--c-primary); color: black; border-color: var(--c-primary); box-shadow: 0 0 10px var(--c-primary-glow); }
.filter-divider { width: 1px; background: rgba(255,255,255,0.1); margin: 0 5px; }

/* BADGES */
.ex-xp-badge { font-size: 0.6rem; padding: 2px 6px; border-radius: 4px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.ex-xp-badge.highlight { background: rgba(59, 130, 246, 0.15); color: var(--c-accent-bright); }
.badge-tech { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-lage { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-pot { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }

.exercises-list { display: flex; flex-direction: column; gap: 20px; padding-bottom: 40px; }
.empty-state-large { text-align: center; padding: 60px 20px; color: var(--c-text-dim); }
.empty-state-large i { font-size: 3rem; margin-bottom: 20px; opacity: 0.3; }

/* Detailed Exercise Card */
.ex-detail-card {
    background: var(--glass-bg); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; overflow: hidden; position: relative;
    display: flex; flex-direction: column; transition: 0.3s;
}
.ex-detail-card.done { border-color: var(--c-primary); background: rgba(16, 185, 129, 0.05); }
.ex-detail-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c-primary); opacity: 0; transition: 0.3s; }
.ex-detail-card.done::before { opacity: 1; }

.ex-card-header { padding: 20px; display: flex; gap: 15px; align-items: flex-start; border-bottom: 1px solid rgba(255,255,255,0.03); justify-content: space-between; }
.ex-type-icon { width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--c-text-sec); }
.ex-detail-card.done .ex-type-icon { color: var(--c-primary); background: rgba(16,185,129,0.1); }

.ex-meta { flex: 1; }
.ex-title-lg { font-size: 1.1rem; font-weight: 800; color: white; margin-top: 6px; line-height: 1.2; }

/* Check Button */
.btn-check {
    width: 36px; height: 36px; border-radius: 50%;
    background: transparent; border: 2px solid var(--c-text-dim); color: transparent;
    cursor: pointer; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.btn-check.checked { background: var(--c-primary); border-color: var(--c-primary); color: black; transform: scale(1.1); box-shadow: 0 0 15px var(--c-primary-glow); }

.ex-card-body { padding: 20px; font-size: 0.9rem; color: var(--c-text-sec); line-height: 1.6; }
.ex-description-text { white-space: pre-wrap; } /* Respect newlines */

.ex-card-actions { padding: 10px 20px 20px; }
.btn-action-pdf {
    width: 100%; padding: 12px; border-radius: 8px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: white; font-weight: 700; font-size: 0.85rem; letter-spacing: 1px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    cursor: pointer; transition: 0.2s;
}
.btn-action-pdf:hover { background: rgba(255,255,255,0.1); border-color: white; }
.btn-action-pdf i { color: var(--c-accent); }


/* Timer Reactor */
.section-center { display: flex; align-items: center; justify-content: center; flex-direction:column; gap:15px; }
.timer-reactor {
    width: 280px; height: 280px; position: relative;
    display: flex; align-items: center; justify-content: center;
    transition: filter 0.5s ease;
}
.reactor-svg {
    width: 100%; height: 100%; transform: rotate(-90deg);
    filter: drop-shadow(0 0 30px rgba(0,0,0,0.5));
}
.track-bg { fill: none; stroke: rgba(255,255,255,0.03); stroke-width: 10; }
.track-deco { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 2; stroke-dasharray: 4 12; }
.track-fill {
    fill: none; stroke-width: 12; stroke-linecap: round;
    stroke-dasharray: 816; /* 2 * PI * 130 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.reactor-hud {
    position: absolute; inset: 0; z-index: 10;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.reactor-status {
    font-size: 0.85rem; letter-spacing: 4px; color: var(--c-text-sec);
    margin-bottom: 8px; font-weight: 700; text-shadow: 0 0 10px rgba(0,0,0,0.8);
}
.reactor-digits {
    font-family: var(--font-tech); font-size: 3.8rem; font-weight: 700;
    color: white; line-height: 1; margin-bottom: 5px;
    text-shadow: 0 0 30px rgba(255,255,255,0.3);
}
.reactor-meta {
    font-family: var(--font-tech); font-size: 0.75rem; color: var(--c-text-dim);
    background: rgba(0,0,0,0.3); padding: 4px 10px; border-radius: 12px;
}

/* SKIPPED STATE STYLES */
.timer-reactor.skipped-state { filter: grayscale(100%) brightness(0.5); }
.skipped-visual {
    background: rgba(239, 68, 68, 0.15); border: 1px solid var(--c-danger);
    color: var(--c-danger); padding: 8px 16px; border-radius: 8px;
    font-weight: 800; letter-spacing: 2px; font-size: 0.9rem;
    display: flex; align-items: center; gap: 10px; animation: pulse-opacity 2s infinite;
}

/* Controls */
.section-bottom { display: flex; flex-direction: column; gap: 20px; transition: opacity 0.3s; }
.section-bottom.disabled { opacity: 0.3; pointer-events: none; filter: blur(2px); }

.mode-selector-bar {
    width: 100%; display: flex; justify-content: center;
}
.selector-track {
    display: flex; position: relative;
    background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 40px; padding: 4px; width: 100%; max-width: 350px;
    transition: 0.3s;
}
/* LOCKED STATE FOR TIMER RUNNING */
.selector-track.locked {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

.mode-btn {
    flex: 1; background: none; border: none; padding: 12px 0;
    color: var(--c-text-sec); font-size: 0.7rem; font-weight: 700; letter-spacing: 1px;
    z-index: 2; cursor: pointer; transition: color 0.3s;
}
.mode-btn.active { color: white; text-shadow: 0 0 10px rgba(255,255,255,0.5); }
.mode-indicator {
    position: absolute; top: 4px; bottom: 4px; width: 33.33%;
    background: rgba(255,255,255,0.1); border-radius: 30px;
    z-index: 1; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255,255,255,0.05);
}
.mode-btn:nth-child(1).active ~ .mode-indicator { transform: translateX(0%); }
.mode-btn:nth-child(2).active ~ .mode-indicator { transform: translateX(100%); }
.mode-btn:nth-child(3).active ~ .mode-indicator { transform: translateX(200%); }

/* Control Group (Reset Button etc) */
.control-group { display: flex; align-items: center; gap: 15px; width: 100%; margin-top: 10px; }

/* Large Activator Button */
.btn-activator {
    position: relative; flex: 1; height: 70px;
    border: none; background: transparent; cursor: pointer;
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.activator-bg {
    position: absolute; inset: 0; 
    background: linear-gradient(135deg, var(--c-primary), #059669);
    transition: 0.3s;
}
.btn-activator:hover .activator-bg { filter: brightness(1.2); }
.btn-activator:active .activator-bg { transform: scale(0.96); }
.activator-content {
    position: relative; z-index: 2; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    font-size: 1.1rem; color: #fff; font-weight: 800; letter-spacing: 2px;
}

/* SUBTLE RESET BUTTON */
.btn-reset-mini {
    width: 50px; height: 70px;
    background: transparent; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; color: var(--c-text-dim);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; transition: 0.2s;
}
.btn-reset-mini:hover { border-color: var(--c-danger); color: var(--c-danger); }
.btn-reset-mini:active { transform: scale(0.95); }
.btn-reset-mini.disabled { opacity: 0.3; pointer-events: none; }

/* Neon Button (General) */
.btn-neon {
    position: relative; width: 100%; border: none; cursor: pointer;
    font-family: var(--font-ui); font-weight: 700; letter-spacing: 1px;
    overflow: hidden; border-radius: 12px; transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.btn-neon.primary {
    background: var(--c-primary); color: #000; padding: 18px;
    box-shadow: 0 0 20px var(--c-primary-dim);
}
.btn-neon.primary:hover { box-shadow: 0 0 35px var(--c-primary-glow); transform: translateY(-2px); }
.btn-neon.ghost {
    background: transparent; border: 1px solid rgba(255,255,255,0.2);
    color: var(--c-text-sec); padding: 16px;
}
.btn-neon.ghost:hover { border-color: var(--c-text-main); color: var(--c-text-main); background: rgba(255,255,255,0.05); }
.btn-neon.danger {
    background: rgba(239, 68, 68, 0.1); border: 1px solid var(--c-danger);
    color: var(--c-danger); padding: 16px;
}
.btn-neon.danger:hover { background: rgba(239, 68, 68, 0.2); box-shadow: 0 0 20px var(--c-danger-glow); }

.btn-content { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; }
.btn-glitch-effect {
    position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg); transition: 0.5s; z-index: 1;
}
.btn-neon:hover .btn-glitch-effect { left: 150%; transition: 0.5s; }


/* --- HISTORY & CHARTS --- */

.view-headline { margin-bottom: 10px; }
.view-headline h2 { font-size: 1.8rem; font-weight: 900; letter-spacing: -1px; margin-bottom: 5px; }
.headline-line { width: 40px; height: 3px; background: var(--c-primary); border-radius: 2px; }

.chart-wrapper { min-height: 240px; display: flex; flex-direction: column; }
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-title { font-size: 0.8rem; font-weight: 700; color: var(--c-text-sec); letter-spacing: 1px; }
.live-badge {
    display: flex; align-items: center; gap: 6px;
    background: rgba(16, 185, 129, 0.1); color: var(--c-primary);
    padding: 4px 8px; border-radius: 6px; font-size: 0.65rem; font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.pulse-dot { width: 6px; height: 6px; background: var(--c-primary); border-radius: 50%; animation: pulse-opacity 1s infinite alternate; }

.bar-chart-area {
    flex: 1; display: flex; justify-content: space-between; align-items: flex-end;
    padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.chart-col {
    width: 10%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative;
    cursor: pointer;
}
.chart-bar {
    width: 100%; min-height: 4px; background: rgba(255,255,255,0.05);
    border-radius: 4px 4px 0 0; transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.chart-bar.active { background: var(--c-primary); box-shadow: 0 0 15px var(--c-primary-dim); }
.chart-bar:hover { background: var(--c-accent); }

.chart-x-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.65rem; color: var(--c-text-dim); }

.log-list-wrapper { margin-top: 20px; }
.list-header { font-size: 0.75rem; color: var(--c-text-dim); letter-spacing: 2px; margin-bottom: 15px; font-weight: 700; }
.log-items-container { display: flex; flex-direction: column; gap: 10px; }
.log-entry {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; background: var(--glass-bg); border: 1px solid rgba(255,255,255,0.03);
    border-radius: 12px; transition: 0.2s;
}
.log-entry:hover { border-color: rgba(255,255,255,0.1); transform: translateX(5px); }
.log-entry.skipped { border-left: 2px solid var(--c-danger); opacity: 0.7; }
.log-date { font-weight: 700; font-size: 0.95rem; display: block; }
.log-detail { font-size: 0.75rem; color: var(--c-text-sec); display: block; margin-top: 2px; }

/* Status Tags */
.status-tag { font-size: 0.65rem; font-weight: 800; padding: 4px 8px; border-radius: 6px; letter-spacing: 0.5px; }
.status-tag.success { background: rgba(16, 185, 129, 0.15); color: var(--c-primary); }
.status-tag.fail { background: rgba(239, 68, 68, 0.15); color: var(--c-danger); }
.status-tag.open { background: rgba(255,255,255,0.05); color: var(--c-text-sec); }

/* --- PROFILE --- */
.profile-card-hero {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding-bottom: 30px;
}
.avatar-edit-overlay {
    position: absolute; top: 15px; right: 15px;
    background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2);
    color: white; border-radius: 50%; width: 32px; height: 32px;
    cursor: pointer; transition: 0.2s;
}
.avatar-edit-overlay:hover { background: var(--c-primary); color: black; }

.profile-avatar-large {
    width: 100px; height: 100px; border-radius: 50%; margin-bottom: 15px;
    position: relative; padding: 3px; background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
    box-shadow: 0 0 20px var(--c-primary-dim);
}
.profile-avatar-large img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
    border: 3px solid var(--c-bg-surface);
}
.level-badge-large {
    position: absolute; bottom: -5px; right: -5px;
    background: var(--c-bg-surface); border: 1px solid var(--c-primary);
    color: var(--c-primary); font-weight: 800; width: 30px; height: 30px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; box-shadow: 0 5px 10px rgba(0,0,0,0.5);
}
.profile-info-edit { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.username-input {
    background: transparent; border: none; font-size: 1.5rem; font-weight: 800;
    color: white; text-align: center; width: auto; max-width: 200px;
    border-bottom: 1px solid transparent; transition: 0.2s;
}
.username-input:focus { outline: none; border-bottom-color: var(--c-primary); }
.edit-icon { color: var(--c-text-dim); font-size: 0.9rem; pointer-events: none; }

.xp-detailed-bar { width: 100%; margin-bottom: 25px; }
.xp-labels { display: flex; justify-content: space-between; margin-bottom: 8px; }
.xp-track-lg {
    height: 10px; background: rgba(0,0,0,0.5); border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.1); overflow: hidden;
}
.xp-fill-lg {
    height: 100%; background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
    width: 0%; box-shadow: 0 0 10px var(--c-primary-dim); transition: width 0.5s;
}

.profile-stats-row {
    display: flex; width: 100%; justify-content: space-around;
    padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.05);
}
.p-stat { display: flex; flex-direction: column; gap: 4px; }
.p-val { font-size: 1.2rem; font-weight: 800; color: white; }
.p-lbl { font-size: 0.65rem; color: var(--c-text-dim); letter-spacing: 1px; }


/* --- SETTINGS --- */
.settings-card { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.setting-group { display: flex; flex-direction: column; gap: 10px; }
.setting-labels { display: flex; justify-content: space-between; align-items: center; }
.setting-labels label { font-size: 0.75rem; font-weight: 700; color: var(--c-text-sec); letter-spacing: 1px; }
.setting-value { font-family: var(--font-tech); color: var(--c-primary); font-weight: 700; }

.cyber-range {
    width: 100%; -webkit-appearance: none; background: transparent; cursor: pointer;
}
.cyber-range::-webkit-slider-runnable-track {
    width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px;
}
.cyber-range::-webkit-slider-thumb {
    -webkit-appearance: none; height: 22px; width: 22px; border-radius: 50%;
    background: var(--c-bg-surface); border: 2px solid var(--c-primary);
    margin-top: -8px; box-shadow: 0 0 10px var(--c-primary-dim); transition: 0.2s;
}
.cyber-range:active::-webkit-slider-thumb { transform: scale(1.2); background: var(--c-primary); }

.setting-divider { height: 1px; background: rgba(255,255,255,0.05); width: 100%; }

.setting-row-toggle { display: flex; justify-content: space-between; align-items: center; }
.toggle-label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9rem; }

.cyber-switch { position: relative; width: 50px; height: 28px; display: inline-block; }
.cyber-switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; inset: 0; background-color: rgba(255,255,255,0.1);
    border-radius: 34px; transition: .4s; border: 1px solid rgba(255,255,255,0.05);
}
.switch-slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .switch-slider { background-color: var(--c-primary-dark); border-color: var(--c-primary); }
input:checked + .switch-slider:before { transform: translateX(22px); background: var(--c-primary); box-shadow: 0 0 10px var(--c-primary); }

.settings-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.version-tag { text-align: center; font-family: var(--font-tech); font-size: 0.65rem; color: var(--c-text-dim); opacity: 0.5; margin-top: 20px; }


/* =============================================================================
   MODALS
============================================================================= */

.modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; animation: fadeIn 0.3s;
}

.modal-window {
    background: #101827; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 50px 100px -20px rgba(0,0,0,0.8);
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2001; 
    /* NEW: Better mobile handling */
    max-height: 85dvh; /* Dynamic viewport height */
}
.modal-window.large { width: 95%; height: 85%; max-width: 1000px; }
.modal-window.small { width: 100%; max-width: 380px; }

/* FIX: Ensure buttons don't get pushed out */
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; background: rgba(255,255,255,0.03); border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 15px; 
    min-width: 0; /* Important for flex child truncation */
    flex-shrink: 0; /* Header stays fixed */
}
.modal-title-group { 
    display: flex; flex-direction: column; gap: 2px; 
    flex: 1; 
    min-width: 0; /* Allow truncation inside flex item */
    overflow: hidden; 
}
.modal-title { font-weight: 800; font-size: 1rem; letter-spacing: 1px; display: flex; gap: 10px; align-items: center; }
.modal-sub { font-size: 0.8rem; color: var(--c-text-sec); font-weight: 400; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* MODAL ACTIONS (NEW) */
.modal-actions-group { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.modal-action-btn { 
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); 
    color: white; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; transition: 0.2s; 
    font-size: 1.1rem;
}
.modal-action-btn:hover { background: var(--c-primary); color: black; border-color: var(--c-primary); }

.modal-close { 
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); 
    color: var(--c-text-sec); width: 40px; height: 40px; border-radius: 8px;
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.modal-close:hover { color: white; background: var(--c-danger); border-color: var(--c-danger); }

.modal-content-area { 
    padding: 25px; flex: 1; overflow-y: auto; background: var(--c-bg-surface); 
    /* Smooth Scroll */
    -webkit-overflow-scrolling: touch;
}
.modal-content-area.no-pad { padding: 0; background: #000; }

.modal-text { color: var(--c-text-sec); font-size: 0.9rem; text-align: center; margin-bottom: 20px; }

.cyber-select-wrapper { position: relative; margin-bottom: 10px; }
.cyber-select {
    width: 100%; background: #050a14; color: white; border: 1px solid rgba(255,255,255,0.2);
    padding: 14px; border-radius: 12px; appearance: none; font-size: 0.95rem;
}
.select-arrow { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--c-text-dim); }

.modal-footer { padding: 20px; background: rgba(0,0,0,0.2); display: flex; gap: 10px; flex-shrink: 0; }

iframe { width: 100%; height: 100%; border: none; }

/* AVATAR GRID (FIXED) */
.avatar-grid {
    display: grid; 
    grid-template-columns: repeat(3, 1fr); /* 3 Columns safer */
    gap: 15px;
    max-height: 400px; 
    overflow-y: auto;
    padding: 10px;
}
.avatar-option {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px; 
    overflow: hidden; 
    cursor: pointer;
    border: 2px solid transparent; 
    background: rgba(255,255,255,0.05);
}
.avatar-option img { 
    width: 100%; height: 100%; 
    object-fit: contain; /* Prevent cut-off */
    display: block;
}
.avatar-option.selected { border-color: var(--c-primary); box-shadow: 0 0 15px var(--c-primary-dim); background: rgba(16, 185, 129, 0.1); }

/* TOAST */
.toast-popup {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(11, 18, 33, 0.9); border: 1px solid var(--c-primary);
    padding: 14px 24px; border-radius: 40px;
    display: flex; align-items: center; gap: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 500;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-icon { color: var(--c-primary); font-size: 1.2rem; }
.toast-message { font-size: 0.85rem; font-weight: 600; color: #fff; }

/* =============================================================================
   ANIMATIONS & KEYFRAMES
============================================================================= */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -30px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse-opacity { 0% { opacity: 0.4; } 100% { opacity: 1; } }

/* Glitch Text Effect */
.glitch { position: relative; }
.glitch::before, .glitch::after {
    content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}
.glitch::before {
    left: 2px; text-shadow: -1px 0 var(--c-danger); clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 3s infinite linear alternate-reverse;
}
.glitch::after {
    left: -2px; text-shadow: -1px 0 var(--c-accent); clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}
@keyframes glitch-anim-1 {
    0% { clip: rect(10px, 9999px, 30px, 0); }
    20% { clip: rect(80px, 9999px, 100px, 0); }
    40% { clip: rect(40px, 9999px, 60px, 0); }
    60% { clip: rect(120px, 9999px, 140px, 0); }
    80% { clip: rect(20px, 9999px, 80px, 0); }
    100% { clip: rect(60px, 9999px, 110px, 0); }
}
@keyframes glitch-anim-2 {
    0% { clip: rect(90px, 9999px, 100px, 0); }
    20% { clip: rect(10px, 9999px, 30px, 0); }
    40% { clip: rect(120px, 9999px, 130px, 0); }
    60% { clip: rect(50px, 9999px, 70px, 0); }
    80% { clip: rect(80px, 9999px, 90px, 0); }
    100% { clip: rect(20px, 9999px, 40px, 0); }
}

/* =============================================================================
   MEDIA QUERIES
============================================================================= */

@media (max-height: 750px) {
    .timer-reactor { width: 220px; height: 220px; }
    .reactor-digits { font-size: 2.8rem; }
    .hud-header { height: 60px; }
    .mission-card { max-height: 100px; }
}

@media (min-width: 600px) {
    /* Tablet/Desktop Tweaks */
    .app-root { border-left: 1px solid rgba(255,255,255,0.05); border-right: 1px solid rgba(255,255,255,0.05); }
}