/* Circus Control: an RAF-style plotting room. The panel is a sheet of slate perspex laid over the map, clues are
   written on it in yellow chinagraph (grease pencil), and the header carries a sector clock: the red, yellow and blue
   five-minute wedges plotters used to tell fresh plots from stale ones. */
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url(/fonts/barlow-condensed-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-700.woff2) format("woff2"); }
@font-face { font-family: "Kalam"; font-weight: 400; font-display: swap; src: url(/fonts/kalam-400.woff2) format("woff2"); }
@font-face { font-family: "Kalam"; font-weight: 700; font-display: swap; src: url(/fonts/kalam-700.woff2) format("woff2"); }

:root {
  --slate: #1d2b37;        /* perspex over the table */
  --slate-deep: #121c25;   /* the teleprinter well, the room behind the globe */
  --chalk: #e6ebee;        /* printed text */
  --chalk-dim: #9fb0bc;
  --grease: #f3d34a;       /* chinagraph pencil */
  --sector-red: #d6402f;
  --sector-yellow: #e9b931;
  --sector-blue: #4f8fe0;
  --ui: "Barlow Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --hand: "Kalam", "Bradley Hand", "Segoe Print", cursive;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--slate-deep); color: var(--chalk); overflow: hidden; }
body { font: 500 18px/1.45 var(--ui); }
a { color: var(--grease); }
#globe { position: fixed; inset: 0; }
.cesium-viewer-bottom { left: 8px; bottom: 4px; }
.cesium-widget-credits { font: 11px var(--ui); opacity: .75; }
.cesium-credit-logoContainer { display: none !important; } /* Cesium ion isn't used; the imagery credit stays */

/* Header: name, sector clock, where the feed is. */
.bar { position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 12px; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 12px; pointer-events: none;
  background: linear-gradient(#121c25f0, #121c2500); }
.brand { display: flex; gap: 9px; align-items: center; font: 700 21px/1 var(--ui); letter-spacing: .01em; }
.clock { width: 30px; height: 30px; flex: none; }
.clock .hand { transform-origin: 16px 16px; transition: transform .6s; }
.status { margin-left: auto; font-size: 15px; color: var(--chalk-dim); text-align: right; }

/* The perspex sheet. */
.panel { position: fixed; z-index: 2; right: 16px; top: 64px; bottom: 16px; width: 384px; overflow-y: auto;
  overscroll-behavior: contain; border-radius: 10px; background: #1d2b37eb; backdrop-filter: blur(6px);
  box-shadow: inset 1px 1px 0 #ffffff24, inset -1px -1px 0 #00000040, 0 20px 50px #0009; }
.paper { padding: 22px 22px 16px; }
@media (max-width: 720px) {
  .panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 54vh; border-radius: 16px 16px 0 0; }
  .paper { padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); }
}

h1 { font: 700 46px/.98 var(--ui); margin: 4px 0 10px; letter-spacing: -.01em; }
h2 { font: 700 30px/1.05 var(--ui); margin: 0 0 12px; }
h3 { font: 700 19px/1.2 var(--ui); margin: 18px 0 8px; }
p { margin: 0 0 12px; max-width: 62ch; }
.where { color: var(--chalk-dim); margin-bottom: 2px; }
.lede { font: 400 21px/1.3 var(--hand); color: var(--grease); margin-bottom: 16px; }
.hint, .small { color: var(--chalk-dim); }
.small { font-size: 15px; }
.loading { color: var(--chalk-dim); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* Buttons: chinagraph-yellow for the one thing to do next, outlined for the rest. */
.btn { display: block; width: 100%; min-height: 48px; margin: 14px 0 10px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--grease); color: var(--slate-deep); font: 700 19px var(--ui); }
.btn:hover { background: #ffe066; }
.btn.ghost { background: transparent; color: var(--chalk); box-shadow: inset 0 0 0 1.5px #e6ebee80; }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--chalk); }
.btn:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 3px solid var(--sector-blue); outline-offset: 2px; }

/* Clues are written on the perspex in grease pencil. Tapping one rings it and fades the planes that don't fit. */
ul.clues, ul.suspects { list-style: none; margin: 0; padding: 0; }
.clue { position: relative; display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  color: var(--grease); font: 400 20px/1.3 var(--hand); padding: 8px 8px 8px 34px; margin-bottom: 2px; border-radius: 6px; }
.clue::before { content: ""; position: absolute; left: 6px; top: 13px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #f3d34a99; }
.clue[aria-pressed="true"]::before { border-color: var(--grease); background: radial-gradient(var(--grease) 0 4px, transparent 5px); }
.clue[aria-pressed="false"] { color: #f3d34ab3; }
.clue:hover { background: #ffffff0d; }

.suspects { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px !important; }
.suspects button { width: 100%; min-height: 48px; text-align: left; padding: 6px 10px; border: 0; border-radius: 6px;
  background: #ffffff10; color: var(--chalk); font: 700 18px/1.1 var(--ui); cursor: pointer; }
.suspects small { display: block; font-weight: 500; font-size: 14px; color: var(--chalk-dim); }
.suspects button[aria-pressed="true"] { background: var(--chalk); color: var(--slate-deep); }
.suspects button[aria-pressed="true"] small { color: #3c4c58; }

/* Rook's terminal: a teleprinter well set into the sheet. */
.term { margin: 16px 0 0; background: var(--slate-deep); border-radius: 8px; padding: 12px 14px; font-size: 16px; line-height: 1.4;
  box-shadow: inset 0 2px 6px #0008; }
.term ol { list-style: none; margin: 0; padding: 0; }
.term li { margin: 0 0 5px; }
.term li.sys { color: var(--chalk-dim); }
.term li.you { color: var(--chalk); font-weight: 700; }
.term li b { font-weight: 700; margin-right: 4px; }
.term li.tom b { color: var(--grease); }
.term li.rook b { color: var(--sector-blue); }
.term form { display: flex; gap: 8px; align-items: center; margin-top: 8px; color: var(--chalk-dim); }
.term input { flex: 1; min-width: 0; min-height: 40px; background: transparent; border: 0; border-bottom: 1.5px solid #e6ebee40;
  color: var(--chalk); font: 500 17px var(--ui); padding: 4px 2px; outline: none; }
.term input:focus { border-bottom-color: var(--grease); }
.term input::placeholder { color: #9fb0bc99; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.quick button { min-height: 40px; background: transparent; color: var(--chalk); border: 1.5px solid #e6ebee40; border-radius: 6px;
  font: 500 16px var(--ui); padding: 4px 12px; cursor: pointer; }
.quick button:disabled { opacity: .35; cursor: default; }
.radio h3 { margin-top: 18px; }
.radio .btn { margin: 6px 0; min-height: 44px; font-size: 17px; }

/* The plane on the sheet. */
.dossier { margin-top: 16px; padding-top: 14px; border-top: 1.5px solid #e6ebee26; }
.cs { position: relative; display: inline-block; font: 700 34px/1 var(--ui); margin: 0 0 10px; }
.tag { font: 400 18px var(--hand); color: var(--sector-red); margin-left: 6px; }
dl { display: grid; grid-template-columns: 76px 1fr; gap: 3px 10px; margin: 0 0 6px; }
dt { color: var(--chalk-dim); }
dd { margin: 0; }

/* The one big moment: a grease-pencil ring drawn round the courier's callsign (or a line struck through a lost one). */
.verdict { margin: 4px 0 14px; }
.verdict .cs { margin: 10px 14px 6px; }
.ring { position: absolute; inset: -14px -22px; width: calc(100% + 44px); height: calc(100% + 28px); overflow: visible; }
.ring path { fill: none; stroke: var(--grease); stroke-width: 3.5; stroke-linecap: round;
  stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw .9s .2s ease-out forwards; }
.verdict.lost .ring path { stroke: var(--sector-red); }
.verdict .note { font: 400 22px var(--hand); color: var(--grease); }
.verdict.lost .note { color: var(--sector-red); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Score, Tom's pulse, and calls left as three plotting counters. */
.meta { display: flex; gap: 14px; align-items: center; font-size: 16px; margin: 18px 0 0; padding-top: 12px;
  border-top: 1.5px solid #e6ebee26; color: var(--chalk-dim); }
.meta .calls { margin-left: auto; display: flex; gap: 5px; }
.counter { width: 14px; height: 13px; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: var(--sector-red); }
.counter:nth-child(2) { background: var(--sector-yellow); }
.counter:nth-child(3) { background: var(--sector-blue); }
.counter.used { background: #e6ebee26; }
.foot { margin: 10px 0 0; font-size: 13px; color: var(--chalk-dim); }
.foot a { color: var(--chalk-dim); }
.score { font: 700 30px var(--ui); color: var(--grease); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.noscript { position: fixed; inset: 40% 16px auto; text-align: center; }

/* The legal page reuses the sheet. */
body.doc { overflow: auto; background: var(--slate); }
.sheet { max-width: 680px; margin: 0 auto; padding: 32px 16px 48px; }
.sheet h1 { font-size: 40px; }
.sheet h2 { font-size: 24px; margin-top: 28px; }
.sheet li { margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
  .loading { animation: none; }
  .ring path { animation: none; stroke-dashoffset: 0; }
  .clock .hand { transition: none; }
}
