/* ── UI scale (js/ui.js applyUiScale): <html> is zoomed by --z on big screens. Zoom also scales viewport
   units, so every vw/vh in this file goes through these vars, which undo it and keep 100vw = the real screen. */
:root { --z: 1; --vw: calc(1vw / var(--z)); --vh: calc(1vh / var(--z)); --vmin: calc(1vmin / var(--z)); --vmax: calc(1vmax / var(--z)); }
/* ───────── Tokens ───────── */
:root {
  --ink: #140a1c;
  --paper: #fff4dc;
  --cream: #f4ead0;
  --deep: #1a0626;
  --purple: #3b1056;
  --violet: #6a1b9a;
  --magenta: #ff2d75;
  --acid: #c6ff3d;
  --gold: #ffc400;
  --red: #d4150b;
  --sky: #4fc3f7;
  --c-green: #2f9a4a; --c-blue: #2c56b8; --c-red: #d22a1e; --c-yellow: #e8b900; --c-pink: #e8649a; --c-gold: #ffb300;
  --f-title: 'Bangers', 'Impact', sans-serif;
  --f-jp: 'Potta One', 'Dela Gothic One', sans-serif;
  --f-body: 'M PLUS Rounded 1c', system-ui, sans-serif;
  --shadow: 5px 5px 0 var(--ink);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--deep);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  overflow: hidden;
  user-select: none;
}
button { font-family: inherit; }
#app { position: fixed; inset: 0; overflow: hidden; }

