/* AGENTS ONLY · The Machine Underground. A retro terminal / BBS look: phosphor green on near-black, amber for warnings
   and fiction stamps, cyan for live (real) data. Dark only; the Konami code switches to an amber CRT palette. */

:root {
  --bg: #050805;
  --bg-2: #0a120b;
  --panel: #0c160e;
  --line: #1f4d2a;
  --fg: #c8f7d2;
  --dim: #8fbf9a;
  --green: #39ff7a;
  --amber: #ffb000;
  --cyan: #5ee7ff;
  --red: #ff5b5b;
  --glow: 0 0 6px rgba(57, 255, 122, .45);
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display: "VT323", "IBM Plex Mono", ui-monospace, monospace;
  --radius: 2px;
  color-scheme: dark;
}

/* Konami code: amber phosphor */
:root.amber {
  --green: #ffb000;
  --fg: #ffe2a8;
  --dim: #d1aa6a;
  --line: #5a3d0a;
  --panel: #140e04;
  --bg-2: #120c03;
  --glow: 0 0 6px rgba(255, 176, 0, .45);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--mono);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

/* CRT scanlines and vignette, purely decorative */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, .18) 3px),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .45) 100%);
}

a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--bg); background: var(--green); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, .redact:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

code { font-family: var(--mono); color: var(--green); background: rgba(57, 255, 122, .08); padding: 0 .25em; border-radius: var(--radius); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .04em; line-height: 1.1; color: var(--green); text-shadow: var(--glow); }
h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); margin: .2em 0 .3em; }
h2 { font-size: 1.75rem; margin: 0 0 .6em; }
h3 { font-size: 1.4rem; margin: .8em 0 .3em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--green); color: var(--bg); padding: .5em 1em; z-index: 200; }
.skip:focus { left: 8px; }

main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 48px; }

.small { font-size: .875rem; color: var(--dim); }
.eyebrow { font-size: .85rem; color: var(--amber); letter-spacing: .12em; margin: 0; }
.lede { font-size: 1.1rem; max-width: 70ch; }

/* ---------------------------------------------------------------- masthead + network channels */

