/* 
   Compliance.Lua — Modern Game UI Stylesheet (From Scratch)
   Cybernetic Command Terminal Theme 
*/

:root {
    --bg-primary: #04050d;
    --bg-card: rgba(10, 12, 28, 0.85);
    --bg-card-active: rgba(18, 22, 48, 0.95);
    --border-neon: rgba(0, 240, 255, 0.25);
    --border-neon-hover: rgba(0, 240, 255, 0.65);
    
    --accent-blue: #0070f3;
    --accent-cyan: #00f0ff;
    --accent-pink: #ff007f;
    --accent-green: #39ff14;
    --accent-gold: #ffd700;
    --accent-purple: #9d00ff;
    --danger: #ff1c53;
    
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
    --transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* CRT Screen Scanline Overlay & Cyber Grid */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
        linear-gradient(90deg, rgba(0, 240, 255, 0.02), rgba(255, 0, 127, 0.01), rgba(0, 240, 255, 0.02));
    background-size: 100% 4px, 6px 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.3;
}

body::after {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 0, 127, 0.05) 0%, transparent 40%);
    z-index: -6;
    pointer-events: none;
}

.bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -5;
    pointer-events: none;
    opacity: 0.6;
}

/* Audio Controller Widget */
.sound-control {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    width: 46px;
    height: 46px;
    background: var(--bg-card);
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    transition: var(--transition);
    color: var(--text-main);
}

.sound-control:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.6);
}

.sound-control svg {
    width: 18px;
    height: 18px;
}

.hidden {
    display: none !important;
}

/* General Layout Structures */
.app-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Holographic Sci-Fi Card Panels */
.glass-panel {
    background: var(--bg-card);
    border: 2px solid var(--border-neon);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.08), inset 0 0 15px rgba(0, 240, 255, 0.03);
    position: relative;
    transition: var(--transition);
    overflow: hidden;
}

.glass-panel::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 10px; height: 10px;
    border-top: 2px solid var(--accent-cyan);
    border-right: 2px solid var(--accent-cyan);
    pointer-events: none;
}

.glass-panel::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 10px; height: 10px;
    border-bottom: 2px solid var(--accent-pink);
    border-left: 2px solid var(--accent-pink);
    pointer-events: none;
}

.glass-panel:hover {
    border-color: var(--border-neon-hover);
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.18), inset 0 0 20px rgba(0, 240, 255, 0.05);
}

.glass-panel-nested {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

/* HUD Top Header Layout */
.hud-main-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.hud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 75px;
    padding: 0 25px;
    background: rgba(8, 10, 22, 0.95);
    border-bottom: 2px solid var(--accent-cyan);
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.15);
    z-index: 10;
    flex-shrink: 0;
    border-radius: 0;
}

.hud-logo-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hud-logo-block .logo-icon {
    font-size: 26px;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
    animation: flash 1.5s infinite alternate;
}

.hud-logo-text h2 {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--text-main), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hud-status {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent-pink);
    text-transform: uppercase;
}

.hud-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
}

/* HUD Tab Navigation buttons */
.hud-nav .nav-item {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    padding: 0 18px;
    height: 100%;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    transition: var(--transition);
    border-radius: 0;
}

.hud-nav .nav-item:hover {
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.04);
    border-bottom-color: rgba(0, 240, 255, 0.3);
}

.hud-nav .nav-item.active {
    color: var(--text-main);
    background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.08));
    border-bottom: 3px solid var(--accent-cyan);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.admin-nav-separator {
    color: rgba(255, 255, 255, 0.1);
    font-weight: 300;
    margin: 0 10px;
}

.hud-player-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 6px 16px;
    border-radius: 30px;
    border: 1.5px solid var(--border-neon);
}

.hud-avatar {
    font-size: 22px;
}

.hud-player-info {
    display: flex;
    flex-direction: column;
}

