/* HORDE: After the Fall. The page looks like the game: a ruined city at dusk, purple ruins, toxic green glow,
   thick black ink lines and hard comic shadows. */
:root {
  --bg: #140B2E;
  --bg2: #1C1040;
  --panel: #251552;
  --panel2: #1A0F3C;
  --track: #120A2A;
  --ink: #07040F;
  --text: #FFF3DC;
  --text2: #C2B5E8;
  --pink: #FF5DA2;
  --yellow: #FFD23F;
  --teal: #2EC4B6;
  --purple: #7B5CFF;
  --orange: #FF8C42;
  --green: #8AFF5C;
  --toxic: #7CFF6B;
  --red: #FF3B4E;
  --line: 3px solid var(--ink);
  --sh: 4px 4px 0 var(--ink);
  --r: 14px;
  --head: "Bungee", "Rubik", system-ui, sans-serif;
  --body: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 50% -10%, rgba(255, 93, 162, 0.22), transparent 70%),
    radial-gradient(900px 400px at 85% 110%, rgba(124, 255, 107, 0.12), transparent 70%),
    radial-gradient(rgba(255, 243, 220, 0.06) 1.2px, transparent 1.3px);
  background-size: auto, auto, 16px 16px;
  background-attachment: fixed, fixed, scroll;
  color: var(--text);
  font: 500 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; margin: 0; line-height: 1.1; letter-spacing: 0.01em; }
h2 { font-size: clamp(26px, 4vw, 40px); text-shadow: 3px 3px 0 var(--ink); }
h3 { font-size: 18px; }
p { margin: 0; }
code { font: 700 0.92em/1 ui-monospace, Menlo, monospace; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; padding: 1px 5px; }
.muted { color: var(--text2); }
.hidden { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; }

