/* ===== Solis Security Quest ===== */
:root {
  --ink: #1d1b2c;
  --ink-2: #3a3752;
  --paper: #fbf3dc;
  --paper-2: #f3e6c3;
  --white: #ffffff;
  --red: #e2483d;
  --red-d: #a8302a;
  --blue: #3a6fd8;
  --blue-d: #22408a;
  --sky: #9fd3f2;
  --sky-2: #cdeafa;
  --green: #4caf50;
  --green-d: #2e7d32;
  --grass: #7ccf5b;
  --grass-d: #3f9a3a;
  --yellow: #f7c836;
  --orange: #f08a2c;
  --purple: #8d5bd6;
  --grey: #c3c8d4;
  --mac-bg: #2b2b31;
  --mac-row: #35353d;
  --mac-line: #45454f;
  --px: 4px;
  --shadow: 6px 6px 0 rgba(29, 27, 44, 0.9);
  --font-pixel: 'Press Start 2P', ui-monospace, monospace;
  --font-body: 'VT323', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 23px;
  line-height: 1.3;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(29, 27, 44, 0.035) 2px, transparent 2px),
    linear-gradient(90deg, rgba(29, 27, 44, 0.035) 2px, transparent 2px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img, svg { display: block; }
.sprite { image-rendering: pixelated; }
a { color: var(--blue-d); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
code, kbd {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.86em;
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 0 5px;
  white-space: nowrap;
}
kbd { box-shadow: 0 3px 0 var(--ink); }
b { font-weight: 700; }
:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--yellow); color: var(--ink); padding: 10px 14px; border: 4px solid var(--ink);
  font-family: var(--font-pixel); font-size: 11px;
}
.skip:focus { top: 8px; }