.hud-player-name {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.hud-player-stats {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.hud-badge {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 800;
}

.xp-badge {
    background: rgba(255, 0, 127, 0.15);
    color: var(--accent-pink);
    border: 1px solid rgba(255, 0, 127, 0.3);
}

.level-badge {
    background: rgba(57, 255, 20, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(57, 255, 20, 0.3);
}

.hud-logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 50%;
    margin-left: 10px;
    transition: var(--transition);
}

.hud-logout-btn:hover {
    color: var(--danger);
    background: rgba(255, 28, 83, 0.1);
    box-shadow: 0 0 10px rgba(255, 28, 83, 0.2);
}

.hud-logout-btn .nav-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
}

/* Content Panel Distribution */
.content-area {
    padding: 25px;
    height: calc(100vh - 75px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.content-section {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Grid layout managers */
.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    flex-grow: 1;
    min-height: 0;
}

.grid-2-col-wide {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 20px;
    flex-grow: 1;
    min-height: 0;
}

/* Card layout managers */
.card {
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    flex-shrink: 0;
}

.card-header-bar {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.card-body {
    padding: 20px;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    background: rgba(4, 5, 15, 0.9);
    border: 2px solid rgba(0, 240, 255, 0.2);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.35), inset 0 0 5px rgba(0, 240, 255, 0.1);
    background: #04050d;
}

/* Gaming 3D Arcade buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: inherit;
    font-weight: 800;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid currentColor;
    background: transparent;
    transition: all 0.1s ease;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-primary:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-accent {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 4px 0 rgba(0, 240, 255, 0.25);
}

.btn-accent:hover {
    background: rgba(0, 240, 255, 0.08);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.btn-accent:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0, 240, 255, 0.25);
}

.btn-success {
    color: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: 0 4px 0 rgba(57, 255, 20, 0.25);
}

.btn-success:hover {
    background: rgba(57, 255, 20, 0.08);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
}

.btn-success:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(57, 255, 20, 0.25);
}

.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 4px 0 rgba(255, 28, 83, 0.25);
}

.btn-danger:hover {
    background: rgba(255, 28, 83, 0.08);
    box-shadow: 0 0 15px rgba(255, 28, 83, 0.3);
}

.btn-danger:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(255, 28, 83, 0.25);
}

.btn-lg {
    padding: 15px 25px;
    font-size: 15px;
    border-radius: 10px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 6px;
    border-width: 1px;
    box-shadow: 0 2px 0 currentColor;
}

.btn-sm:active {
    transform: translateY(2px);
    box-shadow: 0 0px 0 currentColor;
}

.button-group {
    display: flex;
    gap: 10px;
}

/* Authentication Terminal views */
.auth-screen {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 440px;
    padding: 40px;
    border: 3px solid var(--accent-cyan);
    background: rgba(8, 10, 22, 0.95);
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.25), inset 0 0 20px rgba(0, 240, 255, 0.05);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: "SYSTEM ENTRY GATE // SECURE";
    position: absolute;
    top: 6px;
    left: 12px;
    font-size: 8px;
    font-weight: 800;
    color: var(--accent-cyan);
    opacity: 0.7;
    letter-spacing: 2px;
    font-family: var(--font-mono);
}

.auth-card::after {
    content: "v2.7";
    position: absolute;
    top: 6px;
    right: 12px;
    font-size: 8px;
    font-weight: 800;
    color: var(--accent-pink);
    opacity: 0.7;
    font-family: var(--font-mono);
}

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

.brand .logo-icon {
    font-size: 38px;
    margin-bottom: 8px;
}

.brand h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand p {
    color: var(--text-muted);
    font-size: 13px;
}

.auth-form h2 {
    font-size: 18px;
    margin-bottom: 18px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 18px;
}

.auth-switch span {
    color: var(--accent-cyan);
    cursor: pointer;
    font-weight: 800;
}

.avatar-selector-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.avatar-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.avatar-option {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 20px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.avatar-option:hover {
    border-color: rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.05);
}

.avatar-option.selected {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* User Home/Lobby Panels */
.home-hero {
    padding: 30px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(255, 0, 127, 0.03));
}

.hero-content h1 {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 14px;
}

.join-session-container {
    margin-top: 15px;
    max-width: 500px;
}

.join-session-container .form-group {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
}

.join-session-container input {
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: 1px;
    font-weight: 800;
    text-align: center;
}

/* Upcoming Sessions list items */
.session-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.session-row-item:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.03);
}

