/* Eye Aim Arena - Stylesheet */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --accent: #00e5ff;
    --accent2: #ff4081;
    --bg: #0a0e1a;
    --panel: rgba(10, 20, 40, 0.88);
    --text: #e0f0ff;
    --green: #00ff88;
    --yellow: #ffcc00;
    --red: #ff4444;
    --theme-canvas-filter: none;
    --theme-ui-filter: none;
}

body[data-game-theme='default-theme'] {
    --theme-canvas-filter: none;
    --theme-ui-filter: none;
}

body[data-game-theme='cvi-black-white'] {
    --accent: #ffffff;
    --accent2: #ffffff;
    --bg: #000000;
    --panel: rgba(0, 0, 0, 0.92);
    --text: #ffffff;
    --green: #ffffff;
    --yellow: #ffffff;
    --red: #ffffff;
    --theme-canvas-filter: url('#cviBlackWhiteFilter') contrast(1.6) brightness(1.2);
    --theme-ui-filter: grayscale(1) contrast(1.45) brightness(1.2);
}

body[data-game-theme='cvi-blue-green'] {
    --accent: #b6ff00;
    --accent2: #2d9fff;
    --bg: #001022;
    --panel: rgba(0, 20, 42, 0.92);
    --text: #b6ff00;
    --green: #b6ff00;
    --yellow: #b6ff00;
    --red: #2d9fff;
    --theme-canvas-filter: url('#cviBlueGreenFilter') contrast(1.45) brightness(1.2);
    --theme-ui-filter: url('#cviBlueGreenFilter') contrast(1.35) brightness(1.08);
}

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

/* ── Canvas ───────────────────────────────── */
#gameCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    cursor: none;
    filter: var(--theme-canvas-filter);
    transition: filter 90ms linear;
}

#webcamVideo {
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ── Overlay base ─────────────────────────── */
.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(5, 10, 25, 0.92);
    backdrop-filter: blur(6px);
}

.overlay-content {
    text-align: center;
    padding: 2.5rem 3rem;
    background: var(--panel);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.15);
    max-width: 560px;
    width: 90vw;
}

/* ── Loading screen ───────────────────────── */
#loadingScreen h1 {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--accent);
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 4px;
    width: 0%;
    transition: width 0.4s ease;
}

#loadStatus {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    margin-top: 0.5rem;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 229, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Menu screen ──────────────────────────── */
#menuScreen h1 {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--accent);
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
    margin-bottom: 0.4rem;
}

#menuScreen .subtitle {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 1.8rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.6rem;
}

.menu-buttons button, .overlay-content button {
    padding: 0.8rem 1.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    border: 2px solid rgba(0, 229, 255, 0.4);
    border-radius: 8px;
    background: rgba(0, 229, 255, 0.08);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.menu-buttons button:hover, .overlay-content button:hover {
    background: rgba(0, 229, 255, 0.2);
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.3);
    transform: translateY(-1px);
}

.menu-buttons button:active, .overlay-content button:active {
    transform: translateY(0);
}

#calibrateBtn {
    background: rgba(255, 64, 129, 0.08) !important;
    border-color: rgba(255, 64, 129, 0.4) !important;
}

#calibrateBtn:hover {
    background: rgba(255, 64, 129, 0.2) !important;
    border-color: var(--accent2) !important;
    box-shadow: 0 0 16px rgba(255, 64, 129, 0.3) !important;
}

#settingsBtn {
    background: rgba(255, 204, 0, 0.08) !important;
    border-color: rgba(255, 204, 0, 0.4) !important;
}

#settingsBtn:hover {
    background: rgba(255, 204, 0, 0.2) !important;
    border-color: var(--yellow) !important;
    box-shadow: 0 0 16px rgba(255, 204, 0, 0.25) !important;
}

#settingsScreen h2 {
    font-size: 2rem;
    color: var(--yellow);
    margin-bottom: 1rem;
}

.settings-group {
    text-align: left;
    margin-bottom: 1rem;
}

.settings-group label {
    display: block;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.4rem;
}

#cameraSelect, #trackingModeSelect, #aimAssistSelect, #triggerModeSelect, #gazeSmoothingSelect, #safeAreaMarginSelect, #targetScaleSelect {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    font-size: 0.95rem;
}

.settings-hint {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
}

.settings-toggles label {
    display: block;
    margin-bottom: 0.5rem;
}

.settings-toggles input[type='checkbox'] {
    margin-right: 0.5rem;
}