/* ---------- buttons and tags ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 400 14px/1 var(--head); letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  color: var(--text); background: var(--panel); border: var(--line); border-radius: 12px;
  padding: 10px 14px; box-shadow: var(--sh); transition: transform 0.08s, box-shadow 0.08s;
  white-space: nowrap;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.hot { background: var(--pink); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.btn.off { background: #3A2C66; color: var(--text2); cursor: default; text-shadow: none; }
.btn.snd { background: var(--yellow); color: var(--ink); }
.btn.snd.on { background: var(--toxic); }
.btn.x { padding: 10px 12px; }
.tag {
  display: inline-block; font: 400 12px/1 var(--head); letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--text); color: var(--ink); border: 2px solid var(--ink); padding: 5px 9px 4px; border-radius: 8px; transform: rotate(-2deg);
}
.tag.pink { background: var(--pink); color: #fff; }
.tag.teal { background: var(--teal); }
.tag.red { background: var(--red); color: #fff; }
.tag.yellow { background: var(--yellow); }
.tag.purple { background: var(--purple); color: #fff; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 8px max(16px, calc((100vw - 1560px) / 2));
  background: rgba(20, 11, 46, 0.92); backdrop-filter: blur(6px); border-bottom: var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font: 400 24px/1 var(--head); color: var(--toxic); text-shadow: 3px 3px 0 var(--ink); }
.logo-spr { display: block; width: 40px; height: 40px; }
.live { display: inline-flex; align-items: center; gap: 6px; font: 400 12px/1 var(--head); background: var(--red); color: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 5px 9px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.links { display: flex; gap: 18px; margin-left: 10px; }
.links a { text-decoration: none; font-weight: 700; color: var(--text2); }
.links a:hover { color: var(--text); text-decoration: underline wavy var(--toxic); text-underline-offset: 4px; }
.sp { flex: 1; }

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

/* ---------- the show: as wide as the screen allows ---------- */
.show { width: min(1560px, 100vw - 32px); margin-left: 50%; transform: translateX(-50%); padding: 16px 0 10px; }
.stage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.where { display: flex; align-items: center; gap: 8px; font-family: var(--head); }
.where b, .where span { background: var(--panel); border: var(--line); border-radius: 10px; padding: 6px 10px 5px; font-weight: 400; box-shadow: 3px 3px 0 var(--ink); }
.where b { background: var(--purple); color: #fff; }
.tod { display: inline-flex; align-items: center; gap: 6px; background: var(--yellow) !important; color: var(--ink); }
.tod.night { background: #0B0624 !important; color: var(--toxic); }
.radio, .morale { display: flex; align-items: center; gap: 8px; background: var(--panel); border: var(--line); border-radius: 12px; padding: 5px 10px; box-shadow: 3px 3px 0 var(--ink); font-weight: 800; font-size: 14px; }
.radio { flex: 1; min-width: 240px; }
.ri { display: inline-flex; color: var(--red); }
.morale .ri { color: var(--pink); }
.rbar { flex: 1; height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--track); overflow: hidden; position: relative; }
.rbar .part { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: var(--ink); }
.rbar .part::after { content: ""; position: absolute; left: -3px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border: 2px solid var(--ink); border-radius: 50%; background: #FF3B4E; }
.rbar .part.got::after { background: var(--toxic); }
.rbar.stuck i { animation: stuckbar 1s steps(2) infinite; }
@keyframes stuckbar { 50% { filter: saturate(0.3) brightness(0.8); } }
.rbar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--toxic) 0 8px, #4FD13E 8px 16px); border-right: 2px solid var(--ink); transition: width 0.8s; box-shadow: 0 0 10px var(--toxic); }
.hearts { display: flex; gap: 3px; }
.hearts i { width: 16px; height: 14px; background: #3A2C66; clip-path: path("M8 14 1.5 7.5A4 4 0 0 1 8 2.5a4 4 0 0 1 6.5 5z"); }
.hearts i.full { background: var(--pink); }
.hearts i.half { background: linear-gradient(90deg, var(--pink) 50%, #3A2C66 50%); }

.stage {
  position: relative; aspect-ratio: 384 / 180; border: 4px solid var(--ink); border-radius: 18px; overflow: hidden;
  box-shadow: 10px 10px 0 var(--pink), 10px 10px 0 3px var(--ink), 0 0 60px rgba(255, 93, 162, 0.25); background: #2B1557;
}
body.is-night .stage { box-shadow: 10px 10px 0 #2E8A3A, 10px 10px 0 3px var(--ink), 0 0 70px rgba(124, 255, 107, 0.2); }
.stage canvas { display: block; width: 100%; height: 100%; }
.hud { position: absolute; left: 12px; top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.hud span { display: flex; align-items: center; gap: 5px; background: rgba(20, 11, 46, 0.88); color: var(--text); border: 2.5px solid var(--ink); border-radius: 10px; padding: 4px 9px; box-shadow: 2px 2px 0 var(--ink); font-weight: 800; font-size: 17px; }
.hud span em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--text2); }
.hud .h-food .ic { color: var(--red); }
.hud .h-scrap .ic { color: #B79CFF; }
.hud .h-wall .ic { color: var(--orange); }
.hud .h-farm .ic { color: var(--toxic); }
.hud .h-weapons .ic { color: #FF8C42; }
.hud .low { background: var(--red); animation: shake 0.5s infinite; }
.hud .low em, .hud .low .ic { color: #fff !important; }
@keyframes shake { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }

.flash {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) rotate(-3deg);
  background: var(--yellow); color: var(--ink); border: 4px solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--ink);
  padding: 12px 22px; text-align: center; pointer-events: none; max-width: 80%;
}
.flash .lbl { display: block; font: 800 12px/1.2 var(--body); text-transform: uppercase; letter-spacing: 0.1em; }
.flash b { display: block; font: 400 clamp(18px, 3.2vw, 38px)/1.1 var(--head); }
.flash.pop { animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
.flash.betray { background: var(--red); color: #fff; }
.flash.betray b { text-shadow: 3px 3px 0 var(--ink); }
.flash.night { background: #0B0624; color: var(--toxic); }
.flash.win { background: var(--toxic); }
.flash.over { background: var(--ink); color: var(--red); border-color: var(--red); }
.flash.blood { background: #3A0612; color: #FF4A5A; border-color: var(--ink); }
.flash.blood b { text-shadow: 3px 3px 0 var(--ink); }
.flash.event { background: var(--orange); }
.flash.fog { background: #1F3328; color: var(--toxic); }
.hud .h-ev { background: var(--orange); color: var(--ink); }
.hud .h-ev em { color: var(--ink); }
.hud .h-ev.fog { background: #1F3328; color: var(--toxic); }
.hud .h-ev.blood { background: #8A1020; color: #fff; animation: throb 1.2s infinite; }
.hud .h-ev.blood em { color: #FFC9CF; }
@keyframes throb { 50% { transform: scale(1.06); } }
.stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity 2s; background: radial-gradient(ellipse at center, transparent 55%, rgba(5, 2, 12, 0.75)); }
body.is-night .stage::before { opacity: 0.8; }
body.is-blood .stage::before { opacity: 1; background: radial-gradient(ellipse at center, transparent 50%, rgba(90, 4, 20, 0.8)); animation: pulse 2.4s infinite; }
body.is-blood .stage { box-shadow: 10px 10px 0 #8A1020, 10px 10px 0 3px var(--ink), 0 0 80px rgba(255, 40, 60, 0.35); }
@keyframes pulse { 50% { opacity: 0.65; } }
.log .k-blood { background: #3A0612; color: #FF6B78; font-weight: 700; }
.log .k-event { background: #4A2C10; color: #FFD23F; }
@keyframes pop { from { transform: translate(-50%, -50%) rotate(-12deg) scale(0.3); } to { transform: translate(-50%, -50%) rotate(-3deg) scale(1); } }

.paused { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: var(--panel); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 800; box-shadow: 3px 3px 0 var(--ink); white-space: nowrap; }
.paused i { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); animation: blink 1s infinite; }
.soundhint { position: absolute; right: 12px; top: 12px; font: 400 13px/1 var(--head); color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); border-radius: 10px; padding: 7px 10px; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; animation: wob 2s infinite; }
@keyframes wob { 50% { transform: rotate(3deg) scale(1.04); } }
.offline { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: rgba(20, 11, 46, 0.92); gap: 4px; }
.offline b { font: 400 24px var(--head); }

.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bub {
  position: absolute; transform: translate(-50%, -100%) scale(0.6); opacity: 0; transition: opacity 0.25s, transform 0.25s;
  max-width: min(190px, 28%); background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 3px 7px 4px; font-weight: 600; font-size: 12px; line-height: 1.25; box-shadow: 2px 2px 0 var(--ink);
}
.bub b { display: block; font: 400 9px/1.2 var(--head); color: var(--purple); }
.bub::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 9px; height: 9px; background: #fff; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateX(-50%) rotate(45deg) skew(10deg, 10deg); }
.bub.on { opacity: 1; transform: translate(-50%, -100%) scale(1); }

.narr { display: flex; align-items: center; gap: 12px; margin-top: 22px; background: var(--ink); color: var(--text); border: 3px solid var(--ink); border-radius: 14px; padding: 12px 16px; box-shadow: 4px 4px 0 var(--toxic); }
.mic { font: 400 11px/1 var(--head); background: var(--toxic); color: var(--ink); padding: 5px 7px; border-radius: 6px; flex: none; }
.narr p { font-weight: 600; font-size: 17px; }

.play { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; margin-top: 22px; }
.card { background: var(--panel); border: var(--line); border-radius: var(--r); box-shadow: 8px 8px 0 var(--ink); padding: 18px; min-width: 0; }
.vote-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.vote h2 { font-size: clamp(20px, 2.6vw, 28px); margin-top: 8px; }
.vote[data-kind="night"] { background: #0F2A22; box-shadow: 8px 8px 0 #2E8A3A, 8px 8px 0 3px var(--ink); }
.vote[data-kind="night"] .tag { background: var(--toxic); color: var(--ink); }
.vote[data-kind="council"] { background: #4A1233; box-shadow: 8px 8px 0 var(--red), 8px 8px 0 3px var(--ink); }
.vote[data-kind="council"] .tag { background: var(--red); color: #fff; }
.vote[data-kind="turning"] { background: #16301A; box-shadow: 8px 8px 0 #7CFF6B, 8px 8px 0 3px var(--ink); }
.vote[data-kind="turning"] .tag { background: #7CFF6B; color: var(--ink); }
.vote[data-kind="crisis"] { background: #3A0A16; box-shadow: 8px 8px 0 #FF3B4E, 8px 8px 0 3px var(--ink); }
.vote[data-kind="crisis"] .tag { background: #FF3B4E; color: #fff; }
.vote[data-kind="cast"] { background: #10343A; box-shadow: 8px 8px 0 var(--teal), 8px 8px 0 3px var(--ink); }
.vote[data-kind="cast"] .tag { background: var(--teal); }
.vote[data-kind][data-blood="1"] { background: #2A0812; box-shadow: 8px 8px 0 #8A1020, 8px 8px 0 3px var(--ink); }
.vote[data-kind][data-blood="1"] .tag { background: #8A1020; color: #fff; }
.vote[data-blood="1"] .bar i { background: #FF3B4E; }
.clock { text-align: center; background: var(--yellow); color: var(--ink); border: var(--line); border-radius: 12px; padding: 6px 10px; box-shadow: 3px 3px 0 var(--ink); min-width: 74px; }
.clock b { display: block; font: 400 22px/1 var(--head); }
.clock b.sm { font-size: 15px; padding: 3px 0; }
.clock span { font-size: 11px; font-weight: 800; text-transform: uppercase; }
.bar { height: 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--track); margin: 14px 0; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--toxic); transition: width 0.3s linear; }
.bar i.low { background: var(--red); }
.bar i.wait { background: repeating-linear-gradient(-45deg, var(--orange) 0 8px, var(--yellow) 8px 16px); }
.opts { display: grid; gap: 10px; }
.opt {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  font: inherit; color: var(--text); background: var(--panel2); border: var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer;
  box-shadow: var(--sh); transition: transform 0.08s, box-shadow 0.08s;
}
.opt:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.opt:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.opt:disabled { opacity: 0.7; cursor: default; }
.opt > * { position: relative; z-index: 1; }
.opt .fill { position: absolute; inset: 0 auto 0 0; z-index: 0; width: 0; background: rgba(255, 210, 63, 0.25); transition: width 0.5s; }
.opt .num { flex: none; width: 28px; height: 28px; display: grid; place-content: center; font: 400 14px/1 var(--head); background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; }
.opt .ico { flex: none; width: 46px; height: 46px; display: grid; place-content: center; background: #fff; border: 2.5px solid var(--ink); border-radius: 10px; color: var(--purple); }
.opt .ico .ic { width: 26px; height: 26px; }
.opt .txt { flex: 1; min-width: 0; }
.opt .txt b { display: block; font-size: 17px; font-weight: 800; }
.opt .txt small { display: block; color: var(--text2); font-size: 13px; line-height: 1.3; }
.opt .pct { font: 400 18px/1 var(--head); }
.opt.mine { background: #2C5A1E; border-color: var(--ink); box-shadow: 4px 4px 0 var(--toxic); }
.opt.mine .num { background: var(--toxic); }
.opt.exile .ico { background: #FFD3DA; }
.opt.forgive .ico { background: #DFF7CF; }
.hint { margin-top: 12px; font-size: 14px; color: var(--text2); }

.chat { display: flex; flex-direction: column; min-height: 380px; max-height: 520px; }
.chat-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--panel2); border: 2.5px solid var(--ink); border-radius: 10px; font-size: 15px; }
.msg { line-height: 1.35; word-wrap: break-word; }
.msg b { font-weight: 800; }
.voted { margin-left: 6px; font: 400 10px/1 var(--head); background: var(--toxic); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 6px; padding: 2px 5px; vertical-align: 1px; }
.say { display: flex; gap: 8px; margin-top: 10px; }
.say input { min-width: 0; font: 600 15px var(--body); color: var(--text); background: var(--panel2); border: var(--line); border-radius: 10px; padding: 9px 10px; }
.say input::placeholder { color: #8A7DB8; }
.say input:focus { outline: none; box-shadow: 0 0 0 3px var(--yellow); }
#sayName { width: 90px; flex: none; }
#sayText { flex: 1; }
.err { color: var(--red); font-weight: 700; font-size: 14px; min-height: 1em; margin-top: 4px; }

/* ---------- sections ---------- */
.block { padding: 56px 0 10px; }
.sec-h { margin-bottom: 20px; }
.sec-h h2 { margin-top: 10px; }
.sec-h p { margin-top: 6px; }
.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; }

.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pcard { background: var(--panel); border: var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.pcard.c0 { box-shadow: 6px 6px 0 var(--toxic), 6px 6px 0 3px var(--ink); }
.pcard.c1 { box-shadow: 6px 6px 0 var(--pink), 6px 6px 0 3px var(--ink); }
.pcard.c2 { box-shadow: 6px 6px 0 var(--yellow), 6px 6px 0 3px var(--ink); }
.pcard.c3 { box-shadow: 6px 6px 0 var(--teal), 6px 6px 0 3px var(--ink); }
.pcard.c4 { box-shadow: 6px 6px 0 var(--purple), 6px 6px 0 3px var(--ink); }
.pcard.c5 { box-shadow: 6px 6px 0 var(--orange), 6px 6px 0 3px var(--ink); }
.pcard.bitten { background: #1E3A22; }
.pcard.hurt .meter i { background: var(--red); }
.pc-top { display: flex; align-items: center; gap: 10px; }
.pc-spr { width: 64px; height: 64px; flex: none; background: #3A2370; border: 2.5px solid var(--ink); border-radius: 12px; }
.pc-top h3 { font-size: 20px; }
.role { font-weight: 700; color: var(--text2); font-size: 14px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.mood, .bit { font: 400 11px/1 var(--head); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 8px 3px; }
.mood.loyal { background: var(--toxic); }
.mood.content { background: var(--teal); }
.mood.uneasy { background: var(--yellow); }
.mood.resentful { background: var(--red); color: #fff; }
.bit { background: #B6FF6B; animation: shake 0.6s infinite; }
.bit.sick { background: #FFB38A; animation: none; }
.stat { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; }
.meter { flex: 1; height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--track); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--toxic); }
.quote { font-size: 14px; font-style: italic; color: var(--text2); }
.pcard.empty { align-items: center; justify-content: center; text-align: center; border: 3px dashed #4A3A80; background: transparent; box-shadow: none; min-height: 180px; color: var(--text2); }
.pcard.empty .q { font: 400 44px/1 var(--head); color: var(--text); opacity: 0.25; }

.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.log li { display: flex; gap: 10px; background: var(--panel); border: 2.5px solid var(--ink); border-radius: 10px; padding: 8px 10px; font-size: 15px; line-height: 1.35; }
.log .d { flex: none; font: 400 11px/1 var(--head); background: var(--text); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; padding: 4px 5px 3px; height: fit-content; }
.log .k-good, .log .k-win { background: #1D3D2A; }
.log .k-bad, .log .k-hurt { background: #45281E; }
.log .k-bite { background: #24452A; color: var(--toxic); }
.log .k-dead, .log .k-over { background: var(--ink); color: var(--text); }
.log .k-betray { background: var(--red); color: #fff; font-weight: 700; }
.log .k-night { background: #0B0624; color: var(--toxic); }
.log .k-cast { background: #10343A; }
.log .k-vote { color: var(--text2); background: var(--panel2); }

.gone { display: flex; flex-direction: column; gap: 8px; }
.grave { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 2.5px solid var(--ink); border-radius: 10px; padding: 6px 10px; }
.grave b { display: block; font-family: var(--head); font-weight: 400; }
.grave span { font-size: 13px; color: var(--text2); }
.grave.turned { background: #1E3A22; }
.grave.exiled, .grave.deserted { background: #401636; }
.records { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.best { background: var(--yellow); color: var(--ink); border: var(--line); border-radius: 12px; box-shadow: var(--sh); padding: 10px 12px; }
.best span { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.best b { font: 400 22px/1.2 var(--head); }

.story { margin-top: 50px; }
.story-in { background: linear-gradient(180deg, #4FC3FF 0%, #FFB3D9 55%, #FFD58A 100%); color: var(--ink); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 10px 10px 0 var(--ink); padding: clamp(20px, 4vw, 40px); display: grid; grid-template-columns: 1.6fr 0.6fr; gap: 24px; align-items: center; position: relative; overflow: hidden; }
.story-in > * { position: relative; z-index: 1; }
.story h2 { font-size: clamp(30px, 5vw, 54px); margin: 12px 0; text-shadow: 4px 4px 0 var(--ink); color: var(--yellow); -webkit-text-stroke: 2px var(--ink); }
.lead { font-size: 18px; max-width: 62ch; font-weight: 600; }
.lead b { color: #8A1F55; }
.chapters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 20px; }
.ch { position: relative; background: #fff; color: var(--ink); border: var(--line); border-radius: 14px; padding: 14px 14px 14px 50px; box-shadow: var(--sh); }
.ch span { position: absolute; left: 12px; top: 12px; width: 28px; height: 28px; display: grid; place-content: center; font: 400 15px/1 var(--head); border: 2px solid var(--ink); border-radius: 8px; }
.ch.c1 span { background: var(--pink); } .ch.c2 span { background: var(--yellow); } .ch.c3 span { background: var(--teal); } .ch.c4 span { background: var(--red); color: #fff; }
.ch h3 { margin-bottom: 4px; }
.ch p { font-size: 15px; color: #3A3050; }
.story-art { display: grid; place-content: center; }
.story-art span { display: block; background: var(--yellow); border: 4px solid var(--ink); border-radius: 50%; padding: 18px; box-shadow: 6px 6px 0 var(--ink); transform: rotate(-6deg); }

.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { background: var(--panel); border: var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); }
.step .n { display: grid; place-content: center; width: 40px; height: 40px; font: 400 20px/1 var(--head); color: var(--ink); border: var(--line); border-radius: 12px; margin-bottom: 10px; }
.step.s1 .n { background: var(--toxic); } .step.s2 .n { background: var(--yellow); } .step.s3 .n { background: var(--pink); } .step.s4 .n { background: var(--teal); }
.step h3 { margin-bottom: 6px; }
.step p { font-size: 15px; color: var(--text2); }

.coin { padding-bottom: 50px; }
.coin-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--yellow); color: var(--ink); border: 4px solid var(--ink); border-radius: 22px; padding: clamp(20px, 4vw, 40px); box-shadow: 10px 10px 0 var(--pink), 10px 10px 0 3px var(--ink); }
.coin h2 { font-size: clamp(40px, 7vw, 76px); margin: 10px 0 8px; color: var(--ink); text-shadow: 4px 4px 0 var(--pink); }
.coin p { max-width: 50ch; font-size: 17px; font-weight: 600; }
.coin .btn:not(.hot):not(.off) { background: #fff; color: var(--ink); }
.ca { display: flex; align-items: center; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.ca code { background: #fff; font-size: 14px; padding: 8px 10px; word-break: break-all; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.coin-spr { flex: none; }

.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 18px max(16px, calc((100vw - 1240px) / 2)); border-top: var(--line); background: var(--ink); color: var(--yellow); font-family: var(--head); }
.foot .muted { font: 500 14px var(--body); }

/* the 3D preview: a deeper stage seen from above */
.stage.s3d { aspect-ratio: 2 / 1; background: #140B2E; }
.dragtip { position: absolute; right: 12px; bottom: 12px; font: 400 11px/1 var(--head); color: var(--text); background: rgba(20, 11, 46, 0.8); border: 2px solid var(--ink); border-radius: 8px; padding: 5px 8px; pointer-events: none; opacity: 0.85; }
.btn.view { background: var(--teal); color: var(--ink); }
.zoom3d { position: absolute; right: 12px; bottom: 44px; display: flex; flex-direction: column; gap: 6px; }
.zoom3d button { width: 38px; height: 38px; font: 400 22px/1 var(--head); color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; }
.zoom3d button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* the game, the vote and the chat side by side on big screens */
@media (min-width: 1100px) {
  .arena { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 21vw, 330px); gap: 18px; align-items: stretch; }
  .arena .play { display: flex; flex-direction: column; gap: 14px; margin-top: 0; min-height: 0; }
  .arena .card { box-shadow: 5px 5px 0 var(--ink); }
  .arena .vote { padding: 12px; }
  .arena .vote .tag { font-size: 10px; }
  .arena .vote h2 { font-size: 15px; line-height: 1.2; margin-top: 6px; }
  .arena .bar { height: 8px; margin: 9px 0; }
  .arena .opts { gap: 7px; }
  .arena .opt { padding: 6px 8px; gap: 8px; border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
  .arena .opt .num { width: 22px; height: 22px; font-size: 12px; }
  .arena .opt .ico { width: 32px; height: 32px; border-width: 2px; border-radius: 8px; }
  .arena .opt .ico .ic { width: 20px; height: 20px; }
  .arena .opt .ico canvas { width: 30px !important; height: 30px !important; }
  .arena .opt .txt b { font-size: 14px; }
  .arena .opt .txt small { font-size: 11px; }
  .arena .opt .pct { font-size: 14px; }
  .arena .hint { margin-top: 8px; font-size: 11px; line-height: 1.35; }
  .arena .vote-h > div:first-child { min-width: 0; }
  .arena .clock { flex: none; min-width: 56px; padding: 4px 6px; box-shadow: 2px 2px 0 var(--ink); }
  .arena .clock b { font-size: 17px; }
  .arena .clock b.sm { font-size: 11px; }
  .arena .clock span { font-size: 9px; }
  .arena .chat { flex: 1 1 0; min-height: 170px; max-height: none; padding: 12px; }
  .arena .msgs { font-size: 13px; }
  .arena .say { gap: 6px; }
  .arena .say input { font-size: 13px; padding: 7px 8px; }
  .arena .say #sayName { width: 70px; flex: none; }
  .arena .say input#sayText { flex: 1; }
  .arena .say .btn { padding: 7px 10px; font-size: 12px; }
  .arena-main .narr { margin-top: 16px; }
  .stage.s3d { aspect-ratio: 16 / 9; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1000px) {
  .play, .two { grid-template-columns: 1fr; }
  .team { grid-template-columns: repeat(2, 1fr); }
  .how { grid-template-columns: repeat(2, 1fr); }
  .links { display: none; }
}
@media (max-width: 640px) {
  .top { gap: 8px; padding: 8px 12px; }
  .brand { font-size: 20px; }
  .logo-spr { width: 34px; height: 34px; }
  .logo-spr canvas { width: 34px !important; height: 34px !important; }
  .live { display: none; }
  .btn { padding: 8px 10px; font-size: 12px; box-shadow: 3px 3px 0 var(--ink); }
  .btn.snd span { display: none; }
  main { padding: 0 12px; }
  .show { width: 100vw; padding-top: 10px; }
  .stage-head { padding: 0 12px; }
  .stage { border-width: 3px 0; border-radius: 0; box-shadow: 0 6px 0 var(--pink), 0 9px 0 var(--ink); }
  body.is-night .stage { box-shadow: 0 6px 0 #2E8A3A, 0 9px 0 var(--ink); }
  .narr, .play { margin-left: 12px; margin-right: 12px; }
  .hud { left: 6px; top: 6px; gap: 4px; }
  .hud span { padding: 1px 5px; font-size: 12px; border-width: 2px; }
  .hud span em { display: none; }
  .hud .ic { width: 14px; height: 14px; }
  .bubbles { display: none; }
  .stage.s3d { aspect-ratio: 4 / 3; }
  .dragtip { display: none; }
  .zoom3d { right: 6px; bottom: 6px; flex-direction: row; }
  .zoom3d button { width: 30px; height: 30px; font-size: 18px; }
  .btn.view { display: none; }
  .soundhint { top: 6px; right: 6px; font-size: 10px; padding: 5px 7px; }
  .paused { font-size: 12px; bottom: 6px; left: 6px; transform: none; }
  .flash { padding: 8px 14px; }
  .radio { min-width: 0; width: 100%; order: 3; }
  .narr p { font-size: 15px; }
  .team { grid-template-columns: 1fr; }
  .how, .chapters { grid-template-columns: 1fr; }
  .story-in { grid-template-columns: 1fr; }
  .story-art { display: none; }
  .coin-in { flex-direction: column; align-items: flex-start; }
  .coin-spr { display: none; }
  .card { box-shadow: 5px 5px 0 var(--ink); padding: 14px; }
}

/* read their mind */
.peek { position: absolute; left: 12px; bottom: 12px; width: min(300px, 46%); background: var(--panel); color: var(--text); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink); padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; z-index: 3; }
.peek.pop { animation: peekpop 0.3s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes peekpop { from { transform: translateY(14px) scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
body:has(.peek:not(.hidden)) .mindtip { display: none; }
.peek .pk-x { position: absolute; right: 6px; top: 4px; background: none; border: 0; color: var(--text2); font: 700 22px/1 var(--body); cursor: pointer; padding: 4px 6px; }
.peek .pk-top { display: flex; align-items: center; gap: 10px; }
.peek h3 { margin: 0; font: 400 17px/1.1 var(--head); }
.peek .role { font-size: 12px; color: var(--text2); font-weight: 700; }
.peek .pk-trait { margin: 0; font-size: 13px; color: var(--text2); line-height: 1.35; }
.peek .pk-said { margin: 0; font-size: 14px; }
.peek .pk-said span, .peek .pk-think span { display: block; font: 800 10px/1.4 var(--body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text2); }
.peek .pk-think { background: #0F0828; border: 2px dashed var(--toxic); border-radius: 12px; padding: 8px 10px; font-size: 14px; font-style: italic; color: var(--toxic); }
.peek .pk-think span { color: var(--toxic); opacity: 0.8; font-style: normal; }
.pcard[data-id] { cursor: pointer; transition: transform 0.15s; }
.pcard[data-id]:hover { transform: translateY(-3px); }
.pc-mind { align-self: flex-start; font: 800 11px/1 var(--body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--toxic); border: 2px dashed var(--toxic); border-radius: 999px; padding: 5px 9px; }
.mindtip { left: 12px; right: auto; }
@media (max-width: 640px) {
  .clock b { font-size: 18px; }
  .clock b.sm { font-size: 12px; }
  .rbar { min-width: 70px; }
  #radioTxt { font-size: 12px; line-height: 1.2; }
  .peek { position: fixed; left: 8px; right: 8px; bottom: 8px; width: auto; padding: 10px 12px; gap: 5px; z-index: 50; box-shadow: 0 6px 0 var(--ink), 0 10px 40px rgba(0, 0, 0, 0.6); }
  .peek .pk-trait { font-size: 12px; }
  .peek h3 { font-size: 14px; }
  .peek .pk-think { font-size: 12px; padding: 6px 8px; }
  .mindtip { display: block; left: 6px; bottom: 6px; font-size: 9px; }
}

/* the goal, always on the vote card, and a welcome card on the first visit */
.goal { margin: 8px 0 0; font-size: 13px; line-height: 1.35; color: var(--text2); }
.goal b { color: var(--toxic); }
.arena .goal { font-size: 11.5px; margin-top: 6px; }
.intro { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(440px, 88%); z-index: 6; background: var(--panel); color: var(--text); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--toxic), 0 0 0 2000px rgba(8, 4, 20, 0.55); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.intro.hidden { display: none; }
.intro-t { font: 400 22px/1.1 var(--head); color: var(--toxic); }
.intro p { margin: 0; font-size: 15px; }
.intro ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.35; }
.intro code { background: var(--yellow); color: var(--ink); border-radius: 5px; padding: 0 4px; font-size: 12px; }
.intro .btn { align-self: flex-start; }
@media (max-width: 640px) { .intro { width: 92%; padding: 12px; gap: 7px; } .intro-t { font-size: 17px; } .intro p, .intro ol { font-size: 12.5px; } }