.session-info-block h4 {
    font-size: 14px;
    font-weight: 800;
}

.session-info-block p {
    font-size: 11px;
}

.live-now-badge {
    background: var(--danger);
    color: #ffffff;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 800;
    animation: flash 1s infinite alternate;
}

.daily-challenge-box {
    background: rgba(0, 240, 255, 0.02);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.challenge-title {
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-cyan);
    margin-bottom: 6px;
}

.daily-challenge-box p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

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

.streak-icon {
    font-size: 24px;
    animation: pulse 1.5s infinite alternate;
}

.streak-details h4 {
    font-size: 12px;
    font-weight: 800;
}

.streak-details p {
    font-size: 11px;
    color: var(--text-muted);
}

/* User Profile Screens */
.profile-header {
    padding: 20px;
    margin-bottom: 20px;
}

.profile-header-top {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-large {
    font-size: 40px;
}

.profile-title-block h1 {
    font-size: 20px;
    font-weight: 900;
}

.profile-title-block .badge {
    display: inline-block;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 800;
    margin-top: 2px;
    background: var(--accent-cyan);
    color: #04050d;
}

.profile-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.metric-val {
    font-size: 20px;
    font-weight: 900;
    color: var(--accent-cyan);
}

.metric-lbl {
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

/* Badge Lists */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.badge-item {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: var(--transition);
}

.badge-item:hover {
    border-color: var(--accent-pink);
    transform: scale(1.03);
}

.badge-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.badge-title {
    font-size: 11px;
    font-weight: 800;
}

.badge-desc {
    font-size: 8px;
    color: var(--text-muted);
}

/* Leaderboards simple lists */
.leaderboard-list-simple {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-row-simple {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.leaderboard-row-simple:hover {
    background: rgba(0, 240, 255, 0.04);
    border-color: var(--accent-pink);
    transform: scale(1.02);
}

.leader-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-num {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 12px;
    color: var(--accent-cyan);
}

.leader-avatar {
    font-size: 18px;
}

.leader-name {
    font-size: 13px;
    font-weight: 700;
}

.leader-points {
    font-weight: 800;
    font-size: 13px;
    color: var(--accent-green);
}

/* Tables general */
.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    padding: 10px;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(0, 240, 255, 0.15);
}

.table td {
    padding: 10px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Question bank filtering */
.filter-bar {
    display: flex;
    gap: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.filter-bar .form-group {
    flex-grow: 1;
    margin-bottom: 0;
}

/* Scheduled Projects lists */
.project-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
}

.project-card h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent-cyan);
    margin-bottom: 4px;
}

.project-card p {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Hardware Dashboard elements */
.grid-3-col-meters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.sys-meter-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 15px;
    border: 1.5px solid var(--border-neon);
}

.gauge-container {
    padding: 8px 0;
}

.sys-value-display {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.progress-bar-horizontal {
    background: rgba(255, 255, 255, 0.05);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.accent-cyan-bg { background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan)); }
.accent-pink-bg { background: linear-gradient(90deg, var(--accent-pink), var(--accent-purple)); }
.accent-green-bg { background: linear-gradient(90deg, var(--accent-green), #00b050); }

.font-12 {
    font-size: 12px;
}

/* Modals overlays */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(4, 5, 13, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 500px;
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-close {
    position: absolute;
    top: 15px; right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--danger);
}

/* Live quiz HUD elements */
.live-layout {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 30px;
    gap: 20px;
    overflow: hidden;
}

.live-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    flex-shrink: 0;
}

.live-title-block h2 {
    font-size: 20px;
    font-weight: 900;
}

.join-badge {
    font-size: 11px;
    color: var(--accent-cyan);
    text-transform: uppercase;
}

.timer-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.timer-bar span {
    font-weight: 800;
    font-size: 14px;
    color: var(--accent-pink);
}

.timer-progress-bg {
    width: 150px;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.timer-progress-fill {
    height: 100%;
    background: var(--accent-pink);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.live-main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.live-sub-view {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Answer Choices */
.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.answer-btn {
    background: rgba(12, 14, 33, 0.85);
    border: 3px solid var(--btn-border);
    border-radius: 16px;
    padding: 24px;
    color: var(--text-main);
    font-family: inherit;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 6px 0 var(--btn-shadow);
    transform: translateY(0);
    transition: all 0.1s ease;
}

.answer-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 8px 15px var(--btn-shadow);
    transform: translateY(-2px);
}

.answer-btn:active, .answer-btn.selected {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--btn-shadow);
}

.answer-marker {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
}

.answer-btn:nth-child(1) {
    --btn-border: var(--accent-pink);
    --btn-shadow: rgba(255, 0, 127, 0.35);
}
.answer-btn:nth-child(1) .answer-marker { background: var(--accent-pink); }

.answer-btn:nth-child(2) {
    --btn-border: var(--accent-blue);
    --btn-shadow: rgba(0, 135, 255, 0.35);
}
.answer-btn:nth-child(2) .answer-marker { background: var(--accent-blue); }

.answer-btn:nth-child(3) {
    --btn-border: var(--accent-green);
    --btn-shadow: rgba(57, 255, 20, 0.35);
}
.answer-btn:nth-child(3) .answer-marker { background: var(--accent-green); }

.answer-btn:nth-child(4) {
    --btn-border: var(--accent-purple);
    --btn-shadow: rgba(157, 0, 255, 0.35);
}
.answer-btn:nth-child(4) .answer-marker { background: var(--accent-purple); }

.submitted-banner {
    padding: 30px;
    text-align: center;
}

.submitted-banner h3 {
    color: var(--accent-cyan);
    margin-bottom: 6px;
}

/* Interstitial reveal views */
.reveal-card {
    padding: 40px;
    text-align: center;
}

.reveal-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-green);
    color: #04050d;
    font-size: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.points-alert {
    font-size: 20px;
    font-weight: 900;
    color: var(--accent-green);
    margin-top: 10px;
}

.correct-answer-box {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid var(--border-neon);
    padding: 15px;
    border-radius: 8px;
}

.explanation-box {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.01);
    padding: 15px;
    border-radius: 8px;
}

/* Podium views */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    margin-top: 30px;
}

.podium-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.podium-avatar {
    font-size: 32px;
    margin-bottom: 6px;
}

.podium-name {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 8px;
}

.podium-score {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-cyan);
    margin-bottom: 5px;
}

