/* ============================================================
   Star Trek Trivia — LCARS (TNG/DS9/VOY era) stylesheet
   Static chrome + shared tokens live here; app.js supplies the
   per-element inline styling for pills, badges, and answer states.
   ============================================================ */

:root {
    --bg: #000;
    --panel: #0a0a0f;          /* content panel */
    --panel-2: #12121a;        /* inset cards */
    --track: #2a2530;          /* slider track / divider lines */
    --orange: #FF9966;         /* LCARS orange */
    --gold: #FFCC66;           /* LCARS gold */
    --violet: #CC99CC;         /* LCARS violet */
    --blue: #99CCFF;           /* LCARS blue */
    --red: #CC6666;            /* alert red */
    --green: #88CC88;          /* success green */
    --cream: #FFEFD5;          /* body text */
    --muted: #c9b8cf;          /* dim mauve text */
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--cream);
    font-family: 'Antonio', 'Arial Narrow', sans-serif;
    min-height: 100vh;
}

::selection { background: var(--gold); color: #000; }

.hidden { display: none !important; }

.mono { font-family: 'Share Tech Mono', monospace; }

/* ===== Slider ===== */
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 6px; background: var(--track); }
input[type=range]::-moz-range-track { height: 10px; border-radius: 6px; background: var(--track); }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 26px; height: 26px;
    margin-top: -8px; border-radius: 50%; background: var(--orange);
    border: 3px solid #000; cursor: pointer;
}
input[type=range]::-moz-range-thumb {
    width: 24px; height: 24px; border-radius: 50%; background: var(--orange);
    border: 3px solid #000; cursor: pointer;
}
input[type=range]:disabled::-webkit-slider-thumb { background: #5a4a4a; }
input[type=range]:disabled::-moz-range-thumb { background: #5a4a4a; }

button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ===== Animations ===== */
@keyframes lcarsSweep { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes lcarsBlink { 0%,49% { opacity: 1; } 50%,100% { opacity: .25; } }
@keyframes lcarsPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(136,204,136,.5); } 50% { box-shadow: 0 0 0 14px rgba(136,204,136,0); } }

/* ===== Layout frame ===== */
.lcars-app { min-height: 100vh; background: var(--bg); padding: clamp(8px, 2vw, 18px); }
.lcars-frame { max-width: 1180px; margin: 0 auto; display: flex; gap: 10px; align-items: stretch; }

/* Left rail */
.rail { display: flex; flex-direction: column; gap: 8px; width: clamp(56px, 15vw, 148px); flex-shrink: 0; }
.rail .mono { font-size: 11px; color: #000; }
.rail-cap-top { height: clamp(80px, 14vw, 120px); background: var(--orange); border-radius: 44px 0 0 0; display: flex; align-items: flex-end; justify-content: flex-end; padding: 10px; }
.rail-cap-bottom { height: clamp(60px, 10vw, 90px); background: var(--orange); border-radius: 0 0 0 44px; display: flex; align-items: flex-start; justify-content: flex-end; padding: 8px; }
.rail-seg { }
.rail-gold { height: 60px; background: var(--gold); }
.rail-violet { height: 34px; background: var(--violet); }
.rail-red { height: 46px; background: var(--red); }
.rail-fill { flex: 1; min-height: 50px; background: var(--blue); display: flex; align-items: flex-start; justify-content: flex-end; padding: 8px; }

/* Right column */
.column { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.topbar { display: flex; gap: 8px; height: clamp(46px, 8vw, 58px); }
.topbar-main { flex: 1; background: var(--orange); border-radius: 0 28px 0 0; display: flex; align-items: center; justify-content: flex-end; padding: 0 clamp(12px, 2vw, 22px); }
.topbar-main .mono { font-size: clamp(10px, 1.6vw, 13px); letter-spacing: 2px; color: #000; }
.topbar-tab { width: clamp(70px, 14vw, 130px); background: var(--gold); border-radius: 0 28px 0 0; display: flex; align-items: center; justify-content: center; color: #000; font-weight: 700; letter-spacing: 2px; font-size: clamp(11px, 1.8vw, 15px); }

.content-panel { flex: 1; background: var(--panel); border-radius: 0 0 20px 0; padding: clamp(14px, 3vw, 30px); min-height: 66vh; display: flex; flex-direction: column; position: relative; overflow: hidden; }
#screen-root { display: flex; flex-direction: column; flex: 1; }

.bottombar { display: flex; gap: 8px; height: 34px; }
.bottombar-tab { width: clamp(70px, 14vw, 130px); background: var(--violet); border-radius: 0 0 0 22px; }
.bottombar-main { flex: 1; background: var(--orange); border-radius: 0 0 22px 0; display: flex; align-items: center; justify-content: flex-end; padding: 0 18px; }
.bottombar-main .mono { font-size: 11px; color: #000; letter-spacing: 2px; }

/* ===== CRT overlay ===== */
.crt-scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 40; background: repeating-linear-gradient(rgba(0,0,0,0) 0 2px, rgba(0,0,0,.10) 2px 3px); mix-blend-mode: multiply; }
.crt-vignette { position: fixed; inset: 0; pointer-events: none; z-index: 40; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.45) 100%); }
body.no-glow .crt-scanlines, body.no-glow .crt-vignette { display: none; }

/* ===== Tweak drawer ===== */
.tweak-launcher {
    position: fixed; right: 14px; bottom: 14px; z-index: 60;
    background: #2a2530; color: var(--blue); border: 1px solid #444;
    border-radius: 16px; padding: 7px 14px; font-family: 'Share Tech Mono', monospace;
    font-size: 12px; letter-spacing: 1px; cursor: pointer; opacity: .55;
    transition: opacity .15s;
}
.tweak-launcher:hover { opacity: 1; }
.tweak-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
    width: min(320px, 88vw); background: #0d0d14; border-left: 3px solid var(--gold);
    padding: 18px 16px; overflow-y: auto;
    box-shadow: -12px 0 40px rgba(0,0,0,.6);
    animation: lcarsSweep .25s ease;
}
.tweak-drawer h3 { color: var(--gold); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; margin: 16px 0 8px; }
.tweak-drawer h3:first-child { margin-top: 0; }
.tweak-drawer .tweak-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tweak-drawer .tweak-title { color: var(--blue); font-family: 'Share Tech Mono', monospace; letter-spacing: 2px; font-size: 13px; }
.tweak-drawer .tweak-close { background: var(--red); color: #000; border: none; border-radius: 12px; padding: 4px 12px; cursor: pointer; font-family: 'Share Tech Mono', monospace; }
.tweak-btn {
    display: block; width: 100%; text-align: left; margin-bottom: 5px;
    background: #1c1c26; color: #cfc2d6; border: none; border-radius: 9px;
    padding: 8px 11px; font-family: 'Share Tech Mono', monospace; font-size: 12px;
    letter-spacing: .5px; cursor: pointer;
}
.tweak-btn:hover { background: var(--track); color: #fff; }
.tweak-toggle {
    display: flex; justify-content: space-between; align-items: center;
    background: #1c1c26; border-radius: 9px; padding: 8px 11px; margin-bottom: 5px;
    font-family: 'Share Tech Mono', monospace; font-size: 12px; color: #cfc2d6;
    cursor: pointer;
}
.tweak-toggle .state-on { color: var(--green); }
.tweak-toggle .state-off { color: var(--red); }
