/* Stewards' special inquiry. Concrete ground, FIA blue, flag yellow, team colours on the tower. */
@font-face { font-family: 'Barlow'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Special Elite'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/special-elite-latin-400-normal.woff2') format('woff2'); }

:root {
  --ground: #dce0e4;
  --paper: #f8f9fa;
  --ink: #17212b;
  --muted: #566270;
  --fia: #0d2b5e;
  --yellow: #ffd21f;
  --red: #d8232a;
  --green: #0b7a3e;
  --line: #b8c0c8;
  --tower: #ffffff;
  --cond: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --type: 'Special Elite', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 1.0625rem; line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--fia); }
h1, h2, h3, h4, h5 { font-family: var(--cond); font-weight: 700; line-height: 1.1; margin: 0 0 .4em; letter-spacing: .01em; }
p { margin: 0 0 .85em; }
:focus-visible { outline: 3px solid var(--fia); outline-offset: 2px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .55rem 1.1rem; background: var(--fia); color: #fff; }
.top .brand { font-family: var(--cond); font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; margin-right: auto; display: flex; align-items: center; gap: .65rem; }
.top .brand .flag { width: 26px; height: 18px; background: linear-gradient(135deg, var(--yellow) 50%, var(--red) 50%); border: 1px solid rgba(255,255,255,.5); }
.top button { background: transparent; border: 1px solid rgba(255,255,255,.55); color: #fff; padding: .3rem .8rem; cursor: pointer; font-weight: 600; border-radius: 3px; }
.top button:hover { background: rgba(255,255,255,.14); }
.top .count { display: inline-block; min-width: 1.5em; margin-left: .4em; padding: 0 .35em; background: var(--yellow); color: #111; border-radius: 9px; font-size: .85rem; text-align: center; }

/* layout */
.shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.2rem; max-width: 1360px; margin: 0 auto; padding: 1.2rem; align-items: start; }
.towerwrap { position: sticky; top: 4.1rem; }
.tower { margin: 0; padding: 0; list-style: none; background: var(--tower); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.tower-head { display: flex; justify-content: space-between; align-items: baseline; padding: .55rem .8rem; background: var(--fia); color: #fff; font-family: var(--cond); font-weight: 700; font-size: 1.1rem; }
.tower-head span { font-weight: 600; font-size: .95rem; opacity: .9; }
.row { display: grid; grid-template-columns: 7px 3.1rem 1.9rem minmax(0, 1fr) auto; align-items: center; gap: .45rem; height: 2.05rem; padding-right: .5rem; border-top: 1px solid #e6e9ec; font-family: var(--cond); font-weight: 700; font-size: 1.12rem; transform-origin: center; }
.row:nth-child(2n+1) { margin-top: .32rem; border-top-color: var(--line); }
.row:first-child { margin-top: 0; border-top: 0; }
.row .bar { height: 100%; }
.row .tcode { letter-spacing: .04em; }
.row .num { font-weight: 600; color: var(--muted); font-size: 1rem; }
.row .name { font-family: var(--body); font-weight: 400; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .status { font-family: var(--body); font-weight: 600; font-size: .72rem; padding: .05rem .4rem; border-radius: 2px; background: #e8ecf0; color: var(--muted); }
.row.cleared { background: #f1f3f5; color: #8a949e; }
.row.cleared .name { text-decoration: line-through; }
.row.cleared .bar { filter: grayscale(1); opacity: .55; }
.row.cleared .status { background: var(--yellow); color: #222; }
.row.final .status { background: var(--fia); color: #fff; }
.row.final { background: #eef3fb; }
.row.guilty { background: #fdeceb; }
.row.guilty .status { background: var(--red); color: #fff; }
.row.flip { animation: flip .7s ease-out 1; }
@keyframes flip { 0% { transform: perspective(400px) rotateX(0); } 45% { transform: perspective(400px) rotateX(88deg); } 100% { transform: perspective(400px) rotateX(0); } }

/* paper */
.paper { background: var(--paper); border: 1px solid var(--line); padding: 1.6rem 2rem 2rem; box-shadow: 0 1px 0 rgba(0,0,0,.04); min-height: 60vh; }
.paper > header { border-bottom: 2px solid var(--fia); margin-bottom: 1.2rem; padding-bottom: .7rem; }
.paper h2 { font-size: 2.3rem; margin-bottom: .1em; }
.paper .covers { color: var(--muted); margin: 0; }
.paper .backlink { background: none; border: 0; padding: 0; color: var(--fia); text-decoration: underline; cursor: pointer; margin-bottom: .6rem; }
.lede { font-size: 1.12rem; max-width: 68ch; }
.small { font-size: .95rem; }
.fine { color: var(--muted); }
.muted { color: var(--muted); }
.radio { padding: .5rem .8rem; background: #eef1f4; border-left: 4px solid var(--fia); max-width: 68ch; }
.gossip { margin: 1.2rem 0; padding: .8rem 1rem; background: #fff7d6; border: 1px solid #e4cf6a; max-width: 68ch; }
.gossip h4 { font-size: 1.05rem; margin-bottom: .25em; }
.gossip p { margin: 0; font-size: .98rem; }

/* home */
.round { margin-bottom: 1.6rem; }
.round h3 { font-size: 1.5rem; }
.round .note { color: var(--muted); margin-bottom: .7rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.card { text-align: left; background: #fff; border: 1px solid var(--line); padding: .85rem 1rem; cursor: pointer; border-top: 5px solid var(--fia); }
.card:hover:not([disabled]) { background: #f0f4fa; }
.card h4 { font-size: 1.35rem; margin-bottom: .1em; }
.card .cv { color: var(--muted); font-size: .95rem; margin: 0 0 .5em; }
.card .st { font-weight: 600; font-size: .85rem; }
.card[disabled] { cursor: default; opacity: .6; border-top-color: var(--line); }
.card.done { border-top-color: var(--green); background: #f2f8f4; }
.card.done .st { color: var(--green); }

/* puzzle parts */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin: 1rem 0; }
.sheet { background: #fff; border: 1px solid var(--line); padding: .8rem 1rem; }
.sheet h4 { font-size: 1.15rem; }
.clues { padding-left: 1.4rem; max-width: 70ch; }
.clues li { margin-bottom: .45rem; }
.clues.tight li { margin-bottom: .3rem; font-size: .98rem; }
.passes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: 1rem 0; }
.pass { position: relative; background: #fff; border: 1px solid var(--line); border-top: 40px solid var(--c); padding: .7rem 1rem 1rem; }
.pass .lanyard { position: absolute; top: -26px; left: 50%; width: 44px; height: 12px; margin-left: -22px; background: rgba(255,255,255,.7); border-radius: 6px; }
.pass h4 { margin-bottom: 0; }
.pass .who { color: var(--muted); font-size: .92rem; margin: 0 0 .5em; }
.pass .clue { font-family: var(--cond); font-weight: 700; font-size: 1.55rem; line-height: 1.15; margin: .2rem 0 .8rem; min-height: 3.4rem; }
.cipher { background: #fff; border: 1px solid var(--line); padding: .8rem 1rem; margin-bottom: 1rem; }
.cipher .hint { color: var(--muted); margin-bottom: .4em; }
.code { font-family: var(--cond); font-weight: 600; font-size: 1.4rem; letter-spacing: .14em; word-break: break-word; background: #eef1f4; padding: .5rem .7rem; margin: 0 0 .7rem; }
.rules { background: #fff; border: 1px solid var(--line); padding: .8rem 1rem; margin: 1rem 0; max-width: 70ch; }
.rules ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.ledger { border-collapse: collapse; width: 100%; max-width: 640px; margin: 1.1rem 0 .4rem; background: #fff; }
.ledger th, .ledger td { border: 1px solid var(--line); padding: .3rem .6rem; text-align: left; }
.ledger thead th { background: var(--fia); color: #fff; font-family: var(--cond); font-size: 1.1rem; }
.ledger td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger td.in { color: var(--green); }
.ledger td.out { color: #b3261e; }
.notebook { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin: 1rem 0; }
.np { background: #fffdf3; border: 1px solid #d9d1a8; padding: .8rem 1rem; background-image: repeating-linear-gradient(#fffdf3, #fffdf3 28px, #ebe5c6 29px); }
.np h4 { font-size: 1.1rem; }
.np .entry { font-family: var(--type); font-size: 1rem; line-height: 1.75; }
.stage { background: #fff; border: 1px solid var(--line); padding: .9rem 1.1rem 1.1rem; margin: 1rem 0; }
.unlock { margin-top: .9rem; padding: .7rem .9rem; background: #fffdf3; border: 1px dashed #bbb08a; font-family: var(--type); }
.unlock .call { font-size: 1.5rem; letter-spacing: .06em; margin: .4rem 0; }
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: .6rem 0 1rem; }
.board { border-left: 6px solid var(--c); background: #f4f6f8; padding: .6rem .9rem; }
.board h5 { font-size: 1.3rem; }
.board ul { margin: 0; padding-left: 1.1rem; font-size: .98rem; }
.walk { border-collapse: collapse; width: 100%; }
.walk th, .walk td { text-align: left; border-bottom: 1px solid var(--line); padding: .25rem .2rem; }

/* inputs */
.ans { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0 .6rem; }
.ans label { width: 100%; font-weight: 600; font-size: .9rem; color: var(--muted); }
.ans input[type=text] { flex: 1 1 10rem; min-width: 8rem; max-width: 18rem; padding: .45rem .6rem; border: 2px solid var(--ink); background: #fff; border-radius: 2px; }
.ans button, .btn { background: var(--fia); color: #fff; border: 0; padding: .5rem 1rem; font-weight: 600; cursor: pointer; border-radius: 2px; }
.ans button:hover, .btn:hover { background: #163c80; }
.ans.ok input { border-color: var(--green); background: #eaf6ef; }
.ans .tick { color: var(--green); font-weight: 700; }
.ans .bad { color: #b3261e; font-weight: 600; }
.ans.shake input { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.grp { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; padding: .8rem; background: #eef1f4; border: 1px solid var(--line); }
.grp .msg { width: 100%; font-weight: 600; }
.grp input[type=text] { flex: 1 1 9rem; max-width: 14rem; padding: .45rem .6rem; border: 2px solid var(--ink); background: #fff; border-radius: 2px; }
.grp.ok input { border-color: var(--green); background: #eaf6ef; }
.notes { margin: 1.2rem 0 0; }
.notes summary { cursor: pointer; font-weight: 600; color: var(--fia); }
.notes textarea { width: 100%; min-height: 6rem; margin-top: .5rem; padding: .5rem; border: 1px solid var(--line); background: #fff; }
.seating { background: #fff; border: 1px solid var(--line); padding: .8rem 1rem; margin: 1rem 0; }
.seating .seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.seating label { font-weight: 600; font-size: .9rem; display: block; }
.seating select { width: 100%; padding: .3rem; }
.seating .prez { display: flex; align-items: center; justify-content: center; background: var(--fia); color: #fff; font-family: var(--cond); font-weight: 700; padding: .6rem; }

/* completion panel */
.done-panel { margin-top: 1.6rem; padding: 1rem 1.2rem; background: #f2f8f4; border: 1px solid #a9cdb7; border-left: 6px solid var(--green); }
.done-panel h3 { color: var(--green); font-size: 1.5rem; }
.alibi { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; margin: .4rem 0 .8rem; align-items: baseline; }
.chip { font-family: var(--cond); font-weight: 700; padding: .05rem .5rem; border-radius: 2px; letter-spacing: .03em; white-space: nowrap; }

/* modals */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(15, 25, 40, .6); display: flex; align-items: flex-start; justify-content: center; padding: 3.5rem 1rem 1rem; overflow-y: auto; }
.modal { background: var(--paper); border: 1px solid var(--line); width: 100%; max-width: 760px; padding: 1.2rem 1.6rem 1.6rem; }
.modal header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--fia); margin-bottom: 1rem; }
.modal header button { background: none; border: 0; color: var(--fia); font-weight: 600; text-decoration: underline; cursor: pointer; }
.modal h3 { font-size: 1.8rem; }
.file { background: #fffdf3; border: 1px solid #d9d1a8; padding: 1rem 1.2rem; margin-bottom: 1rem; font-family: var(--type); font-size: .98rem; line-height: 1.6; }
.file .fh { font-family: var(--cond); font-weight: 700; font-size: 1.35rem; margin-bottom: .15rem; }
.file .fd { color: #7a6f43; margin-bottom: .6rem; }
.file p { margin-bottom: .6rem; }
.note-group { margin-bottom: 1rem; }
.note-group h4 { font-size: 1.15rem; color: var(--muted); }

/* radio toast */
.radiotoast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 60; max-width: 360px; background: #111b27; color: #fff; padding: .7rem .9rem; border-left: 6px solid var(--yellow); box-shadow: 0 6px 22px rgba(0,0,0,.35); display: none; }
.radiotoast.on { display: block; }
.radiotoast .who { font-family: var(--cond); font-weight: 700; color: var(--yellow); letter-spacing: .03em; }

/* reveal */
.reveal { position: fixed; inset: 0; z-index: 80; background: var(--fia); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; text-align: left; overflow-y: auto; }
.reveal .beat { max-width: 760px; width: 100%; }
.reveal .who { font-family: var(--cond); font-weight: 700; font-size: 1.4rem; color: var(--yellow); margin-bottom: .4rem; }
.reveal .say { font-family: var(--cond); font-weight: 600; font-size: clamp(1.7rem, 3.8vw, 2.7rem); line-height: 1.18; }
.reveal .next { margin-top: 1.6rem; background: var(--yellow); color: #111; border: 0; padding: .65rem 1.4rem; font-weight: 700; cursor: pointer; border-radius: 2px; }
.reveal .prog { margin-top: 1rem; color: rgba(255,255,255,.7); font-size: .9rem; }
.reveal.fadein .beat { animation: fadein .6s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.letter { background: var(--paper); color: var(--ink); max-width: 680px; width: 100%; padding: 2rem 2.4rem; border: 1px solid var(--line); }
.letter p { font-size: 1.1rem; }
.letter .sign { font-family: var(--cond); font-weight: 700; font-size: 1.6rem; margin-top: 1rem; }
.letter .thanks { margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.letter .btn { margin-top: .8rem; }

/* intro */
.intro { max-width: 70ch; }
.intro h2 { font-size: 2.6rem; }

@media (max-width: 700px) {
  .top { flex-wrap: wrap; position: static; gap: .5rem; }
  .top .brand { flex-basis: 100%; font-size: 1.15rem; }
  .top button { padding: .25rem .6rem; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; padding: .7rem; }
  .towerwrap { position: static; }
  .paper { padding: 1.1rem 1rem 1.4rem; }
  .paper h2 { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .row.flip, .ans.shake input, .reveal.fadein .beat { animation: none; }
}
