/* ==========================================================================
   The Sierra Archive — the retro look in VGA (html.sci)
   The SCI1 games of 1990–93: 256 colours, the SCI font, grey raised windows,
   the icon bar that slides down from the top, and no text parser.
   ========================================================================== */

/* "GloryQuest" by the12thdoctor (2008), CC BY-SA 3.0 — the SCI letters.
   One font pixel is 1/16 of the font size: at 32px every letter pixel is 2×2 screen pixels.
   Signs it doesn't have come from the AGI 8x8 font, scaled to the same pixel size. */
@font-face { font-family: "GloryQuest"; src: url("../fonts/gloryquest.woff") format("woff"), url("../fonts/gloryquest.ttf") format("truetype"); font-display: block; }
@font-face { font-family: "SCI fill"; src: url("../fonts/agi8.woff") format("woff"); size-adjust: 50%; font-display: block; }

html.sci {
  --sci-font: "GloryQuest", "SCI fill", "Courier New", monospace;
  --g0: #000000; --g1: #575757; --g2: #979797; --g3: #bbbbbb; --g4: #ebebeb; --sci-blue: #28409c; --sci-red: #8c1c28;
  --top: 0px !important;
  --mini: 52px !important;
  --pbar: 0px;
  color-scheme: dark;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='26' shape-rendering='crispEdges'%3E%3Crect x='0' y='0' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='2' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='2' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='4' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='4' width='2' height='2' fill='%23fff'/%3E%3Crect x='4' y='4' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='6' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='6' width='2' height='2' fill='%23fff'/%3E%3Crect x='4' y='6' width='2' height='2' fill='%23fff'/%3E%3Crect x='6' y='6' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='8' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='8' width='2' height='2' fill='%23fff'/%3E%3Crect x='4' y='8' width='2' height='2' fill='%23fff'/%3E%3Crect x='6' y='8' width='2' height='2' fill='%23fff'/%3E%3Crect x='8' y='8' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='10' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='10' width='2' height='2' fill='%23fff'/%3E%3Crect x='4' y='10' width='2' height='2' fill='%23fff'/%3E%3Crect x='6' y='10' width='2' height='2' fill='%23fff'/%3E%3Crect x='8' y='10' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='10' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='12' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='4' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='6' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='8' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='12' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='14' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='4' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='6' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='8' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='14' y='14' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='16' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='4' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='6' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='8' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='16' width='2' height='2' fill='%23000'/%3E%3Crect x='12' y='16' width='2' height='2' fill='%23000'/%3E%3Crect x='14' y='16' width='2' height='2' fill='%23000'/%3E%3Crect x='16' y='16' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='18' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='18' width='2' height='2' fill='%23fff'/%3E%3Crect x='4' y='18' width='2' height='2' fill='%23000'/%3E%3Crect x='6' y='18' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='18' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='18' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='20' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='20' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='20' width='2' height='2' fill='%23000'/%3E%3Crect x='10' y='20' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='20' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='22' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='22' width='2' height='2' fill='%23000'/%3E%3Crect x='10' y='22' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='22' width='2' height='2' fill='%23000'/%3E%3Crect x='10' y='24' width='2' height='2' fill='%23000'/%3E%3Crect x='12' y='24' width='2' height='2' fill='%23000'/%3E%3C/svg%3E") 1 1, default;
}
html.sci, html.sci[data-era] { --bg: #000 !important; --ink: #fff !important; --acc: #fff0a0 !important; --muted: #c8c8d8; --line: #6a6a7a; --faint: #3a3a4a; --panel: #000; --card: #333; --scan: 0; }
html.sci a, html.sci button, html.sci [role="button"], html.sci .tl-card, html.sci .era-seg, html.sci label, html.sci select,
html.sci input[type="range"], html.sci .zoomable, html.sci .yt-play { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='26' shape-rendering='crispEdges'%3E%3Crect x='8' y='0' width='2' height='2' fill='%23000'/%3E%3Crect x='10' y='0' width='2' height='2' fill='%23000'/%3E%3Crect x='6' y='2' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='2' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='2' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='2' width='2' height='2' fill='%23000'/%3E%3Crect x='6' y='4' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='4' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='4' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='4' width='2' height='2' fill='%23000'/%3E%3Crect x='6' y='6' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='6' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='6' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='6' width='2' height='2' fill='%23000'/%3E%3Crect x='14' y='6' width='2' height='2' fill='%23000'/%3E%3Crect x='16' y='6' width='2' height='2' fill='%23000'/%3E%3Crect x='6' y='8' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='8' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='8' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='8' width='2' height='2' fill='%23000'/%3E%3Crect x='14' y='8' width='2' height='2' fill='%23fff'/%3E%3Crect x='16' y='8' width='2' height='2' fill='%23fff'/%3E%3Crect x='18' y='8' width='2' height='2' fill='%23000'/%3E%3Crect x='20' y='8' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='10' width='2' height='2' fill='%23000'/%3E%3Crect x='4' y='10' width='2' height='2' fill='%23000'/%3E%3Crect x='6' y='10' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='10' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='10' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='10' width='2' height='2' fill='%23000'/%3E%3Crect x='14' y='10' width='2' height='2' fill='%23fff'/%3E%3Crect x='16' y='10' width='2' height='2' fill='%23fff'/%3E%3Crect x='18' y='10' width='2' height='2' fill='%23000'/%3E%3Crect x='20' y='10' width='2' height='2' fill='%23fff'/%3E%3Crect x='22' y='10' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='12' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='4' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='6' y='12' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='14' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='16' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='18' y='12' width='2' height='2' fill='%23000'/%3E%3Crect x='20' y='12' width='2' height='2' fill='%23fff'/%3E%3Crect x='22' y='12' width='2' height='2' fill='%23000'/%3E%3Crect x='0' y='14' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='4' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='6' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='8' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='14' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='16' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='18' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='20' y='14' width='2' height='2' fill='%23fff'/%3E%3Crect x='22' y='14' width='2' height='2' fill='%23000'/%3E%3Crect x='2' y='16' width='2' height='2' fill='%23000'/%3E%3Crect x='4' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='6' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='8' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='14' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='16' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='18' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='20' y='16' width='2' height='2' fill='%23fff'/%3E%3Crect x='22' y='16' width='2' height='2' fill='%23000'/%3E%3Crect x='4' y='18' width='2' height='2' fill='%23000'/%3E%3Crect x='6' y='18' width='2' height='2' fill='%23fff'/%3E%3Crect x='8' y='18' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='18' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='18' width='2' height='2' fill='%23fff'/%3E%3Crect x='14' y='18' width='2' height='2' fill='%23fff'/%3E%3Crect x='16' y='18' width='2' height='2' fill='%23fff'/%3E%3Crect x='18' y='18' width='2' height='2' fill='%23fff'/%3E%3Crect x='20' y='18' width='2' height='2' fill='%23000'/%3E%3Crect x='6' y='20' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='20' width='2' height='2' fill='%23fff'/%3E%3Crect x='10' y='20' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='20' width='2' height='2' fill='%23fff'/%3E%3Crect x='14' y='20' width='2' height='2' fill='%23fff'/%3E%3Crect x='16' y='20' width='2' height='2' fill='%23fff'/%3E%3Crect x='18' y='20' width='2' height='2' fill='%23fff'/%3E%3Crect x='20' y='20' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='22' width='2' height='2' fill='%23000'/%3E%3Crect x='10' y='22' width='2' height='2' fill='%23fff'/%3E%3Crect x='12' y='22' width='2' height='2' fill='%23fff'/%3E%3Crect x='14' y='22' width='2' height='2' fill='%23fff'/%3E%3Crect x='16' y='22' width='2' height='2' fill='%23fff'/%3E%3Crect x='18' y='22' width='2' height='2' fill='%23000'/%3E%3Crect x='8' y='24' width='2' height='2' fill='%23000'/%3E%3Crect x='10' y='24' width='2' height='2' fill='%23000'/%3E%3Crect x='12' y='24' width='2' height='2' fill='%23000'/%3E%3Crect x='14' y='24' width='2' height='2' fill='%23000'/%3E%3Crect x='16' y='24' width='2' height='2' fill='%23000'/%3E%3Crect x='18' y='24' width='2' height='2' fill='%23000'/%3E%3C/svg%3E") 9 1, pointer; }
html.sci input[type="text"], html.sci input[type="search"], html.sci textarea { cursor: text; }

/* ---------- letters, corners, effects ---------- */
html.sci body, html.sci body *, html.sci body *::before, html.sci body *::after {
  font-family: var(--sci-font) !important; font-size: 32px !important; font-weight: 400 !important; font-style: normal !important;
  letter-spacing: 0 !important; line-height: 24px !important; text-shadow: none !important;
  border-radius: 0 !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  -webkit-font-smoothing: none; text-transform: none !important;
}
html.sci body { background: #000; color: #fff; }
html.sci ::selection { background: var(--sci-blue); color: #fff; }
html.sci :focus-visible { outline: 2px dotted #fff; outline-offset: 2px; }
html.sci img.agi-px { image-rendering: pixelated; }
html.sci .logomark img, html.sci .era-logo { image-rendering: pixelated; }
html.sci kbd { border: 0; background: none; padding: 0; }
html.sci :is(.hero-title, .lb-title, .list-title, .feed-era h2, .ck-stat-n, .sci-big, .agi-title) { font-size: 64px !important; line-height: 48px !important; }
html.sci .checklist .lb-title { font-size: 64px !important; }
html.sci .prose, html.sci .prose * { line-height: 28px !important; }
html.sci .tk-label:not(.major) { font-size: 16px !important; line-height: 12px !important; }

/* what the modern look has, the SCI look leaves out */
html.sci .backdrop, html.sci .tb-logo, html.sci .px-grid, html.sci .fx-scan, html.sci .lb-ambient, html.sci .tl-card .tint { display: none !important; }

/* the painted VGA panorama behind the timeline (parallax, dimmed over the timeline itself) */
html.sci .stage > .scene {
  display: block; will-change: background-position; position: absolute; left: 0; right: 0; top: 0; bottom: var(--mini); pointer-events: none;
  background:
    var(--agi-scene-vga, none) repeat-x;
  background-size: auto 100%; background-position: var(--agi-px, 0px) 100%;
  image-rendering: pixelated;
}

/* ==========================================================================
   GREY WINDOWS — raised, with a thin groove inside
   ========================================================================== */
html.sci :is(.hero-main, .story-card, .otd, .news, .lb-frame, .tip, .era-card, .parser, .parser-results, .wl-dialog, .end-card, .sci-win, .filters, .zoombar) {
  --ink: #000; --muted: #3c3c4c; --acc: var(--sci-red); --acc2: var(--sci-blue); --line: #575757; --faint: #979797; --panel: #bbbbbb; --card: #979797; --bg2: #bbbbbb;
  background: var(--g3) !important; color: #000;
  border: 3px solid; border-color: var(--g4) var(--g1) var(--g1) var(--g4) !important;
  box-shadow: 0 0 0 1px #000, 8px 8px 0 1px rgba(0, 0, 0, .5) !important;
}
html.sci :is(.hero-main, .story-card, .otd, .news, .lb-frame, .tip, .era-card, .parser-results, .wl-dialog, .end-card, .sci-win)::after {
  content: ""; position: absolute; inset: 4px; z-index: 30; pointer-events: none; border: 1px solid var(--g2);
}
html.sci :is(.hero-main, .story-card, .otd, .news) { position: relative; }

/* buttons: raised grey; pressed = sunken */
html.sci :is(.btn, .sci-btn, .agi-btn, .iconbtn, .pill, .fchip, .chip-link, .tag, .lb-step, .ed-tab, .zbtn, .lb-sections a) {
  background: var(--g3); color: #000; border: 2px solid; border-color: var(--g4) var(--g1) var(--g1) var(--g4) !important;
  box-shadow: 0 0 0 1px #000 !important; padding: 4px 14px; transform: none !important; text-decoration: none;
}
html.sci :is(.btn, .sci-btn, .agi-btn, .iconbtn, .pill, .fchip, .chip-link, .tag, .lb-step, .ed-tab, .zbtn, .lb-sections a):hover { background: #c8c8c8; color: #000; }
html.sci :is(.btn, .sci-btn, .agi-btn, .iconbtn, .pill, .fchip, .chip-link, .lb-step, .zbtn, .lb-sections a):active,
html.sci :is(.pill, .fchip)[aria-pressed="true"], html.sci .ed-tab[aria-selected="true"], html.sci .lb-sections a.on {
  border-color: var(--g1) var(--g4) var(--g4) var(--g1) !important; background: #a8a8a8; color: #000;
}
html.sci .iconbtn { width: 34px; height: 34px; padding: 0 !important; display: inline-grid !important; place-items: center; line-height: 0 !important; font-size: 0 !important; }
html.sci .iconbtn svg.ico { width: 16px; height: 16px; display: block; margin: 0; }
html.sci .tag-ph { background: #f0d860; }
html.sci .chip { background: transparent; border: 1px solid var(--g2); padding: 0 6px; }
html.sci .badge { background: var(--sci-red); color: #fff; }
html.sci .meter { height: 12px; background: #fff; border: 2px solid; border-color: var(--g1) var(--g4) var(--g4) var(--g1); }
html.sci .meter::after { background: var(--sci-blue); }
html.sci input, html.sci select, html.sci textarea { background: #fff; color: #000; border: 2px solid; border-color: var(--g1) var(--g4) var(--g4) var(--g1) !important; }

/* ==========================================================================
   NO STATUS LINE, NO PARSER — the icon bar does the work
   ========================================================================== */
html.sci .topbar { height: 0; padding: 0; border: 0; background: none; overflow: visible; }
html.sci.sci-search .topbar { z-index: 311; }
html.sci .topbar > :not(.parser) { display: none !important; }
html.sci .parser { display: none; }
html.sci.sci-search .parser {
  display: flex; flex-wrap: wrap; position: fixed; z-index: 310; left: 50%; top: 18vh; transform: translateX(-50%);
  width: min(720px, calc(100vw - 24px)); height: auto; max-width: none; margin: 0; padding: 48px 18px 16px;
}
html.sci.sci-search .parser::before { content: "What would you like to look at?"; position: absolute; left: 18px; top: 14px; color: #000; }
html.sci .parser-prompt { display: none; }
html.sci .parser input { flex: 1 1 100%; height: 36px; padding: 4px 10px; background: #fff; color: #000; caret-color: #000; }
html.sci .parser input::placeholder { color: #8a8a8a; }
html.sci .parser-caret { display: none !important; }
html.sci .sci-search-x { display: none; }
html.sci.sci-search .sci-search-x { display: block; margin: 12px 0 0 auto; }
html.sci .sci-search-x { background: var(--g3); color: #000; border: 2px solid; border-color: var(--g4) var(--g1) var(--g1) var(--g4); box-shadow: 0 0 0 1px #000; padding: 4px 18px; }
.sci-search-x { display: none; }
.sci-search-dim { display: none; }
html.sci.sci-search .sci-search-dim { display: block; position: fixed; inset: 0; z-index: 305; background: rgba(0, 0, 0, .55); }
html.sci .parser-results { position: absolute; top: calc(100% + 10px); bottom: auto; left: -3px; right: -3px; width: auto; max-height: 52vh; padding: 12px; }
html.sci .pr-msg { color: #000; }
html.sci .pr-item { padding: 6px 8px; }
html.sci .pr-item[aria-selected="true"], html.sci .pr-item:hover { background: var(--sci-blue); color: #fff; }
html.sci .pr-item[aria-selected="true"] :is(.pr-meta, .pr-snip), html.sci .pr-item:hover :is(.pr-meta, .pr-snip) { color: #dde; }
html.sci .pr-meta { color: var(--sci-blue); }
html.sci .pr-thumb { border: 1px solid #000; background: var(--g2); }
html.sci .pr-head { border-top: 1px solid var(--g1); color: var(--sci-red); }
html.sci .pr-snip mark { background: #f0d860; color: #000; }
html.sci .stage { top: 0; bottom: 0; }

/* the strip at the very top, and the icon bar */
.sci-strip, .sci-bar { display: none; }
html.sci .sci-strip { display: block; position: fixed; left: 0; right: 0; top: 0; height: 6px; z-index: 290; background: var(--g3); border-bottom: 1px solid #000; opacity: .85; }
html.sci .sci-bar {
  display: flex; align-items: center; gap: 4px; position: fixed; left: 0; right: 0; top: 0; z-index: 300; height: 52px; padding: 4px 8px;
  background: var(--g3); border: 3px solid; border-color: var(--g4) var(--g1) var(--g1) var(--g4); box-shadow: 0 1px 0 #000, 0 8px 0 rgba(0, 0, 0, .4);
  transform: translateY(-110%); transition: transform .18s steps(4);
}
html.sci .sci-bar.open { transform: none; }
.sci-ico { width: 60px; height: 40px; display: grid; place-items: center; padding: 0; background: var(--g3); border: 2px solid; border-color: var(--g4) var(--g1) var(--g1) var(--g4); box-shadow: 0 0 0 1px #000; }
.sci-ico:hover, .sci-ico:focus-visible { background: #c8c8c8; outline: none; }
.sci-ico:active { border-color: var(--g1) var(--g4) var(--g4) var(--g1); }
.sci-ico svg { width: 24px; height: 24px; fill: currentColor; }
.sci-score { margin-left: auto; padding-right: 12px; color: #000; white-space: nowrap; }

/* dialogs */
.sci-dlg { position: fixed; inset: 0; z-index: 320; display: grid; place-items: center; padding: 16px; }
.sci-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
html.sci .sci-win { position: relative; max-width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px 26px 18px; outline: none; }
html.sci .sci-win.sci-small { width: min(560px, 100%); }
html.sci .sci-win.sci-wide { width: min(980px, 100%); max-width: min(980px, 100%); }
html.sci .sci-win.sci-cpwin { width: min(760px, 100%); }
.sci-h { margin: 0 0 14px; color: #000; text-align: center; }
.sci-sub { margin: -6px 0 14px; color: #3c3c4c; text-align: center; }
.sci-msg { color: #000; }
.sci-msg small { color: #3c3c4c; }
.sci-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin: 18px 0 0; }
.sci-sp { flex: 1; }
.sci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.sci-btn { min-width: 80px; }
/* inventory */
.sci-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; padding: 12px; max-height: 46vh; overflow: auto;
  background: #141420; border: 2px solid; border-color: var(--g1) var(--g4) var(--g4) var(--g1); }
.sci-it { aspect-ratio: 3 / 4; padding: 0; border: 2px solid transparent; background: #2a2a38; display: grid; place-items: center; color: #fff; overflow: hidden; }
.sci-it img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .38; filter: grayscale(.5); }
.sci-it.is-own img { opacity: 1; filter: none; }
.sci-it.sel, .sci-it:focus-visible { border-color: #fff; outline: none; }
.sci-sel { margin: 12px 0 0; color: #000; min-height: 24px; }
/* control panel */
.sci-cp { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: start; }
.sci-cp-btns { display: grid; gap: 10px; }
.sci-cp-sliders { display: grid; gap: 18px; }
.sci-cp-sliders label { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; color: #000; }
.sci-cp-sliders output { color: var(--sci-blue); }
.sci-cp-sliders input[type="range"] { grid-column: 1 / -1; width: 100%; height: 26px; -webkit-appearance: none; appearance: none; background: #3c3c4c;
  border: 2px solid; border-color: var(--g1) var(--g4) var(--g4) var(--g1) !important; padding: 0; }
.sci-cp-sliders input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 22px; background: var(--g3); border: 2px solid; border-color: var(--g4) var(--g1) var(--g1) var(--g4); box-shadow: 0 0 0 1px #000; }
.sci-cp-sliders input[type="range"]::-moz-range-thumb { width: 30px; height: 18px; background: var(--g3); border: 2px solid; border-color: var(--g4) var(--g1) var(--g1) var(--g4); border-radius: 0; box-shadow: 0 0 0 1px #000; }
@media (max-width: 600px) { .sci-cp { grid-template-columns: 1fr; } }
html:not(.sci) .sci-dlg, html:not(.sci) .sci-bar, html:not(.sci) .sci-strip { display: none !important; }

/* ==========================================================================
   FRONT PAGE, TIMELINE, HOVER CARDS
   ========================================================================== */
html.sci .hero-card { padding-top: 40px; }
html.sci .hero-main { padding: 26px 30px 24px; }
html.sci .hero-title { background: none; -webkit-text-fill-color: currentColor; color: #000; margin-bottom: 14px; }
html.sci .hero-tagline { color: var(--sci-red); }
html.sci .hero-intro, html.sci .hero-stats strong { color: #000; }
html.sci .hero-stats, html.sci .hero-hint { color: #3c3c4c; }
html.sci .hero-side { gap: 26px; padding-top: 0; }
html.sci .story-card { padding: 22px 24px 20px; transform: none !important; }
html.sci .story-kicker, html.sci .otd h2 { color: var(--sci-blue); }
html.sci .story-title, html.sci .story-excerpt, html.sci .otd a { color: #000; }
html.sci .story-excerpt { -webkit-mask-image: none; mask-image: none; -webkit-line-clamp: 5; }
html.sci .story-more, html.sci .otd-year { color: var(--sci-red); }
html.sci .otd { padding: 20px 24px; }
html.sci .otd a:hover { background: var(--sci-blue); color: #fff; }
html.sci .end-card { padding: 26px 30px; color: #000; }
html.sci .end-pixel { color: var(--sci-red); }
html.sci .feed .end-card { position: relative !important; margin: 40px auto; max-width: 560px; padding: 26px 30px !important; }

html.sci .bigyear { color: #fff; opacity: .3; }
html.sci .bigyear .yr { font-family: GloryQuest, serif !important; font-size: 576px !important; line-height: .62 !important; }   /* 576 px = exactly 36 screen pixels per font pixel */
@media (max-height: 760px) { html.sci .bigyear .yr { font-size: 288px !important; } }

html.sci .era-seg { top: 8px; height: 28px; border: 2px solid; border-color: rgba(255, 255, 255, .55) rgba(0, 0, 0, .55) rgba(0, 0, 0, .55) rgba(255, 255, 255, .55);
  background: color-mix(in srgb, var(--ec) 75%, #000); color: #fff; }
html.sci .era-label { line-height: 24px !important; padding: 0 10px; }
html.sci .tl-trackline { height: 1px; background: rgba(255, 255, 255, .25); }
html.sci .tl-tracklabel { color: #d8d8e8; margin-left: 40px; }
html.sci .tk { background: rgba(255, 255, 255, .25); }
html.sci .tk-label { color: #c8c8d8; margin-top: -6px; }
html.sci .tk-label.major { color: #fff; }
html.sci .tl-card { background: #333; box-shadow: 0 0 0 1px #000, 4px 4px 0 1px rgba(0, 0, 0, .55); }
html.sci .tl-card:hover, html.sci .tl-card:focus-visible, html.sci .tl-card.hl { box-shadow: 0 0 0 1px #000, 0 0 0 3px #fff, 6px 6px 0 3px rgba(0, 0, 0, .55); outline: none; }
html.sci .own { width: 20px; height: 20px; background: #2a9c4c; color: #fff; box-shadow: 0 0 0 1px #000; }
html.sci .own svg { width: 16px !important; height: 16px !important; }
html.sci .tl-card.mini .own, html.sci .tl-card.ghost .own { width: 12px; height: 12px; }
html.sci .tl-card.mini .own svg, html.sci .tl-card.ghost .own svg { width: 8px !important; height: 8px !important; }
html.sci .tl-card.ph::before { background: #f0d860; box-shadow: 0 0 0 1px #000; }
html.sci .tl-more { border: 2px dashed #c8c8d8; background: rgba(0, 0, 0, .6); color: #fff; }
html.sci .zoombar { bottom: calc(var(--mini) + 12px); padding: 3px; gap: 3px; border-width: 2px !important; }
html.sci .zbtn { height: 32px; width: 40px; padding: 0; }
html.sci .zbtn.zfit { width: auto; min-width: 64px; padding: 0 10px; }
html.sci .minimap { background: #000; border-top: 1px solid #575757; }
html.sci .tip { width: 520px; padding: 18px; grid-template-columns: 76px 1fr; transition: none; translate: none; }
html.sci .tip > * { min-width: 0; }
html.sci .tip-img { width: 76px; height: 96px; border: 1px solid #000; background: var(--g2); }
html.sci .tip h3 { color: #000; }
html.sci .tip :is(.tip-sub, .tip-meta, .tip-mf) { color: #3c3c4c; }
html.sci .tip .tip-date { color: var(--sci-red); }
html.sci .tip .tip-sum { color: #000; }
html.sci .tip .tip-kind { color: var(--sci-blue); }
html.sci .tip-own { color: #1e7c3c; }
html.sci .era-card { padding: 16px 44px 16px 18px; }
html.sci .era-years { color: var(--sci-red); }
html.sci .era-name, html.sci .era-text, html.sci .era-hide { color: #000; }
html.sci .filters { top: 0; }
html.sci .fgroup h3 { color: var(--sci-red); }
html.sci .fchip .n { color: inherit; opacity: .7; margin-left: 2px; }
/* the count in brackets, "Titles (63)", so it doesn't run into the name */
html.sci .fchip .n::before { content: "("; } html.sci .fchip .n::after { content: ")"; }

/* list view */
html.sci .feed { background: #000; }
html.sci .feed-yh { background: #000; }
html.sci .feed-yh svg { color: #fff0a0; }
html.sci .feed-card { color: #fff; }
html.sci .feed-card .fc-img { box-shadow: 0 0 0 1px #000, 4px 4px 0 1px rgba(255, 255, 255, .12); transform: none !important; }
html.sci .feed-card:hover .fc-img { box-shadow: 0 0 0 3px #fff; }
html.sci .feed-card .fc-meta, html.sci .feed-era p, html.sci .feed-yh small { color: #c8c8d8; }
html.sci .feed-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */
html.sci .lb-backdrop, html.sci .wl-backdrop { background: rgba(0, 0, 0, .6); animation: none; }
html.sci .wl-backdrop { background: rgba(0, 0, 0, .82); }
html.sci .lb-frame { animation: none; }
html.sci .lb-dialog, html.sci .lb-dialog.tinted { background: var(--g3) !important; clip-path: none; scrollbar-color: var(--g1) var(--g2); }
html.sci .lb-content.swap { animation: none; }
html.sci .lb-top, html.sci .lb-dialog.tinted .lb-top { background: var(--g3) !important; padding: 16px 20px 8px; }
html.sci .lb-sections, html.sci .lb-dialog.tinted .lb-sections { top: 60px; background: var(--g3) !important; border: 0; margin: 0 8px 8px; padding: 6px 10px; gap: 8px; }
html.sci .lb-sections a { padding: 2px 12px; }
html.sci .lb-hero { padding: 10px 32px 26px; }
html.sci .lb-cover { border: 1px solid #000; background: var(--g2); box-shadow: 6px 6px 0 rgba(0, 0, 0, .35); transform: none !important; }
html.sci :is(.kicker, .ed-current, .ed-notes-title, .sec-title) { color: var(--sci-blue); }
html.sci .lb-title { color: #000; }
html.sci .lb-subtitle { color: var(--sci-red); }
html.sci .facts, html.sci .ed-notes-box, html.sci .lb-sec + .lb-sec, html.sci .lb-foot { border-top: 1px solid var(--g1); }
html.sci .facts dt, html.sci h3.sub, html.sci .ed-meta, html.sci .photo-cap, html.sci .card-meta, html.sci .credits small { color: #3c3c4c; }
html.sci .facts dd, html.sci .facts dd a, html.sci .lb-summary, html.sci .ed-notes.prose, html.sci .prose, html.sci .completeness, html.sci .completeness strong { color: #000; }
html.sci .lb-dialog a:not(.btn):not(.chip-link):not(.tag):not(.card):not(.lb-step):not(.iconbtn):not(.ck-name):not(.ck-ed) { color: var(--sci-blue); }
html.sci .lb-sections a { color: #000 !important; }
html.sci .sec-title::after { height: 1px; background: var(--g1); }
html.sci .prose h2, html.sci .prose h3, html.sci .prose h4 { color: var(--sci-red); }
html.sci .prose blockquote { border-left: 4px solid var(--sci-red); color: #000; }
html.sci .prose hr { height: 1px; background: var(--g1); }
html.sci .prose img, html.sci .prose .md-figure img { border: 1px solid #000; box-shadow: 6px 6px 0 rgba(0, 0, 0, .3); }
html.sci .story > p:first-of-type:not(:has(> em:only-child))::first-letter {
  float: left; font-size: 96px !important; line-height: 72px !important; margin: 4px 10px 0 0; padding: 0; color: var(--sci-red);
}
html.sci .inside-box { border: 2px solid var(--sci-blue); background: none; }
html.sci .inside-label { color: var(--sci-blue); }
html.sci .ed-thumb, html.sci .card-img, html.sci :is(.shot, .photo), html.sci .avatar { border: 1px solid #000; background: var(--g2); box-shadow: 4px 4px 0 rgba(0, 0, 0, .3); transform: none !important; }
html.sci .photo-cap { background: rgba(0, 0, 0, .7); color: #fff; padding: 2px 6px; }
html.sci .item { border: 1px solid var(--g1); background: #c4c4c4; box-shadow: none; }
html.sci .item-head h3, html.sci .item-details dd { color: #000; }
html.sci .yt { border: 1px solid #000; }
html.sci .yt-icon { background: var(--sci-red); box-shadow: none; }
html.sci .credits { display: flex; flex-wrap: wrap; gap: 10px; }
html.sci .credits li { flex: 0 0 auto; max-width: 100%; }
html.sci .lb-dialog .credits a { color: #000 !important; background: var(--g3); border: 2px solid; border-color: var(--g4) var(--g1) var(--g1) var(--g4); box-shadow: 0 0 0 1px #000; padding: 6px 14px 6px 6px; }
html.sci .credits strong, html.sci .credits small { white-space: nowrap; }
html.sci .tag { padding: 0 10px; }

/* the full checklist (from the inventory's Checklist button) */
html.sci .ck-intro, html.sci .ck-stat-l, html.sci .ck-stat-n small, html.sci .ck-sub, html.sci .ck-meta { color: #3c3c4c; }
html.sci .ck-stats li { background: #c4c4c4; border: 1px solid var(--g1); }
html.sci .ck-stat-n { color: #000; }
html.sci .ck-tools { background: var(--g3); border-bottom: 1px solid var(--g1); }
html.sci .ck-year-h { color: var(--sci-red); }
html.sci .ck-title { border-bottom: 1px solid var(--g2); }
html.sci .lb-dialog a.ck-name, html.sci .lb-dialog a.ck-ed { color: #000; text-decoration: none; }
html.sci .ck-row[data-own="0"] :is(.ck-name, .ck-ed) { color: #5a5a6a !important; }
html.sci .ck-mark { width: 16px; height: 16px; background: #fff; border: 2px solid; border-color: var(--g1) var(--g4) var(--g4) var(--g1); }
html.sci .ck-mark.on { background: var(--sci-blue); }
html.sci .ck-mark svg { color: #fff; }

/* the quiz keeps its own black AGI screen inside the grey window */
html.sci .qz-screen { border: 1px solid #000; }
html.sci .agi-title { font-size: 32px !important; line-height: 24px !important; }

/* welcome window, reader and viewer */
html.sci .wl-dialog { padding: 0 40px 34px; animation: none; }
html.sci .wl-dialog .prose { color: #000; }
html.sci .wl-looks-label { color: #3c3c4c; }
html.sci :is(.rd-bar, .v-bar) { background: var(--g3); color: #000; border: 0; border-bottom: 1px solid #000; --ink: #000; --panel: var(--g3); }
html.sci .rd-title, html.sci .v-caption { color: #000; }
html.sci .reader, html.sci .viewer { background: #000; }

/* ==========================================================================
   PHONES
   ========================================================================== */
@media (max-width: 860px) {
  html.sci body, html.sci body * { font-size: 32px !important; }
  html.sci :is(.hero-title, .lb-title, .feed-era h2, .sci-big) { font-size: 48px !important; line-height: 40px !important; }
  html.sci .sci-ico { width: 40px; }
  html.sci .sci-score { display: none; }
  html.sci .lb-hero { padding: 10px 18px 20px; }
  html.sci .lb-body { padding: 4px 18px 24px; }
  html.sci .tip { width: calc(100vw - 24px); }
}
html.sci .bigyear.away { opacity: 0; }
/* the admin's own icon pictures (Admin → Looks → VGA) */
.sci-ico img { max-width: min(56px, 100%); max-height: 36px; image-rendering: pixelated; pointer-events: none; }   /* own icons: shown at their own size, never wider than the button */
/* title on missing-cover artwork: the SCI letters at 1:1 pixels */
html.sci .tl-card .miss-t { font-size: 16px !important; line-height: 13px !important; color: #fff; text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000; }
html.sci .tl-card .noimg, html.sci .tl-card .noimg * { font-size: 16px !important; line-height: 13px !important; overflow-wrap: anywhere; }

/* landing page News block */
html.sci .news { padding: 20px 24px; }
html.sci .news h2 { color: var(--sci-blue); }
html.sci .news a, html.sci .news .news-t, html.sci .news .news-x { color: #000; }
html.sci .news-date, html.sci .news a.news-all { color: var(--sci-red); }
html.sci .news a:hover .news-t { background: var(--sci-blue); color: #fff; }