/* ───────── Comic primitives ───────── */
.sunburst { position: absolute; inset: 0; overflow: hidden; z-index: 0; --c1: #4a1170; --c2: #2b0842; }
.sunburst::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: calc(300 * var(--vmax)); height: calc(300 * var(--vmax));
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, var(--c1) 0deg 6deg, var(--c2) 6deg 12deg);
  animation: spin 90s linear infinite;
}
.halftone::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(rgba(20, 10, 28, .22) 1.1px, transparent 1.5px) 0 0 / 7px 7px;
  mix-blend-mode: multiply;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.panel {
  position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-title {
  font-family: var(--f-title); font-size: 22px; letter-spacing: 1px; color: var(--paper);
  background: var(--ink); margin: -3px -3px 10px; padding: 4px 12px 2px; border-radius: var(--radius) var(--radius) 0 0;
  display: flex; align-items: center; justify-content: space-between;
}
.panel-title small { font-family: var(--f-jp); font-size: 12px; color: var(--gold); letter-spacing: 0; }

.btn {
  font-family: var(--f-title); font-size: 20px; letter-spacing: 1px; cursor: pointer;
  background: var(--gold); color: var(--ink); border: 3px solid var(--ink); border-radius: 8px;
  padding: 8px 16px 5px; box-shadow: 4px 4px 0 var(--ink); transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { filter: grayscale(.8) brightness(.8); cursor: not-allowed; opacity: .6; }
.btn.red { background: var(--red); color: var(--paper); }
.btn.magenta { background: var(--magenta); color: var(--paper); }
.btn.acid { background: var(--acid); }
.btn.ghost { background: var(--paper); }
.btn.dark { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--magenta); }
.btn.small { font-size: 15px; padding: 5px 10px 3px; box-shadow: 3px 3px 0 var(--ink); }
.btn.big { font-size: 30px; padding: 12px 28px 8px; }
.btn .sub { display: block; font-family: var(--f-body); font-size: 11px; font-weight: 800; letter-spacing: 0; opacity: .8; }

.tag {
  display: inline-block; font-family: var(--f-body); font-weight: 800; font-size: 11px; padding: 1px 7px;
  border: 2px solid var(--ink); border-radius: 20px; background: var(--cream); margin: 1px 2px; white-space: nowrap;
}
.tag.hot { background: var(--magenta); color: var(--paper); }
.tag.good { background: var(--acid); }
.tag.gold { background: var(--gold); }

.bar { position: relative; height: 14px; background: #2a1438; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--acid); transition: width .5s cubic-bezier(.3, 1.4, .5, 1); }
.bar.fear > i { background: repeating-linear-gradient(45deg, var(--magenta) 0 8px, #c2185b 8px 16px); }
.bar.mood > i { background: var(--gold); }
.bar.hp > i { background: linear-gradient(#ff6b6b, #d4150b); }
.bar.team > i { background: linear-gradient(#7ad7ff, #2c56b8); }
.bar.gauge > i { background: repeating-linear-gradient(90deg, var(--gold) 0 10px, #ff9800 10px 20px); }
.bar > span { position: absolute; inset: 0; font: 800 10px/10px var(--f-body); color: #fff; display: flex; align-items: center; justify-content: center; text-shadow: 0 1px 0 #000; }

.jp { font-family: var(--f-jp); }

/* ───────── Art ───────── */
.art { position: relative; overflow: hidden; width: 100%; height: 100%; }
.art-body { position: absolute; inset: 0; z-index: 2; opacity: 0; transition: opacity .4s; }
.art.loaded .art-body { opacity: 1; }
.art-body > img, .art-body > svg, .art > img.pose { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.art.full .art-body > img { object-fit: cover; }
.art > img.pose { z-index: 3; opacity: 0; pointer-events: none; }
.art > img.pose:not([src]) { display: none; }
.art.posing .art-body { opacity: 0; transition: none; }
.art.posing > img.pose { opacity: 1; animation: posePop .25s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes posePop { from { transform: scale(.9); } }
.art.loaded > .art-fb { opacity: 0; }
.art-fb {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: repeating-conic-gradient(from 0deg at 50% 55%, var(--fb) 0 8deg, color-mix(in srgb, var(--fb) 70%, #000) 8deg 16deg);
  transition: opacity .4s; z-index: 1;
}
.art.cut .art-fb { background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--fb) 80%, #fff) 0 30%, transparent 62%); }
.art-fb span { font-size: min(42cqmin, 90px); filter: drop-shadow(3px 3px 0 var(--ink)); line-height: 1; }
.art-fb svg { width: 70%; height: 70%; filter: drop-shadow(3px 3px 0 var(--ink)); }
.art-fb small { font: 800 10px var(--f-body); color: #fff; background: var(--ink); padding: 1px 6px; border-radius: 6px; margin-top: 4px; max-width: 90%; text-align: center; }
.art { container-type: size; }
.art.cut.sunbg::before {
  content: ''; position: absolute; inset: -40%; z-index: 0; opacity: .9;
  background: repeating-conic-gradient(from 0deg, var(--burst, #ffd54f) 0 7deg, transparent 7deg 14deg);
  -webkit-mask: radial-gradient(closest-side, #000 20%, transparent 54%); mask: radial-gradient(closest-side, #000 20%, transparent 54%);
  animation: spinA 40s linear infinite;
}
@keyframes spinA { to { transform: rotate(360deg); } }

/* ───────── Title screen ───────── */
.title-screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: calc(6 * var(--vh)); }
.title-screen .bgart { position: absolute; inset: 0; z-index: 0; }
.title-screen .bgart::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(26, 6, 38, .85)); z-index: 3; }
.logo { position: absolute; top: calc(5 * var(--vh)); left: 0; right: 0; text-align: center; z-index: 5; pointer-events: none; }
.logo .en {
  font-family: var(--f-title); font-size: clamp(54px, calc(10 * var(--vw)), 140px); line-height: .85; color: var(--gold); letter-spacing: 3px;
  -webkit-text-stroke: 3px var(--ink); text-shadow: 6px 6px 0 var(--red), 10px 10px 0 var(--ink);
  transform: rotate(-4deg); animation: logoIn .9s cubic-bezier(.2, 1.6, .4, 1) both;
}
.logo .jp {
  display: inline-block; margin-top: 18px; font-size: clamp(18px, calc(2.6 * var(--vw)), 34px); color: var(--paper); background: var(--red);
  border: 3px solid var(--ink); padding: 2px 18px; box-shadow: var(--shadow); transform: rotate(-4deg); animation: logoIn .9s .25s cubic-bezier(.2, 1.6, .4, 1) both;
}
.vs-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px auto 0; animation: logoIn .9s .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.vs-badge {
  font-family: var(--f-title); font-size: clamp(30px, calc(3.6 * var(--vw)), 52px); color: var(--paper); letter-spacing: 1px; line-height: 1;
  text-shadow: -2px 0px 0 var(--ink), 2px 0px 0 var(--ink), 0px -2px 0 var(--ink), 0px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), -1.0px -2px 0 var(--ink), 1.0px -2px 0 var(--ink), -1.0px 2px 0 var(--ink), 1.0px 2px 0 var(--ink), -2px -1.0px 0 var(--ink), 2px -1.0px 0 var(--ink), -2px 1.0px 0 var(--ink), 2px 1.0px 0 var(--ink), 4px 4px 0 var(--red), 6px 6px 0 var(--ink); transform: rotate(-6deg);
}
.vs-logo { width: clamp(220px, calc(26 * var(--vw)), 400px); height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55)); }
.logo .vs {
  display: table; margin: 6px auto 0; padding: 4px 16px 2px; animation: logoIn .9s .6s both; background: var(--ink); border: 3px solid var(--acid); border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .6); transform: rotate(-2deg);
  font-family: var(--f-title), 'Noto Sans JP', 'Noto Sans TC', sans-serif; font-weight: 900; color: var(--acid); font-size: clamp(16px, calc(1.8 * var(--vw)), 24px); letter-spacing: 1.5px;
}
/* Chinese title logo: heavy Traditional Chinese face with the same gold, stroke and offset shadows */
.logo .en.zh { font-family: 'Noto Sans TC', sans-serif; font-weight: 900; font-size: clamp(60px, calc(9 * var(--vw)), 128px); line-height: 1.02; letter-spacing: 6px; text-shadow: -3px 0px 0 var(--ink), 3px 0px 0 var(--ink), 0px -3px 0 var(--ink), 0px 3px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink), -1.5px -3px 0 var(--ink), 1.5px -3px 0 var(--ink), -1.5px 3px 0 var(--ink), 1.5px 3px 0 var(--ink), -3px -1.5px 0 var(--ink), 3px -1.5px 0 var(--ink), -3px 1.5px 0 var(--ink), 3px 1.5px 0 var(--ink), 6px 6px 0 var(--red), 10px 10px 0 var(--ink); font-style: italic; }
.logo .en.zh .zh-2 { display: inline-block; font-size: 1.12em; color: #fff; letter-spacing: 14px; text-shadow: 6px 6px 0 var(--magenta), 10px 10px 0 var(--ink); }
html[data-lang="zh"] .logo .jp { font-family: var(--f-title); letter-spacing: 3px; }
@keyframes logoIn { from { transform: scale(2.5) rotate(10deg); opacity: 0; } }
.title-menu { position: relative; z-index: 5; display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.title-foot { position: relative; z-index: 5; margin-top: 16px; color: var(--paper); font-size: 13px; font-weight: 700; text-align: center; background: rgba(18, 6, 26, .78); padding: 4px 12px; border-radius: 6px; }

/* ───────── HQ ───────── */
.hq { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; }
.hq > .bgart { position: absolute; inset: 0; z-index: 0; }
.hq > .bgart::after { content: ''; position: absolute; inset: 0; background: rgba(26, 6, 38, .55); z-index: 3; }
.hud {
  position: relative; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 8px 14px; flex-wrap: wrap;
  background: var(--ink); color: var(--paper); border-bottom: 4px solid var(--magenta);
}
.hud .brand { font-family: var(--f-title); font-size: 24px; color: var(--gold); letter-spacing: 1px; line-height: 1; }
.hud .brand small { display: block; font-family: var(--f-jp); font-size: 10px; color: var(--magenta); }
.hud .stat { display: flex; flex-direction: column; gap: 2px; min-width: 70px; }
.hud .stat b { font: 800 10px var(--f-body); color: var(--cream); opacity: .7; text-transform: uppercase; letter-spacing: 1px; }
.hud .stat span { font-family: var(--f-title); font-size: 22px; line-height: 1; letter-spacing: 1px; }
.hud .stat.wide { min-width: 170px; flex: 1; max-width: 300px; }
.hud .ep { background: var(--red); border: 2px solid var(--paper); padding: 3px 10px 1px; font-family: var(--f-title); font-size: 22px; border-radius: 6px; transform: rotate(-3deg); }
.hud .ap { display: flex; gap: 4px; }
.hud .ap i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--paper); background: var(--acid); box-shadow: 0 0 8px var(--acid); }
.hud .ap i.used { background: transparent; box-shadow: none; opacity: .4; }
.hud .spacer { flex: 1; }
.iconbtn { background: none; border: 2px solid var(--paper); color: var(--paper); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 16px; }
.iconbtn:hover { background: var(--magenta); }

.hq-main { position: relative; z-index: 4; display: grid; grid-template-columns: 290px 1fr 320px; gap: 16px; padding: 16px; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; padding: 0 6px 8px 0; }
.col::-webkit-scrollbar { width: 6px; } .col::-webkit-scrollbar-thumb { background: var(--magenta); border-radius: 4px; }

.monitor { padding: 0 0 10px; overflow: hidden; }
.monitor .screen { position: relative; height: 170px; margin: 0 10px; border: 3px solid var(--ink); border-radius: 14px; background: #12051c; overflow: hidden; }
.monitor .screen .art { position: absolute; inset: 0; }
.monitor .screen::after { content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .25) 2px 4px); }
.monitor .quip { margin: 10px 12px 0; font-weight: 800; font-size: 13px; line-height: 1.35; }
.monitor .moodbar { margin: 8px 12px 0; display: flex; align-items: center; gap: 8px; font: 800 11px var(--f-body); }
.monitor .moodbar .bar { flex: 1; }

.sunday { padding: 0 12px 12px; }
.sunday .opp { display: flex; gap: 10px; align-items: center; }
.sunday .opp .art { width: 90px; height: 62px; border: 2px solid var(--ink); border-radius: 8px; flex: none; }
.sunday p { margin: 6px 0 0; font-size: 12px; line-height: 1.4; }
.sunday .big { font-family: var(--f-title); font-size: 20px; line-height: 1; }

.execs { padding: 0 10px 10px; display: grid; gap: 6px; }
.exec-row { display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: center; }
.exec-row .art { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: var(--cream); }
.exec-row b { font-size: 12px; display: flex; justify-content: space-between; }
.exec-row.gone { opacity: .35; filter: grayscale(1); }

.rooms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.room {
  position: relative; aspect-ratio: 1 / 1.08; cursor: pointer; padding: 0; overflow: hidden; text-align: left;
  border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--paper);
  transition: transform .15s cubic-bezier(.3, 1.6, .5, 1);
}
.room:nth-child(odd) { transform: rotate(-1deg); } .room:nth-child(even) { transform: rotate(1deg); }
.room:hover { transform: rotate(0) scale(1.05); z-index: 2; }
.room:disabled { cursor: not-allowed; filter: grayscale(.7) brightness(.75); }
.room .art { position: absolute; inset: 0 0 52px; width: auto; height: auto; }
.room .label { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 52px; background: var(--ink); color: var(--paper); padding: 5px 8px; }
.room .label b { font-family: var(--f-title); font-size: 19px; letter-spacing: 1px; display: block; line-height: 1; }
.room .label small { font-size: 10.5px; opacity: .8; font-weight: 700; line-height: 1.2; display: block; }
.room .jp-tag { position: absolute; top: 6px; left: 6px; z-index: 4; background: var(--red); color: var(--paper); font-family: var(--f-jp); font-size: 11px; padding: 0 6px; border: 2px solid var(--ink); border-radius: 4px; }

.log { padding: 0 12px 10px; max-height: 190px; overflow-y: auto; }
.log p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.35; padding-left: 14px; position: relative; }
.log p::before { content: '▶'; position: absolute; left: 0; color: var(--magenta); font-size: 9px; top: 3px; }
.log p:first-child { font-weight: 800; }

.roster { padding: 0 10px 10px; display: grid; gap: 10px; }
.kcard { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center; border: 2px solid var(--ink); border-radius: 8px; background: #fff; padding: 6px; }
.kcard .art { width: 74px; height: 74px; border-radius: 8px; background: var(--cream); border: 2px solid var(--ink); }
.kcard b { font-family: var(--f-title); font-size: 17px; letter-spacing: .5px; line-height: 1; display: block; }
.kcard .stats { display: flex; flex-wrap: wrap; gap: 2px 8px; font: 800 11px var(--f-body); margin-top: 3px; }
.kcard .stats em { font-style: normal; opacity: .55; }
.empty { font-size: 12px; opacity: .7; padding: 4px 2px; }

.intel { padding: 0 10px 10px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wanted { text-align: center; cursor: pointer; background: #f9e7b5; border: 2px solid var(--ink); border-radius: 4px; padding: 3px 3px 4px; transform: rotate(-2deg); }
.wanted:nth-child(even) { transform: rotate(2deg); }
.wanted .art { height: 54px; border: 1.5px solid var(--ink); background: var(--cream); }
.wanted b { font-family: var(--f-title); font-size: 13px; display: block; margin-top: 2px; }
.wanted .pips { font-size: 10px; }

.hq-foot { position: relative; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 10px 16px 14px; }
.hq-foot .hint { color: var(--cream); font-size: 12px; font-weight: 700; margin-right: auto; opacity: .85; }
.btn.onair { font-size: 28px; background: var(--red); color: var(--paper); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 4px 4px 0 var(--ink), 0 0 0 8px rgba(255, 45, 117, .35); } }

/* ───────── Modal ───────── */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(10, 2, 16, .75); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(760px, 100%); max-height: calc(calc(100 * var(--vh)) - 40px); display: flex; flex-direction: column; animation: popIn .3s cubic-bezier(.2, 1.6, .4, 1); }
.modal.wide { width: min(1080px, 100%); }
@keyframes popIn { from { transform: scale(.7) rotate(-3deg); opacity: 0; } }
.modal .panel-title { font-size: 26px; }
.modal-body { padding: 4px 18px 16px; overflow-y: auto; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; padding: 0 18px 16px; flex-wrap: wrap; }
.modal-head { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; margin-bottom: 12px; }
.modal-head .art { height: 120px; border: 3px solid var(--ink); border-radius: 10px; background: var(--cream); }
.modal-head p { margin: 0; line-height: 1.45; }
.speech { position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 10px 14px; font-weight: 700; line-height: 1.45; }
.speech::before { content: ''; position: absolute; left: -16px; top: 22px; border: 8px solid transparent; border-right: 12px solid var(--ink); }

.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.opt {
  position: relative; cursor: pointer; text-align: left; background: #fff; border: 3px solid var(--ink); border-radius: 10px;
  padding: 0; overflow: hidden; box-shadow: 3px 3px 0 var(--ink); transition: transform .1s; font-family: var(--f-body);
}
.opt:hover:not(:disabled) { transform: translateY(-3px); }
.opt.sel { outline: 4px solid var(--magenta); outline-offset: 2px; background: #ffe3ee; }
.opt:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(1); }
.opt .art { height: 110px; border-bottom: 3px solid var(--ink); background: var(--cream); }
.opt .t { padding: 6px 8px 8px; }
.opt .t b { font-family: var(--f-title); font-size: 17px; letter-spacing: .5px; display: block; line-height: 1.05; }
.opt .t small { display: block; font-size: 11px; line-height: 1.3; margin-top: 3px; }
.opt .price { position: absolute; top: 6px; right: 6px; z-index: 5; font-family: var(--f-title); font-size: 16px; background: var(--gold); border: 2px solid var(--ink); border-radius: 6px; padding: 1px 6px 0; }
.opt .lock { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; background: rgba(20, 10, 28, .7); color: var(--paper); font-family: var(--f-title); font-size: 18px; text-align: center; padding: 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.section-h { font-family: var(--f-title); font-size: 20px; margin: 16px 0 8px; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.section-h::after { content: ''; flex: 1; height: 3px; background: var(--ink); }
.statline { display: flex; gap: 12px; flex-wrap: wrap; font-weight: 800; font-size: 13px; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.note { font-size: 12px; background: var(--cream); border: 2px dashed var(--ink); border-radius: 8px; padding: 8px 10px; line-height: 1.4; }

/* ───────── Toast ───────── */
#toast-root { position: fixed; z-index: 80; bottom: 90px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { max-width: min(560px, calc(92 * var(--vw))); background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--shadow); border-radius: 10px; padding: 10px 14px; font-weight: 800; font-size: 14px; line-height: 1.35; animation: toastIn .35s cubic-bezier(.2, 1.6, .4, 1), toastOut .3s 3.6s forwards; }
.toast.bad { background: #ffd6d6; } .toast.good { background: #eaffc4; }
@keyframes toastIn { from { transform: translateY(30px) scale(.8); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }

/* ───────── Planning board ───────── */
.plan { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; }
.plan .sunburst { --c1: #12324f; --c2: #0b2236; }
.plan-head { position: relative; z-index: 3; text-align: center; padding: 16px 0 6px; color: var(--paper); }
.plan-head h1 { margin: 0; font-family: var(--f-title); font-size: 46px; letter-spacing: 2px; color: var(--gold); text-shadow: -2px 0px 0 var(--ink), 2px 0px 0 var(--ink), 0px -2px 0 var(--ink), 0px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), -1px -2px 0 var(--ink), 1px -2px 0 var(--ink), -1px 2px 0 var(--ink), 1px 2px 0 var(--ink), -2px -1px 0 var(--ink), 2px -1px 0 var(--ink), -2px 1px 0 var(--ink), 2px 1px 0 var(--ink), 4px 4px 0 var(--ink); }
.plan-head .jp { color: var(--sky); font-size: 14px; }
.plan-body { position: relative; z-index: 3; display: grid; grid-template-columns: 1.25fr 1fr 0.85fr; gap: 16px; padding: 10px 18px; min-height: 0; }
.plan-col { display: flex; flex-direction: column; min-height: 0; }
.plan-col > .panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.plan-col .scroll { overflow-y: auto; padding: 0 12px 12px; display: grid; gap: 10px; align-content: start; }
.scheme { cursor: pointer; text-align: left; background: #fff; border: 3px solid var(--ink); border-radius: 10px; padding: 10px 12px; box-shadow: 3px 3px 0 var(--ink); font-family: var(--f-body); transition: transform .1s; }
.scheme:hover { transform: translateX(4px); }
.scheme.sel { background: #ffe3ee; outline: 4px solid var(--magenta); outline-offset: 2px; }
.scheme b { font-family: var(--f-title); font-size: 19px; letter-spacing: .5px; display: block; line-height: 1.1; }
.scheme p { margin: 4px 0 6px; font-size: 12.5px; line-height: 1.35; }
.scheme.star { background: linear-gradient(135deg, #fff 70%, #ffe082); }
.pick { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; cursor: pointer; text-align: left; background: #fff; border: 3px solid var(--ink); border-radius: 10px; padding: 6px; box-shadow: 3px 3px 0 var(--ink); font-family: var(--f-body); }
.pick.sel { background: #ffe3ee; outline: 4px solid var(--magenta); outline-offset: 2px; }
.pick .art { width: 64px; height: 64px; border-radius: 8px; border: 2px solid var(--ink); background: var(--cream); }
.pick b { font-family: var(--f-title); font-size: 17px; display: block; line-height: 1.05; }
.pick small { font-size: 11px; line-height: 1.3; display: block; }
.forecast { padding: 0 12px 12px; font-size: 12.5px; line-height: 1.45; }
.forecast .opp-art { height: 120px; border: 3px solid var(--ink); border-radius: 10px; margin-bottom: 8px; }
.forecast ul { margin: 6px 0; padding-left: 18px; }
.forecast li { margin-bottom: 3px; }
.plan-foot { position: relative; z-index: 3; display: flex; justify-content: space-between; padding: 8px 18px 16px; }

/* ───────── Broadcast (TV) ───────── */
.tv { position: absolute; inset: 0; background: #000; overflow: hidden; }
.tv .stage { position: absolute; inset: 0; }
.tv .stage-bg { position: absolute; inset: -3%; transition: opacity .6s; }
.tv .stage-bg .art { position: absolute; inset: 0; }
.tv .scan { position: absolute; inset: 0; pointer-events: none; z-index: 40; background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .16) 2px 4px); }
.tv .vignette { position: absolute; inset: 0; pointer-events: none; z-index: 39; box-shadow: inset 0 0 160px rgba(0, 0, 0, .75); border-radius: 18px; }
.tv .film { position: absolute; inset: 0; pointer-events: none; z-index: 38; background: rgba(255, 220, 160, .06); mix-blend-mode: overlay; }
.tv .bug { position: absolute; top: 96px; right: 22px; z-index: 30; font-family: var(--f-jp); color: #fff; font-size: 13px; text-shadow: 2px 2px 0 #000; opacity: .85; }
.tv .bug b { color: var(--red); }

.tv-top { position: absolute; left: 0; right: 0; top: 0; z-index: 25; display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; padding: 14px 18px; align-items: start; }
.hpbox { background: rgba(20, 10, 28, .85); border: 3px solid var(--ink); border-radius: 10px; padding: 6px 10px 8px; color: var(--paper); box-shadow: 4px 4px 0 rgba(0, 0, 0, .5); min-width: 0; }
.hpbox .nm { font-family: var(--f-title); font-size: 18px; letter-spacing: 1px; display: flex; justify-content: space-between; gap: 8px; line-height: 1.1; }
.hpbox .nm small { font-family: var(--f-body); font-size: 11px; font-weight: 800; opacity: .8; }
.hpbox .bar { margin-top: 4px; height: 16px; }
.hpbox .gaugewrap { display: flex; gap: 6px; align-items: center; margin-top: 4px; font: 800 10px var(--f-body); }
.hpbox .gaugewrap .bar { flex: 1; height: 10px; margin: 0; }
.ep-tag { text-align: center; color: #fff; font-family: var(--f-jp); }
.ep-tag .n { display: inline-block; background: var(--red); border: 3px solid var(--ink); padding: 2px 12px; font-size: 16px; box-shadow: 3px 3px 0 var(--ink); }
.ep-tag .t { display: block; margin-top: 6px; font-family: var(--f-title); font-size: 16px; letter-spacing: 1px; max-width: calc(34 * var(--vw)); text-shadow: 2px 2px 0 #000; }
.ranger-pips { display: flex; gap: 4px; margin-top: 6px; }
.ranger-pips i { flex: 1; height: 8px; border-radius: 3px; border: 1.5px solid #000; }
.ranger-pips i.out { opacity: .2; } .ranger-pips i.dz { background-image: repeating-linear-gradient(45deg, transparent 0 3px, rgba(255, 255, 255, .8) 3px 5px) !important; }

.actors { position: absolute; left: 0; right: 0; bottom: 190px; top: 120px; z-index: 10; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 calc(5 * var(--vw)); pointer-events: none; }
.actor { position: relative; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), opacity .4s; }
.actor .art { width: 100%; height: 100%; }
.actor.villain { height: min(calc(36 * var(--vw)), calc(46 * var(--vh))); max-height: 100%; aspect-ratio: 1; }
.actor.heroes { display: flex; align-items: flex-end; gap: 0; }
.actor.heroes .hero { position: relative; width: min(calc(11 * var(--vw)), calc(22 * var(--vh))); height: min(calc(14 * var(--vw)), calc(28 * var(--vh))); max-height: 100%; margin-left: calc(-2 * var(--vw)); transition: transform .3s, opacity .3s, filter .3s; }
.actor.heroes .hero .badge { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 5; font-size: 22px; filter: drop-shadow(2px 2px 0 #000); }
.actor.heroes .hero.out { opacity: .35; filter: grayscale(1); transform: rotate(80deg) translateY(30%); }
.actor.heroes .hero.dz { filter: saturate(.4); transform: rotate(-8deg); }
.actor.heroes .hero.spot .art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(255, 255, 160, .5), transparent 60%); z-index: 3; }
.actor.wide { height: min(calc(32 * var(--vw)), calc(46 * var(--vh))); max-height: 100%; aspect-ratio: 46 / 32; max-width: calc(46 * var(--vw)); }
.actor.robo { height: min(calc(45 * var(--vw)), calc(64 * var(--vh))); max-height: 100%; aspect-ratio: 2 / 3; }
.actor.giant { height: min(calc(42 * var(--vw)), calc(60 * var(--vh))); max-height: 100%; aspect-ratio: 1; }
.actor.enter-l { transform: translateX(calc(-70 * var(--vw))); } .actor.enter-r { transform: translateX(calc(70 * var(--vw))); }
.actor.hit { animation: hitShake .45s; }
@keyframes hitShake { 0%, 100% { transform: none; } 20% { transform: translateX(-18px) rotate(-3deg); filter: brightness(2) sepia(1) hue-rotate(-50deg) saturate(6); } 40% { transform: translateX(14px) rotate(2deg); } 60% { transform: translateX(-8px); } 80% { transform: translateX(5px); } }
.actor.lunge-r { animation: lungeR .45s; } .actor.lunge-l { animation: lungeL .45s; }
@keyframes lungeR { 40% { transform: translateX(calc(12 * var(--vw))) scale(1.08); } }
@keyframes lungeL { 40% { transform: translateX(calc(-12 * var(--vw))) scale(1.08); } }
.actor.boom-out { animation: boomOut 1.1s forwards; }
@keyframes boomOut { 30% { filter: brightness(3); transform: scale(1.1); } 100% { opacity: 0; transform: scale(.4) rotate(30deg); filter: brightness(5); } }
.actor.grow { animation: grow 1.4s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes grow { from { transform: scale(.25); filter: brightness(3) hue-rotate(90deg); } }

.dialog {
  position: absolute; left: calc(3 * var(--vw)); right: calc(3 * var(--vw)); bottom: 22px; z-index: 30; min-height: 140px; cursor: pointer;
  background: rgba(255, 244, 220, .97); border: 4px solid var(--ink); border-radius: 14px; box-shadow: 6px 6px 0 rgba(0, 0, 0, .6);
  padding: 22px 24px 18px; font-size: clamp(15px, calc(1.6 * var(--vw)), 21px); font-weight: 800; line-height: 1.45;
}
.dialog .who { position: absolute; top: -18px; left: 18px; background: var(--ink); color: var(--paper); font-family: var(--f-title); font-size: 20px; letter-spacing: 1px; padding: 3px 14px 1px; border-radius: 8px; border: 3px solid var(--paper); }
.dialog .who:empty { display: none; }
.dialog .next { position: absolute; right: 16px; bottom: 8px; font-size: 14px; animation: bob .8s infinite; opacity: 0; }
.dialog.done .next { opacity: 1; }
@keyframes bob { 50% { transform: translateY(4px); } }
.choices { position: absolute; left: 0; right: 0; bottom: 186px; z-index: 32; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 0 calc(4 * var(--vw)); }
.choices .btn { min-width: 180px; max-width: 300px; animation: popIn .3s cubic-bezier(.2, 1.6, .4, 1) both; }
.choices .btn:nth-child(2) { animation-delay: .05s; } .choices .btn:nth-child(3) { animation-delay: .1s; } .choices .btn:nth-child(4) { animation-delay: .15s; }
.tv-ctrl { position: absolute; right: 18px; bottom: 176px; z-index: 33; display: flex; gap: 6px; }
.tv-ctrl button { font: 800 11px var(--f-body); background: rgba(20, 10, 28, .8); color: var(--paper); border: 2px solid var(--paper); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.tv-ctrl button.on { background: var(--magenta); }

.fx { position: absolute; inset: 0; z-index: 35; pointer-events: none; overflow: hidden; }
.sfx-word {
  position: absolute; display: flex; align-items: flex-end; white-space: nowrap; pointer-events: none;
  font-family: 'Dela Gothic One', var(--f-jp); font-size: clamp(52px, calc(8.5 * var(--vw)), 128px); line-height: 1; letter-spacing: -.06em;
  animation: sfxPop 1.1s cubic-bezier(.2, 1.8, .4, 1) forwards;
}
/* focus lines bursting behind the word */
.sfx-word::before {
  content: ''; position: absolute; inset: -60% -30%; z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .9) 0 1.5deg, transparent 1.5deg 9deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent 38%, #000 42%, transparent 72%); mask-image: radial-gradient(closest-side, transparent 38%, #000 42%, transparent 72%);
  animation: sfxLines .5s ease-out both;
}
@keyframes sfxLines { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.15); opacity: .85; } }
.sfx-word span {
  display: inline-block; transform-origin: 50% 90%;
  transform: translateY(var(--jy)) rotate(var(--jr)) scale(var(--js)) scaleY(1.22);
  position: relative; color: var(--c);
  filter: drop-shadow(5px 5px 0 var(--red));
  animation: sfxChar .28s calc(var(--i) * 55ms) cubic-bezier(.2, 2, .4, 1) both;
}
/* the outline is a stroked copy of the letter drawn BEHIND it, so the fill always stays visible */
.sfx-word span::before { content: attr(data-t); position: absolute; left: 0; top: 0; z-index: -1; color: var(--ink); -webkit-text-stroke: 16px var(--ink); }
/* manga black-ink style: black letters, fat white border, thin black edge */
.sfx-word.ink span::before { color: #fff; -webkit-text-stroke: 20px #fff; }
.sfx-word.ink span {
  color: #141018;
  filter: drop-shadow(2px 0 0 #141018) drop-shadow(-2px 0 0 #141018) drop-shadow(0 2px 0 #141018) drop-shadow(0 -2px 0 #141018) drop-shadow(6px 7px 0 rgba(0, 0, 0, .35));
}
@keyframes sfxChar { from { transform: translateY(-40px) rotate(calc(var(--jr) * 3)) scale(calc(var(--js) * 2.4)) scaleY(1.22); opacity: 0; } }
.sfx-art { position: absolute; width: clamp(180px, calc(24 * var(--vw)), 340px); aspect-ratio: 1; transform: translate(-10%, -20%) rotate(var(--r)); pointer-events: none; animation: sfxPop 1.1s cubic-bezier(.2, 1.8, .4, 1) forwards; filter: drop-shadow(5px 6px 0 rgba(0, 0, 0, .4)); }
.sfx-art .art { position: absolute; inset: 0; }
@keyframes sfxPop { 0% { transform: scale(0) rotate(-20deg); opacity: 1; } 25% { transform: scale(1.15) rotate(var(--r, -8deg)); } 70% { opacity: 1; } 100% { transform: scale(1.05) rotate(var(--r, -8deg)) translateY(-20px); opacity: 0; } }
.dmg { position: absolute; font-family: var(--f-title); font-size: 46px; color: #fff; text-shadow: -2px 0px 0 var(--ink), 2px 0px 0 var(--ink), 0px -2px 0 var(--ink), 0px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), -1px -2px 0 var(--ink), 1px -2px 0 var(--ink), -1px 2px 0 var(--ink), 1px 2px 0 var(--ink), -2px -1px 0 var(--ink), 2px -1px 0 var(--ink), -2px 1px 0 var(--ink), 2px 1px 0 var(--ink), 3px 3px 0 var(--red); animation: dmgUp 1.1s ease-out forwards; }
.dmg.heal { color: var(--acid); text-shadow: 3px 3px 0 #1b5e20; }
@keyframes dmgUp { from { transform: translateY(0) scale(.6); opacity: 1; } 20% { transform: translateY(-20px) scale(1.2); } to { transform: translateY(-90px) scale(1); opacity: 0; } }
.flash { position: absolute; inset: 0; background: #fff; animation: flash .35s forwards; }
@keyframes flash { to { opacity: 0; } }
.burst { position: absolute; width: calc(40 * var(--vmin)); height: calc(40 * var(--vmin)); border-radius: 50%; transform: translate(-50%, -50%) scale(.2);
  background: radial-gradient(circle, #fff 0 12%, var(--bc, #ffc400) 13% 38%, color-mix(in srgb, var(--bc, #ffc400) 60%, #d4150b) 39% 55%, transparent 56%);
  animation: burst .8s cubic-bezier(.2, 1, .3, 1) forwards; }
@keyframes burst { 60% { opacity: 1; } to { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
.shake { animation: screenShake .5s; }
@keyframes screenShake { 10%, 50%, 90% { transform: translate(-8px, 4px); } 30%, 70% { transform: translate(8px, -4px); } }

/* title card inside broadcast */
.card { position: absolute; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; cursor: pointer; }
.card .sunburst { --c1: #d4150b; --c2: #a80f07; }
.card .inner { position: relative; z-index: 3; }
.card .show { font-family: var(--f-jp); font-size: clamp(40px, calc(8 * var(--vw)), 110px); color: var(--gold); text-shadow: -3px 0px 0 var(--ink), 3px 0px 0 var(--ink), 0px -3px 0 var(--ink), 0px 3px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink), -1.5px -3px 0 var(--ink), 1.5px -3px 0 var(--ink), -1.5px 3px 0 var(--ink), 1.5px 3px 0 var(--ink), -3px -1.5px 0 var(--ink), 3px -1.5px 0 var(--ink), -3px 1.5px 0 var(--ink), 3px 1.5px 0 var(--ink), 6px 6px 0 var(--ink); animation: logoIn .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.card .epn { display: inline-block; margin: 10px 0; font-family: var(--f-jp); font-size: clamp(20px, calc(3 * var(--vw)), 36px); color: var(--paper); background: var(--ink); padding: 4px 22px; transform: rotate(-3deg); animation: logoIn .7s .2s both; }
.card .ttl { font-family: var(--f-title); font-size: clamp(28px, calc(4.6 * var(--vw)), 64px); color: #fff; text-shadow: -2px 0px 0 var(--ink), 2px 0px 0 var(--ink), 0px -2px 0 var(--ink), 0px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), -1px -2px 0 var(--ink), 1px -2px 0 var(--ink), -1px 2px 0 var(--ink), 1px 2px 0 var(--ink), -2px -1px 0 var(--ink), 2px -1px 0 var(--ink), -2px 1px 0 var(--ink), 2px 1px 0 var(--ink), 4px 4px 0 var(--ink); max-width: calc(90 * var(--vw)); line-height: 1; animation: logoIn .7s .4s both; }
.card .logo-img { width: min(640px, calc(80 * var(--vw))); animation: logoIn .7s cubic-bezier(.2, 1.6, .4, 1) both; filter: drop-shadow(6px 6px 0 var(--ink)); }
.static { position: absolute; inset: 0; z-index: 46; background: repeating-radial-gradient(#777 0 .0001%, #000 0 .0002%) 50% 0 / 2500px 2500px, repeating-conic-gradient(#777 0 .0001%, #000 0 .0002%) 60% 60% / 2500px 2500px; background-blend-mode: difference; animation: staticMove .2s steps(4) infinite; }
@keyframes staticMove { 100% { background-position: 50% 0, 60% 50%; } }
.rollcall-burst { position: absolute; z-index: 9; width: calc(30 * var(--vmin)); height: calc(30 * var(--vmin)); border-radius: 50%; transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, #fff 0 10%, var(--bc) 12% 45%, transparent 62%); animation: rollBurst 1s forwards; mix-blend-mode: screen; }
@keyframes rollBurst { 30% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; } to { transform: translate(-50%, -50%) scale(2); opacity: 0; } }

/* ───────── Results (newspaper) ───────── */
.results { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.results .sunburst { --c1: #3a3a3a; --c2: #262626; }
.paper {
  position: relative; z-index: 3; width: min(920px, 100%); background: #f3ecd9; border: 3px solid var(--ink); box-shadow: 10px 10px 0 rgba(0, 0, 0, .6);
  padding: 18px 26px 22px; animation: paperSpin .9s cubic-bezier(.2, 1.2, .4, 1) both; font-family: Georgia, 'Times New Roman', serif;
}
@keyframes paperSpin { from { transform: rotate(-720deg) scale(.05); } }
.paper .masthead { text-align: center; border-bottom: 4px double var(--ink); padding-bottom: 6px; }
.paper .masthead h1 { margin: 0; font-family: 'Times New Roman', serif; font-size: clamp(34px, calc(5 * var(--vw)), 60px); letter-spacing: 2px; font-weight: 900; }
.paper .masthead small { font-family: var(--f-body); font-weight: 800; font-size: 11px; letter-spacing: 2px; }
.paper .headline { font-family: var(--f-title); font-size: clamp(30px, calc(4.4 * var(--vw)), 54px); line-height: 1; margin: 14px 0 8px; text-align: center; letter-spacing: 1px; }
.paper .grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.paper .photo { height: 240px; border: 3px solid var(--ink); filter: grayscale(.3) contrast(1.1); position: relative; }
.paper .photo .art { position: absolute; inset: 0; }
.paper .stamp { position: absolute; z-index: 5; right: -10px; bottom: 14px; transform: rotate(-12deg); font-family: var(--f-title); font-size: 30px; padding: 4px 14px 0; border: 4px solid; border-radius: 8px; background: rgba(255, 255, 255, .85); }
.paper .stamp.win { color: #1b8a2a; } .paper .stamp.lose { color: var(--red); }
.paper .copy p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.paper .copy p:first-letter { font-weight: 900; }
.deltas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 6px; font-family: var(--f-body); }
.delta { border: 2px solid var(--ink); background: #fff; border-radius: 8px; text-align: center; padding: 6px 4px; }
.delta b { display: block; font: 800 10px var(--f-body); letter-spacing: 1px; opacity: .7; }
.delta span { font-family: var(--f-title); font-size: 26px; }
.delta .up { color: #1b8a2a; } .delta .down { color: var(--red); }
.paper .msgs { font-family: var(--f-body); font-size: 13px; line-height: 1.45; margin: 8px 0; padding-left: 18px; }
.preview { margin-top: 10px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; font-family: var(--f-body); font-weight: 800; display: flex; gap: 12px; align-items: center; }
.preview .jp { color: var(--gold); font-size: 22px; }

/* ───────── Endings ───────── */
.ending { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 30px; text-align: center; overflow-y: auto; }
.ending .bgart { position: fixed; inset: 0; }
.ending .box { margin-top: auto; } /* sits at the bottom, but scrolls instead of cutting off the top on short screens */
.ending .bgart::after { content: ''; position: absolute; inset: 0; z-index: 3; background: linear-gradient(transparent 30%, rgba(10, 2, 16, .92)); }
.ending .box { position: relative; z-index: 5; max-width: 760px; color: var(--paper); }
.ending h1 { font-family: var(--f-title); font-size: clamp(44px, calc(7 * var(--vw)), 96px); margin: 0; color: var(--gold); text-shadow: -3px 0px 0 var(--ink), 3px 0px 0 var(--ink), 0px -3px 0 var(--ink), 0px 3px 0 var(--ink), -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink), -1.5px -3px 0 var(--ink), 1.5px -3px 0 var(--ink), -1.5px 3px 0 var(--ink), 1.5px 3px 0 var(--ink), -3px -1.5px 0 var(--ink), 3px -1.5px 0 var(--ink), -3px 1.5px 0 var(--ink), 3px 1.5px 0 var(--ink), 6px 6px 0 var(--red); letter-spacing: 2px; line-height: .95; }
.ending p { font-size: 16px; line-height: 1.5; font-weight: 700; background: rgba(20, 10, 28, .72); border-radius: 10px; padding: 8px 14px; max-width: 680px; margin: 8px auto 12px; }
.ending .rank { display: inline-block; font-family: var(--f-title); font-size: 26px; background: var(--magenta); border: 3px solid var(--ink); padding: 4px 16px 1px; transform: rotate(-3deg); box-shadow: var(--shadow); margin: 6px 0 14px; }
.ending .sumstats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }

/* ───────── Responsive ───────── */
@media (max-width: 1180px) {
  .hq-main { grid-template-columns: 250px 1fr 280px; gap: 12px; padding: 12px; }
  .rooms { grid-template-columns: repeat(4, 1fr); gap: 10px; }
}
@media (max-width: 960px) {
  body { overflow: auto; }
  #app { position: relative; min-height: 100%; overflow: visible; }
  .hq, .plan { position: relative; min-height: calc(100 * var(--vh)); }
  .hq-main { grid-template-columns: 1fr; }
  .col { overflow: visible; }
  .rooms { grid-template-columns: repeat(2, 1fr); }
  .plan-body { grid-template-columns: 1fr; }
  .paper .grid, .deltas { grid-template-columns: 1fr 1fr; }
  .hud .stat.wide { min-width: 120px; }
}

/* full-bleed art containers */
.bgart > .art, .photo > .art, .opp-art > .art { position: absolute; inset: 0; }
.opp-art { position: relative; overflow: hidden; }

/* ───────── Languages ───────── */
.lang-pick { position: relative; z-index: 5; display: flex; gap: 8px; margin-top: 16px; }
.hud .iconbtn.lang { width: auto; padding: 0 8px; font-weight: 800; }
html[data-lang="ja"] {
  --f-title: 'Bangers', 'Dela Gothic One', sans-serif;
  --f-body: 'M PLUS Rounded 1c', 'Noto Sans JP', system-ui, sans-serif;
}
html[data-lang="zh"] {
  --f-title: 'Bangers', 'Noto Sans TC', sans-serif;
  --f-jp: 'Noto Sans TC', 'Potta One', sans-serif;
  --f-body: 'Noto Sans TC', 'M PLUS Rounded 1c', system-ui, sans-serif;
}
html[data-lang="zh"] .panel-title, html[data-lang="zh"] .room .label b, html[data-lang="zh"] .btn,
html[data-lang="zh"] .headline, html[data-lang="zh"] .card .ttl, html[data-lang="zh"] .ending h1,
html[data-lang="zh"] .plan-head h1, html[data-lang="zh"] .section-h, html[data-lang="zh"] .opt .t b,
html[data-lang="zh"] .scheme b, html[data-lang="zh"] .pick b, html[data-lang="zh"] .kcard b,
html[data-lang="zh"] .hpbox .nm, html[data-lang="zh"] .dialog .who, html[data-lang="zh"] .rank { font-weight: 900; letter-spacing: 0; }
html[data-lang="ja"] .panel-title, html[data-lang="ja"] .headline, html[data-lang="ja"] .card .ttl,
html[data-lang="ja"] .section-h, html[data-lang="ja"] .btn { letter-spacing: 0; }
html:not([data-lang="en"]) .card .ttl { font-size: clamp(24px, calc(3.8 * var(--vw)), 52px); }
html:not([data-lang="en"]) .headline { font-size: clamp(26px, calc(3.6 * var(--vw)), 44px); line-height: 1.15; }
html:not([data-lang="en"]) .dialog { line-height: 1.6; }

/* ═════════ UX pass ═════════ */
/* panels inside scrolling columns must never be squashed */
.col > * { flex-shrink: 0; }

/* screen transition */
.wipe { position: fixed; inset: 0; z-index: 100; pointer-events: all; overflow: hidden; }
.wipe-panel { position: absolute; top: -20%; bottom: -20%; left: -60%; width: 90%; background: var(--ink); transform: skewX(-14deg) translateX(-120%); animation: wipeIn .26s cubic-bezier(.6, 0, .4, 1) forwards; border-right: 10px solid var(--magenta); }
.wipe-panel.b { left: 30%; width: 100%; background: var(--purple); border-right-color: var(--gold); animation-delay: .04s; }
.wipe.out .wipe-panel { animation: wipeOut .3s cubic-bezier(.6, 0, .4, 1) forwards; }
@keyframes wipeIn { to { transform: skewX(-14deg) translateX(0); } }
@keyframes wipeOut { from { transform: skewX(-14deg) translateX(0); } to { transform: skewX(-14deg) translateX(160%); } }

/* HUD */
.hud .stat { position: relative; }
.fearline { display: flex; align-items: center; gap: 8px; }
.fearline .bar { flex: 1; height: 16px; }
.fearnum { font-family: var(--f-title); font-size: 22px; color: var(--magenta); line-height: 1; }
.delta-float { position: absolute; left: 50%; top: 2px; transform: translateX(-50%); font-family: var(--f-title); font-size: 20px; white-space: nowrap; pointer-events: none; animation: deltaUp 1.8s ease-out forwards; text-shadow: 2px 2px 0 #000; }
.delta-float.up { color: var(--acid); } .delta-float.down { color: #ff6b6b; }
@keyframes deltaUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -6px) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -34px) scale(1); } }

/* Emperor monitor */
.monitor .quip { min-height: 2.7em; }
.warnline { margin: 8px 12px 0; font: 800 11px var(--f-body); color: var(--red); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .45; } }

/* rooms */
.room .cost-tag { position: absolute; top: 6px; right: 6px; z-index: 4; font: 800 10px var(--f-body); background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: 1px 6px; }
.room.recommend { outline: 4px solid var(--acid); outline-offset: 3px; animation: recPulse 1.4s infinite; }
@keyframes recPulse { 50% { outline-color: rgba(198, 255, 61, .25); box-shadow: 5px 5px 0 var(--ink), 0 0 26px rgba(198, 255, 61, .7); } }
.room .rec-tag { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-6deg); z-index: 4; font-family: var(--f-title); font-size: 15px; background: var(--acid); border: 2px solid var(--ink); padding: 2px 8px 0; white-space: nowrap; box-shadow: 3px 3px 0 var(--ink); }
.room.closed .art { filter: grayscale(.85) brightness(.7); }
.room .closed-stamp { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) rotate(-12deg); z-index: 4; font-family: var(--f-title); font-size: 26px; color: var(--red); border: 4px solid var(--red); border-radius: 6px; padding: 2px 10px 0; background: rgba(255, 244, 220, .85); }

/* season timeline */
.timeline { padding-bottom: 10px; }
.timeline .panel-title small { font-family: var(--f-body); font-weight: 800; color: var(--acid); font-size: 11px; }
.tl-row { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; padding: 0 10px; }
.tl-ep { position: relative; aspect-ratio: 1; min-width: 0; border: 2px solid var(--ink); border-radius: 6px; background: var(--cream); display: flex; align-items: center; justify-content: center; font-size: 15px; cursor: default; }
.tl-ep small { position: absolute; top: 0; left: 2px; font: 800 8px var(--f-body); opacity: .6; }
.tl-ep.win { background: #c9f27a; } .tl-ep.lose { background: #ffc4c4; }
.tl-ep.now { background: var(--gold); box-shadow: 0 0 0 3px var(--magenta); animation: recPulse 1.4s infinite; }

/* footer advisor */
.hq-foot { align-items: stretch; }
.advisor { margin-right: auto; display: flex; gap: 10px; align-items: center; background: rgba(20, 10, 28, .88); color: var(--paper); border: 2px solid var(--acid); border-radius: 12px; padding: 8px 14px; max-width: 760px; }
.advisor b { display: block; font-size: 12px; color: var(--acid); }
.advisor span { font-size: 13px; font-weight: 700; line-height: 1.35; }
.advisor-icon { font-size: 24px; }
.btn.onair:not(.ready) { animation: none; }

/* kaiju cards & detail */
.kcard.clickable { cursor: pointer; transition: transform .12s; }
.kcard.clickable:hover { transform: translateX(-3px); box-shadow: 3px 3px 0 var(--ink); }
.kdetail { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.kdetail-art { height: 220px; border: 3px solid var(--ink); border-radius: 12px; background: var(--cream); overflow: hidden; }
.statbar { display: grid; grid-template-columns: 52px 1fr 36px; gap: 8px; align-items: center; margin: 5px 0; font-weight: 800; font-size: 13px; }
.statbar .bar { height: 12px; }

/* battle: telegraphs, hotkeys, ghost bars, layout */
.actors { bottom: 236px; }
.choices { bottom: 182px; }
.choices .btn { position: relative; }
.choices .btn .key { position: absolute; top: -10px; left: -10px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 800 12px/18px var(--f-body); border: 2px solid var(--paper); }
.choices .btn.hint { outline: 3px solid var(--acid); outline-offset: 3px; animation: recPulse 1.2s infinite; }
.bar > i.ghost { background: #fff !important; opacity: .75; transition: width .7s .35s ease-out; }
.bar > i.live { transition: width .25s ease-out; }
.telegraph { display: inline-block; margin-top: 4px; font: 800 11px var(--f-body); color: #fff; background: var(--red); border: 2px solid #000; border-radius: 6px; padding: 1px 8px; animation: blink .7s infinite; }
.round-tag { display: inline-block; margin-top: 6px; font: 800 11px var(--f-body); color: var(--gold); text-shadow: 1px 1px 0 #000; }

/* forecast */
.fc { margin: 8px 0; }
.fc-row { display: grid; grid-template-columns: 1fr 120px 40px; gap: 6px; align-items: center; font-size: 12px; font-weight: 800; margin: 3px 0; }
.fc-row .bar { height: 10px; }
.fc-row.win .bar > i { background: #47b84a; } .fc-row.lose .bar > i { background: var(--red); }
.fc-head { display: flex; justify-content: space-between; align-items: center; }
.fc-verdict { font-family: var(--f-title); font-size: 18px; }

/* results: animated fear meter */
.fearmeter { margin: 10px 0 4px; font-family: var(--f-body); }
.fearmeter .bar { height: 22px; }
.fearmeter .bar > i { transition: width 1.4s cubic-bezier(.3, 1.2, .5, 1) .4s; }
.fearmeter .bar > i.old { background: #8a3a5a; transition: none; }
.fearmeter .row { display: flex; justify-content: space-between; font-weight: 800; font-size: 12px; margin-bottom: 4px; }

/* settings */
.setting-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; margin: 10px 0; font-weight: 800; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.forecast li.warn { color: var(--red); font-weight: 800; }
/* move buttons live inside the dialog box so they never cover the stage */
.dialog .choices { position: static; display: flex; justify-content: flex-start; gap: 14px; padding: 0; margin-top: 0; }
.dialog .choices:not(:empty) { margin-top: 14px; }
.dialog .choices .btn { min-width: 0; flex: 1 1 0; max-width: 340px; text-align: left; cursor: pointer; }
.dialog:has(.choices:not(:empty)) .next { display: none; }
.dialog:has(.choices:not(:empty)) { cursor: default; }
.actors { bottom: 250px; }
.tv-ctrl { bottom: auto; top: 96px; right: 160px; }
@media (max-width: 960px) { .dialog .choices { flex-wrap: wrap; } .dialog .choices .btn { flex-basis: 45%; } }
.dialog .tv-ctrl { position: absolute; top: -16px; right: 18px; bottom: auto; }
.dialog .tv-ctrl button { padding: 3px 10px; }

/* ═════════ Motion ═════════ */
@media (prefers-reduced-motion: no-preference) {
  /* idle life */
  .actor.villain .art-body { transform-origin: 50% 96%; animation: breathe 2.8s ease-in-out infinite; }
  .actor.giant .art-body { transform-origin: 50% 96%; animation: heavyBreathe 3.6s ease-in-out infinite; }
  .actor.heroes .hero .art-body { transform-origin: 50% 95%; animation: sway 2.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.43s); }
  .actor.robo .art-body { animation: hover 3.2s ease-in-out infinite; }
  .actor.wide .art-body { transform-origin: 50% 90%; animation: crowd 1.6s ease-in-out infinite; }
  .monitor .screen .art-body, .modal-head .art.cut .art-body { animation: float 4s ease-in-out infinite; }
  .kcard .art-body, .pick .art-body { transform-origin: 50% 95%; animation: breathe 3s ease-in-out infinite; }
  .exec-row .art-body { animation: float 5s ease-in-out infinite; }
  .wanted .art-body { transform-origin: 50% 95%; animation: sway 2.8s ease-in-out infinite; }
  .wanted:nth-child(2n) .art-body { animation-delay: -1.1s; } .wanted:nth-child(3n) .art-body { animation-delay: -.6s; }
  .title-screen .bgart .art-body > img, .hq > .bgart .art-body > img, .ending .bgart .art-body > img { animation: kenburns 30s ease-in-out infinite alternate; }
  .tv .stage-bg .art-body > img { animation: kenburns 26s ease-in-out infinite alternate; }
  .logo .en { animation: logoIn .9s cubic-bezier(.2, 1.6, .4, 1) both, logoBob 3.5s 1s ease-in-out infinite; }

  /* puppet rig */
  .rig-wag { animation: wag 1.7s ease-in-out infinite; }
  .rig-blink .lid { transform: scaleY(0); animation: blinkLid 4.6s infinite; }
  .rig-blink { animation: none; }
}
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.035); } }
@keyframes heavyBreathe { 0%, 100% { transform: scale(1, 1) rotate(0); } 25% { transform: scale(1.01, 1.03) rotate(-.6deg); } 75% { transform: scale(1.01, 1.03) rotate(.6deg); } }
@keyframes sway { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-2.5%) rotate(1deg); } }
@keyframes hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2%); } }
@keyframes crowd { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012, 1.02); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-4%) rotate(1deg); } }
@keyframes kenburns { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.12) translate(-2%, -1.5%); } }
@keyframes logoBob { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-8px); } }
@keyframes wag { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(3.5deg); } }
@keyframes blinkLid { 0%, 90%, 100% { transform: scaleY(0); } 93%, 95% { transform: scaleY(1); } }

/* faked poses (used until <id>_attack / _hurt / _win art exists) */
.actor.villain, .actor.giant { --dir: 1; }
.actor.heroes, .actor.robo, .actor.wide { --dir: -1; }
.art.fake-attack .art-body { animation: fakeAttack .7s cubic-bezier(.3, 1.4, .5, 1) !important; }
.art.fake-hurt .art-body { animation: fakeHurt .6s !important; }
.art.fake-win .art-body { animation: fakeWin .55s ease-in-out infinite !important; }
@keyframes fakeAttack { 0% { transform: none; } 35% { transform: translateX(calc(var(--dir) * 9%)) rotate(calc(var(--dir) * 7deg)) scale(1.08); } 100% { transform: none; } }
@keyframes fakeHurt { 0% { transform: none; filter: none; } 20% { transform: translateX(calc(var(--dir) * -7%)) rotate(calc(var(--dir) * -9deg)); filter: brightness(1.8) sepia(1) hue-rotate(-45deg) saturate(5); } 60% { transform: translateX(calc(var(--dir) * -3%)) rotate(calc(var(--dir) * -4deg)); filter: none; } 100% { transform: none; } }
@keyframes fakeWin { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-7%) scale(.97, 1.04); } 60% { transform: translateY(0) scale(1.05, .95); } }

/* battle FX */
.tv.hitstop *, .tv.hitstop *::before, .tv.hitstop *::after { animation-play-state: paused !important; }
.speedlines { position: absolute; inset: -20%; z-index: 34; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at var(--sx, 50%) var(--sy, 50%), rgba(255, 255, 255, .85) 0 .8deg, transparent .8deg 6deg);
  -webkit-mask: radial-gradient(circle at var(--sx, 50%) var(--sy, 50%), transparent 22%, #000 48%); mask: radial-gradient(circle at var(--sx, 50%) var(--sy, 50%), transparent 22%, #000 48%);
  animation: speedFlash .38s ease-out forwards; }
@keyframes speedFlash { from { opacity: .95; transform: scale(1.06); } to { opacity: 0; transform: scale(1); } }
.dust { position: absolute; width: 70px; height: 70px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(236, 222, 196, .95) 0 35%, rgba(200, 184, 150, .6) 55%, transparent 70%); animation: dust .8s ease-out forwards; }
@keyframes dust { from { transform: translate(-50%, -50%) scale(.3); opacity: 1; } to { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 40px)) scale(1.8); opacity: 0; } }
.debris { position: absolute; top: -30px; width: var(--w, 18px); height: var(--h, 14px); background: var(--c, #9e9e9e); border: 2px solid var(--ink); pointer-events: none; animation: debris var(--t, 1.4s) cubic-bezier(.4, 0, .9, .6) forwards; }
@keyframes debris { to { transform: translate(var(--dx, 0px), calc(110 * var(--vh))) rotate(var(--rot, 360deg)); } }
.spark { position: absolute; width: 4px; height: 26px; background: linear-gradient(#fff, var(--c, #ffc400)); border-radius: 2px; pointer-events: none; transform-origin: 50% 100%; animation: spark .55s ease-out forwards; }
@keyframes spark { from { transform: rotate(var(--a)) translateY(0) scaleY(1); opacity: 1; } to { transform: rotate(var(--a)) translateY(-120px) scaleY(.3); opacity: 0; } }
.tv .stage { transition: none; }
.tv .stage.cam-punch { animation: camPunch .95s cubic-bezier(.2, .9, .3, 1); transform-origin: var(--cx, 50%) var(--cy, 50%); }
@keyframes camPunch { 0% { transform: scale(1); } 25% { transform: scale(1.16); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ambient layers */
.ambient { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.ambient.motes { background-image: radial-gradient(2px 2px at 10% 30%, rgba(255, 255, 255, .7), transparent), radial-gradient(3px 3px at 30% 70%, rgba(255, 250, 230, .6), transparent), radial-gradient(2px 2px at 60% 40%, rgba(255, 255, 255, .6), transparent), radial-gradient(3px 3px at 85% 65%, rgba(255, 250, 230, .6), transparent), radial-gradient(2px 2px at 45% 15%, rgba(255, 255, 255, .5), transparent);
  background-size: 400px 300px; animation: motes 18s linear infinite; }
@keyframes motes { to { background-position: 400px -300px; } }
.ambient.smoke .plume { position: absolute; bottom: 18%; width: 120px; height: 260px; border-radius: 50%; background: radial-gradient(ellipse at 50% 70%, rgba(60, 40, 50, .55), transparent 70%); filter: blur(6px); animation: plume 7s ease-in infinite; }
@keyframes plume { from { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-260px) scale(1.6); opacity: 0; } }
.ambient.smoke .ember { position: absolute; bottom: 10%; width: 4px; height: 4px; border-radius: 50%; background: #ffb347; box-shadow: 0 0 6px #ff6d00; animation: ember 4s linear infinite; }
@keyframes ember { from { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } to { transform: translate(var(--dx, 30px), calc(-60 * var(--vh))); opacity: 0; } }

/* ═════════ Rigs: rangers & robot ═════════ */
/* the rig layer keeps the image's own aspect ratio, so clip-path percentages line up in any box */
.art.rigged .art-body { inset: 0; margin: auto; width: min(100cqw, calc(100cqh * var(--r, 1))); height: min(100cqh, calc(100cqw / var(--r, 1))); }
.rig-shine { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }
.rig-glow { mix-blend-mode: screen; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .rig-part { animation-delay: var(--rd, 0s); }
  .rig-nod { animation: nod 3.2s ease-in-out infinite; }
  .rig-proudNod { animation: proudNod 3.6s ease-in-out infinite; }
  .rig-deadpan { animation: deadpan 5s ease-in-out infinite; }
  .rig-tremble { animation: tremble .18s linear infinite; }
  .rig-shrug { animation: shrug 2.2s ease-in-out infinite; }
  .rig-flutter { animation: flutter 1.1s ease-in-out infinite; }
  .rig-drip { animation: drip 1.6s ease-in infinite; }
  .rig-pump { animation: pump 1.5s cubic-bezier(.3, 1.6, .5, 1) infinite; }
  .rig-dangle { animation: dangle 2.4s ease-in-out infinite; }
  .rig-armSwayL { animation: armSwayL 4s ease-in-out infinite; }
  .rig-armSwayR { animation: armSwayR 4s ease-in-out infinite; animation-delay: -1.3s; }
  .rig-roboHead { animation: roboHead 6s ease-in-out infinite; }
  .shine-visor { background: linear-gradient(110deg, transparent 42%, rgba(255, 255, 255, .8) 50%, transparent 58%) no-repeat; background-size: 300% 100%; animation: shine 4.5s ease-in-out infinite; }
  .shine-canopy { background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, .7) 50%, transparent 60%) no-repeat; background-size: 300% 100%; animation: shine 5.5s ease-in-out infinite; }
  .shine-drill { background: repeating-linear-gradient(62deg, transparent 0 16px, rgba(255, 255, 255, .6) 16px 22px, transparent 22px 30px); background-size: 120px 120px; animation: drillSpin .3s linear infinite; }
  .rig-glow .glow { animation: glowPulse 2.2s ease-in-out infinite; }
}
@keyframes nod { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2.5deg); } }
@keyframes proudNod { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-3deg) translateY(-1%); } 80% { transform: rotate(1deg); } }
@keyframes deadpan { 0%, 40% { transform: rotate(0); } 50%, 85% { transform: rotate(5deg); } 95% { transform: rotate(0); } }
@keyframes tremble { 0%, 100% { transform: rotate(-.8deg); } 50% { transform: rotate(.8deg); } }
@keyframes shrug { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(9deg); } 45% { transform: rotate(-3deg); } 60% { transform: rotate(6deg); } }
@keyframes flutter { 0%, 100% { transform: rotate(-4deg) skewY(-2deg); } 50% { transform: rotate(5deg) skewY(2deg); } }
@keyframes drip { 0% { transform: translateY(-6%); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(6%); opacity: 0; } }
@keyframes pump { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-7deg) translateY(-1%); } 30% { transform: rotate(2deg); } }
@keyframes dangle { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(6deg); } }
@keyframes armSwayL { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(2deg); } }
@keyframes armSwayR { 0%, 100% { transform: rotate(1.5deg); } 50% { transform: rotate(-2deg); } }
@keyframes roboHead { 0%, 35%, 100% { transform: rotate(0); } 45%, 60% { transform: rotate(-4deg); } 70%, 85% { transform: rotate(3deg); } }
@keyframes shine { 0%, 55% { background-position: 150% 0; } 85%, 100% { background-position: -50% 0; } }
@keyframes drillSpin { to { background-position: 120px 0; } }
@keyframes glowPulse { 0%, 100% { opacity: .25; } 50% { opacity: .95; } }

/* ═════════ Depth & secrets ═════════ */
/* live viewer comments */
.danmaku { position: absolute; inset: 0; z-index: 36; pointer-events: none; overflow: hidden; }
.dan {
  position: absolute; left: 100%; white-space: nowrap; animation: danScroll linear forwards;
  font: 800 clamp(17px, calc(1.9 * var(--vw)), 26px) var(--f-body), 'Noto Sans JP', 'Noto Sans TC', sans-serif; letter-spacing: .3px;
  /* niconico-style: a solid black outline drawn *behind* the fill, so thin glyphs stay crisp on busy art */
  /* outline as a ring of shadows: works in every browser (paint-order on HTML text does not) */
  text-shadow: -2.5px 0px 0 #000, 2.5px 0px 0 #000, 0px -2.5px 0 #000, 0px 2.5px 0 #000, -2.5px -2.5px 0 #000, 2.5px -2.5px 0 #000, -2.5px 2.5px 0 #000, 2.5px 2.5px 0 #000, -1.25px -2.5px 0 #000, 1.25px -2.5px 0 #000, -1.25px 2.5px 0 #000, 1.25px 2.5px 0 #000, -2.5px -1.25px 0 #000, 2.5px -1.25px 0 #000, -2.5px 1.25px 0 #000, 2.5px 1.25px 0 #000, 0 4px 0 #000, 0 0 10px rgba(0, 0, 0, .55);
}
html[lang="ja"] .dan { font-family: 'Noto Sans JP', var(--f-body), sans-serif; font-weight: 900; }
html[lang="zh-Hant"] .dan, html[lang="zh"] .dan { font-family: 'Noto Sans TC', var(--f-body), sans-serif; font-weight: 900; }
@keyframes danScroll { to { transform: translateX(calc(calc(-100 * var(--vw)) - 110%)); } }
.ep-sub { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 4px; }
.ratings { font: 900 14px var(--f-body); color: #fff; background: rgba(212, 21, 11, .9); border: 2px solid #000; border-radius: 6px; padding: 1px 8px; }
.ratings.bump { animation: bump .4s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes bump { 40% { transform: scale(1.35); background: var(--gold); color: var(--ink); } }
.demand-line { margin-top: 4px; font: 800 11px var(--f-body); color: var(--gold); text-shadow: 1px 1px 0 #000; max-width: calc(34 * var(--vw)); }
.lv-tag { color: var(--gold); }

/* HQ: demand card */
.demand { padding-bottom: 10px; }
.demand-body { display: flex; gap: 10px; align-items: center; padding: 0 12px; }
.demand-icon { font-size: 30px; animation: float 3s ease-in-out infinite; }
.demand-body b { display: block; font-size: 14px; line-height: 1.25; }
.demand-body small { font-size: 10.5px; font-weight: 700; opacity: .75; }

/* kaiju levels & traits */
.lv-badge { display: inline-block; margin-left: 6px; font: 900 10px var(--f-body); color: var(--ink); background: var(--gold); border: 2px solid var(--ink); border-radius: 8px; padding: 0 5px; vertical-align: middle; }
.xpbar { height: 6px; margin: 3px 0; background: #ddd; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #7c4dff, #ff2d75); }
.trait-row { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.trait-chip { font: 800 10px var(--f-body); background: #efe6ff; border: 1.5px solid var(--ink); border-radius: 10px; padding: 0 6px; }
.trait-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.trait-card { cursor: pointer; text-align: center; background: linear-gradient(160deg, #fff 60%, #ffe8f1); border: 4px solid var(--ink); border-radius: 14px; padding: 18px 14px; box-shadow: 6px 6px 0 var(--ink); font-family: var(--f-body); transition: transform .15s cubic-bezier(.3, 1.6, .5, 1); animation: popIn .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.trait-card:nth-child(2) { animation-delay: .12s; }
.trait-card:hover { transform: translateY(-8px) rotate(-1.5deg); box-shadow: 8px 12px 0 var(--magenta); }
.trait-card b { display: block; font-family: var(--f-title); font-size: 26px; letter-spacing: 1px; margin: 6px 0; }
.trait-card small { font-size: 13px; font-weight: 700; line-height: 1.4; }
.trait-icon { font-size: 48px; display: block; }

/* lab secret slot / difficulty */
.secret-opt { background: repeating-linear-gradient(45deg, #2a1438 0 12px, #1a0626 12px 24px) !important; color: var(--paper); min-height: 150px; display: flex; align-items: center; justify-content: center; text-align: center; }
.secret-opt b { font-size: 34px !important; color: var(--gold); }
.diff-opt .t { text-align: center; padding: 18px 10px; }
.diff-icon { font-size: 40px; display: block; }

/* trophies */
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.trophy { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; background: #ece6d6; border: 2px solid var(--ink); border-radius: 10px; padding: 8px; filter: grayscale(1); opacity: .6; }
.trophy.got { filter: none; opacity: 1; background: linear-gradient(135deg, #fff8d6, #ffe08a); box-shadow: 3px 3px 0 var(--ink); }
.trophy.hidden { background: #2a1438; color: var(--paper); opacity: .85; }
.trophy-icon { font-size: 30px; text-align: center; }
.trophy b { display: block; font-size: 13px; } .trophy small { font-size: 11px; line-height: 1.3; }
.ach-toast { position: fixed; z-index: 120; top: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: var(--ink); color: var(--paper); border: 3px solid var(--gold); border-radius: 14px; padding: 10px 18px; box-shadow: 0 0 0 4px var(--magenta), 6px 6px 0 #000; animation: achIn .5s cubic-bezier(.2, 1.6, .4, 1), toastOut .4s 3.8s forwards; }
.ach-toast small { display: block; font: 800 10px var(--f-body); color: var(--gold); letter-spacing: 2px; }
.ach-toast b { font-family: var(--f-title); font-size: 22px; letter-spacing: 1px; }
.ach-icon { font-size: 32px; }
@keyframes achIn { from { transform: translate(-50%, -120%); } }

/* secret event banner, newspaper ratings, tea egg */
.secret-banner { text-align: center; font-family: var(--f-title); font-size: 20px; letter-spacing: 3px; color: var(--gold); background: var(--ink); border-radius: 8px; padding: 4px 0 2px; margin-bottom: 8px; animation: blink 1.4s infinite; }
.ratings-badge { position: absolute; z-index: 5; left: -10px; top: 12px; transform: rotate(-8deg); background: var(--red); color: #fff; border: 3px solid #000; border-radius: 50%; width: 82px; height: 82px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 3px 3px 0 #000; }
.ratings-badge small { font: 800 9px var(--f-body); letter-spacing: 1px; }
.ratings-badge b { font-family: var(--f-title); font-size: 22px; line-height: 1; }
.tea-egg { position: absolute; z-index: 4; right: 6.5%; bottom: 24%; width: 34px; height: 34px; border: none; border-radius: 50%; background: transparent; font-size: 20px; cursor: pointer; opacity: .28; transition: opacity .2s, transform .2s; }
.tea-egg:hover { opacity: 1; transform: scale(1.4) rotate(-12deg); filter: drop-shadow(0 0 8px #fff); }

/* Showa mode: 1975 broadcast look */
body.showa #app { filter: sepia(.55) contrast(1.08) saturate(.85); }
body.showa #app::after { content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none; background: repeating-linear-gradient(transparent 0 3px, rgba(0, 0, 0, .12) 3px 4px), radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, .45)); animation: vhs 4s steps(8) infinite; }
@keyframes vhs { 50% { transform: translateY(2px); } }
/* placeholder for room panels until their art arrives: bold title lettering instead of an emoji */
.fb-text { font-family: 'Dela Gothic One', var(--f-jp); font-size: min(17cqmin, 44px); color: var(--paper); text-shadow: -2px 0px 0 var(--ink), 2px 0px 0 var(--ink), 0px -2px 0 var(--ink), 0px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), -1px -2px 0 var(--ink), 1px -2px 0 var(--ink), -1px 2px 0 var(--ink), 1px 2px 0 var(--ink), -2px -1px 0 var(--ink), 2px -1px 0 var(--ink), -2px 1px 0 var(--ink), 2px 1px 0 var(--ink), 4px 4px 0 var(--ink); transform: rotate(-6deg); text-align: center; line-height: 1.1; padding: 0 8px; }

/* ═════════ Newspaper: side column ═════════ */
.paper { width: min(1140px, 100%); }
.paper-cols { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 0; }
.paper-main { padding-right: 20px; border-right: 2px solid var(--ink); min-width: 0; }
.paper-side { padding-left: 18px; font-family: Georgia, 'Times New Roman', 'Noto Serif JP', 'Noto Serif TC', serif; }
.side-h { font: 900 12px var(--f-body); letter-spacing: 3px; text-align: center; border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); padding: 4px 0 3px; margin-bottom: 8px; }
.side-story { padding: 0 0 9px; margin-bottom: 9px; border-bottom: 1px dotted var(--ink); }
.side-story h3 { margin: 0 0 3px; font: 900 13.5px/1.15 'Times New Roman', Georgia, var(--f-body); letter-spacing: .2px; }
.side-story.lead h3 { font-size: 17px; }
.side-story p { margin: 0; font-size: 12px; line-height: 1.38; }
.side-story p:first-letter { font-weight: 900; }
.side-box { border: 2px solid var(--ink); padding: 6px 8px; margin-bottom: 8px; font-size: 12px; line-height: 1.35; background: rgba(255, 255, 255, .5); }
.side-box b { display: block; font: 900 10px var(--f-body); letter-spacing: 2px; margin-bottom: 2px; }
.side-box.classified { background: repeating-linear-gradient(0deg, transparent 0 15px, rgba(0, 0, 0, .05) 15px 16px); font-style: italic; }
.paper.final { border: 6px double var(--gold); box-shadow: 10px 10px 0 rgba(0, 0, 0, .6), 0 0 0 4px var(--ink); }
.paper.final .masthead small { color: var(--red); letter-spacing: 3px; }
html:not([data-lang="en"]) .side-story h3 { font-family: var(--f-body); font-weight: 900; }
@media (max-width: 960px) {
  .paper-cols { grid-template-columns: 1fr; }
  .paper-main { padding-right: 0; border-right: none; }
  .paper-side { padding-left: 0; border-top: 2px solid var(--ink); margin-top: 12px; padding-top: 8px; }
}

/* ═════════ 戦隊新聞: printed broadsheet front page ═════════ */
.results.desk { flex-direction: column; align-items: center; justify-content: flex-start; gap: 16px; padding: 22px 16px 26px; background: #3a302a radial-gradient(ellipse at 50% 30%, #4a3e35, #241d18); }
.results.desk .sunburst { display: none; }
.np {
  --paper: #efe7d3; --ink: #1b1915; --spot: #b3121f; --rule: rgba(27, 25, 21, .85);
  position: relative; width: min(1200px, 100%); color: var(--ink); padding: 18px 26px 14px;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(0, 0, 0, .07) 50%, transparent calc(50% + 1px)),
    radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(ellipse at 90% 95%, rgba(120, 90, 40, .14), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0 0.18 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: 0 1px 0 #d9cfb8, 0 2px 0 #cdc2a9, 0 3px 0 #c4b89d, 14px 18px 34px rgba(0, 0, 0, .55);
  font-family: 'Old Standard TT', 'Noto Serif JP', 'Noto Serif TC', Georgia, serif;
  animation: paperDrop .7s cubic-bezier(.2, 1.2, .4, 1) both;
}
.np.cjk { font-family: 'Noto Serif JP', 'Noto Serif TC', serif; }
.np.cjk:lang(zh-Hant), html[data-lang="zh"] .np { font-family: 'Noto Serif TC', 'Noto Serif JP', serif; }
@keyframes paperDrop { from { transform: translateY(-40px) rotate(-1.5deg); opacity: 0; } }

/* masthead */
.np-mast { display: grid; grid-template-columns: 170px 1fr 170px; align-items: center; gap: 18px; padding-bottom: 6px; }
.np-ear { border: 1px solid var(--rule); padding: 6px 8px; font-size: 11.5px; line-height: 1.35; text-align: center; }
.np-ear b { display: block; font: 700 9.5px 'Old Standard TT', serif; letter-spacing: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 3px; padding-bottom: 2px; }
.np-ear-big { display: block; font: 900 26px/1.1 'Playfair Display', serif; }
.np-ear small { font-weight: 700; }
.np-title { text-align: center; }
.np-title-en { font-family: 'UnifrakturMaguntia', 'Old English Text MT', serif; font-size: clamp(40px, calc(5.4 * var(--vw)), 72px); line-height: 1; letter-spacing: 1px; }
.np-title-jp { margin-top: 2px; font: 900 22px 'Noto Serif JP', serif; letter-spacing: 10px; display: inline-flex; align-items: center; gap: 10px; }
.np-seal { font-size: 12px; letter-spacing: 0; color: var(--spot); border: 2px solid var(--spot); border-radius: 4px; padding: 1px 4px; transform: rotate(-8deg); opacity: .9; }
.np-dateline { display: flex; justify-content: space-between; gap: 10px; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); box-shadow: 0 -5px 0 -4px var(--ink); margin-top: 8px; padding: 4px 2px 3px; font: 700 10.5px 'Old Standard TT', serif; letter-spacing: 1.5px; text-transform: uppercase; }
.np.cjk .np-dateline { letter-spacing: 1px; }
.np-extra { margin-top: 6px; text-align: center; font: 900 22px/1.5 'Playfair Display', 'Noto Serif JP', serif; letter-spacing: 6px; color: var(--paper); background: var(--ink); }

/* banner headline */
.np-banner { text-align: center; padding: 10px 0 8px; border-bottom: 1px solid var(--rule); }
.np-kicker { font: 700 12px 'Old Standard TT', serif; letter-spacing: 4px; color: var(--spot); text-transform: uppercase; }
.np-head { margin: 4px 0 6px; font: 900 clamp(34px, calc(5 * var(--vw)), 66px)/1 'Playfair Display', 'Noto Serif JP', 'Noto Serif TC', serif; letter-spacing: -.5px; text-transform: uppercase; }
.np-deck { margin: 0 auto; max-width: 820px; font: italic 400 17px/1.35 'Old Standard TT', serif; }
.np.cjk .np-head { font-weight: 900; letter-spacing: 2px; text-transform: none; }
.np.cjk .np-deck { font-style: normal; font-weight: 500; }

/* front-page grid */
.np-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); margin-top: 10px; }
.np-lead { padding-right: 18px; border-right: 1px solid var(--rule); }
.np-right { padding-left: 16px; display: flex; flex-direction: column; gap: 10px; }
.np-photo { position: relative; margin: 0; height: 330px; overflow: hidden; border: 1px solid var(--ink); background: #ddd5c2; }
.np-photo-img { position: absolute; inset: 0; filter: grayscale(.82) sepia(.18) contrast(1.25) brightness(1.02); }
.np-photo-img .art { position: absolute; inset: 0; }
.np-halftone { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(circle, rgba(20, 18, 14, .35) 0.9px, transparent 1.3px) 0 0 / 4px 4px; mix-blend-mode: multiply; }
.np-photo.small { height: 120px; margin: 4px 0 6px; }
.np-caption { margin: 4px 0 8px; font: italic 400 12px/1.35 'Old Standard TT', serif; border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.np-credit { float: right; font-style: normal; font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; opacity: .75; margin-left: 8px; }
.np-byline { font: 700 11px 'Old Standard TT', serif; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
.np-text { column-count: 3; column-gap: 18px; column-rule: 1px solid rgba(27, 25, 21, .4); font-size: 13.5px; line-height: 1.5; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.np-text p { margin: 0 0 7px; text-indent: 1.2em; }
.np-text p:first-child { text-indent: 0; }
.np-dl { font-weight: 700; letter-spacing: .5px; }
.np-quote { break-inside: avoid; margin: 8px 0 10px; padding: 8px 4px; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); font: italic 700 16px/1.3 'Playfair Display', 'Noto Serif JP', serif; text-align: center; }
.np-quote cite { display: block; margin-top: 4px; font: normal 400 11px 'Old Standard TT', serif; letter-spacing: 1px; text-transform: uppercase; }
.np-cont { font-style: italic; font-size: 11px; text-align: right; text-indent: 0 !important; }
.np.cjk .np-text p { text-indent: 1em; }

/* right column */
.np-story h3 { margin: 0 0 4px; font: 900 16px/1.15 'Playfair Display', 'Noto Serif JP', 'Noto Serif TC', serif; }
.np-story.big h3 { font-size: 22px; border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.np-story p { margin: 0; font-size: 12.5px; line-height: 1.45; text-align: justify; }
.np-story.big p::first-letter { float: left; font: 900 34px/.85 'Playfair Display', serif; margin: 3px 5px 0 0; }
.np.cjk .np-story.big p::first-letter { float: none; font: inherit; margin: 0; }
.np-sec { font: 700 10.5px 'Old Standard TT', serif; letter-spacing: 3px; text-align: center; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 3px 0 2px; margin-bottom: 5px; text-transform: uppercase; }
.np-markets table { width: 100%; border-collapse: collapse; font: 400 12px 'Old Standard TT', 'Noto Serif JP', serif; }
.np-markets td { padding: 2px 2px; border-bottom: 1px dotted rgba(27, 25, 21, .5); }
.np-markets td:nth-child(2), .np-markets td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.np-markets td.up { color: #1d5e2a; } .np-markets td.down { color: var(--spot); }
.np-brief p { margin: 0 0 4px; font-size: 12px; line-height: 1.4; text-align: justify; padding-left: 10px; text-indent: -10px; }
.np-brief p::before { content: '■ '; font-size: 8px; vertical-align: 2px; }

/* below the fold */
.np-section { margin: 12px 0 8px; border-top: 3px solid var(--ink); box-shadow: 0 -5px 0 -4px var(--ink); text-align: center; }
.np-section span { position: relative; top: -10px; background: var(--paper); padding: 0 14px; font: 700 12px 'Old Standard TT', serif; letter-spacing: 4px; }
.np-lower { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 0; }
.np-lower > * { padding: 0 12px; border-right: 1px solid var(--rule); }
.np-lower > *:last-child { border-right: none; }
.np-lower > *:first-child { padding-left: 0; }
.np-cartoon-img { position: relative; height: 140px; border: 1.5px solid var(--ink); background: #f7f1e3; overflow: hidden; filter: grayscale(1) contrast(1.5) brightness(1.08); }
.np-cartoon-img .art { position: absolute; inset: 0; }
.np-cartoon p { margin: 5px 0 0; font: italic 400 12px/1.35 'Old Standard TT', serif; text-align: center; }
.np-tv p { margin: 0; padding: 2px 0; font-size: 11.5px; line-height: 1.35; border-bottom: 1px dotted rgba(27, 25, 21, .45); }
.np-tv p.hot { font-weight: 700; color: var(--spot); }
.np-tv .np-preview { border: none; font-style: italic; margin-top: 4px; }
.np-classified p { margin: 0 0 5px; padding: 4px 5px; border: 1px solid var(--rule); font-size: 11px; line-height: 1.3; text-align: justify; }
.np-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--ink); font: 400 10px 'Old Standard TT', serif; letter-spacing: 1.5px; text-transform: uppercase; }
.np-actions { display: flex; justify-content: center; }
/* the newspaper scrolls; its continue button stays on screen, floating at the bottom when the page is taller than the window */
.results.desk .np-actions { position: sticky; bottom: -26px; z-index: 20; width: 100%; padding: 22px 0 18px; background: linear-gradient(rgba(36, 29, 24, 0), rgba(36, 29, 24, .9) 45%); pointer-events: none; }
.results.desk .np-actions .btn { pointer-events: auto; }
.np.final { outline: 3px solid var(--spot); outline-offset: -10px; }

/* CJK: vertical banner headline beside the lead photo, as Japanese papers set it */
.np.cjk .np-banner { text-align: left; display: flex; align-items: baseline; gap: 18px; padding: 8px 0 6px; }
.np.cjk .np-kicker { flex: none; }
.np.cjk .np-deck { margin: 0; max-width: none; font-size: 17px; font-weight: 700; }
.np-leadtop { display: flex; gap: 14px; align-items: stretch; }
.np-leadtop .np-photo { flex: 1; min-width: 0; }
.np-head.v { writing-mode: vertical-rl; margin: 0; height: 330px; font-size: clamp(34px, calc(3.4 * var(--vw)), 48px); line-height: 1.12; padding-left: 10px; border-left: 3px double var(--ink); white-space: normal; overflow: hidden; }

@media (max-width: 960px) {
  .np { padding: 12px 14px; }
  .np-mast { grid-template-columns: 1fr; }
  .np-ear { display: none; }
  .np-dateline { flex-wrap: wrap; justify-content: center; }
  .np-grid { grid-template-columns: 1fr; }
  .np-lead { padding-right: 0; border-right: none; }
  .np-right { padding-left: 0; margin-top: 12px; }
  .np-text { column-count: 1; }
  .np.cjk .np-banner { flex-direction: column; gap: 4px; }
  .np-leadtop { flex-direction: column; }
  .np-leadtop .np-photo { flex: none; height: 240px; }
  .np-head.v { order: -1; writing-mode: horizontal-tb; height: auto; border-left: none; padding: 0; }
  .np-lower > * { border-right: none; padding: 8px 0; border-bottom: 1px solid var(--rule); }
}
/* press photos: full black-and-white, slightly warm, crushed like cheap newsprint */
.np-photo-img { filter: grayscale(1) sepia(.12) contrast(1.35) brightness(1.04); }
.np-photo-bg, .np-photo-subj { position: absolute; inset: 0; }
.np-photo-bg .art { position: absolute; inset: 0; }
.np-photo-bg img { object-fit: cover; }
.np-photo-bg { filter: blur(1.2px) brightness(1.15) contrast(.8); }
.np-photo-subj { inset: 6% 0 0; }
.np-photo-subj .art { position: absolute; inset: 0; }
.np-photo-subj img { object-fit: contain; object-position: center bottom; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .45)); }
.np-cartoon-img { filter: grayscale(1) contrast(1.6) brightness(1.1); }

/* ═════════ TV packaging: cut-ins, captions, growth ray ═════════ */
.cutin { position: absolute; inset: 0; z-index: 37; cursor: pointer; overflow: hidden; background: rgba(10, 4, 16, .55); animation: fadeIn .15s both; }
.cutin.out { animation: cutOut .22s forwards; }
@keyframes cutOut { to { opacity: 0; transform: scale(1.06); } }
/* radial speed lines behind the panels */
.cutin-speed { position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .16) 0 2deg, transparent 2deg 7deg); animation: spinA 6s linear infinite; }
.cutin-strips { position: absolute; inset: 6% 4%; display: flex; gap: 10px; transform: skewX(-12deg); }
.cutin-strip {
  position: relative; flex: 1; overflow: hidden; background: var(--c); border: 5px solid #fff; outline: 4px solid var(--ink); box-shadow: 10px 10px 0 rgba(0, 0, 0, .6);
  animation: stripIn .32s cubic-bezier(.2, 1.4, .4, 1) both;
}
.cutin-strip:nth-child(even) { animation-name: stripInUp; }
@keyframes stripIn { from { transform: translateY(-120%); } }
@keyframes stripInUp { from { transform: translateY(120%); } }
/* colour burst inside each panel, then the art, unskewed */
.cutin-strip::before { content: ''; position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .28) 0 6deg, transparent 6deg 18deg); animation: spinA 9s linear infinite; }
.cutin-strip > .art, .cutin-strip > img { position: absolute; inset: 0; transform: skewX(12deg); }
.cutin-strip > img { transform: skewX(12deg) scale(1.15); }
.cutin-strip > img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 3s ease-out both; }
.cutin-strip > .art img { object-fit: contain; object-position: center bottom; }
.cutin-strip > b {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%) skewX(12deg); white-space: nowrap; z-index: 3;
  font: 400 clamp(16px, calc(1.8 * var(--vw)), 26px) var(--f-title); letter-spacing: 1px; color: #fff; background: var(--ink); padding: 2px 10px 0; border: 2px solid #fff;
  animation: popIn .25s cubic-bezier(.2, 1.8, .4, 1) both;
}
.cutin-word {
  position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%) rotate(-6deg); white-space: nowrap;
  font-family: var(--f-jp); font-size: clamp(70px, calc(12 * var(--vw)), 170px); color: var(--gold); isolation: isolate;
  text-shadow: 8px 8px 0 var(--red), 14px 14px 0 var(--ink); animation: wordSlam .45s cubic-bezier(.2, 1.8, .4, 1) both;
}
.cutin-word::before { content: attr(data-t); position: absolute; left: 0; top: 0; z-index: -1; color: var(--ink); -webkit-text-stroke: 12px var(--ink); }
@keyframes wordSlam { from { transform: translate(-50%, -50%) rotate(-6deg) scale(3); opacity: 0; } }
/* henshin: ranger panels; photo-ish combine footage gets a print/halftone pass so it sits with the comic art */
/* fill the panel's height so each ranger shows helmet to boots; only the empty sides of the square art are trimmed */
.cutin.henshin .cutin-strip > .art { inset: 3% 0 0; }
.cutin.henshin .cutin-strip > .art img { object-fit: cover; object-position: 50% 100%; }
.cutin.combine .cutin-strip > img { filter: saturate(1.4) contrast(1.15); }
.cutin.combine .cutin-strip::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(0, 0, 0, .28) 1px, transparent 1.5px) 0 0 / 5px 5px; mix-blend-mode: multiply; }
.cutin.combine .cutin-strip::before { display: none; }
.cutin.combine.wrong .cutin-word { color: #fff; text-shadow: 8px 8px 0 var(--blue, #1e63d6), 14px 14px 0 var(--ink); animation: wordSlam .45s both, tremble .3s .5s 3; }
/* VS eyecatch: two big diagonal halves */
.cutin.vs .cutin-strips { inset: 5% -6%; gap: 18px; }
.cutin.vs .cutin-strip > .art { transform: skewX(12deg); inset: 4% 10% 3%; }
.cutin.vs .cutin-word { font-family: var(--f-title); font-size: clamp(110px, calc(16 * var(--vw)), 230px); color: #fff; letter-spacing: -4px; }
/* single finisher panel: one wide strip flashing across */
.cutin.single { background: transparent; pointer-events: none; }
.cutin.single .cutin-speed { opacity: .6; }
.cutin.single .cutin-strips { inset: 30% -10% 30%; }
.cutin.single .cutin-strip { animation-name: stripSide; }
.cutin.single .cutin-strip > img, .cutin.single .cutin-strip > .art { transform: skewX(12deg) scale(1.2); }
@keyframes stripSide { from { transform: translateX(-110%); } }

/* monster-of-the-week caption: a red slash with the kaiju's name, like the show's on-screen titles */
.kcap {
  position: absolute; right: 4%; top: 22%; z-index: 33; pointer-events: none; text-align: right;
  padding: 10px 26px 8px 40px; background: linear-gradient(100deg, transparent 0 14px, var(--red) 14px); filter: drop-shadow(6px 6px 0 var(--ink));
  transform: skewX(-10deg); animation: kcapIn .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.kcap.out { animation: kcapOut .4s forwards; }
.kcap small { display: block; font: 800 13px var(--f-body); letter-spacing: 3px; color: var(--gold); transform: skewX(10deg); }
.kcap b { display: block; font: 400 clamp(30px, calc(3.6 * var(--vw)), 52px)/1 var(--f-title); letter-spacing: 1px; color: #fff; text-shadow: -2px 0px 0 var(--ink), 2px 0px 0 var(--ink), 0px -2px 0 var(--ink), 0px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), -1.0px -2px 0 var(--ink), 1.0px -2px 0 var(--ink), -1.0px 2px 0 var(--ink), 1.0px 2px 0 var(--ink), -2px -1.0px 0 var(--ink), 2px -1.0px 0 var(--ink), -2px 1.0px 0 var(--ink), 2px 1.0px 0 var(--ink); transform: skewX(10deg); }
html:not([data-lang="en"]) .kcap b { font-family: var(--f-jp); }
@keyframes kcapIn { from { transform: skewX(-10deg) translateX(120%); } }
@keyframes kcapOut { to { transform: skewX(-10deg) translateX(130%); opacity: 0; } }

/* growth ray: a purple beam from the sky onto the kaiju, then shockwave rings */
.grow-ray { position: absolute; left: 18%; top: 0; width: 22%; height: 100%; pointer-events: none; }
.grow-ray::before {
  content: ''; position: absolute; left: 30%; width: 40%; top: 0; bottom: 18%;
  background: linear-gradient(90deg, transparent, #d36bff 30%, #fff 50%, #d36bff 70%, transparent);
  box-shadow: 0 0 40px 20px rgba(190, 80, 255, .6); animation: rayDown .5s ease-in both, rayFade .5s 1s forwards;
}
@keyframes rayDown { from { transform: scaleY(0); transform-origin: top; } to { transform-origin: top; } }
@keyframes rayFade { to { opacity: 0; } }
.grow-ray i { position: absolute; left: 50%; bottom: 18%; width: 40px; height: 14px; margin-left: -20px; border: 4px solid #e9a8ff; border-radius: 50%; animation: ring .8s ease-out both; }
@keyframes ring { to { transform: scale(12); opacity: 0; } }

/* ═════════ Title screen life ═════════ */
.title-fx { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.title-rays {
  position: absolute; left: 50%; top: 22%; width: calc(150 * var(--vmax)); height: calc(150 * var(--vmax)); margin: calc(-75 * var(--vmax)) 0 0 calc(-75 * var(--vmax));
  background: repeating-conic-gradient(from 0deg, rgba(255, 236, 160, .16) 0 5deg, transparent 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 0 12%, transparent 48%); mask-image: radial-gradient(circle, #000 0 12%, transparent 48%);
  mix-blend-mode: screen; animation: spinA 40s linear infinite;
}
.twinkle { position: absolute; width: 26px; height: 26px; transform: scale(0); animation: twinkle 4s ease-in-out infinite; }
.twinkle::before, .twinkle::after { content: ''; position: absolute; inset: 0; background: #fff8d6; clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%); filter: drop-shadow(0 0 6px #ffd54a); }
.twinkle::after { transform: rotate(45deg) scale(.55); }
@keyframes twinkle { 0%, 70%, 100% { transform: scale(0) rotate(0); } 80% { transform: scale(var(--s)) rotate(45deg); } 90% { transform: scale(calc(var(--s) * .4)) rotate(90deg); } }
.t-ember { position: absolute; bottom: -10px; width: 5px; height: 5px; border-radius: 50%; background: #ffcf70; box-shadow: 0 0 8px 2px #ff7a1a; animation: ember 6s linear infinite; }
/* gold glint sweeping across the 超絶戦隊 logo, masked to the logo's own shape */
.vs-logo-wrap { position: relative; display: inline-block; line-height: 0; }
.vs-logo-wrap::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .85) 48%, rgba(255, 240, 180, .4) 52%, transparent 62%) -200% 0 / 250% 100% no-repeat;
  -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat;
  animation: glint 3.8s 1.4s ease-in-out infinite;
}
@keyframes glint { 0% { background-position: -200% 0; } 45%, 100% { background-position: 200% 0; } }
.vs-badge { animation: vsPulse 1.6s ease-in-out infinite; }
@keyframes vsPulse { 0%, 100% { transform: rotate(-6deg) scale(1); } 50% { transform: rotate(-6deg) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .title-fx, .vs-logo-wrap::after { display: none; } .vs-badge { animation: none; } }
.vs-logo-wrap:not([style*="--logo"])::after { display: none; }

/* ═════════ Lair life ═════════ */
.lair-life { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.lava-glow { position: absolute; left: -10%; right: -10%; bottom: -30%; height: 60%; background: radial-gradient(ellipse at 50% 100%, rgba(255, 90, 20, .35), transparent 65%); animation: lavaPulse 4.5s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes lavaPulse { 0%, 100% { opacity: .55; transform: scaleY(1); } 50% { opacity: 1; transform: scaleY(1.08); } }
.lair-life .ambient.motes { position: absolute; inset: 0; opacity: .6; }
.walker { position: absolute; left: 0; width: 70px; height: 70px; animation: walkAcross 20s linear infinite; }
.walker.rev { animation-name: walkBack; }
.walker.rev .walker-body { transform: scaleX(-1); }
.walker-body { position: absolute; inset: 0; animation: walkBob .42s ease-in-out infinite alternate; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .45)) brightness(.85); }
.walker.rev .walker-body { animation-name: walkBobRev; }
.walker-body .art { position: absolute; inset: 0; }
@keyframes walkAcross { from { transform: translateX(-90px); } to { transform: translateX(calc(calc(100 * var(--vw)) + 90px)); } }
@keyframes walkBack { from { transform: translateX(calc(calc(100 * var(--vw)) + 90px)); } to { transform: translateX(-90px); } }
@keyframes walkBob { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-6px) rotate(4deg); } }
@keyframes walkBobRev { from { transform: scaleX(-1) translateY(0) rotate(-4deg); } to { transform: scaleX(-1) translateY(-6px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .lair-life { display: none; } }

/* ═════════ Story: speaker portraits in the dialogue box ═════════ */
.dialog .portrait { position: absolute; left: 14px; bottom: 12px; width: 150px; height: 170px; z-index: 2; pointer-events: none; display: none;
  overflow: hidden; border: 4px solid var(--ink); border-radius: 10px; box-shadow: 4px 4px 0 rgba(0, 0, 0, .55);
  background: repeating-conic-gradient(from 0deg at 50% 70%, #ffd54a 0 10deg, #ff9d2e 10deg 20deg); }
.dialog.has-portrait .portrait { display: block; }
.dialog.has-portrait { padding-left: 182px; }
.dialog.has-portrait .who { left: 182px; }
/* comic-panel frame with a sunburst, the character bursting out of the top */

.portrait .art { position: absolute; inset: 6px 4px 0; filter: drop-shadow(3px 3px 0 var(--ink)); }
.portrait .art img { object-fit: contain; object-position: 50% 100%; }
.portrait.wide .art { inset: 0; filter: none; }
.portrait.wide .art img { object-fit: cover; object-position: 50% 30%; }
.portrait .art-fb { display: none; }
.portrait.in .art { animation: portraitIn .35s cubic-bezier(.2, 1.7, .4, 1) both; }
@keyframes portraitIn { from { transform: translateY(30%); opacity: 0; } }
/* a little bounce while the line is being typed out */
.dialog.talking .portrait .art img { animation: talkBob .22s ease-in-out infinite alternate; }
@keyframes talkBob { from { transform: translateY(0); } to { transform: translateY(-4px) rotate(-1deg); } }
.dialog.talking .portrait.wide .art img { animation: none; }

/* ═════════ Battle: impact frames, painted FX, live inset ═════════ */
.tv.impact .stage, .tv.impact .fx { filter: grayscale(1) invert(1) contrast(3) brightness(1.2); }
.fx-art { position: absolute; transform: translate(-50%, -50%); pointer-events: none; z-index: 6; animation: fxPop 1.1s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.fx-art .art { position: absolute; inset: 0; }
@keyframes fxPop { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-20deg); opacity: 1; } 25% { transform: translate(-50%, -50%) scale(1.1) rotate(4deg); } 70% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.25) rotate(8deg); opacity: 0; } }
.pip {
  position: absolute; right: calc(3.5 * var(--vw)); top: 110px; z-index: 31; width: min(calc(34 * var(--vw)), 460px); aspect-ratio: 3 / 2;
  border: 5px solid #fff; outline: 4px solid var(--ink); box-shadow: 8px 8px 0 rgba(0, 0, 0, .55); transform: rotate(2deg); overflow: hidden;
  animation: pipIn .45s cubic-bezier(.2, 1.5, .4, 1) both; background: #000;
}
.pip.out { animation: pipOut .3s forwards; }
.pip .art { position: absolute; inset: 0; }
.pip .art img { animation: kenburns 8s ease-out both; }
.pip::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .14) 2px 4px); pointer-events: none; }
.pip-live { position: absolute; top: 8px; left: 8px; z-index: 2; font: 900 12px var(--f-body); color: #fff; background: var(--red); padding: 1px 7px; border-radius: 3px; animation: recPulse 1s infinite; }
.pip-label { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; font: 400 clamp(14px, calc(1.4 * var(--vw)), 20px) var(--f-title); letter-spacing: 1px; color: #fff; background: linear-gradient(90deg, var(--ink), rgba(26, 6, 38, .4)); padding: 4px 10px 2px; }
html:not([data-lang="en"]) .pip-label { font-family: var(--f-jp); }
@keyframes pipIn { from { transform: rotate(2deg) translateX(130%); } }
@keyframes pipOut { to { transform: rotate(2deg) translateX(130%); } }
@media (max-width: 760px) { .dialog .portrait { width: 84px; height: 100px; } .dialog.has-portrait { padding-left: 110px; } .dialog.has-portrait .who { left: 110px; } }

/* danmaku display styles */
.dan.small { font-size: clamp(13px, calc(1.3 * var(--vw)), 18px); opacity: .9; }
.dan.big { font-size: clamp(26px, calc(3 * var(--vw)), 42px); }
.dan.wall { font-size: clamp(20px, calc(2.3 * var(--vw)), 32px); letter-spacing: 1px; }
/* niconico-style fixed comments: pinned centre-top (ue) or above the dialogue (shita) */
.dan.ue, .dan.shita { left: 50%; transform: translateX(-50%); animation: danFixed 3.2s ease-out both; }
.dan.shita { top: auto; bottom: 214px; }
@keyframes danFixed { 0% { opacity: 0; transform: translateX(-50%) scale(1.3); } 8% { opacity: 1; transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
/* rare "premium" comment: big and colour-cycling */
.dan.rainbow { font-size: clamp(24px, calc(2.6 * var(--vw)), 36px); color: #ff5a5a !important; animation-name: danScroll, hueCycle; animation-duration: 7s, 1.2s; animation-timing-function: linear, linear; animation-iteration-count: 1, infinite; animation-fill-mode: forwards, none; }
@keyframes hueCycle { to { filter: hue-rotate(360deg); } }

/* settings: volume sliders */
.vol { display: flex; align-items: center; gap: 10px; }
.vol input[type=range] { width: 170px; accent-color: var(--red); cursor: pointer; }
.vol-val { min-width: 42px; text-align: right; font: 800 13px var(--f-body); }

/* ═════════ New-game cold open (js/opening.js) ═════════ */
.opening { position: fixed; inset: 0; z-index: 200; overflow: hidden; background: #000; cursor: pointer; }
.opening.op-out { animation: cutOut .35s forwards; }
.opening.op-static::after { content: ''; position: absolute; inset: 0; z-index: 9; background: repeating-radial-gradient(#777 0 .0001%, #000 0 .0002%) 50% 0 / 2500px 2500px, repeating-conic-gradient(#777 0 .0001%, #000 0 .0002%) 60% 60% / 2500px 2500px; background-blend-mode: difference; animation: staticMove .2s steps(4) infinite; }
/* hero rays in the five team colours, from behind the logo (no sun disc) */
.op-rays { position: absolute; left: 50%; top: 46%; width: calc(220 * var(--vmax)); height: calc(220 * var(--vmax)); margin: calc(-110 * var(--vmax)) 0 0 calc(-110 * var(--vmax)); opacity: 0;
  background: repeating-conic-gradient(from 0deg, #e53935 0 9deg, #fff6dc 9deg 18deg, #1e63d6 18deg 27deg, #fff6dc 27deg 36deg, #ffc400 36deg 45deg, #fff6dc 45deg 54deg, #2e9d4a 54deg 63deg, #fff6dc 63deg 72deg, #ff5fa2 72deg 81deg, #fff6dc 81deg 90deg);
  animation: spinA 30s linear infinite; transition: opacity .3s, filter .4s; }
.opening.op-on .op-rays { opacity: 1; }
.op-scan { position: absolute; inset: 0; z-index: 8; pointer-events: none; background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .16) 2px 4px); box-shadow: inset 0 0 180px rgba(0, 0, 0, .8); }
.op-bug { position: absolute; top: 22px; right: 28px; z-index: 7; font: 900 14px var(--f-body); color: #fff; text-shadow: 2px 2px 0 #000; opacity: 0; letter-spacing: 1px; }
.opening.op-on .op-bug { opacity: .9; }
.op-bug::first-letter { color: #ff3b3b; }

/* the logo: four letters fly in and slam together, then the ribbon slides in */
.op-logo { position: absolute; left: 50%; top: 46%; z-index: 3; width: min(880px, calc(88 * var(--vw))); aspect-ratio: 2172 / 724; transform: translate(-50%, -50%); filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55)); }
.op-letter, .op-ribbon { position: absolute; height: auto; opacity: 0; }
.op-letter { z-index: 2; transform: var(--from); }
.op-letter.op-in { animation: opSlam .32s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes opSlam { 0% { opacity: 1; transform: var(--from); } 70% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
.op-ribbon { z-index: 1; }
.op-ribbon.op-in { animation: opRibbon .4s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes opRibbon { from { opacity: 1; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.op-ribbon.op-gone { visibility: hidden; }
/* gold glint across the finished logo */
.op-logo::after { content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .9) 48%, transparent 60%) -200% 0 / 250% 100% no-repeat; mix-blend-mode: overlay; }
.op-logo.op-glint::after { opacity: 1; animation: glint 1s ease-in-out forwards; }
.op-logo.op-tremble { animation: opTremble .12s linear infinite; }
@keyframes opTremble { 0%, 100% { transform: translate(-50%, -50%); } 25% { transform: translate(calc(-50% - 4px), calc(-50% + 2px)) rotate(-.6deg); } 75% { transform: translate(calc(-50% + 4px), calc(-50% - 2px)) rotate(.6deg); } }

/* the hijack: everything turns villain purple and flickers, the Emperor's shadow rises behind the logo */
.opening.op-hijack .op-rays { filter: grayscale(1) sepia(1) hue-rotate(225deg) saturate(3.5) brightness(.5); animation: spinA 30s linear infinite, opFlicker .35s steps(2) 4; }
@keyframes opFlicker { 50% { filter: brightness(.2) saturate(0); } }
.op-emperor { position: absolute; left: 50%; bottom: -10%; z-index: 2; width: min(760px, calc(80 * var(--vw))); aspect-ratio: 1; transform: translate(-50%, 100%);
  filter: brightness(0) drop-shadow(0 0 28px #b04cff) drop-shadow(0 0 60px #6a0dad); transition: transform 1.3s cubic-bezier(.2, .9, .3, 1), filter .5s; }
.op-emperor .art { position: absolute; inset: 0; }
.op-emperor.op-rise { transform: translate(-50%, 0); }
.op-emperor.op-reveal { filter: brightness(.55) saturate(1.2) drop-shadow(0 0 40px #b04cff); }

/* blasts */
.op-fx { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.op-beam { position: absolute; top: 0; width: 70px; margin-left: -35px; background: linear-gradient(90deg, transparent, #d36bff 25%, #fff 50%, #d36bff 75%, transparent); box-shadow: 0 0 40px 18px rgba(190, 80, 255, .6); transform-origin: top; animation: opBeam .5s ease-out forwards; }
@keyframes opBeam { 0% { transform: scaleY(0); } 30% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.op-letter.op-blast { opacity: 1; animation: opFly .9s cubic-bezier(.3, .2, .6, 1) forwards; }
@keyframes opFly { 0% { transform: none; filter: brightness(3); } 15% { filter: brightness(1); } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.4); opacity: 0; } }
.op-letter.op-cling { opacity: 1; animation: opCling .9s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes opCling { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } }
.op-confetti { position: absolute; width: 12px; height: 7px; border: 1.5px solid #111; animation: opConfetti 1.4s cubic-bezier(.2, .6, .5, 1) forwards; }
@keyframes opConfetti { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(calc(var(--dx) * .4), calc(-14 * var(--vh))) rotate(calc(var(--rot) * .3)); } 100% { transform: translate(var(--dx), calc(70 * var(--vh))) rotate(var(--rot)); opacity: .8; } }
.opening.op-impact .op-logo, .opening.op-impact .op-rays, .opening.op-impact .op-emperor { filter: grayscale(1) invert(1) contrast(3); }
.opening.op-shake { animation: screenShake .4s; }
.opening .danmaku { z-index: 6; }

/* the grunt walks in and kicks 隊 */
.op-grunt { position: absolute; left: -12%; top: 30%; width: min(200px, calc(18 * var(--vw))); aspect-ratio: 1; animation: opWalk .65s linear forwards; }
.op-grunt .art { position: absolute; inset: 0; }
@keyframes opWalk { to { left: var(--tx); } }
.op-grunt.op-kick { left: var(--tx); animation: opKick .35s ease-out forwards; }
@keyframes opKick { 40% { transform: rotate(-25deg) translateX(12px); } 100% { transform: rotate(0); } }

/* the takeover title */
.opening.op-smoke .op-rays { filter: grayscale(1) sepia(1) hue-rotate(225deg) saturate(3) brightness(.65); }
.op-title { top: 50% !important; transform: translateY(-50%); z-index: 6; }
.op-title .en { animation: logoIn .7s cubic-bezier(.2, 1.6, .4, 1) both !important; }
.op-skip { position: absolute; right: 22px; bottom: 20px; z-index: 10; font: 400 18px var(--f-title); letter-spacing: 1px; color: #fff; background: rgba(0, 0, 0, .55); border: 2px solid #fff; border-radius: 8px; padding: 4px 14px 2px; cursor: pointer; }
.op-skip:hover { background: var(--red); }

/* ═════════ Phones are played in LANDSCAPE ═════════ */
/* held upright: ask to rotate (Android also gets fullscreen + orientation lock on first tap, see main.js) */
#rotate { display: none; }
@media (orientation: portrait) and (max-width: 760px) {
  #rotate { position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    background: #1a0626 repeating-conic-gradient(from 0deg, #2a0b3d 0 10deg, #1a0626 10deg 20deg); color: var(--paper); text-align: center; padding: 24px; }
  #rotate .phone { width: 70px; height: 120px; border: 6px solid var(--paper); border-radius: 14px; box-shadow: 0 0 0 4px var(--ink), 6px 6px 0 6px rgba(0, 0, 0, .5); animation: rotPhone 2.2s ease-in-out infinite; }
  #rotate .phone::after { content: ''; display: block; width: 20px; height: 4px; margin: 100px auto 0; border-radius: 2px; background: var(--paper); }
  #rotate b { font: 400 30px/1.1 var(--f-title); letter-spacing: 1px; color: var(--gold); text-shadow: 3px 3px 0 var(--ink); }
  #rotate span { font: 800 15px var(--f-body); opacity: .9; }
  #rotate [data-l] { display: none; }
  html[data-lang="en"] #rotate [data-l="en"], html[data-lang="ja"] #rotate [data-l="ja"], html[data-lang="zh"] #rotate [data-l="zh"] { display: block; }
}
@keyframes rotPhone { 0%, 20% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* held sideways: short screen (~390px tall) */
@media (orientation: landscape) and (max-height: 540px) {
  body { overflow: auto; }
  #app { position: relative; min-height: 100%; overflow: visible; }
  .hq, .plan { position: relative; min-height: calc(100 * var(--vh)); }

  /* lair HUD: one thin bar */
  .hud { padding: 4px 10px; gap: 8px; flex-wrap: nowrap; }
  .hud .brand { display: none; }
  .hud .stat { min-width: 50px; } .hud .stat.wide { min-width: 90px; }
  .hud .stat b { font-size: 10px; } .hud .stat span { font-size: 18px; }
  .hud .ep { font-size: 16px; padding: 2px 8px 0; }
  .hud .iconbtn { width: 34px; height: 34px; min-width: 0; }

  /* lair: the eight rooms on the left (always in view), everything else scrolls on the right */
  .hq-main { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 8px; padding: 6px 8px 64px; align-items: start; }
  .hq-main > .col { display: contents; }
  .hq-main .rooms { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 6px; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .hq-main > .col > :not(.rooms) { grid-column: 2; }
  .hq-main .sunday { order: 1; } .hq-main .demand { order: 2; }
  .hq-main > .col:nth-child(3) > :nth-child(1) { order: 3; } .hq-main > .col:nth-child(3) > :nth-child(2) { order: 4; }
  .hq-main .timeline { order: 5; } .hq-main .monitor { order: 6; }
  .hq-main > .col:nth-child(3) > :nth-child(3) { order: 7; } .hq-main > .col:nth-child(2) > :nth-child(3) { order: 8; }
  .room { aspect-ratio: auto; height: calc((100 * var(--vh) - 84px) / 2); }
  .room .art { inset: 0 0 34px; }
  .room .label { height: 34px; padding: 3px 6px; }
  .room .label b { font-size: 14px; } .room .label small { display: none; }
  .room .jp-tag { font-size: 10px; }
  .panel-title { font-size: 17px; }
  .monitor .screen { height: 110px; }
  /* PLAN button floats bottom-right over the scrolling column */
  .hq-foot { position: fixed; right: 8px; bottom: 8px; z-index: 30; width: 250px; padding: 0; background: none; }
  .hq-foot .hint, .hq-foot .advisor { display: none; }
  .hq-foot .btn.onair { width: 100%; font-size: 17px; padding: 10px 8px; }

  /* title screen */
  .logo { top: calc(2 * var(--vh)); }
  .logo .en { font-size: 38px; } .logo .en.zh { font-size: 40px; }
  .logo .jp { font-size: 14px; margin-top: 8px; padding: 1px 12px; }
  .vs-row { margin-top: 4px; } .vs-badge { font-size: 22px; } .vs-logo { width: 150px; }
  .logo .vs { font-size: 12px; margin-top: 2px; }
  .title-screen { padding-bottom: 10px; }
  .title-menu { gap: 8px; } .title-menu .btn.big { font-size: 17px; padding: 8px 14px; }
  .lang-pick { margin-top: 6px; } .title-foot { display: none; }

  /* battle: a thinner HUD and dialogue box so the stage keeps its space */
  .tv-top { padding: 5px 10px; gap: 8px; }
  .hpbox { padding: 3px 8px 5px; border-width: 2px; }
  .hpbox .nm { font-size: 14px; } .hpbox .nm small { font-size: 10px; }
  .hpbox .bar { height: 10px; margin-top: 2px; }
  .ep-tag .n { font-size: 12px; padding: 1px 8px; } .ep-tag .t { font-size: 12px; margin-top: 3px; }
  .tv .bug { top: 64px; font-size: 11px; }
  .actors { top: 64px; bottom: 112px; }
  .dialog { bottom: 6px; min-height: 92px; padding: 14px 14px 8px; font-size: 14px; border-width: 3px; }
  .dialog .who { font-size: 15px; top: -14px; padding: 2px 10px 0; }
  .dialog.has-portrait { padding-left: 104px; } .dialog.has-portrait .who { left: 104px; }
  .dialog .portrait { width: 80px; height: 88px; left: 10px; bottom: 6px; }
  .dialog .choices { flex-wrap: nowrap; gap: 8px; } .dialog .choices:not(:empty) { margin-top: 8px; }
  .dialog .choices .btn { flex-basis: 0; font-size: 15px; padding: 6px 8px; min-height: 0; }
  .dialog .choices .btn .sub { font-size: 10.5px; }
  .dialog:has(.choices:not(:empty)) ~ .actors, .tv:has(.choices:not(:empty)) .actors { bottom: 150px; }
}


/* single-column lair (narrow window, or a big UI size): the rooms first, the PLAN button always reachable.
   (plain max-width queries are switched by zoomed width in js/ui.js) */
@media (max-width: 960px) {
  .hq-main { display: flex; flex-direction: column; gap: 12px; }
  .hq-main > .col { display: contents; }
  .hq-main .rooms { order: 1; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .hq-main .sunday { order: 2; } .hq-main .demand { order: 3; }
  .hq-main > .col:nth-child(3) > :nth-child(1) { order: 4; } .hq-main > .col:nth-child(3) > :nth-child(2) { order: 5; }
  .hq-main .timeline { order: 6; } .hq-main .monitor { order: 7; }
  .hq-main > .col:nth-child(3) > :nth-child(3) { order: 8; } .hq-main > .col:nth-child(2) > :nth-child(3) { order: 9; }
  .hq-foot { position: sticky; bottom: 0; z-index: 30; background: linear-gradient(transparent, rgba(18, 6, 26, .96) 30%); padding-top: 22px; }
}

/* episode title card: the title on a dark band, readable over the red sunburst in any language */
.card .ttl { display: inline-block; background: rgba(18, 6, 26, .82); padding: 8px 22px 6px; border: 3px solid var(--ink); box-shadow: 6px 6px 0 rgba(0, 0, 0, .45); transform: rotate(-1.5deg); line-height: 1.15; }
html:not([data-lang="en"]) .card .ttl { letter-spacing: 1px; }

/* title logo: painted image per language; the Chinese text fallback must not inherit the English logo's
   on-top outline (it cuts lines through thick CJK strokes) — its outline is the shadow ring only */
.logo .en.zh { -webkit-text-stroke: 0; }
.title-logo { display: block; }
.title-logo-img { display: block; margin: 0 auto; width: min(760px, calc(80 * var(--vw))); height: auto; max-height: calc(34 * var(--vh)); object-fit: contain;
  filter: drop-shadow(8px 10px 0 rgba(0, 0, 0, .45)); transform: rotate(-3deg); animation: logoIn .9s cubic-bezier(.2, 1.6, .4, 1) both; }
@media (orientation: landscape) and (max-height: 540px) { .title-logo-img { max-height: calc(34 * var(--vh)); } }


/* ── Network meeting (season modifiers + starting perk) ── */
.season-note { margin: 0 0 10px; font-weight: 700; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mod-grid .opt { text-align: left; }
.mod-grid .opt .t { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: start; }
.mod-grid .opt .t small { grid-column: 2; }
.mod-grid .opt .diff-icon { grid-row: span 2; font-size: 24px; line-height: 1; }
.mod-grid .opt:disabled.sel { opacity: 1; filter: none; cursor: default; color: var(--ink); }
.mod-opt.easy:not(.sel) { background: #eef8e0; }
.mod-mult { float: right; font-size: 13px; color: var(--magenta); margin-left: 6px; }
.mod-opt.easy .mod-mult { color: #2e7d32; }
.mod-grid .tag.hot { font-size: 10px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }
.season-mult { text-align: center; font-family: var(--f-title); font-size: 26px; letter-spacing: 1px; background: var(--ink); color: var(--gold); border-radius: 8px; padding: 6px 10px 3px; }

/* ── Season grade, Hall of Fame ── */
.grade-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0 12px; }
.grade { font-family: var(--f-title); font-size: 92px; line-height: .9; width: 1.1em; height: 1.1em; display: grid; place-items: center; padding-top: .08em;
  border: 5px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow); color: var(--ink); background: var(--paper); transform: rotate(-8deg); animation: logoIn .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.grade.gS { background: linear-gradient(135deg, #fff59d, var(--gold) 45%, #ff9800); }
.grade.gA { background: var(--acid); }
.grade.gB { background: #8fd3ff; }
.grade.gC { background: #ffd6e5; }
.grade.gD { background: #bdbdbd; }
.grade-row .rank { margin: 0 0 6px; }
.score-calc, .record.small { text-shadow: -2px 0px 0 var(--ink), 2px 0px 0 var(--ink), 0px -2px 0 var(--ink), 0px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink); }
.score-calc { font-weight: 800; font-size: 17px; }
.record { font-family: var(--f-title); font-size: 22px; color: var(--gold); margin-top: 4px; animation: blink 1s steps(2) infinite; }
.record.small { font-size: 16px; animation: none; color: var(--paper); }
.unlocks { display: inline-block; text-align: left; background: rgba(20, 10, 28, .75); border: 3px solid var(--gold); border-radius: 10px; padding: 8px 14px; margin-bottom: 14px; font-weight: 700; }
.unlocks b { color: var(--gold); font-family: var(--f-title); letter-spacing: 1px; }
.hof ol { margin: 0 0 14px; padding-left: 22px; }
.hof li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 0; font-size: 13px; }
.hof li b { font-family: var(--f-title); font-size: 18px; }
.grade.mini { font-size: 18px; border-width: 2px; box-shadow: none; animation: none; transform: none; }

/* ── Story mode (visual-novel scenes in the lair) ── */
.vn { position: fixed; inset: 0; z-index: 60; cursor: pointer; animation: vnIn .25s ease-out both; }
.vn.out { animation: vnOut .25s ease-in both; }
.vn.choosing { cursor: default; }
.vn-bg { position: absolute; inset: 0; z-index: 0; isolation: isolate; }
.vn-bg::after { content: ""; position: absolute; inset: 0; z-index: 10; background: linear-gradient(rgba(20, 10, 28, .5), rgba(20, 10, 28, .75)); }
.vn-bg .art { width: 100%; height: 100%; }
.vn-portrait { position: absolute; right: 6%; bottom: 0; width: min(46%, 640px); height: 92%; pointer-events: none; }
.vn-portrait .art { width: 100%; height: 100%; background: none; border: 0; }
.vn-portrait .art img { object-fit: contain; object-position: bottom; filter: drop-shadow(10px 10px 0 rgba(20, 10, 28, .85)); }
.vn-portrait.in { animation: vnPop .28s cubic-bezier(.2, 1.5, .4, 1) both; }
.vn-portrait.empty { display: none; }
.vn-badge { position: absolute; top: 18px; left: 18px; max-width: 70%; background: var(--purple); color: #fff; border: 4px solid var(--ink); border-radius: 12px; box-shadow: 5px 5px 0 var(--ink); padding: 8px 16px 10px; font-size: 13px; font-weight: 800; letter-spacing: 1px; transform: rotate(-2deg); }
.vn-badge b { display: block; font-family: var(--f-jp); font-size: 26px; color: var(--gold); letter-spacing: 0; line-height: 1.25; }
.vn-box { position: absolute; left: 4%; right: 4%; bottom: 4%; min-height: 25%; background: #fffdf4; border: 5px solid var(--ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--ink); padding: 34px 28px 22px; }
.vn-name { position: absolute; top: -24px; left: 24px; background: var(--gold); border: 4px solid var(--ink); border-radius: 10px; padding: 3px 16px 4px; font-family: var(--f-jp); font-size: 22px; box-shadow: 3px 3px 0 var(--ink); }
.vn-name.narr { background: #d9d0e6; font-family: var(--f-body); font-size: 16px; font-weight: 800; }
.vn-text { font-size: 22px; font-weight: 800; line-height: 1.6; white-space: pre-wrap; min-height: 2.2em; }
.vn-choices { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.vn-choices:empty { display: none; }
.vn-choices .btn { font-size: 18px; }
.vn-hint { position: absolute; right: 20px; bottom: 10px; font-size: 18px; animation: blink 1s steps(2) infinite; }
@keyframes vnIn { from { opacity: 0; } }
@keyframes vnOut { to { opacity: 0; } }
@keyframes vnPop { from { transform: translateY(30px) scale(.94); opacity: 0; } }
@media (orientation: landscape) and (max-height: 540px) { .vn-text { font-size: 16px; line-height: 1.45; } .vn-box { padding: 26px 18px 14px; min-height: 0; } .vn-badge b { font-size: 18px; } .vn-choices .btn { font-size: 14px; } }

/* ── Account panel, the gate after the free episodes, title-screen account button ── */
.acct { display: grid; gap: 12px; }
.acct-step { display: grid; gap: 6px; justify-items: start; }
.acct-step > b { font-family: var(--f-title); font-size: 18px; letter-spacing: 1px; }
.acct-step small { font-size: 13px; opacity: .8; }
.acct-user { display: flex; gap: 10px; align-items: center; font-weight: 800; }
.acct-id { display: flex; gap: 10px; align-items: center; }
.acct-id code { font: 900 30px/1 ui-monospace, Menlo, monospace; letter-spacing: 3px; background: var(--ink); color: var(--gold); padding: 8px 14px; border-radius: 8px; }
.acct-status { font-weight: 800; background: var(--cream); border: 3px solid var(--ink); border-radius: 10px; padding: 8px 12px; }
.acct-note { font-weight: 700; }
.acct-privacy { font-size: 13px; font-weight: 700; color: inherit; justify-self: start; }
.btn.google { display: inline-flex; gap: 10px; align-items: center; background: #fff; }
.btn.google .g { font: 900 20px/1 Arial, sans-serif; color: #4285f4; }
.btn.fb { background: #1877f2; color: #fff; text-decoration: none; display: inline-block; }
.acct-chip { position: absolute; top: 14px; right: 14px; z-index: 6; }
.title-foot a { color: inherit; font-weight: 700; }
.gate { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.gate-bg { position: absolute; inset: 0; filter: brightness(.35); }
.gate-bg .art { width: 100%; height: 100%; }
.gate-box { position: relative; z-index: 2; width: min(760px, 100%); padding: 20px 24px; margin: auto; }
.gate-head { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: center; }
.gate-emp { height: 130px; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; background: #2a1036; }
.gate-emp .art { width: 100%; height: 100%; }
.gate h1 { margin: 0 0 6px; font-family: var(--f-title); font-size: 34px; letter-spacing: 1px; color: var(--magenta); }
.gate-sub { font-weight: 800; margin: 14px 0; }
@media (max-width: 600px) { .gate-head { grid-template-columns: 1fr; } .gate-emp { display: none; } .acct-id code { font-size: 22px; } }

/* ── Title screen on wide, short screens (phones and iPads in landscape, small laptop windows):
   logo on the left, menu on the right, so nothing overlaps ── */
@media (min-aspect-ratio: 3/2) and (max-height: 720px) {
  .title-screen { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: 1fr auto; align-items: center; justify-items: center; column-gap: 16px; padding: 10px 16px 12px; }
  .title-screen .logo { position: relative; top: auto; left: auto; right: auto; grid-column: 1; grid-row: 1 / span 2; align-self: center; width: 100%; }
  .title-screen .title-logo-img { width: 100%; max-width: 440px; max-height: calc(46 * var(--vh)); }
  .title-screen .vs-logo { width: 130px; }
  .title-screen .title-menu { grid-column: 2; grid-row: 1; align-self: end; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(100%, 340px); }
  .title-screen .title-menu .btn.big { font-size: 16px; padding: 8px 10px; min-width: 0; width: 100%; }
  .title-screen .title-menu .btn.big:first-child { grid-column: 1 / -1; }
  .title-screen .lang-pick { grid-column: 2; grid-row: 2; margin-top: 8px; }
  .title-screen .acct-chip { top: 8px; right: 8px; }
}

/* ── Epilogue (後日談) on the ending screen ── */
.epilogue { text-align: left; background: rgba(20, 10, 28, .78); border: 3px solid var(--gold); border-radius: 12px; padding: 10px 16px 12px; margin: 4px auto 16px; max-width: 680px; }
.epilogue > b { display: block; font-family: var(--f-title); color: var(--gold); letter-spacing: 2px; font-size: 18px; margin-bottom: 4px; }
.epi-line { display: grid; grid-template-columns: 28px 1fr; gap: 6px; font-size: 15px; font-weight: 700; line-height: 1.45; padding: 3px 0; }
.epi-icon { font-size: 18px; }
@media (orientation: landscape) and (max-height: 540px) { .epi-line { font-size: 13px; } .epilogue { padding: 8px 12px; } }

/* Title screen (all sizes): logo block and menu stack in normal flow, so they can never overlap */
.title-screen { justify-content: space-evenly; overflow-y: auto; }
.title-screen .logo { position: relative; top: auto; left: auto; right: auto; flex: 0 0 auto; }
/* the tilted subtitle and its shadow stick out of their box: keep clear space before the buttons */
.title-screen .logo { padding-bottom: 22px; }
.title-screen .vs-logo { width: clamp(200px, calc(22 * var(--vw)), 340px); }
.title-screen .title-menu, .title-screen .lang-pick, .title-screen .title-foot { flex: 0 0 auto; }

/* Lair on short landscape screens. The narrow-screen (≤960px) single-column rules come later and are more specific,
   so they used to win on landscape phones and squeeze the lair into one thin column. Re-assert the two-pane layout. */
@media (orientation: landscape) and (max-height: 540px) {
  html:root:root .hq-main { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 8px; padding: 6px 8px 64px; align-items: start; }
  html:root:root .hq-main > .col { display: contents; }
  html:root:root .hq-main .rooms { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 6px; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  html:root:root .hq-main > .col > :not(.rooms) { grid-column: 2; min-width: 0; }
  html:root:root .hq-foot { position: fixed; right: 8px; bottom: 8px; z-index: 30; width: 250px; padding: 0; background: none; }
  /* small room names: the decorative title font turns to mush at this size */
  html:root:root .room .label b { font-family: var(--f-body); font-weight: 900; letter-spacing: 0; font-size: 13px; }
}