/* ── Settings Screen Enhancement ──────────────── */
.settings-overlay-content {
    max-width: 680px;
    width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 1.5rem 2rem;
    box-sizing: border-box;
}

.settings-overlay-content h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.2rem;
}

.settings-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem; /* Prevent layout shift or overlapping with scrollbar */
}

.settings-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.settings-preview-area {
    position: sticky;
    top: 0;
    width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.settings-preview-area .camera-label {
    width: 100%;
    text-align: center;
    padding: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(0, 229, 255, 0.12);
    color: var(--accent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#settingsCameraOverlay {
    display: block;
    width: 240px;
    height: 180px;
    background: #000;
}

.preview-status {
    width: 100%;
    padding: 6px;
    font-size: 0.75rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
    .settings-container {
        flex-direction: column;
        align-items: center;
    }
    .settings-form {
        width: 100%;
    }
    .settings-preview-area {
        position: static;
        width: 100%;
        max-width: 280px;
    }
    #settingsCameraOverlay {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
    }
}

/* ── Leaderboard ──────────────────────────── */
#leaderboard {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    text-align: left;
}

#leaderboard h3 {
    font-size: 1rem;
    color: var(--yellow);
    margin-bottom: 0.6rem;
    text-align: center;
}

#leaderboardList {
    font-size: 0.9rem;
    max-height: 180px;
    overflow-y: auto;
}

.lb-entry {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.lb-entry:nth-child(odd) {
    background: rgba(255,255,255,0.04);
}

.lb-entry .lb-rank {
    color: var(--yellow);
    width: 24px;
}

.lb-entry .lb-mode {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    flex: 1;
    padding-left: 8px;
}

.lb-entry .lb-score {
    color: var(--accent);
    font-weight: 700;
}

/* ── HUD ──────────────────────────────────── */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}

#hudLeft, #hudRight {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#hudRight {
    align-items: flex-end;
}

.hud-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
    padding: 4px 10px;
    background: rgba(0,0,0,0.45);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 0.5px;
    min-width: 120px;
}

#scoreDisplay { color: var(--yellow); }
#timerDisplay { color: var(--accent); }
#modeDisplay  { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
#accuracyDisplay { color: var(--green); }
#livesDisplay { color: var(--red); }
#eyeStatus { color: rgba(255,255,255,0.8); font-size: 0.82rem; }

/* ── Camera preview ───────────────────────── */
#cameraPreview {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 6;
    width: 240px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    overflow: hidden;
    pointer-events: none;
}

.camera-label {
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    background: rgba(0, 229, 255, 0.12);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#cameraOverlay {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
}

#cameraPreview,
#settingsCameraOverlay {
    filter: var(--theme-canvas-filter);
    transition: filter 90ms linear;
}

#hud,
#healthBar,
#keyboardHint,
#menuGazeReticle,
#aiAssistantPanel,
.overlay-content {
    filter: var(--theme-ui-filter);
    transition: filter 90ms linear;
}

/* ── Health / Lives bar ───────────────────── */
#healthBar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    z-index: 5;
    pointer-events: none;
}

.health-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.health-track {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

#healthFill {
    height: 100%;
    background: linear-gradient(90deg, var(--red), #ff8800);
    border-radius: 5px;
    transition: width 0.3s ease;
    width: 100%;
}

/* ── Game over ────────────────────────────── */
#gameoverScreen h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent2);
    text-shadow: 0 0 20px rgba(255, 64, 129, 0.6);
    margin-bottom: 1.2rem;
}

#finalStats {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.9;
}

#finalStats .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 4px;
}

#sessionReviewStats .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 4px;
}

#finalStats .stat-row:nth-child(odd) {
    background: rgba(255,255,255,0.04);
}

#sessionReviewStats .stat-row:nth-child(odd) {
    background: rgba(255,255,255,0.04);
}

#finalStats .stat-label {
    color: rgba(255,255,255,0.55);
}

#sessionReviewStats .stat-label {
    color: rgba(255,255,255,0.55);
}

#finalStats .stat-val {
    font-weight: 700;
    color: var(--accent);
}

#sessionReviewStats .stat-val {
    font-weight: 700;
    color: var(--accent);
}

#sessionReviewStats {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.82);
}

.session-review-content {
    width: min(1120px, 96vw);
    max-width: min(1120px, 96vw);
    max-height: 94vh;
    padding: 1.2rem 1.4rem;
}

