/* ============================================================
   Rocket Island — cinematic shader sandbox styling.
   Full-bleed canvas, mono sci-fi header + telemetry HUD, and a
   scanline / vignette / grain overlay echoing the Video-B mood.
   ============================================================ */

:root {
    --ri-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
    --ri-header-h: 40px;
    --ri-text: #e8eef6;
    --ri-text-dim: #8aa0b4;
    --ri-ember: #ff7a3c;
    --ri-ember-hot: #ffb060;
    --ri-cyan: #5fd0ff;
    --ri-panel: rgba(6, 12, 20, 0.55);
    --ri-line: rgba(120, 170, 210, 0.22);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0; height: 100%;
    background: #02030a; color: var(--ri-text);
    font-family: var(--ri-mono);
    overflow: hidden;
}

/* ── 3D viewport ── */
#ri-viewport {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}
#ri-viewport canvas { display: block; }

/* ── VFX overlay (above canvas, below UI) ── */
.ri-vfx {
    position: fixed; inset: 0; z-index: 5;
    pointer-events: none;
}
.ri-scanline {
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px,
        rgba(0,0,0,0.10) 3px, rgba(0,0,0,0) 4px);
    mix-blend-mode: multiply; opacity: 0.5;
}
.ri-vignette {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center,
        rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%);
}
.ri-grain {
    position: absolute; inset: 0; opacity: 0.05;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ── Header ── */
.ri-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 20;
    height: var(--ri-header-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px;
    background: linear-gradient(to bottom, rgba(2,6,12,0.85), rgba(2,6,12,0.0));
    font-size: 11px; letter-spacing: 0.12em;
}
.ri-header-left { display: flex; align-items: center; gap: 8px; }
.ri-header-left a { color: var(--ri-text-dim); text-decoration: none; }
.ri-header-left a:hover { color: var(--ri-ember-hot); }
.ri-sep { opacity: 0.35; }
.ri-title { color: var(--ri-ember-hot); font-weight: bold; letter-spacing: 0.2em; }
.ri-tag {
    font-size: 9px; letter-spacing: 0.18em; color: var(--ri-cyan);
    border: 1px solid var(--ri-line); border-radius: 3px; padding: 1px 6px;
}
.ri-header-right { display: flex; align-items: center; gap: 10px; }
.ri-hbtn {
    font-family: var(--ri-mono); font-size: 11px; letter-spacing: 0.1em;
    color: var(--ri-text-dim); text-decoration: none;
    border: 1px solid var(--ri-line); border-radius: 3px; padding: 4px 8px;
}
.ri-hbtn:hover { color: var(--ri-ember-hot); border-color: var(--ri-ember); }

.ri-scene-pick { display: flex; align-items: center; gap: 6px; }
.ri-scene-label { font-size: 9px; letter-spacing: 0.16em; color: var(--ri-text-dim); }
#ri-scene {
    font-family: var(--ri-mono); font-size: 10px; letter-spacing: 0.08em;
    color: var(--ri-text); background: var(--ri-panel);
    border: 1px solid var(--ri-line); border-radius: 3px; padding: 3px 6px;
}

/* ── Telemetry HUD ── */
.ri-hud {
    position: fixed; inset: 0; z-index: 15;
    pointer-events: none;
    opacity: 0; transition: opacity 0.6s ease;
}
.ri-hud[aria-hidden="false"] { opacity: 1; }
.ri-hud-block {
    position: absolute;
    background: var(--ri-panel);
    border: 1px solid var(--ri-line);
    border-radius: 4px; padding: 8px 12px;
    backdrop-filter: blur(2px);
    min-width: 150px;
}
.ri-hud-tl { top: calc(var(--ri-header-h) + 12px); left: 12px; }
.ri-hud-tr { top: calc(var(--ri-header-h) + 12px); right: 12px; }
.ri-hud-line {
    display: flex; justify-content: space-between; gap: 18px;
    font-size: 10px; letter-spacing: 0.08em; line-height: 1.7;
}
.ri-hud-line span { color: var(--ri-text-dim); }
.ri-hud-line b { color: var(--ri-ember-hot); font-weight: 600; }
.ri-hud-status {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    font-size: 10px; letter-spacing: 0.24em; color: var(--ri-cyan);
    border: 1px solid var(--ri-line); border-radius: 3px;
    background: var(--ri-panel); padding: 5px 14px;
}

/* ── Boot overlay ── */
.ri-boot {
    position: fixed; inset: 0; z-index: 30;
    display: flex; align-items: center; justify-content: center;
    background: #02030a; color: var(--ri-text-dim);
    font-size: 12px; letter-spacing: 0.28em;
    transition: opacity 0.8s ease;
}
.ri-boot--done { opacity: 0; pointer-events: none; }
.ri-boot--err { color: var(--ri-ember); letter-spacing: 0.12em; }

/* ── Mobile ── */
@media (max-width: 640px) {
    .ri-header-left { font-size: 9px; gap: 5px; }
    .ri-header-right { gap: 6px; }
    .ri-hud-block { min-width: 0; padding: 6px 8px; }
    .ri-hud-tl, .ri-hud-tr { top: calc(var(--ri-header-h) + 8px); }
    .ri-hud-tl { left: 6px; } .ri-hud-tr { right: 6px; }
    .ri-hud-line { gap: 8px; font-size: 9px; }
    .ri-tag { display: none; }
}