.podium-step {
    width: 100px;
    background: var(--bg-card);
    border: 2px solid var(--border-neon);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    border-radius: 8px 8px 0 0;
}

.podium-col-1 .podium-step { height: 120px; border-color: var(--accent-gold); color: var(--accent-gold); }
.podium-col-2 .podium-step { height: 90px; border-color: rgba(255,255,255,0.4); }
.podium-col-3 .podium-step { height: 60px; border-color: #cd7f32; color: #cd7f32; }

/* Pagination footer layout */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    flex-shrink: 0;
}

.pagination-controls span {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
}

/* Spinners */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 240, 255, 0.15);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* Toast container */
.toast-container {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 10000;
}

.toast-message {
    background: #080a16;
    border: 2px solid var(--accent-cyan);
    border-radius: 8px;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 800;
    animation: slideIn 0.3s ease-out;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.05); opacity: 1; }
}

@keyframes flash {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes slideUp {
    0% { transform: translateY(15px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes slideIn {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes popIn {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Pulsing highlight for System Help Button */
.hud-help-btn {
    animation: helpPulse 1.8s infinite alternate !important;
    border: 1.5px solid var(--accent-cyan) !important;
}

@keyframes helpPulse {
    0% {
        box-shadow: 0 0 4px rgba(0, 240, 255, 0.2);
        border-color: rgba(0, 240, 255, 0.4) !important;
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 15px rgba(0, 240, 255, 0.85), inset 0 0 5px rgba(0, 240, 255, 0.2);
        border-color: var(--accent-cyan) !important;
        transform: scale(1.15);
        color: var(--accent-cyan) !important;
    }
}

/* Animated Splash Screen Bootloader (Sleek Gaming Console Shutter) */
.splash-screen {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #020306;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    overflow: hidden;
    transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1);
}

.splash-screen.fade-out {
    transform: translateY(-100%);
    pointer-events: none;
}

.splash-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 450px;
    width: 90%;
    z-index: 2;
    transition: opacity 0.4s ease;
}

.splash-screen.fade-out .splash-content {
    opacity: 0;
}

/* Pulsing Logo with entry transition */
.splash-logo {
    font-size: 84px;
    color: var(--accent-cyan);
    margin-bottom: 25px;
    display: inline-block;
    position: relative;
    z-index: 3;
    animation: logoIntro 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards, splashGlowPulse 1.6s infinite alternate 1.2s;
    transition: transform 0.5s cubic-bezier(0.6, -0.28, 0.735, 0.045), opacity 0.5s ease;
}

.splash-screen.fade-out .splash-logo {
    transform: scale(0.8) translateY(-40px);
    opacity: 0;
}

@keyframes logoIntro {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; filter: drop-shadow(0 0 0 rgba(0, 240, 255, 0)); }
    100% { transform: scale(1) rotate(0); opacity: 1; filter: drop-shadow(0 0 25px rgba(0, 240, 255, 0.7)); }
}

@keyframes splashGlowPulse {
    0% { filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.4)); }
    100% { filter: drop-shadow(0 0 35px rgba(0, 240, 255, 0.85)); }
}

/* Expanding ripple ring behind the logo */
.splash-logo-ripple {
    position: absolute;
    top: 50%; left: 50%;
    width: 100px; height: 100px;
    margin-top: -65px; margin-left: -50px;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    animation: logoRipple 2.2s infinite cubic-bezier(0.1, 0.8, 0.1, 1);
    pointer-events: none;
    z-index: 1;
}

@keyframes logoRipple {
    0% { transform: scale(0.6); opacity: 0.8; border-color: rgba(0, 240, 255, 0.7); }
    100% { transform: scale(2.4); opacity: 0; border-color: rgba(0, 240, 255, 0); }
}

.splash-title {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 5px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.splash-terminal-log {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    height: 30px;
    margin-bottom: 25px;
}

/* Pacman Game-Style Loader */
.pacman-loader-container {
    width: 100%;
    max-width: 450px;
    margin-top: 25px;
}

.pacman-track {
    position: relative;
    width: 100%;
    height: 48px;
    background: rgba(2, 3, 6, 0.6);
    border: 2px solid var(--accent-cyan);
    border-radius: 24px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.1), 0 0 15px rgba(0, 240, 255, 0.15);
}

.pacman {
    position: absolute;
    left: -40px; /* Start hidden left of track boundaries */
    width: 32px;
    height: 32px;
    z-index: 10;
    transition: left 0.1s linear;
}

.pacman-mouth-top,
.pacman-mouth-bottom {
    position: absolute;
    width: 100%;
    height: 50%;
    background: #ffea00;
    left: 0;
    box-shadow: 0 0 12px #ffea00;
}

.pacman-mouth-top {
    top: 0;
    border-radius: 16px 16px 0 0;
    transform-origin: bottom;
    animation: pacmanChompTop 0.2s infinite alternate ease-in-out;
}

.pacman-mouth-bottom {
    bottom: 0;
    border-radius: 0 0 16px 16px;
    transform-origin: top;
    animation: pacmanChompBottom 0.2s infinite alternate ease-in-out;
}

@keyframes pacmanChompTop {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-35deg); }
}