.session-review-content h2 {
    margin-bottom: 0.45rem;
    color: var(--accent);
}

.session-review-viewport {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.65);
    overflow: hidden;
}

#sessionReviewCanvas {
    display: block;
    width: 100%;
    max-height: 58vh;
    height: auto;
    background: #000;
}

.session-review-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.8rem 1.25rem;
    margin: 0.8rem 0 1rem;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.88);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 0.25rem;
}

.session-review-controls label {
    white-space: nowrap;
    flex: 0 0 auto;
}

.session-review-controls button {
    flex: 0 0 auto;
}

.session-review-controls input[type='range'] {
    width: 220px;
    margin-top: 0;
    flex: 0 0 auto;
}

.gameover-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.gameover-buttons button {
    flex: 1;
}

/* ── Keyboard hint ────────────────────────── */
#keyboardHint {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
    pointer-events: none;
    z-index: 5;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ── Mode badge ───────────────────────────── */
.mode-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.mode-badge.time-attack  { background: rgba(0,229,255,0.15); color: var(--accent); border: 1px solid var(--accent); }
.mode-badge.survival     { background: rgba(255,68,68,0.15); color: var(--red); border: 1px solid var(--red); }
.mode-badge.precision    { background: rgba(0,255,136,0.15); color: var(--green); border: 1px solid var(--green); }

/* ── Webcam error ─────────────────────────── */
#errorScreen {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(5,10,25,0.97);
}

#errorScreen .error-box {
    text-align: center;
    padding: 2rem 2.5rem;
    background: rgba(255,68,68,0.1);
    border: 1px solid rgba(255,68,68,0.4);
    border-radius: 12px;
    max-width: 460px;
}

#errorScreen h2 {
    color: var(--red);
    margin-bottom: 0.8rem;
}

#errorScreen p {
    color: rgba(255,255,255,0.7);
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

#errorScreen button {
    padding: 0.7rem 1.6rem;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

/* ── Calibration instructions ─────────────── */
#calibrationTip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    pointer-events: none;
    z-index: 15;
    text-align: center;
    background: rgba(0,0,0,0.5);
    padding: 6px 16px;
    border-radius: 20px;
}

/* ── Pause screen ─────────────────────────── */
#pauseScreen {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(5,10,25,0.75);
    backdrop-filter: blur(4px);
}

#pauseScreen .pause-box {
    text-align: center;
    padding: 2rem;
    background: var(--panel);
    border: 1px solid rgba(0,229,255,0.25);
    border-radius: 12px;
}

#pauseScreen h2 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

#pauseScreen p {
    color: rgba(255,255,255,0.6);
}

/* ── Scrollbar ────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.3); border-radius: 3px; }

/* ── Menu Gaze Reticle ─────────────────────── */
.menu-gaze-reticle {
    position: fixed;
    width: 64px;
    height: 64px;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    display: block;
    transition: transform 0.05s ease-out;
}

.menu-gaze-reticle .reticle-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #00e5ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #00e5ff, 0 0 20px #00e5ff;
}

.menu-gaze-reticle .reticle-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(0, 229, 255, 0.4);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    animation: reticlePulse 2s infinite ease-in-out;
}

.menu-gaze-reticle .reticle-line {
    position: absolute;
    background: #00e5ff;
    box-shadow: 0 0 8px #00e5ff;
}

.menu-gaze-reticle .reticle-line-h {
    top: 50%;
    left: -10px;
    width: 14px;
    height: 2px;
    transform: translateY(-50%);
}

.menu-gaze-reticle .reticle-line-h:last-of-type {
    left: auto;
    right: -10px;
}

.menu-gaze-reticle .reticle-line-v {
    left: 50%;
    top: -10px;
    width: 2px;
    height: 14px;
    transform: translateX(-50%);
}

.menu-gaze-reticle .reticle-line-v:last-of-type {
    top: auto;
    bottom: -10px;
}

@keyframes reticlePulse {
    0%, 100% {
        transform: scale(0.9);
        border-color: rgba(0, 229, 255, 0.3);
    }
    50% {
        transform: scale(1.1);
        border-color: rgba(0, 229, 255, 0.6);
        box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
    }
}

/* ── WebGazer UI Hide ─────────────────────── */
#webgazerVideoFeed, #webgazerVideoCanvas, #webgazerFaceOverlay, #webgazerFaceFeedbackBox, #webgazerGazeDot {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 320px !important;
    height: 240px !important;
    opacity: 0.001 !important;
    pointer-events: none !important;
    z-index: -9999 !important;
}