.wrap { width: min(1160px, 100% - 40px); margin: 0 auto; }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-pixel); font-size: 13px; line-height: 1.2; letter-spacing: 0.5px;
  color: var(--ink); background: var(--yellow);
  border: 4px solid var(--ink); padding: 14px 18px;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.18), inset 4px 4px 0 rgba(255, 255, 255, 0.5), 4px 4px 0 var(--ink);
  cursor: pointer; text-decoration: none;
  transition: transform 0.06s steps(1);
}
.btn:hover { background: #ffd95c; color: var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.18), inset 4px 4px 0 rgba(255, 255, 255, 0.5); }
.btn:disabled { background: var(--grey); color: #6b6f7d; cursor: not-allowed; box-shadow: 4px 4px 0 var(--ink); }
.btn-small { font-size: 10px; padding: 9px 12px; }
.link-btn {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  font-family: var(--font-body); font-size: 20px; color: var(--blue-d);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--red); }
.link-light { color: var(--yellow); }

/* ===== HUD ===== */
.hud {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 20px;
  background: var(--ink); color: var(--white);
  border-bottom: 4px solid var(--yellow);
}
.hud-logo { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; flex-shrink: 0; }
.hud-logo:hover { color: var(--yellow); }
.hud-logo-text { font-family: var(--font-pixel); font-size: 11px; }
.hud-xp { flex: 1; max-width: 420px; margin-left: auto; }
.xp-label { display: flex; justify-content: space-between; font-family: var(--font-pixel); font-size: 9px; margin-bottom: 5px; color: var(--yellow); }
.xp-bar { height: 14px; background: #4a4766; border: 3px solid var(--white); position: relative; }
.xp-fill {
  height: 100%; width: 0;
  background: repeating-linear-gradient(90deg, var(--green) 0, var(--green) 8px, #6cd070 8px, #6cd070 10px);
  transition: width 0.6s steps(12);
}
.hud-badges { display: flex; gap: 6px; }
.hud-btn {
  font-family: var(--font-pixel); font-size: 9px; color: var(--white);
  background: transparent; border: 3px solid var(--white); padding: 7px 8px; cursor: pointer;
}
.hud-btn[aria-pressed="true"] { background: var(--white); color: var(--ink); }

/* ===== badges ===== */
.badge {
  display: inline-grid; place-items: center;
  border: 3px solid var(--ink); background: #8b8fa0;
  border-radius: 50%; padding: 3px;
  filter: grayscale(1) brightness(0.75);
  opacity: 0.55;
  transition: filter 0.3s steps(3), opacity 0.3s steps(3);
}
.badge.earned { filter: none; opacity: 1; }
.badge-vault.earned { background: #fff1b8; }
.badge-flame.earned { background: #ffd0b0; }
.badge-hush.earned { background: #ffd6dc; }
.badge-cloud.earned { background: #d3ecff; }
.hud .badge { border-color: var(--white); }

/* ===== title screen ===== */
.title-screen {
  position: relative; overflow: hidden;
  min-height: min(760px, 100vh);
  display: grid; place-items: center;
  background: linear-gradient(180deg, #5aa7e6 0, #5aa7e6 22%, #7cbcee 22%, #7cbcee 44%, var(--sky) 44%, var(--sky) 66%, var(--sky-2) 66%);
  border-bottom: 4px solid var(--ink);
  padding: 60px 20px 150px;
}
.sky { position: absolute; inset: 0; pointer-events: none; }
.pcloud {
  position: absolute; width: 96px; height: 24px; background: var(--white);
  box-shadow: 24px -24px 0 0 var(--white), 48px -24px 0 0 var(--white), 24px -24px 0 0 var(--white), 0 0 0 0 var(--white);
  animation: drift 60s linear infinite;
}
.pcloud::before { content: ''; position: absolute; left: 24px; top: -24px; width: 48px; height: 24px; background: var(--white); }
.pcloud::after { content: ''; position: absolute; left: 36px; top: -36px; width: 24px; height: 12px; background: var(--white); }
.pc1 { top: 18%; left: -10%; }
.pc2 { top: 34%; left: -30%; transform: scale(1.4); animation-duration: 85s; animation-delay: -30s; }
.pc3 { top: 10%; left: -50%; transform: scale(0.8); animation-duration: 70s; animation-delay: -55s; }
@keyframes drift { from { translate: 0 0; } to { translate: 160vw 0; } }
.star { position: absolute; width: 8px; height: 8px; background: var(--white); animation: twinkle 1.6s steps(2) infinite; }
.s1 { top: 12%; left: 78%; } .s2 { top: 26%; left: 12%; animation-delay: 0.5s; } .s3 { top: 8%; left: 40%; animation-delay: 1s; }
@keyframes twinkle { 50% { opacity: 0; } }

.title-inner { position: relative; z-index: 2; text-align: center; max-width: 820px; }
.kicker { font-family: var(--font-pixel); font-size: 11px; letter-spacing: 1px; color: var(--ink); margin: 0 0 18px; }
.logo-title { margin: 0; font-family: var(--font-pixel); font-weight: 400; line-height: 1.15; display: grid; justify-items: center; gap: 10px; }
.logo-title span {
  display: block; font-size: clamp(34px, 7.5vw, 82px); color: var(--yellow);
  text-shadow:
    -4px -4px 0 var(--ink), 4px -4px 0 var(--ink), -4px 4px 0 var(--ink), 4px 4px 0 var(--ink),
    0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink),
    8px 10px 0 var(--blue-d);
  animation: titleIn 0.9s steps(6) both;
}
.logo-title .lt2 { color: var(--red); text-shadow:
    -4px -4px 0 var(--ink), 4px -4px 0 var(--ink), -4px 4px 0 var(--ink), 4px 4px 0 var(--ink),
    0 -4px 0 var(--ink), 0 4px 0 var(--ink), -4px 0 0 var(--ink), 4px 0 0 var(--ink),
    8px 10px 0 var(--blue-d);
  animation-delay: 0.25s; }
@keyframes titleIn { from { transform: translateY(-60px); } to { transform: none; } }
.tagline {
  font-size: 26px; margin: 26px auto 10px; max-width: 640px;
  background: rgba(255, 255, 255, 0.85); border: 4px solid var(--ink); padding: 12px 16px; box-shadow: var(--shadow);
}
.parade { display: flex; justify-content: center; gap: clamp(10px, 4vw, 40px); margin: 28px 0 26px; }
.bob { display: inline-block; animation: bob 1s steps(2) infinite; }
.bob.b2, .b2 { animation-delay: 0.25s; }
.bob.b3, .b3 { animation-delay: 0.5s; }
.bob.b4 { animation-delay: 0.75s; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.btn-start { font-size: 16px; padding: 18px 26px; }
.blink { animation: twinkle 1s steps(2) infinite; }
.pack { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pack li { background: var(--white); border: 3px solid var(--ink); padding: 6px 12px; font-size: 21px; }
.pack-k { font-family: var(--font-pixel); font-size: 9px; color: var(--red); margin-right: 6px; }
.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: 1;
  background:
    linear-gradient(180deg, var(--grass) 0, var(--grass) 24px, var(--grass-d) 24px, var(--grass-d) 32px, #c99a5b 32px, #c99a5b 100%);
  border-top: 4px solid var(--ink);
}
.ground::before {
  content: ''; position: absolute; left: 0; right: 0; top: -20px; height: 16px;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 20px, var(--grass-d) 20px, var(--grass-d) 24px, transparent 24px, transparent 28px, var(--grass-d) 28px, var(--grass-d) 32px, transparent 32px, transparent 64px);
}
.ground::after {
  content: ''; position: absolute; left: 0; right: 0; top: 52px; height: 8px;
  background: repeating-linear-gradient(90deg, #a87a42 0, #a87a42 16px, transparent 16px, transparent 48px);
}

/* ===== sections ===== */
.section { padding: 80px 0; border-bottom: 4px solid var(--ink); }
.section-alt { background-color: var(--paper-2); }
.h2 {
  font-family: var(--font-pixel); font-weight: 400; font-size: clamp(17px, 2.6vw, 26px); line-height: 1.5;
  margin: 0 0 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.h2-num { background: var(--ink); color: var(--yellow); padding: 8px 10px; font-size: 0.7em; }
.h2-light { color: var(--white); }
.h3 { font-family: var(--font-pixel); font-weight: 400; font-size: 15px; line-height: 1.6; margin: 0 0 12px; }
.lead { font-size: 26px; max-width: 780px; margin: 0 0 34px; }
.lead-light { color: #e7e3ff; }

/* ===== professor ===== */
.prof { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: end; margin: 34px 0 50px; }
.prof-sprite { display: grid; justify-items: center; }
.prof-shadow { width: 90px; height: 10px; background: rgba(29, 27, 44, 0.25); margin-top: 4px; }
.dialog {
  position: relative; background: var(--white); border: 4px solid var(--ink);
  box-shadow: inset 0 0 0 4px var(--white), inset 0 0 0 8px var(--ink), var(--shadow);
  padding: 26px 30px 20px; min-height: 210px;
  display: flex; flex-direction: column;
}
.dialog::before {
  content: ''; position: absolute; left: -22px; bottom: 34px; width: 18px; height: 18px;
  background: var(--white); border-left: 4px solid var(--ink); border-bottom: 4px solid var(--ink); transform: rotate(45deg);
}
.dialog-name { font-family: var(--font-pixel); font-size: 11px; color: var(--red); margin: 0 0 12px; }
.dialog-text { font-size: 28px; line-height: 1.5; margin: 0; flex: 1; min-height: 3em; }
.dialog-text.typing::after { content: '▌'; animation: twinkle 0.6s steps(2) infinite; }
.dialog-text .dl { display: block; margin-bottom: 10px; font-size: 24px; }
.dialog-ctrl { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 14px; }
.dialog-count { font-family: var(--font-pixel); font-size: 9px; color: #7a7690; margin-right: auto; }

.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.why-card { background: var(--white); border: 4px solid var(--ink); box-shadow: var(--shadow); padding: 20px 22px; }
.why-card h3 { font-family: var(--font-pixel); font-weight: 400; font-size: 12px; line-height: 1.7; margin: 14px 0 10px; }
.why-card p { margin: 0; font-size: 22px; }
.why-icon { display: inline-block; padding: 6px; background: var(--paper); border: 3px solid var(--ink); }

.loop { margin-top: 56px; background: var(--ink); color: var(--white); border: 4px solid var(--ink); box-shadow: var(--shadow); padding: 28px; }
.loop .h3 { color: var(--yellow); }
.loop-intro, .loop-note { margin: 0 0 18px; font-size: 23px; }
.loop-note { margin: 18px 0 0; }
.loop-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: loop; }
.loop-steps li {
  position: relative; counter-increment: loop;
  background: #2c2a44; border: 3px solid #5d5a7e; padding: 14px; display: grid; gap: 6px;
  transition: background 0.2s steps(2), border-color 0.2s steps(2), transform 0.2s steps(2);
}
.loop-steps li::before { content: counter(loop); font-family: var(--font-pixel); font-size: 9px; color: #8f8bb5; }
.loop-steps li:not(:last-child)::after {
  content: '▶'; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: var(--yellow); font-size: 12px; z-index: 1;
}
.loop-steps b { font-family: var(--font-pixel); font-weight: 400; font-size: 11px; color: var(--yellow); }
.loop-steps span { font-size: 20px; color: #dcd8f5; }
.loop-steps li.lit { background: var(--blue-d); border-color: var(--yellow); transform: translateY(-4px); }

/* ===== threats ===== */
.threat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.threat { background: var(--white); border: 4px solid var(--ink); box-shadow: var(--shadow); padding: 20px; }
.threat-top { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.threat-sprite { background: linear-gradient(rgba(29, 27, 44, 0.2), rgba(29, 27, 44, 0.2)) no-repeat 50% 100% / 60% 6px; padding: 4px 4px 8px; }
.threat-hp { flex: 1; }
.threat-name { font-family: var(--font-pixel); font-size: 12px; margin: 0; }
.threat-type { margin: 4px 0 8px; font-size: 20px; color: #605c78; }
.threat p { margin: 0 0 10px; font-size: 22px; }
.weak { background: var(--paper); border: 3px dashed var(--ink); padding: 8px 10px; font-size: 20px !important; margin: 0 !important; }
.hp { display: flex; align-items: center; gap: 6px; }
.hp-k { font-family: var(--font-pixel); font-size: 8px; color: var(--orange); background: var(--ink); padding: 3px 4px; }
.hp-bar { flex: 1; height: 10px; background: #e6e2d0; border: 3px solid var(--ink); position: relative; }
.hp-fill { display: block; height: 100%; background: var(--green); width: 100%; transition: width 0.7s steps(10); }
.hp-fill.hp-mid { background: var(--yellow); }
.hp-fill.hp-low { background: var(--red); }

/* ===== map ===== */
.map-scroll { overflow-x: auto; padding: 4px 4px 14px; }
.map {
  position: relative; min-width: 720px; height: 230px;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 30px 26px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0, rgba(255, 255, 255, 0.08) 8px, transparent 8px, transparent 16px),
    var(--grass);
  border: 4px solid var(--ink); box-shadow: var(--shadow);
}
.map-path {
  position: absolute; left: 60px; right: 60px; bottom: 66px; height: 22px;
  background: repeating-linear-gradient(90deg, #d8b27a 0, #d8b27a 20px, #c99a5b 20px, #c99a5b 24px);
  border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink);
}
.map-node {
  position: relative; z-index: 2;
  display: grid; justify-items: center; gap: 8px;
  text-decoration: none; color: var(--ink);
}
.node-pad {
  width: 74px; height: 74px; display: grid; place-items: center;
  background: var(--paper); border: 4px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
}
.map-node:hover .node-pad, .map-node:focus-visible .node-pad { background: var(--yellow); transform: translateY(-3px); }
.map-node.current .node-pad { background: var(--white); animation: pulse 1s steps(2) infinite; }
.map-node.cleared .node-pad { background: #d9f7cf; }
@keyframes pulse { 50% { box-shadow: 4px 4px 0 var(--ink), 0 0 0 6px var(--yellow); } }
.node-ico { font-family: var(--font-pixel); font-size: 20px; }
.node-champ .node-ico { color: var(--orange); }
.node-label { font-family: var(--font-pixel); font-size: 9px; background: var(--ink); color: var(--white); padding: 5px 6px; }
.map-trainer {
  position: absolute; z-index: 3; top: 18px; left: 0;
  transition: left 1.1s steps(10);
  filter: drop-shadow(0 4px 0 rgba(29, 27, 44, 0.25));
}
.map-trainer .tf { display: block; }
.map-trainer .tf2 { display: none; }
.map-trainer.walking .tf1 { animation: frameA 0.3s steps(1) infinite; }
.map-trainer.walking .tf2 { display: block; position: absolute; inset: 0; animation: frameB 0.3s steps(1) infinite; }
@keyframes frameA { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes frameB { 0% { opacity: 0; } 50% { opacity: 1; } }

/* ===== stages ===== */
.stage {
  background: var(--white); border: 4px solid var(--ink); box-shadow: var(--shadow);
  margin-bottom: 40px; scroll-margin-top: 84px;
}
.stage:focus { outline: none; }
.stage-head { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-bottom: 4px solid var(--ink); }
.stage-vault .stage-head { background: #fff1b8; }
.stage-flame .stage-head { background: #ffd9c2; }
.stage-hush .stage-head { background: #ffdbe0; }
.stage-cloud .stage-head { background: #d6edff; }
.stage-partner { background: var(--white); border: 4px solid var(--ink); padding: 6px; }
.stage-title { flex: 1; min-width: 0; }
.stage-kicker { font-family: var(--font-pixel); font-size: 10px; margin: 0 0 8px; color: var(--red-d); }
.stage-title h3 { font-family: var(--font-pixel); font-weight: 400; font-size: clamp(14px, 2vw, 19px); line-height: 1.5; margin: 0 0 8px; }
.stage-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 21px; }
.stage-meta b { font-family: var(--font-pixel); font-weight: 400; font-size: 8px; background: var(--ink); color: var(--white); padding: 3px 5px; margin-right: 4px; vertical-align: 2px; }
.stage.cleared .stage-head::after {
  content: 'CLEAR!'; font-family: var(--font-pixel); font-size: 11px; color: var(--white); background: var(--green-d);
  border: 3px solid var(--ink); padding: 6px 8px; transform: rotate(-6deg);
}
.stage-why { margin: 0; padding: 14px 22px; background: var(--paper); border-bottom: 4px dashed rgba(29, 27, 44, 0.3); font-size: 23px; }
.stage-why b, .tip b, .warn b {
  font-family: var(--font-pixel); font-weight: 400; font-size: 8px; padding: 3px 5px; margin-right: 6px; vertical-align: 2px;
  background: var(--ink); color: var(--yellow);
}
.stage-body { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 26px; padding: 24px 22px; align-items: start; }
.screen-col { position: sticky; top: 92px; }
.screen-wrap { width: 100%; }
.screen {
  background: #1f2a3a; border: 4px solid var(--ink); padding: 16px; min-height: 330px;
  display: grid; place-items: center;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 8px 8px;
}
.screen.pop > * { animation: popIn 0.35s steps(4) both; }
@keyframes popIn { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }
.screen-cap, .step-body .screen-cap { font-family: var(--font-pixel); font-size: 8px; color: #6e6a86; margin: 8px 0 0; text-align: right; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.step { border: 3px solid var(--ink); background: var(--paper); }
.step.open { background: var(--white); box-shadow: 4px 4px 0 var(--ink); }
.step-head {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  font-family: var(--font-body); font-size: 23px; font-weight: 400; color: var(--ink);
  background: none; border: 0; padding: 10px 12px; cursor: pointer;
}
.step-head:hover .step-title { text-decoration: underline; text-decoration-thickness: 2px; }
.step-num {
  flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center;
  font-family: var(--font-pixel); font-size: 11px; background: var(--white); border: 3px solid var(--ink);
}
.step.open .step-num { background: var(--yellow); }
.step.done .step-num { background: var(--green); color: var(--white); }
.step.done .step-title { color: #4c5a4c; }
.step-body { padding: 0 14px 14px 56px; }
.step-body p { margin: 0 0 10px; font-size: 22px; }
.step-body ul.mini { margin: 8px 0 0; padding-left: 22px; }
.step-body ul.mini li { margin-bottom: 4px; }
.tip { background: #e9f4ff; border-left: 4px solid var(--blue); padding: 8px 10px; }
.warn { background: #ffe7e3; border-left: 4px solid var(--red); padding: 8px 10px; }
.warn b { background: var(--red-d); color: var(--white); }
.step-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.step-count { font-family: var(--font-pixel); font-size: 8px; color: #7a7690; }
.step.done .done-btn { background: var(--white); }
.screen-slot:empty { display: none; }
.screen-slot { margin-top: 16px; }
.copy {
  font-family: var(--font-pixel); font-size: 8px; padding: 4px 6px; margin: 0 2px;
  background: var(--blue); color: var(--white); border: 2px solid var(--ink); cursor: pointer; vertical-align: 2px;
}
.copy:hover { background: var(--blue-d); }
.chooser { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 21px; }
.chip { font-family: var(--font-body); font-size: 20px; padding: 4px 10px; background: var(--white); border: 3px solid var(--ink); cursor: pointer; }
.chip.on { background: var(--ink); color: var(--white); }

.stage-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 16px 22px; border-top: 4px solid var(--ink); background: var(--paper);
}
.stage-progress { font-family: var(--font-pixel); font-size: 10px; }
.claim.ready { animation: ready 0.9s steps(2) infinite; background: var(--yellow); }
@keyframes ready { 50% { background: #fff1a8; transform: translateY(-3px); } }
.stage.cleared .claim:disabled { background: #d9f7cf; color: var(--green-d); }

/* ===== practice screens (simplified macOS / app drawings) ===== */
.win {
  width: 100%; max-width: 560px; background: var(--mac-bg); color: #ecebf3;
  border: 3px solid #0d0d12; box-shadow: 0 0 0 3px #5a5a66, 6px 8px 0 rgba(0, 0, 0, 0.45);
  font-size: 18px; line-height: 1.35;
}
.win.browser { background: #f5f5f7; color: #1d1b2c; }
.win.dark, .win.dark .win-main { background: #111114; color: #f2f2f2; }
.win-bar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: #3a3a42; border-bottom: 3px solid #0d0d12; }
.win.browser .win-bar { background: #dcdce2; }
.win-bar i { width: 10px; height: 10px; background: #ff5f57; display: block; }
.win-bar i:nth-child(2) { background: #febc2e; }
.win-bar i:nth-child(3) { background: #28c840; }
.win-title { font-size: 16px; margin-left: 8px; color: #b7b6c4; }
.win.browser .win-title { color: #4b4a5a; }
.win-body { display: grid; grid-template-columns: 38% 62%; min-height: 250px; }
.win-side { background: #24242a; padding: 8px; border-right: 3px solid #0d0d12; display: grid; align-content: start; gap: 2px; }
.win.dark .win-side { background: #000; }
.side-search { background: #3a3a42; padding: 4px 8px; margin-bottom: 8px; color: #a9a8b8; font-size: 16px; }
.side-logo { padding: 2px 4px 10px; }
.side-item { padding: 5px 8px; font-size: 17px; color: #d8d7e3; }
.side-item.on { background: #3a6fd8; color: var(--white); }
.win.dark .side-item.on { background: #2e2e33; }
.win-main { padding: 12px; background: var(--mac-bg); min-width: 0; }
.win-main.solo { min-height: 220px; }
.win.browser .win-main { background: #fbfbfd; }
.main-title { font-weight: 700; font-size: 21px; margin: 0 0 10px; }
.main-sect { font-weight: 700; font-size: 16px; color: #b7b6c4; margin: 12px 0 6px; }
.win.dark .main-sect { color: #c9c9d1; }
.main-note { font-size: 16px; color: #a9a8b8; margin: 8px 0; }
.main-note.center { text-align: center; color: #d8d7e3; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--mac-row); border-bottom: 2px solid var(--mac-line); padding: 7px 9px; font-size: 17px;
  position: relative; width: 100%; color: inherit; font-family: inherit; text-align: left;
}
.win.browser .row { background: var(--white); border-bottom-color: #e3e3ea; }
.win.dark .row { background: #18181c; border: 2px solid #2c2c33; margin-bottom: 4px; }
.row-v { display: inline-flex; align-items: center; gap: 6px; color: #b7b6c4; font-size: 16px; text-align: right; }
.win.browser .row-v { color: #4b4a5a; }
.row.ok { background: #1e3a24; }
.pill { font-size: 15px; padding: 1px 6px; border: 2px solid currentColor; }
.pill.off { color: #ff8f86; }
.pill.on { color: #7be08a; }
.mbtn { display: inline-block; font-size: 15px; padding: 3px 8px; background: #55555f; color: var(--white); border: 2px solid #0d0d12; white-space: nowrap; }
.win.browser .mbtn { background: #e8e8ee; color: #1d1b2c; border-color: #9a9aa6; }
.mbtn.primary { background: #3a7ff0; color: var(--white); border-color: #0d2a66; }
.mbtn.dim { opacity: 0.5; }
.dot { display: inline-block; width: 8px; height: 8px; background: #888; }
.dot.green { background: #3fd25a; }
.dot.red { background: #ff5f57; }
.tgl { display: inline-block; width: 30px; height: 16px; background: #5a5a66; border: 2px solid #0d0d12; position: relative; }
.tgl::after { content: ''; position: absolute; left: 1px; top: 1px; width: 10px; height: 10px; background: #e6e6ee; transition: left 0.15s steps(2); }
.tgl.on { background: #3a7ff0; }
.tgl.on::after { left: 15px; }
.tgl-list { display: grid; }
.tgl-row { cursor: pointer; border: 0; border-bottom: 2px solid var(--mac-line); }
.tgl-row:hover { background: #42424c; }
.tgl-row.hl { outline: 3px solid var(--yellow); outline-offset: -3px; }
.share-status { font-size: 16px; padding: 6px 8px; margin-bottom: 8px; border: 2px solid; }
.share-status.bad { color: #ffd166; border-color: #ffd166; background: rgba(255, 209, 102, 0.08); }
.share-status.good { color: #7be08a; border-color: #7be08a; background: rgba(123, 224, 138, 0.1); }

/* highlight = "click here" */
.hl { position: relative; outline: 3px solid var(--yellow); outline-offset: 1px; animation: hlBlink 1s steps(2) infinite; z-index: 1; }
@keyframes hlBlink { 50% { outline-color: var(--orange); } }
.row.hl::after, .side-item.hl::after, .opt.hl::after, .card2.hl::after, .team-input.hl::after, .sso-acc.hl::after, .vault.hl::after, .dd-row.hl::after, .tl-step.hl::after {
  content: '◀'; position: absolute; right: -24px; top: 50%; translate: 0 -50%;
  color: var(--yellow); font-size: 20px; text-shadow: 2px 2px 0 #000;
  animation: nudge 0.6s steps(2) infinite;
}
.tgl-row.hl::after { content: none; }
@keyframes nudge { 50% { transform: translateX(-5px); } }
.hl-btn { outline: 3px solid var(--yellow); outline-offset: 2px; animation: hlBlink 1s steps(2) infinite; }
.hl-ico { outline: 2px solid var(--yellow); animation: hlBlink 1s steps(2) infinite; }

.stack { position: relative; width: 100%; max-width: 560px; display: grid; place-items: center; }
.stack > .win { filter: brightness(0.55); }
.sheet {
  background: #3a3a42; color: #f2f2f2; border: 3px solid #0d0d12; box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.45);
  padding: 14px; font-size: 17px; width: min(330px, 92%);
}
.stack .sheet { position: absolute; top: 34px; }
.sheet p { margin: 0 0 8px; }
.sheet-title { font-weight: 700; font-size: 18px; }
.sheet.flat { position: static; width: auto; flex: 1; }
.dark-sheet { background: #17282b; width: 100%; margin-top: 8px; }
.opt { padding: 6px 8px; margin-bottom: 6px; background: #2b2b31; position: relative; }
.opt.sel { background: #1f3b75; }
.sheet-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.split { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 580px; }
.split-arrow { color: var(--yellow); font-size: 22px; animation: nudge 0.6s steps(2) infinite; }
.key { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: #111; padding: 6px; word-break: break-all; color: #ffd166; }
.warn-txt { color: #ff8f86; font-size: 16px; margin: 0 !important; }
.vault { flex: 1; background: #f5f7fb; color: #1d1b2c; border: 3px solid #0d0d12; padding: 10px; font-size: 16px; position: relative; }
.vault p { margin: 0 0 6px; }
.vault-head { font-weight: 700; color: #175ddc; }
.vault-item { font-weight: 600; }
.vault-field { background: var(--white); border: 2px solid #c8cbd6; padding: 3px 6px; }
.vault-field span { display: block; font-size: 14px; color: #6b6f7d; }
.vault.hl::after { right: auto; left: -22px; content: '▶'; }
.timeline { display: grid; gap: 8px; }
.tl-step { position: relative; background: #34343c; border: 2px solid #4a4a55; padding: 8px; }
.tl-step p { margin: 0 0 4px; font-size: 16px; }
.tl-k { font-family: var(--font-pixel); font-size: 8px; color: #b7b6c4; }
.tl-step.warn { border-color: #ffd166; background: #3c3627; }
.tl-step.good { border-color: #7be08a; background: #23392a; }
.tl-step .row { background: transparent; border: 0; padding: 4px 0 0; }
.url { background: var(--white); border: 2px solid #c8c8d2; padding: 4px 8px; font-size: 15px; color: #4b4a5a; margin-bottom: 10px; word-break: break-all; }
.win.dark .url { background: #1d1d22; border-color: #33333b; color: #bdbdc8; }
.menubar { width: 100%; max-width: 560px; display: flex; justify-content: space-between; background: #e9e9ee; color: #1d1b2c; border: 3px solid #0d0d12; padding: 5px 10px; font-size: 16px; }
.mb-icons { display: flex; gap: 12px; align-items: center; }
.mb-ico { font-weight: 700; padding: 0 3px; }
.dropdown { width: 240px; margin: 4px 0 0 auto; max-width: 100%; background: #f2f2f5; color: #1d1b2c; border: 3px solid #0d0d12; box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.45); }
.screen > .menubar + .dropdown { justify-self: end; margin-right: 6%; }
.dd-row { padding: 6px 10px; font-size: 17px; position: relative; }
.dd-head { font-weight: 700; border-bottom: 2px solid #c8c8d2; }
.dd-row.hl { background: #3a7ff0; color: var(--white); }
.cf-home { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 6px 0; }
.cf-cloud { position: relative; padding: 6px; }
.cf-cloud.off { filter: grayscale(1); }
.cf-cloud.on { animation: bob 1s steps(2) infinite; }
.cf-x { position: absolute; inset: 0; display: grid; place-items: center; font-size: 32px; color: #1d1b2c; font-weight: 700; }
.cf-big { font-weight: 700; font-size: 24px; margin: 0; }
.cf-big.faint { opacity: 0.35; text-align: center; margin-top: 10px; }
.ok-txt { color: #7be08a; }
.cf-sub { margin: 0 0 4px; font-size: 16px; color: #c9c9d1; }
.vnet { width: 90%; text-align: left; margin-top: 8px; }
.vnet-l { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.vnet-list { border: 2px solid #3a3a44; }
.vnet-opt { padding: 4px 8px; font-size: 16px; color: #9d9dab; }
.vnet-opt.sel { background: #2b3b63; color: var(--white); }
.q { font-weight: 700; margin: 0 0 10px; }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card2 { position: relative; border: 2px solid #3a3a44; padding: 10px; display: grid; gap: 6px; align-content: start; font-size: 16px; }
.card2 p { margin: 0; }
.card2-t { font-weight: 700; font-size: 18px; }
.card2.dim { opacity: 0.45; }
.card2.hl::after { right: auto; left: 50%; top: auto; bottom: -24px; translate: -50% 0; content: '▲'; }
.team-input { position: relative; display: flex; align-items: center; background: #1d1d22; border: 2px solid #4a4a55; padding: 8px; margin-bottom: 12px; font-size: 18px; }
.team-val { color: var(--white); font-weight: 700; }
.team-suf { color: #8c8c98; }
.right { text-align: right; }
.sso { background: var(--white); border: 2px solid #dadce0; padding: 14px; color: #1d1b2c; }
.sso p { margin: 0 0 8px; }
.sso-t { font-weight: 700; font-size: 20px; }
.sso-acc { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px; border-top: 2px solid #eee; font-size: 17px; }
.sso-acc.dim { opacity: 0.55; }
.sso-av { width: 22px; height: 22px; display: grid; place-items: center; background: var(--purple); color: var(--white); font-size: 15px; }

/* ===== boss ===== */
.section-boss {
  background: #2a1f3d;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 2px, transparent 2px, transparent 6px);
}
.section-boss code { background: #3d2f58; color: var(--yellow); border-color: var(--yellow); }
.battle { max-width: 860px; margin: 0 auto; border: 4px solid var(--ink); box-shadow: 8px 8px 0 #000; background: var(--white); }
.battle-field {
  position: relative; height: 330px;
  background: linear-gradient(180deg, #f8f4e3 0, #f8f4e3 60%, #d9e9b8 60%, #d9e9b8 100%);
  border-bottom: 4px solid var(--ink);
}
.foe, .ally { position: absolute; display: flex; align-items: flex-end; gap: 22px; }
.foe { right: 5%; top: 20px; }
.ally { left: 5%; bottom: 18px; align-items: center; }
.foe-sprite, .ally-sprite {
  background: linear-gradient(rgba(29, 27, 44, 0.22), rgba(29, 27, 44, 0.22)) no-repeat 50% 100% / 70% 8px;
  padding: 0 8px 10px;
}
.ally-sprite { transform: scaleX(-1); }
.hpbox { background: var(--white); border: 4px solid var(--ink); padding: 8px 12px; min-width: 220px; box-shadow: 4px 4px 0 var(--ink); }
.hpbox-name { font-family: var(--font-pixel); font-size: 11px; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 10px; }
.hpbox-name span { color: var(--red); font-size: 9px; }
.foe .hpbox { order: -1; align-self: flex-start; }
.glitch { animation: glitch 2.4s steps(1) infinite; }
@keyframes glitch {
  0%, 86%, 100% { transform: none; filter: none; }
  88% { transform: translateX(-6px); filter: hue-rotate(80deg); }
  90% { transform: translateX(5px) skewX(8deg); }
  92% { transform: translateX(-2px); filter: hue-rotate(-60deg) saturate(2); }
}
.shake { animation: shake 0.45s steps(6); }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-10px); filter: brightness(2.2); } 50% { transform: translateX(10px); } 75% { transform: translateX(-6px); filter: brightness(2.2); } }
.foe-sprite.fainted { animation: faint 0.8s steps(5) forwards; }
@keyframes faint { to { transform: translateY(40px); opacity: 0; } }
.battle-log {
  margin: 0; padding: 18px 22px; min-height: 92px; background: var(--white);
  box-shadow: inset 0 0 0 4px var(--white), inset 0 0 0 8px var(--ink); border-bottom: 4px solid var(--ink);
}
.battle-log p { margin: 0; font-size: 26px; }
.moves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; background: #efe9d6; }
.move {
  display: grid; gap: 6px; text-align: left; cursor: pointer;
  font-family: var(--font-body); font-size: 18px; color: var(--ink);
  background: var(--white); border: 4px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 12px;
}
.move b { font-family: var(--font-pixel); font-weight: 400; font-size: 10px; line-height: 1.5; }
.move:hover:not(:disabled) { background: var(--yellow); }
.move:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: none; }
.move:disabled { opacity: 0.5; cursor: default; }
.wiggle { animation: wiggle 0.35s steps(4); }
@keyframes wiggle { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
#bossReset { display: block; margin: 0 auto; padding: 12px; }
.battle #bossReset { color: var(--blue-d); }
.plain-steps { max-width: 860px; margin: 28px auto 0; background: #3d2f58; color: #f1edff; border: 4px solid #000; padding: 14px 18px; }
.plain-steps summary { cursor: pointer; font-family: var(--font-pixel); font-size: 11px; line-height: 1.6; color: var(--yellow); }
.plain-steps li { margin-bottom: 8px; }
.plain-steps a { color: var(--yellow); }

/* ===== habits ===== */
.habit-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: habit; }
.habit { counter-increment: habit; background: var(--white); border: 4px solid var(--ink); box-shadow: var(--shadow); padding: 18px; position: relative; }
.habit::before {
  content: counter(habit); position: absolute; top: -14px; left: -14px; width: 34px; height: 34px; display: grid; place-items: center;
  font-family: var(--font-pixel); font-size: 12px; background: var(--red); color: var(--white); border: 4px solid var(--ink);
}
.habit b { font-family: var(--font-pixel); font-weight: 400; font-size: 12px; color: var(--blue-d); }
.habit p { margin: 10px 0 0; font-size: 22px; }

/* ===== trainer card ===== */
.card-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.trainer-card {
  position: relative; background: linear-gradient(135deg, #ffe58a 0, #ffe58a 50%, #ffd34d 50%, #ffd34d 100%);
  border: 4px solid var(--ink); box-shadow: inset 0 0 0 4px #fff3c4, var(--shadow); padding: 18px;
}
.trainer-card.champion { animation: shine 2s steps(2) infinite; }
@keyframes shine { 50% { box-shadow: inset 0 0 0 4px var(--white), 6px 6px 0 var(--ink), 0 0 0 6px var(--orange); } }
.tc-head { display: flex; justify-content: space-between; font-family: var(--font-pixel); font-size: 10px; background: var(--ink); color: var(--yellow); padding: 8px 10px; }
.tc-body { display: grid; grid-template-columns: auto 1fr; gap: 18px; margin: 16px 0; align-items: center; }
.tc-avatar { background: var(--sky-2); border: 4px solid var(--ink); padding: 8px 14px; }
.tc-info p { display: flex; justify-content: space-between; border-bottom: 3px dotted rgba(29, 27, 44, 0.4); margin: 0 0 8px; padding-bottom: 4px; font-size: 21px; }
.tc-info p span, .tc-name { font-family: var(--font-pixel); font-size: 9px; }
.tc-info p b { font-family: var(--font-pixel); font-weight: 400; font-size: 11px; }
.tc-name { display: grid; gap: 6px; margin-bottom: 12px; }
.tc-name input { font-family: var(--font-body); font-size: 23px; padding: 6px 8px; border: 3px solid var(--ink); background: var(--white); width: 100%; }
.tc-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: rgba(255, 255, 255, 0.6); border: 3px solid var(--ink); padding: 10px; }
.tc-slot { display: grid; justify-items: center; gap: 6px; font-family: var(--font-pixel); font-size: 8px; }
.tc-ribbon { margin: 12px 0 0; text-align: center; font-family: var(--font-pixel); font-size: 11px; background: var(--red); color: var(--white); border: 3px solid var(--ink); padding: 8px; }
.finish { background: var(--white); border: 4px solid var(--ink); box-shadow: var(--shadow); padding: 22px; }
.finish-steps { margin: 0 0 16px; padding-left: 24px; }
.finish-steps li { margin-bottom: 10px; font-size: 22px; }
.finish-status { font-size: 22px; padding: 12px; background: var(--paper); border: 3px dashed var(--ink); }
.finish-status.won { background: #d9f7cf; border-style: solid; }

/* ===== footer ===== */
.footer { background: var(--ink); color: #d8d4ee; padding: 26px 0; font-size: 20px; }
.footer a { color: var(--yellow); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-inner p { margin: 0; max-width: 820px; }
.footer .link-btn { color: #ffb4ab; }

/* ===== overlay ===== */
.overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
  background: rgba(15, 12, 30, 0.82);
}
.ov-box {
  position: relative; overflow: hidden; z-index: 2; text-align: center;
  width: min(460px, 100%); background: var(--white); border: 4px solid var(--ink);
  box-shadow: inset 0 0 0 4px var(--white), inset 0 0 0 8px var(--ink), 8px 8px 0 #000;
  padding: 34px 26px 28px;
  animation: ovIn 0.5s steps(5) both;
}
@keyframes ovIn { from { transform: scale(0.3) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ov-rays {
  position: absolute; left: 50%; top: 150px; width: 640px; height: 640px; margin: -320px 0 0 -320px; z-index: -1;
  background: repeating-conic-gradient(#fff3c4 0deg 12deg, #ffffff 12deg 24deg);
  animation: spin 12s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ov-badge { position: absolute; top: 18px; right: 18px; animation: badgeSpin 1.2s steps(8) 0.4s both; }
@keyframes badgeSpin { from { transform: rotateY(0) scale(0); } to { transform: rotateY(720deg) scale(1); } }
.ov-sprite { display: grid; place-items: center; animation: hop 0.6s steps(2) infinite; }
@keyframes hop { 50% { transform: translateY(-12px); } }
.ov-title { font-family: var(--font-pixel); font-weight: 400; font-size: 20px; line-height: 1.5; margin: 14px 0 10px; color: var(--red); }
.ov-text { font-size: 24px; margin: 0 0 20px; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.cf-bit { position: absolute; top: -20px; width: 10px; height: 10px; animation: fall 2.5s steps(14) forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* ===== small effects ===== */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 150; translate: -50% 160%;
  background: var(--ink); color: var(--white); border: 4px solid var(--yellow); padding: 12px 18px;
  font-size: 22px; max-width: calc(100% - 32px); visibility: hidden;
  transition: translate 0.25s steps(4), visibility 0s linear 0.25s;
}
.toast.show { translate: -50% 0; visibility: visible; transition: translate 0.25s steps(4), visibility 0s; }
.xp-float {
  position: fixed; z-index: 160; pointer-events: none; translate: -50% 0;
  font-family: var(--font-pixel); font-size: 12px; color: var(--green-d); text-shadow: 2px 2px 0 var(--white);
  animation: xpUp 1s steps(8) forwards;
}
@keyframes xpUp { to { transform: translateY(-46px); opacity: 0; } }
body.flash::after { content: ''; position: fixed; inset: 0; z-index: 300; pointer-events: none; background: var(--white); animation: flash 0.35s steps(3) forwards; }
@keyframes flash { 0% { opacity: 1; } 33% { opacity: 0; } 66% { opacity: 0.8; } 100% { opacity: 0; } }

/* ===== responsive ===== */
@media (max-width: 1000px) {
  .why-grid, .threat-grid, .habit-grid { grid-template-columns: repeat(2, 1fr); }
  .loop-steps { grid-template-columns: repeat(3, 1fr); }
  .loop-steps li::after { display: none; }
}
@media (max-width: 860px) {
  body { font-size: 22px; }
  .stage-body { grid-template-columns: 1fr; padding: 18px 14px; }
  .screen-col { display: none; }
  .screen { min-height: 0; padding: 12px; }
  .step-body { padding: 0 12px 14px 12px; }
  .card-layout { grid-template-columns: 1fr; }
  .hud-logo-text { display: none; }
  .row.hl::after, .side-item.hl::after, .opt.hl::after, .team-input.hl::after, .sso-acc.hl::after, .dd-row.hl::after, .tl-step.hl::after { right: 4px; }
}
@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .why-grid, .threat-grid, .habit-grid, .loop-steps, .moves { grid-template-columns: 1fr; }
  .prof { grid-template-columns: 1fr; justify-items: center; }
  .dialog::before { left: 50%; top: -22px; bottom: auto; transform: translateX(-50%) rotate(135deg); }
  .dialog { padding: 22px 18px 16px; }
  .dialog-text { font-size: 24px; }
  .stage-head { flex-wrap: wrap; padding: 14px; }
  .stage-partner { display: none; }
  .stage.cleared .stage-head::after { position: absolute; right: 10px; margin-top: -60px; }
  .stage { position: relative; }
  .hud { gap: 10px; padding: 8px 12px; }
  .hud-badges .badge svg { width: 16px; height: 16px; }
  .win-body { grid-template-columns: 1fr; }
  .win-side { display: none; }
  .cards2 { grid-template-columns: 1fr; }
  .split { flex-direction: column; }
  .split-arrow { transform: rotate(90deg); }
  .battle-field { height: 300px; }
  .foe, .ally { gap: 8px; }
  .hpbox { min-width: 150px; padding: 6px 8px; }
  .foe-sprite svg { width: 96px; height: 96px; }
  .ally-sprite svg { width: 84px; height: 84px; }
  .foe { flex-direction: column; align-items: flex-end; right: 3%; top: 10px; }
  .foe .hpbox { order: 0; }
  .tc-body { grid-template-columns: 1fr; justify-items: center; }
  .tc-info { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
