/* The show's real face, used when installed on the device. With a licensed web copy, add url("fonts/friz-quadrata.woff2") to these src lists;
   otherwise Marcellus (closest free glyphic serif) stands in. */
@font-face { font-family: "Friz Quadrata"; src: local("Friz Quadrata"), local("Friz Quadrata Std"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Friz Quadrata"; src: local("Friz Quadrata Bold"), local("Friz Quadrata Std Bold"); font-weight: 700; font-display: swap; }
:root {
  --friz: "Friz Quadrata", "Marcellus", Georgia, serif;
  --bg: #0d0f13;
  --panel: #161a21;
  --panel2: #1e232c;
  --line: #2a303b;
  --text: #eef1f5;
  --muted: #8d96a5;
  --accent: #6f9bff;
  --green: #3fa45b;
  --yellow: #d9a520;
  --red: #c8423b;
  --skip: #3a3f48;
  --card: #000;
  --display: "Oswald", "Arial Narrow", sans-serif;
  --cardfont: "Archivo Narrow", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); }
body { min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- cold open ---------- */
.intro { position: fixed; inset: 0; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; text-align: center; z-index: 20; }
.narration { font-family: var(--friz); font-size: clamp(18px, 2.6vw, 26px); line-height: 1.55; max-width: 720px; min-height: 8em; letter-spacing: .01em; }
.narration .w { opacity: 0; transition: opacity .5s; }
.narration .w.on { opacity: 1; }
.intro .cta { margin-top: 28px; }
.cnote { color: #c9cfda; font-size: 16px; max-width: 460px; margin-top: 18px; }

/* ---------- layout ---------- */
main { max-width: 640px; margin: 0 auto; padding: 12px 16px 48px; }
.top { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding: 6px 0 12px; border-bottom: 1px solid var(--line); }
.brand { text-align: center; }
/* Logo: white chiseled serif, dark drop shadow for depth, saturated halo per line
   (blue LAW&, red ORDER, orange SPECIAL VICTIMS UNIT in the show). --g scales the halo. */
.logo { --g: 1px; margin: 0; font-family: var(--friz); font-weight: 400; line-height: .98; letter-spacing: -.01em; color: #f2f3f6; display: inline-flex; flex-direction: column; align-items: center; font-size: 28px; -webkit-text-stroke: .02em #f2f3f6; }
.logo .row { display: flex; }
.logo .l3 { display: block; }
.logo .l1 { text-shadow: calc(var(--g) * 2) calc(var(--g) * 2) 0 #1b1e25, 0 0 calc(var(--g) * 3) #4aa3ff, 0 0 calc(var(--g) * 8) #2b8cff, 0 0 calc(var(--g) * 16) #1f78ff, 0 0 calc(var(--g) * 28) rgba(25, 100, 255, .85); }
.logo .l2 { text-shadow: calc(var(--g) * 2) calc(var(--g) * 2) 0 #1b1e25, 0 0 calc(var(--g) * 3) #ff4a32, 0 0 calc(var(--g) * 8) #e8321e, 0 0 calc(var(--g) * 16) #c8200f, 0 0 calc(var(--g) * 28) rgba(190, 20, 10, .85); }
.logo .l3 { font-size: .3em; letter-spacing: .04em; margin-top: .3em; color: #f7ecd2; -webkit-text-stroke: 0; text-shadow: var(--g) var(--g) 0 #1b1e25, 0 0 calc(var(--g) * 3) #ffa040, 0 0 calc(var(--g) * 7) #ff8a1e, 0 0 calc(var(--g) * 14) rgba(240, 110, 10, .8); }
.brand .sub { color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; }
.icon { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 16px; }
.icon:hover { border-color: var(--muted); }
.logo.big { --g: 2.4px; font-size: clamp(44px, 9.5vw, 110px); margin-bottom: 36px; }

/* ---------- stat strip (Bandle's year / views / difficulty) ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 14px 0; }
.stat { flex: 1 1 0; background: var(--panel); padding: 8px 6px; text-align: center; min-width: 0; }
.stat span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.stat b { display: block; font-size: 15px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- theme player ---------- */
.player { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.play { flex: none; width: 52px; height: 52px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 20px; display: grid; place-items: center; }
.play:disabled { opacity: .5; }
.track { flex: 1; min-width: 0; }
.tlabel { font-size: 13px; color: var(--muted); margin-bottom: 7px; letter-spacing: .02em; }
.bar { height: 4px; border-radius: 2px; background: var(--panel2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; }

/* ---------- case cards (the location title cards) ---------- */
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rung { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.rung.locked { background: var(--panel); color: var(--muted); padding: 12px 14px; font-size: 13px; display: flex; justify-content: space-between; }
.tcard { background: var(--card); padding: 16px 18px 14px; font-family: var(--cardfont); }
.tcard .slug { font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #cfd6e2; }
.tcard .slug i { font-style: normal; color: var(--muted); font-weight: 600; margin-left: 8px; }
.tcard .txt { font-size: 19px; line-height: 1.4; margin-top: 6px; min-height: 1.4em; }
.tcard .lead { margin-top: 10px; padding-top: 9px; border-top: 1px dashed #2c323d; font-family: var(--body); font-size: 14px; line-height: 1.45; color: #e6d6ad; transition: opacity .5s; }
.tcard .lead span { color: var(--yellow); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-right: 4px; }
.tcard .lead.later { opacity: 0; }
.tcard .lead.solved { opacity: .45; text-decoration: line-through; text-decoration-color: rgba(230,214,173,.4); }
.tcard .caret { display: inline-block; width: .5em; background: #fff; animation: blink 1s steps(1) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }
.verdict { padding: 7px 14px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.verdict.wrong { background: rgba(200, 66, 59, .18); color: #ff9b94; }
.verdict.alt { background: rgba(217, 165, 32, .16); color: #ffd36b; }
.verdict.skip { background: var(--panel2); color: var(--muted); }
.verdict.right { background: rgba(63, 164, 91, .2); color: #8ee6a5; }

/* ---------- guessing ---------- */
.guessbox { margin-top: 14px; }
.search { position: relative; }
#guess { width: 100%; padding: 14px 16px; font-size: 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); outline: none; }
#guess:focus { border-color: var(--accent); }
.sugg { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); list-style: none; margin: 0; padding: 4px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow-y: auto; z-index: 5; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.sugg li { padding: 9px 12px; border-radius: 7px; cursor: pointer; font-size: 15px; }
.sugg li small { color: var(--muted); margin-left: 6px; }
.sugg li.sel, .sugg li:hover { background: var(--accent); color: #fff; }
.sugg li.sel small, .sugg li:hover small { color: #e3ebff; }
.btnrow { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.btnrow .grow { flex: 1; }
.verdict .plus { margin-left: auto; font-weight: 700; }
/* the main-case flash */
.flash { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,0); transition: background .3s; cursor: pointer; }
.flash.on { background: rgba(0,0,0,.82); }
.flashbox { text-align: center; transform: scale(.85); opacity: 0; transition: transform .35s cubic-bezier(.2,1.4,.4,1), opacity .25s; }
.flash.on .flashbox { transform: scale(1); opacity: 1; }
.logo.flashword { font-size: clamp(48px, 11vw, 120px); margin-bottom: 14px; }
.flashname { font-family: var(--friz); font-size: clamp(20px, 3vw, 30px); color: #f7ecd2; text-shadow: 0 0 10px rgba(255,140,30,.8); }
.flashmore { color: #c9cfda; margin-top: 14px; font-size: 15px; }
/* today's cases on the result screen */
.case .chead { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.case .ctag { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.case .cscore { margin-left: auto; color: var(--muted); }
.case.got.major { border-color: rgba(63,164,91,.6); }
.case.got.minor { border-color: rgba(217,165,32,.55); }
.case.got .cscore b { color: var(--text); }
.case.missed a { color: var(--muted); }
.case .cnote2 { margin-top: 4px; }
.verdict.major { background: rgba(63, 164, 91, .2); color: #8ee6a5; }
.verdict.minor { background: rgba(217, 165, 32, .16); color: #ffd36b; }
.grid { font-size: 20px; letter-spacing: 2px; line-height: 1.35; }
.cta { background: var(--accent); color: #fff; border: none; border-radius: 22px; padding: 11px 26px; font-weight: 700; letter-spacing: .02em; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 22px; padding: 11px 20px; color: var(--muted); }
.ghost:hover { color: var(--text); border-color: var(--muted); }
#skipNote { opacity: .7; font-size: 12px; }

/* ---------- reveal ---------- */
.result { margin-top: 18px; }
.banner { text-align: center; padding: 18px 12px 8px; }
.banner .rank { font-family: var(--friz); font-size: 30px; letter-spacing: .06em; text-transform: uppercase; }
.banner .pts { color: var(--muted); margin-top: 4px; }
.grid { font-size: 24px; letter-spacing: 3px; margin: 10px 0 4px; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.side { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.side h4 { margin: 0; padding: 10px 14px; font-family: var(--friz); letter-spacing: .12em; font-size: 14px; text-transform: uppercase; background: var(--panel2); border-bottom: 1px solid var(--line); }
.side .body { padding: 12px 14px 14px; font-size: 14px; line-height: 1.5; }
.side .name { font-weight: 700; font-size: 17px; margin-bottom: 2px; }
.side .meta { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.side img { width: 100%; max-height: 180px; object-fit: cover; display: block; border-bottom: 1px solid var(--line); }
.side a { color: var(--accent); }
.changed { margin-top: 10px; background: var(--panel); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 10px 14px; font-size: 14px; line-height: 1.5; }
.also { margin-top: 14px; }
.also h5 { margin: 0 0 8px; color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.also .item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; font-size: 14px; line-height: 1.5; }
.also .item a { color: var(--text); font-weight: 700; text-decoration: none; }
.also .item a:hover { text-decoration: underline; }
.share { display: flex; justify-content: center; margin: 18px 0 4px; }

/* ---------- dialogs ---------- */
.dialog { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 16px; z-index: 30; }
.dlg { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; max-width: 440px; width: 100%; padding: 22px; line-height: 1.5; font-size: 15px; }
.dlg h3 { margin: 0 0 12px; font-family: var(--friz); letter-spacing: .08em; text-transform: uppercase; }
.dlg .btns { display: flex; justify-content: center; margin-top: 16px; }
.toggles label { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-weight: 600; cursor: pointer; border-bottom: 1px solid var(--line); }
.toggles label:last-child { border-bottom: none; }
.toggles input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggles .sw { position: relative; width: 44px; height: 24px; border-radius: 12px; background: var(--skip); transition: background .15s; flex: none; }
.toggles .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #d9dde4; transition: left .15s; }
.toggles input:checked + .sw { background: var(--accent); }
.toggles input:checked + .sw::after { left: 23px; }
.toggles input:focus-visible + .sw { outline: 2px solid #fff; outline-offset: 3px; }

.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); background: var(--text); color: #000; padding: 9px 18px; border-radius: 20px; font-weight: 600; font-size: 14px; z-index: 40; }

@media (max-width: 560px) {
  .stat { flex: 1 1 30%; }
  .vs { grid-template-columns: 1fr; }
  .tcard .txt { font-size: 17px; }
    .brand h1 { font-size: 26px; }
}
