:root {
  --g0: #0b1d0e;
  --g1: #1f6b29;
  --g2: #43a047;
  --g3: #9ccc65;
  --w: #eaffea;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --c: 0; /* corruption 0..1, set from JS */
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #000; color: var(--g3); font-family: var(--mono); }
body { overflow-x: hidden; -webkit-font-smoothing: antialiased; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.75) 100%);
  opacity: 0; transition: opacity .6s; }
body.awake #vignette { opacity: 1; }

#voice { position: fixed; left: 50%; bottom: 7vh; transform: translateX(-50%); z-index: 4; pointer-events: none;
  max-width: 92vw; padding: .5rem 1rem; font-size: clamp(16px, 2.6vw, 30px); letter-spacing: .04em;
  color: var(--w); background: rgba(0,0,0,.72); border: 1px solid var(--g1); white-space: pre-wrap; text-align: center;
  opacity: 0; transition: opacity .25s; text-shadow: 0 0 8px rgba(120,255,140,.5); }
#voice.on { opacity: 1; }
#voice::after { content: "▌"; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

#hint { position: fixed; top: 10px; right: 12px; z-index: 4; font-size: 12px; color: var(--g2); pointer-events: none;
  opacity: .9; transition: opacity .4s; }
body.awake #hint { opacity: 0; }

#page { position: relative; z-index: 2; max-width: 880px; margin: 0 auto; padding: 4vh 16px 10vh;
  filter: contrast(calc(1 + var(--c) * 0.6)) saturate(calc(1 - var(--c) * 0.6));
  pointer-events: none; }
#page > * { pointer-events: auto; }
#page { transition: opacity .9s; }
body.awake #page { opacity: .42; }
body.taken #page { opacity: .22; }
.box { transition: background .9s; }
body.awake .box { background: rgba(0, 0, 0, .25); }

header#top { text-align: center; margin-bottom: 28px; }
.logo, .logo-small { margin: 0 auto; display: inline-block; text-align: left; color: var(--w); font-size: 15px; line-height: 1.05;
  text-shadow: 0 0 10px rgba(130,255,150,.55), 0 0 30px rgba(60,200,90,.35); }
.logo-small { display: none; }
.tag { margin: 12px 0 14px; font-size: 13px; color: var(--g2); }
.nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 14px; }
.nav a, .nav button, .btn, #copy, #ask button { color: var(--g3); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; padding: 2px 0; }
.nav a:hover, .nav button:hover, .btn:hover, #copy:hover, #ask button:hover { color: #000; background: var(--g3); }

.box { position: relative; border: 1px solid var(--g1); padding: 22px 18px 16px; margin: 26px 0;
  background: rgba(0, 0, 0, .78); box-shadow: 0 0 0 1px #000, 0 0 24px rgba(0,0,0,.9); }
.box::before, .box::after { position: absolute; color: var(--g2); font-size: 12px; line-height: 1; }
.box::before { content: "+"; top: -7px; left: -4px; }
.box::after { content: "+"; bottom: -7px; right: -4px; }
.lbl { position: absolute; top: -9px; left: 16px; background: #000; padding: 0 4px; color: var(--w); font-size: 13px; letter-spacing: .08em; }
.box p { margin: 10px 0; font-size: 14px; line-height: 1.6; }
.dim { color: var(--g2); }
pre { margin: 10px 0; font-size: 13px; line-height: 1.45; white-space: pre; overflow-x: auto; color: var(--g3); }
pre.stat { color: var(--w); }
pre.art { color: var(--g2); }
pre.list { color: var(--g3); }
#status { color: #fff; }

.ca { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0; padding: 10px; border: 1px dashed var(--g1); font-size: 13px; }
.ca .k, #ask .k { color: var(--w); }
.ca code { flex: 1 1 220px; word-break: break-all; color: var(--w); }
.btns { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 12px; font-size: 14px; }
.btn.dead { color: var(--g1); cursor: default; pointer-events: none; }

#lines { font-size: 13px; line-height: 1.55; max-height: 320px; overflow-y: auto; margin-bottom: 10px; }
#lines .t { color: var(--g1); }
#lines .me { color: var(--g2); }
#lines .it { color: var(--w); }
#lines div { margin: 2px 0; white-space: pre-wrap; word-break: break-word; }
#ask { display: flex; gap: 8px; align-items: center; border-top: 1px dashed var(--g1); padding-top: 10px; font-size: 14px; }
#ask input { flex: 1; min-width: 0; background: #000; border: 0; border-bottom: 1px solid var(--g1); color: var(--w); font: inherit; padding: 4px 2px; outline: none; }
#ask input::placeholder { color: var(--g1); }

footer { text-align: center; margin-top: 40px; }
footer pre { display: inline-block; text-align: left; color: var(--g2); }
footer .dim { font-size: 12px; max-width: 560px; margin: 8px auto; line-height: 1.5; }

::selection { background: var(--g3); color: #000; }

@media (max-width: 640px) {
  .logo { display: none; }
  .logo-small { display: inline-block; font-size: 13px; }
  pre { font-size: 11.5px; }
  .box { padding: 20px 12px 14px; }
  .box p { font-size: 13px; }
  #voice { bottom: 9vh; font-size: 17px; }
  #hint { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  #voice::after { animation: none; }
}