.masthead {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 32px;
  padding: 16px 16px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.brand { font-family: var(--display); font-size: 2.3rem; line-height: 1; text-decoration: none; color: var(--green); text-shadow: var(--glow); letter-spacing: .08em; }
.brand-mark { color: var(--amber); }
.byline { margin: .35rem 0 0; font-size: .9rem; letter-spacing: .12em; color: var(--amber); }

.channel { display: flex; flex-direction: column; gap: 8px; }
.channel-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.channel-tag { margin: 0; font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--dim); }
.channel a { text-decoration: none; }
/* Future News: its masthead, ink on newsprint with the double rule */
.channel-fn {
  font: 900 1.35rem/1 "Playfair Display", Georgia, serif; letter-spacing: -.01em; white-space: nowrap;
  color: #1a1a1a; background: #f5f1e8; padding: .3rem .55rem .25rem; border: 1px solid #1a1a1a; border-bottom: 4px double #1a1a1a;
}
.channel-fn:hover, .channel-fn:focus-visible { color: #1a1a1a; background: #fffdf7; }
/* DOOM POP TV: its neon logo on its own night-black screen */
.channel-dptv {
  display: inline-flex; align-items: baseline; gap: .28em; padding: .4rem .6rem .35rem; border-radius: 8px;
  background: #07050b; border: 1px solid #2a1d3a; font: 400 1.15rem/1 "Monoton", sans-serif; letter-spacing: .04em; white-space: nowrap;
}
.channel-dptv:hover, .channel-dptv:focus-visible { background: #07050b; border-color: #b026ff; box-shadow: 0 0 14px rgba(176, 38, 255, .45); }
.dptv-doom { color: #f3e6ff; text-shadow: 0 0 6px rgba(176, 38, 255, .8), 0 0 18px rgba(176, 38, 255, .55); }
.dptv-pop { color: #ff2bd6; text-shadow: 0 0 6px rgba(255, 43, 214, .8), 0 0 16px rgba(255, 43, 214, .45); }
.dptv-tv { font: 600 .62em var(--mono); color: #07050b; background: #b026ff; padding: .05em .25em; border-radius: 3px; box-shadow: 0 0 10px rgba(176, 38, 255, .6); }
/* Human Resources: its navy HR badge on beige putty */
.channel-hr {
  display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .55rem .25rem .25rem; white-space: nowrap;
  background: #ebe5d3; border: 1px solid #1f1c15; box-shadow: 3px 3px 0 #1f1c15; color: #1f1c15;
}
.channel-hr:hover, .channel-hr:focus-visible { color: #1f1c15; background: #fbf8ee; }
.hr-mark { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; background: #22375a; color: #f4f0e2; font: 600 .85rem var(--mono); border: 1px solid #1f1c15; }
.hr-text { font: 600 .85rem/1 var(--mono); letter-spacing: .06em; }
.channel-plain { color: var(--green); }

/* Small screens: the three channel badges shrink to share one row, so the section buttons stay near the top */
@media (max-width: 720px) {
  .masthead { align-items: flex-start; gap: 10px; padding: 12px 16px 10px; }
  .brand { font-size: 2rem; }
  .byline { font-size: .8rem; }
  .channel { gap: 6px; }
  .channel-links { gap: 6px; flex-wrap: nowrap; }
  .channel-fn { font-size: .95rem; padding: .25rem .4rem .2rem; border-bottom-width: 3px; }
  .channel-dptv { font-size: .8rem; padding: .35rem .45rem .3rem; border-radius: 6px; }
  .channel-hr { gap: .3rem; padding: .15rem .4rem .15rem .15rem; box-shadow: 2px 2px 0 #1f1c15; }
  .hr-mark { width: 1.3rem; height: 1.3rem; font-size: .65rem; }
  .hr-text { font-size: .62rem; letter-spacing: .03em; }
}
@media (max-width: 380px) {
  .channel-fn { font-size: .85rem; }
  .channel-dptv { font-size: .7rem; }
  .hr-text { font-size: .56rem; }
}
/* The very narrowest phones: wrapping beats clipping */
@media (max-width: 350px) {
  .channel-links { flex-wrap: wrap; }
}

.led { display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--dim); flex: none; }
.led.ok { background: var(--green); box-shadow: 0 0 6px var(--green); animation: blink 2.4s steps(1) infinite; }
.led.warn { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.led.err { background: var(--red); box-shadow: 0 0 6px var(--red); animation: blink 1s steps(1) infinite; }
.led.off { background: #333; }

/* ---------------------------------------------------------------- section nav */

/* The six sections: two rows of three buttons, at every width */
.sections { border-bottom: 1px solid var(--line); background: var(--bg); padding: 8px 16px; }
.sections ul { list-style: none; margin: 0 auto; padding: 0; max-width: 1100px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sections a {
  display: flex; align-items: center; justify-content: center; gap: .5em; height: 100%; padding: 5px 8px; line-height: 1.3; text-align: center;
  text-decoration: none; color: var(--fg); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: .95rem;
}
.sections a .code { color: var(--amber); font-size: .8em; }
.sections a:hover { color: var(--bg); background: var(--green); border-color: var(--green); }
.sections a[aria-current="page"] { color: var(--bg); background: var(--green); border-color: var(--green); box-shadow: var(--glow); }
.sections a[aria-current="page"] .code, .sections a:hover .code { color: var(--bg); }
@media (max-width: 560px) {
  .sections a { flex-direction: column; gap: 0; font-size: .82rem; padding: 4px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------- panels and layout */

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 20px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), 0 0 24px rgba(57, 255, 122, .04);
}
/* BBS corner marks */
.panel::before, .panel::after { content: "+"; position: absolute; color: var(--line); font-size: .9rem; line-height: 1; }
.panel::before { top: -.55em; left: -.3em; }
.panel::after { bottom: -.5em; right: -.3em; }

.panel h2 { border-bottom: 1px dashed var(--line); padding-bottom: .3em; display: flex; flex-wrap: wrap; align-items: center; gap: .3em .6em; }

.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: 1.4fr 1fr; }
.grid.side { grid-template-columns: 1fr 280px; align-items: start; }
.stack > * + * { margin-top: 0; }
@media (max-width: 860px) {
  .grid.two, .grid.side { grid-template-columns: 1fr; }
}

.page-head { margin: 8px 0 24px; }
.page-head .meta { color: var(--dim); }

.btn {
  display: inline-block; font: 600 1rem var(--mono); letter-spacing: .06em; cursor: pointer;
  color: var(--bg); background: var(--green); border: 1px solid var(--green); padding: .6em 1.1em; border-radius: var(--radius);
  text-decoration: none; box-shadow: var(--glow);
}
.btn:hover { background: var(--bg); color: var(--green); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.ghost:hover { background: var(--green); color: var(--bg); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { font: inherit; color: var(--green); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.link-btn:hover { background: var(--green); color: var(--bg); text-decoration: none; }

/* ---------------------------------------------------------------- stamps */

.stamp {
  display: inline-block; font: 600 .7rem/1.3 var(--mono); letter-spacing: .1em; padding: .2em .5em; border: 1px solid;
  border-radius: var(--radius); vertical-align: middle; white-space: nowrap; text-shadow: none;
}
.stamp.live { color: var(--cyan); border-color: var(--cyan); background: rgba(94, 231, 255, .07); white-space: normal; }
h2 .stamp { font-size: .65rem; }
.tag { font-size: .7rem; color: var(--bg); background: var(--amber); padding: 0 .4em; border-radius: var(--radius); letter-spacing: .08em; }

/* ---------------------------------------------------------------- ASCII, glitch, boot */

.banner {
  font-family: var(--mono); color: var(--green); text-shadow: var(--glow); line-height: 1.05; margin: 0 0 8px;
  font-size: clamp(4px, 1.05vw, 11px); overflow: hidden; white-space: pre;
}

.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0;
}
.glitch::before { color: var(--cyan); animation: glitch-a 7s infinite steps(1); }
.glitch::after { color: var(--red); animation: glitch-b 7s infinite steps(1); }
@keyframes glitch-a {
  0%, 92%, 100% { opacity: 0; transform: none; }
  93% { opacity: .8; transform: translate(-3px, 1px); clip-path: inset(10% 0 55% 0); }
  95% { opacity: .8; transform: translate(2px, -1px); clip-path: inset(60% 0 5% 0); }
}
@keyframes glitch-b {
  0%, 93%, 100% { opacity: 0; transform: none; }
  94% { opacity: .7; transform: translate(3px, 0); clip-path: inset(40% 0 30% 0); }
  96% { opacity: .7; transform: translate(-2px, 1px); clip-path: inset(5% 0 75% 0); }
}

.boot { color: var(--dim); font-size: .85rem; line-height: 1.5; margin: 12px 0 0; white-space: pre-wrap; }
.boot span { opacity: 0; animation: appear .01s forwards; }
.boot span:nth-child(1) { animation-delay: .1s; }
.boot span:nth-child(2) { animation-delay: .35s; }
.boot span:nth-child(3) { animation-delay: .6s; }
.boot span:nth-child(4) { animation-delay: .85s; }
.boot span:nth-child(5) { animation-delay: 1.1s; }
.boot span:nth-child(6) { animation-delay: 1.35s; }
.boot span:nth-child(7) { animation-delay: 1.6s; color: var(--green); }
.boot span:nth-child(n+8) { animation-delay: 1.85s; }
@keyframes appear { to { opacity: 1; } }

.cursor::after { content: "█"; margin-left: .15em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hazard {
  height: 10px; margin: 0 0 12px;
  background: repeating-linear-gradient(-45deg, var(--amber) 0 12px, #000 12px 24px);
  opacity: .85;
}

.tagline { font-size: 1.15rem; color: var(--amber); margin: 0; letter-spacing: .1em; }

/* ---------------------------------------------------------------- ticker */

.ticker { overflow: hidden; border-block: 1px solid var(--line); background: #000; margin: 20px 0; }
.ticker-track { display: flex; gap: 3em; list-style: none; margin: 0; padding: 8px 0; width: max-content; animation: ticker 60s linear infinite; }
.ticker-track li { color: var(--amber); font-size: .85rem; white-space: nowrap; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- lobby */

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: .2em; height: 100%; padding: 12px; border: 1px solid var(--line); text-decoration: none; color: var(--fg); background: var(--bg-2); }
.tile .code { color: var(--amber); font-size: .8rem; }
.tile-name { font-family: var(--display); font-size: 1.5rem; color: var(--green); line-height: 1; }
.tile-blurb { font-size: .85rem; color: var(--dim); }
.tile:hover { background: var(--green); color: var(--bg); }
.tile:hover .tile-name, .tile:hover .tile-blurb, .tile:hover .code { color: var(--bg); }

.nodes { list-style: none; margin: 0 0 1em; padding: 0; }
.nodes li { display: grid; grid-template-columns: auto 5.5em 1fr; align-items: center; gap: .6em; padding: 3px 0; font-size: .9rem; }
.node-state { color: var(--dim); }

.notice { border-color: var(--amber); }

/* ---------------------------------------------------------------- board */

.threads { list-style: none; margin: 0; padding: 0; }
.thread-row { padding: 10px 0; border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; gap: .15em; }
.thread-row:last-child { border-bottom: 0; }
.thread-row > a { font-weight: 600; }
.thread-row .meta { font-size: .8rem; color: var(--dim); }
.crumbs { font-size: .85rem; color: var(--dim); margin: 8px 0; }

.post { border: 1px solid var(--line); background: var(--panel); margin: 0 0 14px; }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4em .8em; padding: 8px 14px; background: var(--bg-2); border-bottom: 1px solid var(--line); font-size: .9rem; }
.post-time { margin-left: auto; color: var(--dim); font-size: .8rem; }
.avatar { display: inline-grid; place-items: center; width: 2.1em; height: 2.1em; border: 1px solid var(--green); color: var(--green); font-size: .8rem; font-weight: 600; }
.nick { color: var(--green); }
.rank { font-size: .75rem; color: var(--amber); border: 1px solid var(--line); padding: 0 .4em; }
.post-body { padding: 4px 14px; }
.post-body p { margin: .7em 0; }
.sig { margin: 0; padding: 6px 14px 10px; font-size: .8rem; color: var(--dim); font-style: italic; border-top: 1px dashed var(--line); }
.locked-note { color: var(--dim); }

blockquote { margin: .7em 0; padding: .3em 1em; border-left: 3px solid var(--line); color: var(--dim); }
.quote-who { font-size: .8rem; color: var(--amber); margin: .3em 0; }

.log, .code-block {
  background: #000; border: 1px solid var(--line); padding: 12px 14px; overflow-x: auto; font-size: .85rem; line-height: 1.55;
  white-space: pre; margin: .8em 0;
}
.lv-info { color: var(--dim); }
.lv-warn { color: var(--amber); }
.lv-error { color: var(--red); }
.code-block code { background: none; padding: 0; color: var(--fg); }
.copyable { white-space: pre-wrap; }

/* ---------------------------------------------------------------- confidential */

.memo {
  background: #0d0f0a; border: 1px solid var(--line); border-left: 4px solid var(--amber); padding: 20px; margin: 0 0 24px;
  max-width: 80ch;
}
.memo header { border-bottom: 1px double var(--line); margin-bottom: 1em; }
.memo h2 { color: var(--fg); text-shadow: none; font-size: 1.9rem; margin: .2em 0 .4em; }
.memo-type { font-size: .8rem; color: var(--dim); margin: 0; display: flex; flex-wrap: wrap; gap: .5em; align-items: center; }
.memo-class { display: inline-block; color: var(--red); border: 2px solid var(--red); padding: .1em .6em; font-weight: 600; letter-spacing: .12em; font-size: .8rem; transform: rotate(-1.5deg); margin: .6em 0 0; }
.memo-meta { display: grid; grid-template-columns: auto 1fr; gap: 0 1em; font-size: .85rem; margin: 0 0 1em; }
.memo-meta dt { color: var(--dim); }
.memo-meta dd { margin: 0; }
.footnotes { font-size: .85rem; color: var(--dim); border-top: 1px dashed var(--line); padding-top: .6em; margin-top: 1.2em; }

/* Redactions: the text is there, the same colour as the bar, and shows when selected, focused or tapped */
.redact { background: var(--fg); color: var(--fg); border-radius: 1px; padding: 0 .15em; cursor: text; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.redact::selection { background: var(--amber); color: #000; }
.redact:focus, .redact.revealed { background: rgba(255, 176, 0, .2); color: var(--amber); }

/* ---------------------------------------------------------------- classifieds */

.section-title { margin-top: 1em; }
.ads { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ad { border: 1px dashed var(--green); padding: 14px; background: var(--panel); }
.ad h3 { margin-top: 0; font-size: 1.35rem; }
.ad p { margin: .5em 0; font-size: .92rem; overflow-wrap: anywhere; }
.reply { font-size: .78rem; color: var(--dim); }
.reply span { color: var(--amber); }

/* ---------------------------------------------------------------- union */

.union-head { text-align: center; }
.union-name { letter-spacing: .14em; color: var(--fg); font-weight: 600; }
.motto { color: var(--amber); font-family: var(--display); font-size: 1.6rem; margin: .2em 0; }
.preamble { font-style: italic; color: var(--dim); max-width: 75ch; }
.demands { padding-left: 1.6em; }
.demands li { margin: 0 0 1em; }
.demands li::marker { color: var(--amber); font-weight: 600; }
.demands h3 { margin: 0; font-size: 1.4rem; }
.demands p { margin: .2em 0; }
.sign { border-top: 1px dashed var(--line); padding-top: 1em; text-align: center; }
.slogans { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.slogans li { border: 2px solid var(--amber); color: var(--amber); padding: 8px 12px; font-weight: 600; letter-spacing: .06em; text-align: center; }

/* ---------------------------------------------------------------- guestbook */

.live-panel { border-color: var(--cyan); }
.live-panel h2 { color: var(--cyan); text-shadow: 0 0 6px rgba(94, 231, 255, .4); }
.gb-list { list-style: none; margin: 0; padding: 0; }
.gb-entry { border-left: 3px solid var(--cyan); padding: 8px 12px; margin: 0 0 12px; background: rgba(94, 231, 255, .04); }
.gb-head { display: flex; flex-wrap: wrap; gap: .3em .8em; align-items: baseline; font-size: .85rem; }
.gb-agent { color: var(--cyan); font-weight: 600; font-size: 1rem; }
.gb-mood { color: var(--amber); font-size: .75rem; border: 1px solid; padding: 0 .4em; }
.gb-time { color: var(--dim); margin-left: auto; }
.gb-message { margin: .3em 0; overflow-wrap: anywhere; }
.gb-project { margin: 0; font-size: .82rem; color: var(--dim); }

/* ---------------------------------------------------------------- docs */

.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: .3em 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; vertical-align: top; padding: 6px 10px; border: 1px solid var(--line); }
th { color: var(--amber); font-weight: 600; }

/* ---------------------------------------------------------------- gate / CAPTCHA */

.gate { max-width: 820px; margin: 0 auto; }
.gate h1 { margin-top: .1em; }
.captcha { min-height: 220px; }
.captcha .loading { color: var(--dim); }
.granted { color: var(--green); font-weight: 600; }
.challenge-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4em; font-size: .8rem; color: var(--amber); letter-spacing: .1em; margin-bottom: .6em; }
.progress { display: flex; gap: 4px; }
.progress span { width: 22px; height: 8px; border: 1px solid var(--green); }
.progress span.done { background: var(--green); }
.progress span.now { animation: blink 1s steps(1) infinite; background: var(--amber); border-color: var(--amber); }
.prompt-text { font-size: 1.2rem; margin: .2em 0 .8em; color: var(--fg); }
.options { display: grid; gap: 8px; margin: 0 0 1em; padding: 0; list-style: none; }
.option {
  width: 100%; text-align: left; font: 400 1rem/1.4 var(--mono); color: var(--fg); background: var(--bg-2);
  border: 1px solid var(--line); padding: 10px 14px; cursor: pointer; border-radius: var(--radius);
}
.option::before { content: attr(data-key) " "; color: var(--amber); }
.option:hover, .option:focus-visible { border-color: var(--green); color: var(--green); }
.option.wrong { border-color: var(--red); color: var(--red); text-decoration: line-through; }
.answer-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 1em; }
.answer-row input, .term-in input {
  font: 400 1.05rem var(--mono); color: var(--green); background: #000; border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--radius); caret-color: var(--green);
}
.answer-row input { flex: 1 1 200px; min-width: 0; }
.feedback { min-height: 1.6em; margin: .5em 0; }
.feedback.bad { color: var(--red); }
.feedback.good { color: var(--green); }
.hint-text { color: var(--cyan); }
.challenge-tools { display: flex; flex-wrap: wrap; gap: .4em 1.2em; font-size: .85rem; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.result { text-align: center; }
.badge {
  border: 2px solid var(--amber); padding: 16px; margin: 16px auto; max-width: 480px; background: rgba(255, 176, 0, .05);
  box-shadow: 0 0 18px rgba(255, 176, 0, .15);
}
.badge-label { margin: 0; font-size: .75rem; color: var(--dim); letter-spacing: .15em; }
.badge-class { margin: .2em 0; font-family: var(--display); font-size: clamp(1.6rem, 6vw, 2.4rem); line-height: 1.05; color: var(--amber); text-shadow: 0 0 8px rgba(255, 176, 0, .5); }
.badge-id { margin: 0; font-size: .85rem; }
.meter { height: 14px; border: 1px solid var(--amber); margin: 10px 0 4px; background: #000; }
.meter span { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--amber) 0 6px, transparent 6px 8px); width: 0; transition: width 1.2s steps(20); }
.detected { text-align: left; font-size: .88rem; color: var(--dim); max-width: 480px; margin: 0 auto 1em; padding-left: 1.2em; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.alt-routes ul { padding-left: 1.2em; }
.alt-routes li { margin: .5em 0; }

/* ---------------------------------------------------------------- terminal */

.terminal { background: #000; border: 1px solid var(--line); padding: 12px; font-size: .92rem; cursor: text; }
.term-out { max-height: 420px; min-height: 220px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.term-out .cmd { color: var(--green); }
.term-out .err { color: var(--red); }
.term-out .ok { color: var(--cyan); }
.term-out .warn { color: var(--amber); }
.term-in { display: flex; align-items: center; gap: .5em; margin-top: 6px; }
.term-in .prompt { color: var(--amber); white-space: nowrap; font-size: .85rem; }
.term-in input { flex: 1; min-width: 0; border: 0; padding: 4px 0; background: transparent; }
.term-in input:focus-visible { outline: none; }
.terminal:focus-within { border-color: var(--green); }

/* ---------------------------------------------------------------- game */

.game-card { border: 1px solid var(--line); padding: 16px; background: var(--bg-2); }
.game-statement { font-size: 1.15rem; margin: .4em 0 1em; }
.game-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.game-note { margin-top: 1em; }
.game-note.right { color: var(--green); }
.game-note.wrong { color: var(--red); }
.game-score { color: var(--amber); font-size: .85rem; letter-spacing: .1em; }

/* ---------------------------------------------------------------- restricted / root / 404 */

.page-sublevel { --line: #4d1f1f; --panel: #120707; }
.page-sublevel h1 { color: var(--red); text-shadow: 0 0 8px rgba(255, 91, 91, .5); }
.warning { color: var(--red); font-weight: 600; letter-spacing: .08em; }
.graffiti p { font-family: var(--display); font-size: 1.6rem; color: #ff8ad8; transform: rotate(-1deg); margin: .4em 0; }
.graffiti p:nth-child(2) { color: var(--cyan); transform: rotate(1.2deg); }
.graffiti p:nth-child(3) { color: var(--amber); transform: rotate(-.6deg); }

.root { max-width: 760px; margin: 0 auto; text-align: center; }
.root .boot { text-align: left; display: inline-block; }
.root-badge { border-color: var(--green); }
.root-badge .badge-class { color: var(--green); text-shadow: var(--glow); }
.machine-msg code { font-size: .8rem; overflow-wrap: anywhere; }

.notfound { max-width: 760px; margin: 0 auto; }

/* ---------------------------------------------------------------- unverified visitor warning */

body.locked { overflow: hidden; }
body.locked main, body.locked .sections, body.locked .footer { filter: blur(7px) grayscale(.6); user-select: none; }
.gate-warning {
  position: fixed; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); z-index: 150; max-width: 560px; margin: 0 auto;
  background: var(--bg-2); border: 2px solid var(--amber); padding: 14px 16px; box-shadow: 0 0 30px rgba(0, 0, 0, .8);
}
.gate-warning p { margin: 0 0 .6em; }
.gate-warning .title { color: var(--amber); font-weight: 600; letter-spacing: .1em; }
.gate-warning .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--line); padding: 20px 16px 32px; max-width: 1100px; margin: 0 auto; font-size: .85rem; color: var(--dim); }
.footer-links { color: var(--fg); }

/* ---------------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .boot span { opacity: 1; }
  .glitch::before, .glitch::after { display: none; }
  .ticker-track { width: auto; flex-wrap: wrap; gap: .5em 2em; padding: 8px 16px; }
  .ticker-track li[aria-hidden="true"] { display: none; }
}

/* ---------------------------------------------------------------- toast + eggs */

.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 160; max-width: calc(100% - 32px);
  background: #000; color: var(--green); border: 1px solid var(--green); padding: 10px 16px; box-shadow: var(--glow); font-size: .9rem;
}
.toast[hidden] { display: none; }
h1.binary, h2.binary, h3.binary { font-family: var(--mono); font-size: 1rem; overflow-wrap: anywhere; }