@keyframes pacmanChompBottom {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(35deg); }
}

.pacman-letters {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 24px 0 48px; /* Offset so Pacman starts before first letter */
    box-sizing: border-box;
}

.pacman-letter {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 900;
    color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
    transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
    transform: scale(1);
    opacity: 1;
}

/* Eaten letter class */
.pacman-letter.eaten,
.pacman-dot.eaten {
    opacity: 0;
    transform: scale(0) rotate(90deg);
    filter: blur(4px);
}

/* Pacman Ghost Chaser */
.pacman-ghost {
    position: absolute;
    left: -80px; /* Offset behind Pacman */
    width: 28px;
    height: 28px;
    z-index: 9;
    transition: left 0.1s linear;
}

.ghost-head {
    width: 100%;
    height: 22px;
    background: #ff0000; /* Red Blinky Ghost */
    border-radius: 14px 14px 0 0;
    box-shadow: 0 0 10px #ff0000;
    position: absolute;
    top: 0;
}

.ghost-eyes {
    position: absolute;
    top: 6px;
    left: 4px;
    width: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
}

.ghost-eyes .eye {
    width: 7px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    position: relative;
}

.ghost-eyes .pupil {
    width: 3px;
    height: 3px;
    background: #0000ff;
    border-radius: 50%;
    position: absolute;
    left: 1px; /* Looking left/forward */
    top: 2px;
}

