/* LiquidAI's anatomy, the jev-decision-index skin: paper surfaces, 2 px ink borders, hard offset
   shadows, a Chewy display face with a yellow mark, mono labels. Colours are tokens only. */
:root {
  --bg: #E9E6DD; --surface: #FBF8F1; --paper: #FFF1C6; --ink: #232323; --soft: #55524B; --muted: #8C8C8C;
  --line: #D8D3C8; --edge: #232323; --yellow: #FFD21E; --blue: #3B7CF6; --orange: #FF9D00; --red: #EF3E36;
  --purple: #A855F7; --green: #3E8E5E; --dark: #0a0a0a;
  --display: "Chewy", "Source Sans 3", cursive; --body: "Source Sans 3", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 14px; --shadow: 4px 4px 0 var(--edge); --shadow-sm: 2px 2px 0 var(--edge);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1A17; --surface: #26241F; --paper: #3A3320; --ink: #F3EFE6; --soft: #C9C3B6; --muted: #8C8C8C; --line: #3D3A33; --edge: #0b0b0b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { --bg: #1B1A17; --surface: #26241F; --paper: #3A3320; --ink: #F3EFE6; --soft: #C9C3B6; --muted: #8C8C8C; --line: #3D3A33; --edge: #0b0b0b; color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; height: 58px; display: flex; align-items: center; gap: 16px; padding: 0 28px; border-bottom: 2px solid var(--edge); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.logo { display: inline-flex; color: var(--ink); }
.logo .mark { width: 36px; height: 36px; display: block; border-radius: 9px; border: 2px solid var(--edge); box-shadow: var(--shadow-sm); background: #0b1a33; }
.topbar .sep { width: 1px; height: 22px; background: var(--line); }
.topbar .product, .topbar .title { font: 400 22px/1 var(--display); letter-spacing: .01em; }
.back { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--edge); background: var(--surface); font: 500 12px var(--mono); box-shadow: var(--shadow-sm); }
.back:hover { background: var(--yellow); }
.topbar .tag { font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.pill { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--edge); background: var(--surface); font: 11px/1 var(--mono); color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: var(--shadow-sm); }
.pill > span { overflow: hidden; text-overflow: ellipsis; }
.pill i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line); border: 1.5px solid var(--edge); }
.pill.live i { background: var(--yellow); box-shadow: 0 0 0 3px #FFD21E55; }
.pill.live { color: var(--ink); }

/* hero and menu */
.hero { position: relative; padding: 64px 24px 36px; text-align: center; overflow: hidden; }
.hero .glow { position: absolute; left: 50%; top: -220px; width: 720px; height: 520px; transform: translateX(-50%); border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #FFD21E33, #FFD21E00 65%); }
.eyebrow { position: relative; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.hero h1 { position: relative; margin: 18px 0 14px; font: 400 clamp(44px, 7vw, 82px)/1 var(--display); }
.hero h1 mark { background: var(--yellow); color: #232323; padding: 0 .12em; border-radius: 6px; }
.hero p { position: relative; max-width: 680px; margin: 0 auto; color: var(--soft); font-size: 17px; line-height: 1.6; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; margin-top: 20px; position: relative; }
.menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 18px; max-width: 1360px; margin: 0 auto; padding: 8px 28px 48px; }
.card { display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; border-radius: var(--radius); border: 2px solid var(--edge); background: var(--surface); box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--edge); }
.card .thumb { aspect-ratio: 16 / 10; background: var(--paper); border-bottom: 2px solid var(--edge); }
.card .thumb svg { width: 100%; height: 100%; display: block; }
.card .body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.card .name { font: 400 22px/1.15 var(--display); }
.card .blurb { color: var(--soft); font-size: 14px; line-height: 1.5; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tags span { font: 500 9.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); padding: 5px 7px; border-radius: 5px; border: 1.5px solid var(--line); }
.tags span.cap { color: #232323; background: var(--yellow); border-color: var(--edge); }
.foot { max-width: 1360px; margin: 0 auto; padding: 0 28px 40px; color: var(--muted); font: 11px/1.6 var(--mono); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Decision Lab */
.lab { max-width: 1360px; margin: 0 auto; padding: 8px 28px 40px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 16px; flex-wrap: wrap; }
h2 { font: 400 30px/1.1 var(--display); margin: 0; }
.head p { margin: 0; font-size: 15px; color: var(--soft); max-width: 620px; }
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 2px solid var(--edge); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); text-align: left; display: flex; flex-direction: column; gap: 6px; }
.tile:hover { background: var(--paper); }
.tile b { font: 400 22px/1.1 var(--display); }
.tile span { font: 11px var(--mono); color: var(--soft); letter-spacing: .04em; }
.tile small { color: var(--soft); font-size: 13px; line-height: 1.4; }
.tile.key { background: var(--yellow); color: #232323; }
.tile.key span, .tile.key small { color: #6b5a09; }
.board { margin-top: 18px; background: var(--surface); border: 2px solid var(--edge); border-radius: 14px; box-shadow: 6px 6px 0 var(--edge); padding: 18px 22px; display: grid; gap: 12px; }
.board pre { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--paper); border: 1.5px solid var(--line); font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.picks label { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--edge); border-radius: 999px; padding: 6px 12px; background: var(--surface); font: 13px var(--mono); cursor: pointer; box-shadow: var(--shadow-sm); }
.picks label:has(input:checked) { background: var(--yellow); color: #232323; }
.picks input { accent-color: var(--ink); }
.scoreline { font: 12px var(--mono); color: var(--soft); }
.verdict { font: 400 24px/1.2 var(--display); }
.verdict .ok { color: var(--green); } .verdict .miss { color: var(--red); }

/* play screen */
.play { padding: 20px 28px 28px; max-width: 1500px; margin: 0 auto; }
.stage { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 960px) { .stage { grid-template-columns: 1fr; } }
.view { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--dark); border: 2px solid var(--edge); box-shadow: var(--shadow); }
.view:has(.camera-hint) { min-height: 280px; }
.view video { width: 100%; max-height: calc(100vh - 124px); object-fit: contain; display: block; transform: scaleX(-1); }
.view.nocam, .view.covered { background: var(--surface); }
.view.nocam > video, .view.covered > video { display: none; }
.caption { position: absolute; z-index: 2; inset: auto 0 0 0; padding: 22px 18px; text-align: center; pointer-events: none; font: 400 clamp(28px, 4vw, 52px)/1.05 var(--display); color: #fff; text-shadow: 0 2px 18px #000a; }
.caption[data-tone="good"] { color: #9be7b2; } .caption[data-tone="bad"] { color: #ffb0a8; } .caption[data-tone="warn"] { color: var(--yellow); } .caption[data-tone="accent"] { color: #ffe68a; }
.view.nocam .caption { inset: 18px 0 auto 0; color: var(--ink); text-shadow: none; }
.view.nocam .caption[data-tone="good"] { color: var(--green); } .view.nocam .caption[data-tone="bad"] { color: var(--red); } .view.nocam .caption[data-tone="accent"] { color: var(--orange); }
.caption[data-tone="badge"] { inset: auto auto 20px 50%; transform: translateX(-50%); width: max-content; padding: 10px 18px; border-radius: 999px; background: #0a0a0ae6; color: #fff; font: 600 12px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; text-shadow: none; }
.camera-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #d6d2c8; font: 12px var(--mono); text-align: center; padding: 24px; white-space: pre-line; }

.panel { border-radius: var(--radius); border: 2px solid var(--edge); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.sect { padding: 16px 18px; border-bottom: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.sect:last-child { border-bottom: 0; }
.label { font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--soft); }
.note { color: var(--soft); font-size: 13.5px; line-height: 1.55; margin: 0; }
.note kbd { font: 11px var(--mono); padding: 1px 6px; border-radius: 4px; border: 1.5px solid var(--line); color: var(--ink); background: var(--paper); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 2px; background: var(--line); border: 2px solid var(--edge); border-radius: 10px; overflow: hidden; }
.kpi { background: var(--surface); padding: 12px 10px; text-align: center; }
.kpi .v { font: 400 28px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.kpi .v.accent { color: var(--orange); }
.kpi .k { margin-top: 6px; font: 9.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.btn { height: 36px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--edge); background: var(--surface); color: var(--ink); text-decoration: none; font: 500 13px var(--mono); display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--shadow-sm); transition: transform .08s ease, box-shadow .08s ease; }
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--edge); }
.btn.primary { background: var(--yellow); color: #232323; }
.btn:disabled { opacity: .45; cursor: default; }
.seg { display: inline-flex; flex-wrap: wrap; border: 2px solid var(--edge); border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface); box-shadow: var(--shadow-sm); }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 999px; font: 12.5px var(--mono); color: var(--soft); }
.seg button.on { background: var(--yellow); color: #232323; font-weight: 500; }

/* probability bars */
.bars { display: flex; flex-direction: column; gap: 8px; }
.prob { display: grid; grid-template-columns: 1fr 48px; row-gap: 4px; align-items: center; }
.prob .name { font-size: 13.5px; color: var(--soft); }
.prob .value { text-align: right; font: 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.prob .track { grid-column: 1 / span 2; height: 7px; border-radius: 5px; background: var(--line); border: 1px solid var(--line); overflow: hidden; }
.prob .fill { height: 100%; width: 0; background: var(--muted); border-radius: 5px; transition: width .08s linear; }
.prob.top .name, .prob.top .value { color: var(--ink); }
.prob.top .fill { background: var(--yellow); }
.prob.top .track { border-color: var(--edge); }

/* facts drawer */
.facts { border-top: 1.5px solid var(--line); }
.facts summary { padding: 10px 18px; cursor: pointer; font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--soft); }
.facts .facts-q { padding: 0 18px 6px; font: 12px var(--mono); color: var(--ink); }
.facts pre { margin: 0 18px 14px; padding: 10px 12px; border-radius: 8px; background: var(--paper); border: 1.5px solid var(--line); font: 11px/1.5 var(--mono); max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.cpu { padding: 14px 18px; background: var(--paper); border-bottom: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cpu strong { font: 400 18px var(--display); }
.cpu p { margin: 0; font-size: 13.5px; line-height: 1.5; }

/* game surfaces */
.surface { display: block; width: 100%; height: auto; }
.view .surface { max-height: calc(100vh - 124px); object-fit: contain; }
.mirror { transform: scaleX(-1); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.thumbs figure { margin: 0; position: relative; border-radius: 8px; overflow: hidden; border: 1.5px solid var(--line); }
.thumbs img, .thumbs canvas { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; transform: scaleX(-1); }
.thumbs figcaption { position: absolute; inset: auto 0 0 0; padding: 3px 6px; font: 9.5px var(--mono); background: #FBF8F1d9; color: #232323; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
textarea { width: 100%; border: 2px solid var(--edge); border-radius: 10px; padding: 12px; background: var(--surface); color: var(--ink); font: 13.5px/1.55 var(--mono); resize: vertical; }
textarea:focus { outline: none; box-shadow: 0 0 0 3px #FFD21E66; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 12px; color: var(--soft); }
.chips button:hover { color: var(--ink); border-color: var(--edge); }
.frame { display: block; width: 100%; border-radius: 10px; transform: scaleX(-1); }
.frame-tile { display: block; width: 100%; max-width: 300px; margin: 0 auto; height: auto; border-radius: 10px; background: var(--dark); transform: none; }
.paper-wrap { display: grid; place-items: center; padding: 64px 18px 22px; background: var(--bg); }
.paper { width: min(100%, calc(100vh - 210px)); aspect-ratio: 1; border-radius: 12px; cursor: crosshair; touch-action: none; border: 2px solid var(--edge); box-shadow: var(--shadow); background: #fff; }
.logrow { display: flex; justify-content: space-between; font: 12px var(--mono); padding: 4px 0; border-bottom: 1px solid var(--line); }
.logrow .ok { color: var(--green); } .logrow .miss { color: var(--red); }
.rep-big { position: absolute; top: 14px; right: 20px; text-align: right; pointer-events: none; color: #fff; }
.rep-big .n { font: 400 104px/1 var(--display); font-variant-numeric: tabular-nums; text-shadow: 0 2px 24px #0008; }
.rep-big .n.pop { animation: pop .25s ease-out; }
@keyframes pop { 40% { color: var(--yellow); transform: scale(1.08); } }
.rep-big .l { font: 500 10px/1 var(--mono); letter-spacing: .3em; text-transform: uppercase; color: #ffffffcc; }
.phase-tag { position: absolute; top: 12px; left: 12px; padding: 8px 14px; font: 600 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; background: #FBF8F1e6; color: #232323; border-radius: 999px; border: 2px solid #232323; }
.phase-tag[data-phase="1"] { background: var(--yellow); }
.meter { position: relative; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--line), var(--yellow)); border: 1.5px solid var(--edge); }
.meter i { position: absolute; top: -6px; width: 5px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--ink); left: 50%; transition: left .08s linear; }
.meter-ends { display: flex; justify-content: space-between; font: 10px var(--mono); color: var(--soft); text-transform: uppercase; letter-spacing: .1em; }
.strip { position: relative; height: 20px; border-radius: 6px; background: var(--paper); border: 1.5px solid var(--line); overflow: hidden; }
.strip i { position: absolute; top: 0; width: 1.2%; height: 100%; background: #00000010; }
.strip i[data-phase="1"] { background: var(--yellow); } .strip i[data-phase="0"] { background: var(--line); }
.target { font: 400 34px/1.15 var(--display); }
.inbox { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.inbox-head { display: flex; align-items: center; justify-content: space-between; }
.inbox-head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); border: 1.5px solid var(--edge); }
.composer { min-height: 220px; font: 17px/1.6 var(--body); padding: 18px; border-radius: 12px; background: var(--paper); }
.pass { font: 12px/1.6 var(--mono); color: var(--soft); }
.pass b { color: var(--ink); font-weight: 600; }
.scale { display: flex; align-items: center; gap: 12px; }
.scale .cells { display: flex; gap: 4px; }
.scale .cells i { width: 26px; height: 12px; border-radius: 3px; background: var(--yellow); border: 1.5px solid var(--edge); opacity: .15; transition: opacity .1s; }
.scale-text { font: 12px var(--mono); color: var(--ink); }
.doll { display: flex; gap: 10px; padding: 7px 10px; border-radius: 999px; background: var(--surface); border: 2px solid var(--edge); }
.doll i { width: 26px; height: 26px; border-radius: 50%; opacity: .18; border: 1.5px solid var(--edge); transition: opacity .15s, box-shadow .15s; }
.doll i.red { background: var(--red); } .doll i.green { background: var(--green); }
.doll i.on { opacity: 1; }
.doll i.red.on { box-shadow: 0 0 0 4px #EF3E3633; } .doll i.green.on { box-shadow: 0 0 0 4px #3E8E5E33; }

/* "Run it locally" */
.local { max-width: 620px; width: calc(100% - 32px); border: 2px solid var(--edge); border-radius: var(--radius); padding: 24px 26px; color: var(--ink); background: var(--surface); box-shadow: 6px 6px 0 var(--edge); }
.local::backdrop { background: #0007; }
.local h2 { margin: 0 0 10px; }
.local .label { margin: 18px 0 6px; }
.local pre { margin: 0; padding: 12px 14px; border-radius: 9px; background: var(--paper); border: 1.5px solid var(--line); font: 12.5px/1.6 var(--mono); overflow-x: auto; user-select: all; }
.local .x { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 22px; color: var(--soft); }
.note a { color: var(--blue); }

@media (max-width: 720px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .logo .mark { width: 32px; height: 32px; }
  .topbar .tag, .topbar .sep { display: none; }
  .topbar .product, .topbar .title { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .back { flex: none; padding: 0 9px; }
  .pill { min-width: 0; max-width: 38vw; }
  .play { padding: 12px 14px 20px; } .menu, .lab { padding-left: 16px; padding-right: 16px; } .hero { padding: 44px 16px 24px; }
  .rep-big .n { font-size: 64px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* brand: the emblem and the banner come from static/nirnaya-brand-banner-v3.png */
.banner { display: block; position: relative; width: min(760px, 100%); height: auto; margin: 0 auto 28px; border: 2px solid var(--edge); border-radius: var(--radius); box-shadow: var(--shadow); background: #0b1a33; }
.head h2 { display: flex; align-items: center; gap: 12px; }
h2 .mark { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--edge); box-shadow: var(--shadow-sm); background: #0b1a33; }

/* who drives the games */
.switch { margin-left: auto; display: inline-flex; height: 30px; border: 2px solid var(--edge); border-radius: 999px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.switch + .pill { margin-left: 12px; }
.switch button { border: 0; background: transparent; color: var(--soft); font: 11px/1 var(--mono); padding: 0 12px; cursor: pointer; white-space: nowrap; }
.switch button[aria-pressed="true"] { background: var(--edge); color: var(--surface); }
.switch button:focus-visible { outline: 2px solid var(--accent, #c8553d); outline-offset: -4px; }
@media (max-width: 720px) { .switch button { padding: 0 8px; } .switch + .pill { display: none; } }

/* Nirnaya versus the referee */
.driver-note { font: 11px/1.45 var(--mono); color: var(--soft); margin: 4px 0 8px; }
.decisions { display: grid; gap: 6px; }
.decision { border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 9px; background: var(--surface); }
.decision.match { border-color: #3f8f5f; }
.decision.differs { border-color: #c8553d; }
.decision .q { font-size: 12px; margin-bottom: 3px; }
.decision .cmp { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 11px/1.4 var(--mono); color: var(--soft); font-variant-numeric: tabular-nums; }
.decision .cmp b { font-weight: 600; color: var(--ink, inherit); }
.decision .mark { font-weight: 700; }
.decision.match .mark { color: #3f8f5f; }
.decision.differs .mark { color: #c8553d; }
.decision .drv { margin-left: auto; }