/* ── Separation of concerns & cleanup classes ── */
.loading-hint {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
}

.settings-btn-area {
    margin-top: 1rem;
}

#resumeBtn {
    padding: 0.6rem 1.4rem;
    border: 2px solid rgba(0, 229, 255, 0.4);
    border-radius: 8px;
    background: rgba(0, 229, 255, 0.08);
    color: #e0f0ff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

#resumeBtn:hover {
    background: rgba(0, 229, 255, 0.2);
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.3);
    transform: translateY(-1px);
}

#zenBtn {
    background: rgba(0, 255, 136, 0.08) !important;
    border-color: rgba(0, 255, 136, 0.4) !important;
}

#zenBtn:hover {
    background: rgba(0, 255, 136, 0.2) !important;
    border-color: var(--green) !important;
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.3) !important;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: var(--text) !important;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.1) !important;
}

/* ── Menu description styling ── */
.menu-desc {
    font-weight: 400;
    opacity: 0.6;
}

/* ── Initial hidden states for dynamic components ── */
#menuScreen,
#settingsScreen,
#gameoverScreen,
#sessionReviewScreen,
#pauseScreen,
#hud,
#cameraPreview,
#aiAssistantPanel,
#healthBar,
#keyboardHint,
#menuGazeReticle,
#calibrationGuideModal {
    display: none;
}

/* ── Calibration Guide Modal ──────────────────────── */
.calibration-guide-content {
    max-width: 520px;
    text-align: left;
}

.calibration-guide-content h2 {
    text-align: center;
    color: var(--accent);
    font-size: 1.7rem;
    margin-bottom: 0.6rem;
}

.calibration-guide-intro {
    text-align: center;
    color: rgba(255,255,255,0.55);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

.calibration-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
    margin: 0;
}

.calibration-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.12);
    border-radius: 8px;
    line-height: 1.5;
}

.calibration-checklist li .check-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

/* ── Range inputs in settings ──────────────────────── */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(0, 229, 255, 0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin-top: 0.4rem;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px rgba(0, 229, 255, 0.5);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
}

/* ── File inputs in settings ───────────────────────── */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    font-size: 0.88rem;
    cursor: pointer;
    margin-top: 0.2rem;
}

input[type="file"]::-webkit-file-upload-button {
    padding: 0.35rem 0.8rem;
    background: rgba(0, 229, 255, 0.15);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 5px;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    margin-right: 0.5rem;
}

/* ── Image preview list ────────────────────────────── */
.image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.image-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(0, 229, 255, 0.4);
    background: #000;
    flex-shrink: 0;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-preview-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--red);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    z-index: 2;
}

/* ── Settings error message ────────────────────────── */
.settings-error {
    margin-top: 0.4rem;
    padding: 0.45rem 0.7rem;
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.4);
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--red);
}

/* ── AI Assistant Panel (Aria) ───────────────── */
.ai-panel {
    position: fixed;
    left: 16px;
    bottom: 16px;
    width: 250px;
    background: rgba(10, 15, 26, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.15), inset 0 0 8px rgba(0, 229, 255, 0.05);
    z-index: 6;
    pointer-events: none;
    font-family: inherit;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.ai-avatar-container {
    position: relative;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-avatar-core {
    width: 10px;
    height: 10px;
    background: #00e5ff;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e5ff, 0 0 15px #00e5ff;
    animation: aiPulse 1.8s infinite ease-in-out;
}

.ai-avatar-ring {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1.5px solid rgba(0, 229, 255, 0.4);
    border-radius: 50%;
    animation: aiRotate 4s infinite linear;
}

.ai-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #00e5ff;
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.3);
    letter-spacing: 0.5px;
}

.ai-body {
    min-height: 48px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

#aiMessage {
    font-size: 0.82rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 500;
}

.ai-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.ai-stat-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ai-stat-val {
    font-size: 0.78rem;
    color: var(--yellow);
    font-weight: 700;
}

/* Animations */
@keyframes aiPulse {
    0%, 100% {
        transform: scale(0.85);
        box-shadow: 0 0 4px #00e5ff, 0 0 8px #00e5ff;
        background: #00e5ff;
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 10px #bf00ff, 0 0 20px #bf00ff;
        background: #bf00ff;
    }
}

@keyframes aiRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
