/* The quest's look, shared by the classic page (inlined by build.py) and the explore page. */

/* Layout: one amber-phosphor monitor centred on a dark desk; every scene renders inside the glass. */
:root {
  --desk: #0b0805;
  --glass: #150e06;
  --phosphor: #ffb43a;
  --dim: #a8722a;
  --hot: #ffe6b0;
  --blood: #ff6a45;
  --rule: #4a3210;
  --font-game: "VT323", "Courier New", ui-monospace, monospace;
  --font-code: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--desk);
  color: var(--phosphor);
  font-family: var(--font-game);
  font-size: 22px;
  line-height: 1.25;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-bottom, 0px));
}
.monitor {
  max-width: 860px;
  margin: 0 auto;
  border: 2px solid var(--rule);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: 0 0 0 6px #1d1409, 0 0 60px rgba(255,180,58,.08), inset 0 0 80px rgba(0,0,0,.7);
  position: relative;
  overflow: hidden;
}
.monitor::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
}
.screen {
  padding: 22px 24px 28px;
  display: grid;
  gap: 14px;
  text-shadow: 0 0 6px rgba(255,180,58,.45);
  min-width: 0;
}
.status {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.status .lbl { color: var(--dim); letter-spacing: .06em; }
.bar { color: var(--hot); letter-spacing: -1px; }
.bar .gone { color: var(--rule); text-shadow: none; }
h1, h2 { font-weight: 400; margin: 0; text-wrap: balance; }
h2 { font-size: 30px; color: var(--hot); }
p { margin: 0; max-width: 62ch; }
.dim { color: var(--dim); }
.hot { color: var(--hot); }
.art {
  margin: 0;
  font-family: var(--font-game);
  /* Shrinks to fit narrow screens: a VT323 cell is about half its height wide. */
  font-size: min(20px, calc((100vw - 76px) / (var(--cols, 40) * 0.5)));
  line-height: 1.05;
  white-space: pre;
  overflow-x: auto;
}
.art.hot { color: var(--hot); }
.scroll {
  margin: 0;
  font-family: var(--font-code);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  background: rgba(0,0,0,.35);
  color: var(--dim);
  text-shadow: none;
}
.scroll .ln { display: block; padding: 0 6px; margin: 0 -6px; }
.scroll .ln.on { background: var(--phosphor); color: var(--glass); font-weight: 600; }
.scroll .agent { color: var(--phosphor); }
.cap { font-size: 18px; color: var(--dim); }
.legend { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 18px; color: var(--dim); }
.legend b { font-weight: 400; color: var(--hot); }
.pane { display: grid; gap: 4px; min-width: 0; }
.pane .lbl { font-size: 18px; color: var(--dim); letter-spacing: .06em; }
.rule-card { border: 1px dashed var(--phosphor); padding: 10px 12px; display: grid; gap: 6px; }
.feedback { border-left: 3px solid var(--hot); padding: 4px 0 4px 12px; display: grid; gap: 6px; }
.feedback.miss { border-color: var(--blood); }
.feedback .tag { color: var(--hot); letter-spacing: .08em; }
.feedback.miss .tag { color: var(--blood); }
.feedback.magic { border-color: var(--dim); }
.choices { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.choices button {
  font: inherit;
  color: var(--phosphor);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  padding: 4px 8px;
  width: 100%;
  cursor: pointer;
  text-shadow: inherit;
}
.choices button:hover, .choices button:focus-visible {
  outline: none;
  background: var(--phosphor);
  color: var(--glass);
  text-shadow: none;
}
.choices .key { color: var(--hot); }
.choices button:hover .key, .choices button:focus-visible .key { color: var(--glass); }
.cursor { display: inline-block; width: .6em; background: var(--phosphor); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.foot { font-size: 16px; color: var(--dim); border-top: 1px dashed var(--rule); padding-top: 8px; }
.foot a { color: var(--phosphor); }
.map-list { display: grid; gap: 4px; }
.realm-meta { font-size: 18px; color: var(--dim); }
.tag { color: var(--hot); }
.law { width: 100%; border-collapse: collapse; font-size: 19px; }
.law-wrap { overflow-x: auto; }
.law th, .law td { text-align: left; vertical-align: top; padding: 6px 10px 6px 0; border-bottom: 1px dashed var(--rule); }
.law th { color: var(--hot); font-weight: 400; }
.law td:first-child { color: var(--dim); min-width: 9em; }
.routes { display: grid; gap: 2px; font-size: 18px; color: var(--dim); }
.routes b { font-weight: 400; color: var(--hot); }
.notes { display: grid; gap: 8px; margin: 0; padding-left: 1.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.soon { color: var(--hot); letter-spacing: .04em; }
.sound { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: flex-end; padding: 0 24px 14px; position: relative; z-index: 1; }
.back-explore { margin: 0; padding: 0 24px 14px; font-size: 16px; position: relative; z-index: 1; }
.back-explore a { color: var(--phosphor); }
.sound button { font: inherit; font-size: 17px; color: var(--dim); background: transparent; border: 1px solid var(--rule); padding: 2px 10px; cursor: pointer; }
.sound button[aria-pressed="true"] { color: var(--phosphor); border-color: var(--dim); }
.sound button:hover, .sound button:focus-visible { outline: none; color: var(--glass); background: var(--phosphor); }
@media (max-width: 520px) {
  body { font-size: 20px; padding-block: 12px; }
  .screen { padding: 16px 14px 20px; }
  .law thead { display: none; }
  .law, .law tbody, .law tr, .law td { display: block; width: 100%; }
  .law tr { padding: 8px 0; border-bottom: 1px dashed var(--rule); }
  .law td { border: 0; padding: 2px 0; }
  .law td:first-child { color: var(--hot); min-width: 0; }
  .law td[data-col]::before { content: attr(data-col) ": "; color: var(--dim); }
}
.flame { color: var(--hot); animation: flicker 1.3s steps(2) infinite; }
.flame.b { animation-delay: .45s; }
@keyframes flicker { 50% { color: var(--blood); opacity: .7; } }
.scene { color: var(--dim); }
.scene .hot { color: var(--hot); }
.shimmer { color: var(--phosphor); animation: shimmer 2.4s ease-in-out infinite; }
@keyframes shimmer { 50% { color: var(--dim); } }
.rules { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rules li { display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; }
.verdict { font-size: 27px; color: var(--hot); border-top: 1px dashed var(--dim); border-bottom: 1px dashed var(--dim); padding: 8px 0; }
.rules .who { color: var(--hot); letter-spacing: .06em; }
@media (max-width: 520px) { .rules li { grid-template-columns: 1fr; gap: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor, .flame, .shimmer { animation: none; } }