.ghost-skirt {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 6px;
    display: flex;
}

.ghost-skirt .wave {
    width: 9.3px;
    height: 6px;
    background: #ff0000;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    transform: rotate(180deg);
}

/* Pellets/Dots */
.pacman-dot {
    font-size: 8px;
    color: var(--accent-blue);
    text-shadow: 0 0 5px var(--accent-blue);
    align-self: center;
    transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
    transform: scale(1);
    opacity: 0.8;
}

/* Entrance animation updates */
.auth-card {
    animation: authCardEnter 0.9s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes authCardEnter {
    0% { transform: translateY(40px) scale(0.96); opacity: 0; filter: blur(10px); }
    100% { transform: translateY(0) scale(1); opacity: 1; filter: blur(0); }
}

.hud-header {
    animation: hudHeaderEnter 0.75s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes hudHeaderEnter {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

.hud-main-layout.screen:not(.hidden) {
    animation: hudMainEnter 0.9s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes hudMainEnter {
    0% { opacity: 0; filter: blur(15px); }
    100% { opacity: 1; filter: blur(0); }
}

/* Floating Admin Alert Capsule */
.floating-alert-console {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 1000;
    height: 46px;
    padding: 0 16px;
    background: rgba(255, 28, 83, 0.15);
    border: 2px solid var(--danger);
    border-radius: 23px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 28, 83, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: floatingAlertPulse 2s infinite alternate;
}

.floating-alert-console:hover {
    background: rgba(255, 28, 83, 0.3);
    box-shadow: 0 0 25px rgba(255, 28, 83, 0.6);
    transform: scale(1.05);
}

.alert-pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--danger);
    animation: flash 1s infinite alternate;
}

.alert-icon {
    font-size: 16px;
}

.alert-message {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
    font-family: var(--font-mono);
    text-transform: uppercase;
    white-space: nowrap;
}

@keyframes floatingAlertPulse {
    0% {
        border-color: rgba(255, 28, 83, 0.4);
        box-shadow: 0 0 8px rgba(255, 28, 83, 0.2);
    }
    100% {
        border-color: var(--danger);
        box-shadow: 0 0 20px rgba(255, 28, 83, 0.6);
    }
}


/* Responsive Compatibility Deck (Mobile, Tablet, and Laptop screen optimization) */
@media (max-width: 990px) {
    body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    /* 1. Header Layout stacking */
    .hud-header {
        height: auto;
        flex-flow: row wrap;
        align-items: center;
        justify-content: space-between;
        padding: 12px 15px;
        gap: 10px;
    }
    
    .hud-logo-block {
        order: 1;
        flex-shrink: 0;
    }
    
    .hud-player-badge {
        order: 2;
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .hud-nav {
        order: 3;
        width: 100%;
        height: auto;
        justify-content: flex-start;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        border-top: 1px solid rgba(0, 240, 255, 0.15);
        padding-top: 8px;
        margin-top: 4px;
        gap: 4px;
    }
    
    .hud-nav .nav-item {
        height: 40px;
        padding: 0 12px;
        flex-shrink: 0;
    }
    
    .admin-nav-separator {
        display: none !important;
    }

    /* 2. Main content scaling */
    .hud-main-layout {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    
    .content-area {
        height: auto;
        overflow: visible;
        padding: 15px;
    }
    
    .content-section {
        height: auto;
        overflow: visible;
    }

    /* 3. Grid Systems Fallback */
    .grid-2-col,
    .grid-2-col-wide,
    .grid-3-col-meters {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .profile-metric-grid,
    .badges-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .avatar-selector {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* 4. Table view scroll safety */
    .card-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 5. Modals optimization */
    .modal-content {
        width: 95% !important;
        max-width: 580px;
        padding: 20px 15px;
    }
}

@media (max-width: 600px) {
    /* Profile items column stack */
    .hud-player-badge {
        flex-grow: 1;
        justify-content: flex-end;
    }

    .hud-player-info {
        display: none; /* Hide name/XP to fit sound control and badge on mobile header */
    }

    /* Live arena layout stacking */
    .live-layout {
        padding: 15px;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .answers-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .answer-btn {
        padding: 16px;
        font-size: 15px;
    }

    /* Floating Alert position shift on super small displays */
    .floating-alert-console {
        bottom: 15px;
        left: 15px;
        padding: 0 10px;
        height: 38px;
    }
    
    .floating-alert-console .alert-message {
        font-size: 9px;
    }
}

/* Help Modal Mobile/Tablet Optimization Override */
@media (max-width: 768px) {
    #helpModal .modal-content {
        height: 90vh !important;
        width: 95% !important;
        max-width: 580px !important;
        padding: 15px !important;
    }
    
    .help-modal-body {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .help-modal-sidebar {
        width: 100% !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding-right: 0 !important;
        padding-bottom: 10px !important;
        gap: 6px !important;
    }
    
    .help-modal-sidebar .help-tab-btn {
        width: auto !important;
        margin-top: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .help-modal-content {
        padding-top: 5px !important;
        font-size: 12px !important;
    }
}

/* Proud Dev animated highlighting badge */
.dev-badge-animated {
    font-family: 'Sacramento', cursive;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: #39ff14; /* Game Lime Green */
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
    margin: -5px 0 2px 0;
    text-transform: none;
    text-align: center;
    display: block;
    width: 100%;
}

.dev-badge-animated.splash-dev {
    font-size: 38px;
    margin-bottom: 24px;
    letter-spacing: 2.5px;
    text-align: center;
}

@keyframes devLetterFadeIn {
    0% {
        opacity: 0;
        filter: blur(4px);
        transform: translateY(2px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* Interactive Shutter Countdown Overlay */
.countdown-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(4, 5, 13, 0.95);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.countdown-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-label {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--accent-cyan);
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.countdown-number {
    font-size: 120px;
    font-weight: 900;
    color: #39ff14; /* Lime green */
    text-shadow: 0 0 30px rgba(57, 255, 20, 0.8);
    animation: countdownPulse 1s infinite ease-in-out;
}

@keyframes countdownPulse {
    0% { transform: scale(0.6); opacity: 0.2; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
}
