@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@400;500;600;700;800&display=swap");
:root {
  color-scheme: dark;
  --bg: #100e20;
  --panel: #1b172b;
  --line: #4b3b64;
  --pink: #fb628e;
  --muted: #a99fbb;
  --gold: #f9d897;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 0, #2b1c39 0, #100e20 60%);
  color: #fff8ef;
  font-family: Inter, system-ui, sans-serif;
  min-height: 100svh;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
main {
  max-width: 1190px;
  margin: auto;
  padding: 28px 30px 20px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font:
    800 38px "Barlow Condensed",
    sans-serif;
  letter-spacing: 5px;
  text-decoration: none;
  color: #ffe3bd;
  text-shadow: 0 2px #ac637c;
}
.sigil {
  color: var(--pink);
  font-size: 32px;
}
.tools {
  display: flex;
  gap: 8px;
}
.tools button {
  background: #211a31;
  border: 1px solid var(--line);
  color: #ead8f5;
  border-radius: 6px;
  width: 40px;
  height: 38px;
  font-size: 21px;
}
.subhead {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--muted);
  margin: 8px 0 20px;
}
#progress {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0 23px;
}
#progress span {
  width: 11px;
  height: 11px;
  border: 1px solid #746083;
  transform: rotate(45deg);
  background: #241d32;
}
#progress span.active {
  background: var(--pink);
  border-color: #ffc1d0;
  box-shadow: 0 0 15px #f96c8f88;
}
#progress span.done {
  background: #ddb687;
  border-color: #ffe6bb;
}
.arena {
  position: relative;
  aspect-ratio: 1200/650;
  border: 1px solid #ac8ab0;
  outline: 4px solid #2c223b;
  border-radius: 3px;
  overflow: hidden;
  background: #171928;
  isolation: isolate;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.battle-top {
  position: absolute;
  top: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.battle-top > span {
  font:
    700 14px "Barlow Condensed",
    sans-serif;
  letter-spacing: 2px;
  background: #141426d9;
  border: 1px solid #b08bb4;
  padding: 8px 13px;
}
.hp-wrap {
  width: 28%;
  text-align: right;
}
.hp-track {
  padding: 3px;
  border: 1px solid #e4bbd3;
  background: #211b31;
}
.hp-track div {
  height: 10px;
  width: 100%;
  background: linear-gradient(90deg, #d94279, #ff9fae);
  transition: width 0.45s;
}
.hp-wrap > span {
  font-size: 9px;
  letter-spacing: 2px;
  text-shadow: 0 1px 3px #000;
}
.scene-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 26px 23px 14px;
  display: flex;
  justify-content: space-between;
  background: linear-gradient(transparent, #100c20e8);
  font-size: 10px;
  letter-spacing: 2px;
  text-shadow: 0 2px 3px black;
}
.scene-bottom b {
  color: #ffdfaa;
  font-size: 18px;
}
.cover {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0f1024ee, #1113299c 55%, #10132466);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  padding: 6%;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
}
h1 {
  font:
    700 clamp(26px, 3.8vw, 48px) / 1.05 "Barlow Condensed",
    sans-serif;
  letter-spacing: 0.5px;
  margin: 17px 0;
}
p {
  line-height: 1.65;
}
.cover p {
  color: #d0c7dd;
  font-size: 13px;
  margin: 0 0 24px;
}
.primary {
  background: linear-gradient(#f57a9c, #cd426f);
  color: white;
  border: 1px solid #ffc3d5;
  box-shadow: 0 3px 0 #762744;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 1.5px;
  padding: 16px 23px;
  border-radius: 3px;
}
.primary span {
  margin-left: 18px;
}
.secondary {
  color: #eee1f7;
  background: transparent;
  border: 0;
  padding: 16px 0;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 5px;
}
small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}
.question-panel {
  background: linear-gradient(110deg, #251b34, #181629);
  border: 1px solid var(--line);
  margin-top: 15px;
  padding: 20px 25px;
  border-radius: 4px;
}
.question-meta {
  display: flex;
  justify-content: space-between;
  color: #bdafcb;
  font-size: 10px;
  letter-spacing: 2px;
}
#timer {
  color: var(--gold);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}
h2 {
  font-size: 21px;
  font-weight: 600;
  margin: 12px 0 20px;
}
form#answer-form {
  display: flex;
  gap: 12px;
}
input#answer {
  width: 100%;
  min-width: 0;
  background: #110e1e;
  border: 1px solid #655078;
  padding: 15px 16px;
  color: white;
  font-size: 16px;
  border-radius: 3px;
}
input#answer:focus {
  outline: 1px solid #f68cac;
  border-color: #f68cac;
}
.question-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 13px;
  line-height: 1.5;
}
#round-score {
  color: var(--gold);
  white-space: nowrap;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 1px;
  color: #81758f;
  margin-top: 23px;
}
footer button {
  color: #bfb1cc;
  border: 0;
  background: transparent;
  font-size: 10px;
}
em {
  font-size: 7px;
  font-style: normal;
  border: 1px solid #45354f;
  padding: 3px;
  margin-left: 5px;
}
#announce {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin-top: 14px;
  font:
    600 14px/1.5 Inter,
    sans-serif;
  color: #e9d6a9;
  letter-spacing: 0.02em;
  text-shadow: none;
  pointer-events: none;
}
#announce:empty {
  display: none;
}
dialog {
  max-width: 460px;
  width: calc(100% - 32px);
  background: #20182d;
  color: #fff5ed;
  border: 1px solid #9a789f;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 20px 100px black;
}
dialog::backdrop {
  background: #080716bb;
  backdrop-filter: blur(5px);
}
dialog label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #403149;
  font-size: 13px;
}
dialog input {
  accent-color: var(--pink);
  width: 18px;
  height: 18px;
}
dialog select {
  background: #110e1e;
  color: #fff;
  border: 1px solid #67536e;
  padding: 6px;
  font-size: 12px;
}
.close {
  position: absolute;
  right: 15px;
  top: 10px;
  background: none;
  border: 0;
  color: #c8b8d1;
  font-size: 25px;
}
dialog p {
  font-size: 12px;
  color: #cabbda;
}
.tiers p {
  display: flex;
  justify-content: space-between;
}
.results {
  align-items: center;
  text-align: center;
  padding: 20px;
  background: #111022ed;
}
.results h1 {
  margin: 12px;
}
.results .score {
  font: 800 64px "Barlow Condensed";
  color: var(--gold);
}
.result-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 14px 0;
}
.result-row span {
  border: 1px solid #64506d;
  padding: 8px;
  font-size: 11px;
}
@media (max-width: 600px) {
  main {
    padding: 16px 12px 24px;
  }
  .brand {
    font-size: 27px;
    letter-spacing: 3px;
  }
  .sigil {
    font-size: 23px;
  }
  .subhead {
    font-size: 7px;
    letter-spacing: 1.3px;
  }
  .tools button {
    width: 33px;
    height: 32px;
  }
  #progress {
    margin: 16px 0;
    gap: 18px;
  }
  .arena {
    aspect-ratio: 1.25;
  }
  .battle-top {
    top: 12px;
    left: 12px;
    right: 12px;
  }
  .battle-top > span {
    font-size: 10px;
    padding: 6px 8px;
  }
  .hp-wrap {
    width: 34%;
  }
  .hp-track div {
    height: 7px;
  }
  .scene-bottom {
    font-size: 7px;
    letter-spacing: 1px;
    padding: 20px 10px 10px;
  }
  .scene-bottom b {
    font-size: 14px;
  }
  .cover {
    padding: 7%;
  }
  .cover h1 {
    font-size: 32px;
  }
  .cover p {
    font-size: 11px;
    max-width: 240px;
    margin-bottom: 15px;
  }
  .cover .eyebrow {
    font-size: 8px;
  }
  .cover small {
    font-size: 8px;
  }
  .primary {
    font-size: 10px;
    padding: 14px;
  }
  .question-panel {
    padding: 16px 14px;
  }
  h2 {
    font-size: 18px;
    line-height: 1.35;
    margin: 10px 0 16px;
  }
  #answer-form {
    gap: 8px !important;
  }
  #attack span {
    display: none;
  }
  input#answer {
    padding: 13px 10px;
  }
  .question-foot {
    font-size: 9px;
  }
  footer > span:first-child {
    display: none;
  }
  .results .score {
    font-size: 46px;
  }
  .results h1 {
    font-size: 27px;
  }
  .result-row span {
    padding: 5px;
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media (max-width: 600px) {
  .arena {
    aspect-ratio: 1.65;
  }
  .cover {
    padding: 5%;
  }
  .cover h1 {
    font-size: clamp(22px, 5.8vw, 30px);
    margin: 10px 0;
  }
  .cover p {
    margin-bottom: 10px;
    font-size: 10px;
  }
  .cover .primary {
    padding: 10px 14px;
  }
  .cover .secondary {
    padding: 10px 0;
  }
  .cover .eyebrow {
    font-size: 7px;
  }
  .cover small {
    font-size: 7px;
  }
  .results h1 {
    font-size: 22px;
    margin: 5px;
  }
  .results .score {
    font-size: 38px;
  }
  .result-row {
    margin: 8px 0;
  }
  .scene-bottom {
    padding-top: 14px;
  }
}

.scene-bottom {
  justify-content: flex-end;
}
input#answer[aria-invalid="true"] {
  border-color: #fb628e;
}

/* Focused prompt and response surface, inspired by compact daily-game layouts. */
.question-panel {
  max-width: 760px;
  margin: 18px auto 0;
  padding: 24px 28px;
  background: #151421;
  border: 1px solid #ffffff15;
  border-radius: 12px;
  box-shadow: 0 8px 32px #00000018;
}
.question-meta {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  color: #a6a0b5;
}
#timer {
  font:
    600 14px/1.4 Inter,
    sans-serif;
  font-variant-numeric: tabular-nums;
  background: #ffffff08;
  padding: 4px 9px;
  border-radius: 6px;
}
#question {
  font:
    600 clamp(19px, 2.3vw, 25px) / 1.45 Inter,
    sans-serif;
  letter-spacing: -0.035em;
  text-align: center;
  margin: 18px 0 22px;
}
form#answer-form {
  gap: 8px;
  max-width: 600px;
  margin: auto;
}
input#answer {
  min-height: 52px;
  background: #0d0d17;
  border: 1px solid #ffffff24;
  border-radius: 8px;
  padding: 14px 16px;
  font:
    400 16px/1.4 Inter,
    sans-serif;
  box-shadow: none;
  transition: border-color 0.15s;
}
input#answer::placeholder {
  color: #777387;
}
input#answer:focus {
  outline: 3px solid #db9dad18;
  border-color: #c28d9d;
}
input#answer[aria-invalid="true"] {
  border-color: #d89a9a;
}
#attack.primary {
  min-height: 52px;
  min-width: 100px;
  padding: 12px 18px;
  border-radius: 8px;
  background: #e4c4ce;
  color: #261b2a;
  border: 1px solid #eddae0;
  box-shadow: none;
  font:
    600 14px Inter,
    sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
#attack.primary:disabled {
  opacity: 0.38;
}
#attack span {
  font-size: 16px;
  margin-left: 8px;
  opacity: 0.55;
}
.question-foot {
  margin-top: 8px;
  justify-content: center;
  font:
    400 12px/1.5 Inter,
    sans-serif;
  text-align: center;
}
.question-foot:has(#feedback:empty):has(#round-score:empty) {
  display: none;
}
footer {
  max-width: 760px;
  margin: 20px auto;
  letter-spacing: 0.04em;
}
@media (max-width: 600px) {
  .question-panel {
    padding: 18px 16px;
    margin-top: 12px;
  }
  #question {
    margin: 16px 0 18px;
  }
  #attack.primary {
    min-width: 84px;
    padding: 12px;
  }
  #attack span {
    display: none;
  }
}

/* A reserved result line prevents layout jumps while the strike resolves. */
#announce,
#announce:empty {
  display: flex;
  min-height: 48px;
  margin-top: 12px;
}
.shot-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 600px;
  padding: 10px 14px;
  box-sizing: border-box;
  border: 1px solid #ffffff0e;
  border-radius: 8px;
  background: #ffffff03;
  animation: shot-reveal 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.shot-name {
  font:
    500 13px/1.4 Inter,
    sans-serif;
  color: #ddd6e4;
  letter-spacing: 0;
}
.shot-damage {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.shot-damage strong {
  font-size: 20px;
  font-weight: 600;
  color: #f1e8dc;
}
.shot-damage span {
  font-size: 11px;
  font-weight: 400;
  color: #928b9f;
}
.shot-result[data-rarity="rare"] {
  border-color: #d8bc7b30;
  background: #d8bc7b07;
}
.shot-result[data-rarity="rare"] .shot-name {
  color: #e5d1a3;
}
.shot-result[data-rarity="miss"] .shot-name,
.shot-result[data-rarity="miss"] strong {
  color: #a19aac;
}
@keyframes shot-reveal {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .shot-result {
    animation: none;
  }
}

/* Scene-first interface: quiet dialogue above the action, one answer dock. */
body {
  background: radial-gradient(ellipse at 50% 10%, #252238, #0d101b 70%);
}
main {
  max-width: 1280px;
  padding: 22px 28px 16px;
}
header {
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 27px;
  letter-spacing: 3px;
  text-shadow: none;
  color: #eee5d8;
}
.brand-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  image-rendering: pixelated;
}
.tools button {
  background: #ffffff04;
  border-color: #ffffff18;
  border-radius: 4px;
  width: 36px;
  height: 34px;
  font-size: 18px;
}
.subhead {
  font-size: 8px;
  letter-spacing: 1.8px;
  margin: 8px 0 14px;
}
#progress {
  gap: 7px;
  margin: 13px 0 18px;
}
#progress span {
  width: 24px;
  height: 6px;
  transform: none;
  border: 0;
  background: #ffffff15;
  border-radius: 1px;
}
#progress span.active {
  box-shadow: 0 0 12px #fb628e38;
}
.arena {
  outline: none;
  border: 1px solid #b5b6db30;
  border-radius: 8px;
  box-shadow: 0 20px 70px #0004;
}
.battle-top {
  top: 16px;
  left: 18px;
  right: 18px;
}
.battle-top > span {
  font:
    600 10px/1.3 Inter,
    sans-serif;
  letter-spacing: 1px;
  border: 0;
  border-radius: 3px;
  padding: 7px 9px;
  background: #101421a6;
}
.hp-wrap {
  width: 18%;
  max-width: 190px;
}
.hp-track {
  padding: 2px;
  border-color: #ffffff50;
  background: #101421a6;
}
.hp-track div {
  height: 5px;
}
.hp-wrap > span {
  font-size: 8px;
  letter-spacing: 1px;
}
.scene-bottom {
  background: linear-gradient(transparent, #0d101b99);
  padding: 20px 18px 12px;
  font-size: 9px;
  letter-spacing: 1px;
}
.scene-bottom b {
  font-size: 17px;
}
.prompt-card {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: min(540px, 64%);
  padding: 15px 21px 17px;
  background: linear-gradient(110deg, #111522e8, #171a2bd1);
  border: 1px solid #d0bdd02e;
  border-top-color: #efcbdc66;
  border-radius: 4px;
  box-shadow: 0 8px 26px #0002;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms;
}
.prompt-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font:
    500 9px/1.4 Inter,
    sans-serif;
  letter-spacing: 1.5px;
  color: #d99caf;
}
#prompt-count {
  color: #b1aec0;
}
#question {
  font:
    500 clamp(18px, 2.15vw, 27px) / 1.38 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: #fcf3e9;
  letter-spacing: -0.055em;
  text-align: left;
  margin: 10px 0 0;
  min-height: 1.38em;
}
body[data-state="question"] .prompt-card,
body[data-state="introducing"] .prompt-card {
  opacity: 1;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.question-panel {
  max-width: 800px;
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin: 18px auto 0;
}
.answer-dock {
  display: flex;
  gap: 12px;
  align-items: center;
}
.timer-badge {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border: 1px solid #bfc6ea35;
  border-radius: 50%;
  background: #141927;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 4px #0d101b;
}
#timer {
  font:
    600 18px/1.1 ui-monospace,
    monospace;
  padding: 0;
  border-radius: 0;
  background: none;
  color: #f3d6e1;
}
.timer-label {
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #a9a5b6;
  margin-top: 4px;
}
form#answer-form {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
  gap: 10px;
  padding-bottom: 7px;
}
form#answer-form::after {
  content: "";
  position: absolute;
  height: 2px;
  bottom: 0;
  left: 0;
  width: var(--time-left, 100%);
  background: #d4a3b8;
  transition: width 100ms linear;
  opacity: 0.7;
}
input#answer {
  background: #131827;
  border-color: #9e9dbb45;
  border-radius: 4px;
  min-height: 54px;
  padding: 14px 18px;
  color: #fff7ec;
}
input#answer:focus {
  border-color: #d5aec4;
  outline: 2px solid #d5aec417;
}
#attack.primary {
  background: #dba4ba;
  border-color: #e7bdcd;
  border-radius: 4px;
  min-height: 54px;
  color: #291c2a;
  letter-spacing: 0.03em;
}
.question-foot {
  min-height: 18px;
  margin-top: 6px;
  margin-left: 70px;
  text-align: left;
  justify-content: flex-start;
}
body:not([data-state]) .question-panel,
body[data-state="ready"] .question-panel,
body[data-state="complete"] .question-panel {
  display: none;
}
body[data-state="combat"] .answer-dock,
body[data-state="travel"] .answer-dock {
  opacity: 0.35;
  transition: opacity 200ms;
}
#announce,
#announce:empty {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, 65%);
  min-height: 0;
  margin: 0;
  pointer-events: none;
}
#announce:empty {
  display: none;
}
.shot-result {
  background: #111522dd;
  border: 1px solid #d0bdd02e;
  border-radius: 4px;
  padding: 14px 18px;
}
.shot-name {
  font-size: 14px;
  color: #ede4ed;
}
.shot-damage strong {
  font-size: 26px;
}
.shot-result[data-rarity="rare"] {
  background: #201e2ce8;
  border-color: #d8bc7b60;
}
.cover {
  z-index: 3;
}
.cover h1 {
  font:
    600 clamp(25px, 3.3vw, 43px) / 1.15 Inter,
    sans-serif;
  letter-spacing: -1.6px;
}
.cover .primary {
  font:
    600 12px Inter,
    sans-serif;
  letter-spacing: 0.04em;
  background: #dba4ba;
  color: #291c2a;
  border-color: #e7bdcd;
  box-shadow: none;
}
footer {
  max-width: 800px;
  margin: 17px auto 0;
}
@media (max-width: 600px) {
  main {
    padding: 14px 12px;
  }
  .brand {
    font-size: 23px;
    letter-spacing: 2px;
  }
  .brand-icon {
    width: 28px;
    height: 28px;
  }
  .subhead {
    font-size: 7px;
    letter-spacing: 1px;
  }
  #progress {
    margin: 12px 0 15px;
  }
  .arena {
    aspect-ratio: 1.65;
  }
  .arena canvas {
    object-fit: cover;
  }
  .battle-top {
    top: 10px;
    left: 10px;
    right: 10px;
  }
  .battle-top > span {
    font-size: 8px;
    padding: 5px 6px;
  }
  .hp-wrap {
    width: 24%;
  }
  .prompt-card {
    top: 44px;
    width: 86%;
    padding: 10px 13px 12px;
  }
  .prompt-label {
    font-size: 7px;
    letter-spacing: 1px;
  }
  #question {
    font-size: clamp(15px, 4vw, 20px);
    line-height: 1.35;
    margin-top: 7px;
  }
  .question-panel {
    margin-top: 14px;
    padding: 0;
  }
  .answer-dock {
    gap: 8px;
  }
  .timer-badge {
    width: 45px;
    height: 45px;
  }
  #timer {
    font-size: 15px;
  }
  .timer-label {
    font-size: 6px;
  }
  form#answer-form {
    gap: 6px;
  }
  input#answer {
    padding: 12px;
    min-height: 48px;
  }
  #attack.primary {
    min-width: 70px;
    padding: 10px;
    min-height: 48px;
  }
  .question-foot {
    margin-left: 53px;
    font-size: 11px;
  }
  #announce {
    top: 53px;
    width: 72%;
  }
  .shot-result {
    padding: 10px 13px;
    gap: 12px;
  }
  .shot-name {
    font-size: 12px;
  }
  .shot-damage strong {
    font-size: 22px;
  }
  .cover h1 {
    font-size: 24px;
    letter-spacing: -1px;
  }
}
body:has(#reduced:checked) .prompt-card,
body:has(#reduced:checked) .shot-result {
  transition: none;
  animation: none;
}

@media (min-width: 601px) and (min-height: 600px) {
  main {
    max-width: min(1280px, calc((100svh - 240px) * 1.846 + 56px));
  }
}

#report-notes {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0 18px;
  padding: 12px;
  color: #f3efff;
  background: #141322;
  border: 1px solid #77718c;
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}
#report-notes:focus-visible {
  outline: 2px solid #b5a4ef;
  outline-offset: 2px;
}
#report-status {
  font-size: 12px;
}

/* Daily review stays readable and scrolls naturally on small screens. */
body[data-state="complete"] .arena {
  height: auto;
  aspect-ratio: auto;
  min-height: 480px;
}
body[data-state="complete"] #battle,
body[data-state="complete"] .battle-top,
body[data-state="complete"] .scene-bottom {
  display: none;
}
.cover.results {
  position: relative;
  gap: 8px;
  padding: 24px;
  justify-content: flex-start;
}
.daily-review {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  width: min(100%, 680px);
  text-align: left;
}
.daily-review li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  padding: 15px 0;
  border-top: 1px solid #ffffff18;
}
.daily-review .review-question {
  grid-column: 1 / -1;
  margin: 0;
  color: #aba6bb;
  font-size: 12px;
  line-height: 1.4;
}
.review-answer {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.review-strike {
  color: #e6c89e;
  font-size: 12px;
  align-self: center;
}
.cover .review-note {
  margin: 0;
  color: #bdb7ce;
  font-size: 13px;
}
@media (max-width: 600px) {
  .cover.results {
    padding: 20px 16px;
  }
  .daily-review li {
    grid-template-columns: 1fr;
  }
  .review-strike {
    grid-column: 1;
  }
}

/* Clear combat overlays before bringing in the daily review. */
body[data-state="finishing"] .arena::after {
  content: ""; position: absolute; inset: 0; z-index: 10;
  background: #111022; pointer-events: none;
  animation: review-curtain 280ms ease-out both;
}
body[data-state="complete"] #announce,
body[data-state="complete"] .prompt-card { display: none; }
.cover.results { background: #111022; }
.cover.results > * { animation: review-arrive 520ms cubic-bezier(.2,.7,.2,1) both; }
.cover.results > .score { animation-delay: 65ms; }
.cover.results > .review-note { animation-delay: 110ms; }
.cover.results > .daily-review { animation-delay: 160ms; }
@keyframes review-curtain { from { opacity: 0; } to { opacity: 1; } }
@keyframes review-arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
body:has(#reduced:checked) .cover.results > * { animation: none; }
@media(prefers-reduced-motion: reduce) {
  .cover.results > *, body[data-state="finishing"] .arena::after { animation: none; }
}

/* Share-safe summary stays separate from the private answer review. */
.share-scorecard { width:min(100%,760px); text-align:center; padding:12px 0; }
.cover .result-date {font:500 14px/1.5 system-ui;letter-spacing:.12em;color:#c2b9ce;margin:0 0 18px;}
.share-scorecard h1 {font:600 clamp(28px,5vw,44px)/1.15 system-ui;margin:0 0 16px;}
.result-total {display:flex;justify-content:center;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:28px;}
.result-total strong {font:800 clamp(56px,9vw,94px)/1 system-ui;color:#f9d88f;letter-spacing:-.05em;}
.result-total span {font:400 18px system-ui;color:#c2b9ce;}
.damage-grid {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;padding:0;margin:0;list-style:none;}
.damage-cell {background:#201d35;border:1px solid #ffffff0d;border-radius:8px;padding:14px 6px;display:flex;flex-direction:column;gap:12px;align-items:center;}
.damage-label {font:400 14px system-ui;color:#c2b9ce;white-space:nowrap;}
.damage-cell strong {font:700 clamp(20px,3vw,32px) system-ui;color:var(--strike-color);}
.damage-bar {width:80%;height:4px;background:#39354c;border-radius:4px;overflow:hidden;}
.damage-bar::after {content:"";display:block;height:100%;width:var(--damage);background:var(--strike-color);}
.cover .result-site {color:#c2b9ce;font:500 14px system-ui;margin:18px 0 0;}
.cover .share-hint {width:100%;text-align:center;font:400 14px/1.5 system-ui;color:#c2b9ce;margin:8px 0;}
.share-actions {display:flex;flex-wrap:wrap;justify-content:center;gap:10px;}
.share-actions button {font:600 16px system-ui;padding:13px 20px;border:1px solid #ffffff2b;border-radius:8px;background:#252137;color:#fff8ed;cursor:pointer;}
.share-actions .primary-share {background:#e5a2bd;color:#20172a;border-color:#e5a2bd;}
.share-actions button:hover {filter:brightness(1.12);}
.share-actions button:focus-visible,.answer-review summary:focus-visible {outline:2px solid #f9d88f;outline-offset:4px;}
.cover .share-status {font:400 14px/1.4 system-ui;color:#ddd2e9;min-height:20px;margin:4px 0;}
.share-manual {width:min(100%,680px);min-height:170px;color:#fff8ed;background:#201d35;padding:16px;font:14px/1.6 monospace;border:1px solid #e5a2bd;border-radius:8px;}
.share-manual[hidden] {display:none;}
.answer-review {width:min(100%,680px);margin-top:22px;border-top:1px solid #ffffff20;padding-top:20px;}
.answer-review summary {cursor:pointer;color:#c2b9ce;font:500 15px/1.5 system-ui;}
.answer-review .daily-review {width:100%;}
.answer-review .review-question,.answer-review .review-strike {font-size:14px;}
@media(max-width:480px){.damage-grid{gap:4px;}.damage-cell{padding:12px 2px;}.damage-label{font-size:12px;}.share-actions button{padding:12px 16px;}.cover.results{padding:24px 12px;}}

/* Animillion Quest Archive */
#archive-dialog {
  max-width: 480px;
  max-height: 85dvh;
  overflow-y: auto;
}
#archive-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}
.archive-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px;
  background: #251e35;
  border: 1px solid #4b3b64;
  border-radius: 6px;
  color: #fff8ef;
  text-decoration: none;
}
.archive-entry:hover {
  border-color: #d99caf;
  background: #302640;
}
.archive-entry strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
}
.archive-entry small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
}
.archive-entry .archive-best {
  color: var(--gold);
}
.archive-play {
  font-size: 12px;
  font-weight: 800;
  color: #e5a2bd;
  white-space: nowrap;
}
#archive-button {
  color: var(--gold);
  font-weight: 700;
}
.archive-home {
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
}

/* Fighter Profile V2 */
#stats-button {
  display: inline-grid;
  place-items: center;
}

#stats-dialog {
  --fp-gold: #f9d897;
  --fp-muted: #a99fbb;
  --fp-panel: #211a32;
  --fp-line: #4b3b64;
  width: min(560px, calc(100vw - 24px));
  max-height: 88dvh;
  padding: 22px;
  overflow: auto;
  box-sizing: border-box;
  background: #100e20;
  color: #eee8f6;
  border: 1px solid var(--fp-line);
  border-radius: 12px;
}

#stats-dialog .fp-header {
  position: relative;
  padding-right: 28px;
}

#stats-dialog .fp-header h2 {
  font-size: 28px;
  color: var(--fp-gold);
  margin: 8px 0;
}

.fp-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--fp-muted);
}

#fp-since {
  font-size: 12px;
  color: var(--fp-muted);
  margin: 6px 0 20px;
}

.fp-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--fp-line);
  margin: 0 0 20px;
}

#stats-dialog .fp-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 12px 2px;
  font-size: 12px;
  color: var(--fp-muted);
  cursor: pointer;
}

#stats-dialog .fp-tabs button[aria-pressed="true"] {
  color: var(--fp-gold);
  border-bottom-color: var(--fp-gold);
}

#stats-dialog button:focus-visible,
#stats-dialog summary:focus-visible {
  outline: 2px solid var(--fp-gold);
  outline-offset: 3px;
}

.fp-hero {
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid #79644e;
  border-radius: 9px;
  background: linear-gradient(125deg, #30263c, #19162a);
}

.fp-hero > span {
  color: var(--fp-gold);
  font-size: 10px;
  letter-spacing: 2px;
}

.fp-hero strong {
  display: inline-block;
  color: var(--fp-gold);
  font-size: 48px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.fp-hero small {
  color: var(--fp-muted);
}

.fp-hero .fp-track {
  margin-top: 10px;
}

.fp-hero .fp-track i {
  background: var(--fp-gold);
}

.fp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fp-tile {
  background: var(--fp-panel);
  border: 1px solid #ffffff10;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.fp-tile span {
  font-size: 11px;
  color: var(--fp-muted);
}

.fp-tile strong {
  font-size: clamp(20px, 5vw, 28px);
  font-variant-numeric: tabular-nums;
  color: var(--fp-gold);
  overflow-wrap: anywhere;
}

#stats-dialog h3 {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1.6px;
  margin: 26px 0 14px;
  color: var(--fp-muted);
}

.fp-chart {
  background: var(--fp-panel);
  padding: 10px;
  border-radius: 8px;
}

.fp-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.fp-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  font-size: 13px;
  border-bottom: 1px solid #ffffff10;
}

.fp-record b {
  text-align: right;
  color: var(--fp-gold);
  font-variant-numeric: tabular-nums;
}

.fp-track {
  height: 7px;
  background: #302940;
  border-radius: 8px;
  overflow: hidden;
}

.fp-track i {
  display: block;
  height: 100%;
  max-width: 100%;
  background: #bb91ed;
  border-radius: inherit;
}

.fp-rarity {
  margin: 14px 0;
}

.fp-rarity > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 12px;
}

.fp-dist {
  display: grid;
  grid-template-columns: 64px 1fr 26px;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 11px;
}

.fp-dist b {
  text-align: right;
  color: var(--fp-gold);
}

.fp-quest {
  border: 1px solid #ffffff15;
  background: var(--fp-panel);
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.fp-quest summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 14px;
  gap: 10px;
  margin-bottom: 10px;
  list-style: none;
}

.fp-quest summary::-webkit-details-marker {
  display: none;
}

.fp-quest summary::after {
  content: "+";
  color: var(--fp-muted);
}

.fp-quest[open] summary::after {
  content: "−";
}

.fp-quest summary b {
  color: var(--fp-gold);
  margin-left: auto;
  white-space: nowrap;
}

.fp-strikes {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 10px;
}

.fp-strikes span {
  background: #302940;
  text-align: center;
  border-radius: 4px;
  padding: 5px 0;
  color: var(--fp-gold);
  font-size: 11px;
}

.fp-answer {
  padding: 14px 0;
  border-bottom: 1px solid #ffffff15;
  overflow-wrap: anywhere;
}

.fp-answer small {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--fp-muted);
}

.fp-answer p {
  font-size: 12px;
  margin: 6px 0;
}

.fp-answer strong {
  color: var(--fp-gold);
  font-size: 13px;
}

.fp-answer > div {
  margin-top: 5px;
  font-size: 11px;
  color: var(--fp-muted);
}

.fp-achievement {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--fp-panel);
  border: 1px solid #ffffff10;
  border-radius: 8px;
  margin-bottom: 8px;
}

.fp-achievement.unlocked {
  border-color: #79644e;
}

.fp-achievement > div {
  flex: 1;
  min-width: 0;
}

.fp-achievement strong {
  display: block;
  font-size: 13px;
}

.fp-achievement small {
  font-size: 10px;
  color: var(--fp-muted);
}

.fp-medal {
  font-size: 26px;
  color: var(--fp-muted);
}

.fp-achievement.unlocked .fp-medal,
.fp-achievement.unlocked strong {
  color: var(--fp-gold);
}

.fp-empty, .fp-note, .fp-footer p {
  font-size: 11px;
  line-height: 1.6;
  color: var(--fp-muted);
}

.fp-empty {
  padding: 20px;
  text-align: center;
  background: var(--fp-panel);
  border-radius: 8px;
}

.fp-footer {
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid var(--fp-line);
  text-align: center;
}

#fp-export {
  font-size: 12px;
  padding: 9px 16px;
}

@media (max-width: 420px) {
  #stats-dialog {
    padding: 15px;
  }
  .fp-tile {
    padding: 12px;
  }
  .fp-tabs button {
    font-size: 11px;
  }
  .fp-hero strong {
    font-size: 40px;
  }
}

/* Anime Expeditions */
#expedition-button {
  color: var(--gold);
  font-weight: 700;
}

#expedition-dialog {
  max-width: 520px;
  max-height: 85dvh;
  overflow-y: auto;
  background: #161324;
}

#expedition-dialog h2 {
  color: var(--gold);
  font-size: 26px;
  margin-bottom: 8px;
}

#expedition-list {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.expedition-entry {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 75px;
  padding: 15px;
  background: #211c30;
  border: 1px solid #4b3b64;
  border-left: 3px solid var(--expedition-color);
  border-radius: 5px;
  text-decoration: none;
  color: #fff8ef;
  transition: background 150ms,
    border-color 150ms;
}

.expedition-entry:hover {
  background: #30273e;
  border-color: var(--expedition-color);
}

.expedition-number {
  font: 700 28px "Barlow Condensed", sans-serif;
  color: var(--expedition-color);
  min-width: 28px;
}

.expedition-content {
  flex: 1;
  min-width: 0;
}

.expedition-content strong {
  display: block;
  font-size: 17px;
  color: var(--expedition-color);
}

.expedition-content small {
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

.expedition-play {
  font-size: 10px;
  font-weight: 800;
  color: var(--expedition-color);
  white-space: nowrap;
}

footer {
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
}

@media (max-width: 600px) {
  #expedition-dialog {
    padding: 22px 16px;
  }

  .expedition-entry {
    padding: 12px;
    gap: 10px;
    min-height: 65px;
  }

  .expedition-content strong {
    font-size: 15px;
  }

  .expedition-content small {
    font-size: 10px;
  }

  .expedition-number {
    font-size: 23px;
  }
}

/* Fighter Profile V3 — lifetime progression */

#stats-dialog .fp-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#stats-dialog .fp-tabs button {
  min-width: 0;
  padding-inline: 3px;
  font-size: 11px;
}

.fp-level {
  background: linear-gradient(
    130deg, #2c233a, #191629
  );
  border: 1px solid #a4885d80;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.fp-level-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fp-level-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 82px;
  padding: 8px;
  background: #171422;
  border: 1px solid #c8ab72;
  border-radius: 8px;
}

.fp-level-number small {
  color: #c5b5a0;
  letter-spacing: 2px;
  font-size: 9px;
}

.fp-level-number strong {
  color: var(--gold);
  font: 800 38px "Barlow Condensed", sans-serif;
}

.fp-level-info {
  flex: 1;
  min-width: 0;
}

.fp-level-info > span {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
}

#stats-dialog .fp-level-info h3 {
  color: var(--gold);
  font-size: 19px;
  margin: 5px 0 12px;
}

.fp-level .fp-track {
  height: 8px;
  background: #41374d;
}

.fp-level .fp-track i {
  background: linear-gradient(
    90deg, #b89055, #f9d897
  );
}

.fp-xp-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #c4b8ce;
  margin-top: 6px;
}

.fp-level-bottom {
  border-top: 1px solid #ffffff17;
  padding-top: 13px;
  margin-top: 15px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fp-level-bottom small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.fp-level-bottom b {
  display: block;
  color: #f7ead4;
  margin-top: 4px;
  font-size: 13px;
}

.fp-world {
  background: #211a32;
  border: 1px solid #4b3b64;
  border-left: 3px solid var(--world-color);
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 7px;
}

.fp-world-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.fp-world-title strong {
  color: var(--world-color);
  font-size: 14px;
}

.fp-world-title b {
  color: #eee5f6;
  font-size: 12px;
  white-space: nowrap;
}

.fp-world .fp-track i {
  background: var(--world-color);
}

.fp-world small {
  display: inline-block;
  margin-top: 7px;
}

.fp-world a {
  display: block;
  color: var(--world-color);
  font-size: 12px;
  text-decoration: none;
  margin-top: 12px;
}

@media (max-width: 420px) {
  #stats-dialog .fp-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  #stats-dialog .fp-tabs button {
    font-size: 10px;
  }

  .fp-level-top {
    gap: 11px;
  }

  #stats-dialog .fp-level-info h3 {
    font-size: 16px;
  }
}

/* Fighter Progression Rewards */

.quest-progression {
  width: min(100%, 680px);
  box-sizing: border-box;
  background: linear-gradient(
    135deg, #2c2339, #191627
  );
  border: 1px solid #b69a635c;
  border-radius: 10px;
  padding: 20px;
  margin: 12px auto;
  text-align: left;
}

.qp-eyebrow {
  display: block;
  color: #c8b18a;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 600;
}

.qp-earned {
  display: block;
  color: #f9d897;
  font: 700 34px "Barlow Condensed", sans-serif;
  margin: 7px 0 15px;
}

.qp-level-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #eee4f6;
  margin-bottom: 10px;
}

.qp-level-row span {
  color: #d8c19a;
  text-align: right;
}

.qp-track {
  height: 8px;
  background: #42384f;
  border-radius: 20px;
  overflow: hidden;
}

.qp-track i {
  display: block;
  height: 100%;
  width: var(--xp-progress);
  background: linear-gradient(
    90deg, #b48d53, #f9d897
  );
  border-radius: 20px;
  animation: qp-fill 900ms ease-out both;
}

.qp-progress-label {
  display: block;
  margin-top: 8px;
  color: #c3b7d0;
  font-size: 11px;
}

.quest-progression.level-up {
  border-color: #f9d897;
  animation: qp-level-up 900ms ease-out both;
}

.qp-rank {
  background: #f9d89710;
  color: #f9d897;
  border: 1px solid #f9d89740;
  padding: 12px;
  margin-top: 16px;
  border-radius: 5px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.qp-achievement {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid #d7b97b50;
  border-radius: 6px;
  background: #d7b97b09;
}

.qp-achievement strong {
  display: block;
  color: #f9d897;
  font-size: 16px;
  margin: 6px 0;
}

.qp-achievement small {
  display: block;
  font-size: 11px;
}

.qp-note {
  display: block;
  margin-top: 12px;
  font-size: 11px;
}

@keyframes qp-fill {
  from { width: 0; }
  to { width: var(--xp-progress); }
}

@keyframes qp-level-up {
  0% { box-shadow: 0 0 0 #f9d89700; }
  40% { box-shadow: 0 0 26px #f9d89745; }
  100% { box-shadow: 0 0 8px #f9d89715; }
}

@media (max-width: 600px) {
  .quest-progression {
    padding: 16px;
  }

  .qp-earned {
    font-size: 30px;
  }

  .qp-level-row {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qp-track i,
  .quest-progression.level-up {
    animation: none;
  }
}

body:has(#reduced:checked) .qp-track i,
body:has(#reduced:checked) .quest-progression.level-up {
  animation: none;
}

/* Journey navigation */

#leave-journey {
  color: #e5a2bd;
  font-weight: 700;
}

#leave-journey[hidden] {
  display: none;
}

#leave-dialog {
  max-width: 420px;
  background: #20182d;
}

#leave-dialog h2 {
  color: #f9d897;
}

.leave-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.leave-cancel {
  background: #292237;
  color: #eee5f6;
  border: 1px solid #665475;
  border-radius: 5px;
  padding: 12px;
  font-size: 12px;
}

#confirm-leave {
  background: #dba4ba;
  color: #291c2a;
  box-shadow: none;
  border-radius: 5px;
  padding: 12px;
  letter-spacing: 0;
}


/* Animillion Game Mode Navigation V2 */

#mode-navigation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 18px 0 14px;
  padding: 5px;
  background: #141321;
  border: 1px solid #ffffff15;
  border-radius: 8px;
}

#mode-navigation .mode-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 8px;
  background: transparent;
  color: #a99fbb;
  font: 600 12px Inter, system-ui, sans-serif;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 5px;
  transition: background 150ms, color 150ms;
}

#mode-navigation .mode-tab svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

#mode-navigation .mode-tab:hover {
  background: #ffffff08;
  color: #f1e8f5;
}

#mode-navigation .mode-active {
  color: #f9d897;
  background: #2b2338;
  border-color: #f9d89728;
}

#mode-navigation .mode-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  border-radius: 2px;
  background: #f9d897;
}

#leave-journey,
.archive-home {
  display: none !important;
}

#expedition-dialog.mode-selection-screen,
#archive-dialog.mode-selection-screen {
  width: min(720px, calc(100vw - 32px));
  max-width: 720px;
  max-height: 88dvh;
  padding: 32px;
  background: #151323;
  border: 1px solid #665477;
  border-radius: 12px;
  overflow-y: auto;
}

.mode-selection-screen h2 {
  color: #f9d897;
  font: 700 32px "Barlow Condensed", sans-serif;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

.mode-selection-screen > p {
  font-size: 13px;
  color: #bdb4cc;
}

#expedition-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}

#expedition-list .expedition-entry {
  min-height: 105px;
  padding: 16px;
}

#archive-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}

#archive-list .archive-entry {
  min-height: 85px;
}

footer {
  justify-content: center;
  gap: 24px;
}

@media (max-width: 600px) {
  #mode-navigation {
    margin: 12px 0;
    gap: 3px;
    padding: 4px;
  }

  #mode-navigation .mode-tab {
    flex-direction: column;
    min-height: 60px;
    gap: 5px;
    padding: 7px 3px;
    font-size: 10px;
    text-align: center;
  }

  #mode-navigation .mode-tab svg {
    width: 19px;
    height: 19px;
  }

  #expedition-dialog.mode-selection-screen,
  #archive-dialog.mode-selection-screen {
    width: calc(100vw - 16px);
    max-height: 92dvh;
    padding: 24px 16px;
  }

  #expedition-list,
  #archive-list {
    grid-template-columns: 1fr;
  }

  #expedition-list .expedition-entry {
    min-height: 76px;
  }

  .mode-selection-screen h2 {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mode-navigation .mode-tab {
    transition: none;
  }
}

/* Remove subtitle while preserving quest number */
.subhead > span:first-child {
  display: none;
}

.subhead {
  justify-content: flex-end;
  margin: 8px 0;
}

/* Quick fighter polish */

#fighter-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid #b69a635c;
  border-radius: 5px;
  background: #282235;
  color: #f9d897;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.new-personal-best {
  color: #f9d897;
  background: #f9d8970b;
  border: 1px solid #f9d89740;
  border-radius: 6px;
  padding: 10px 16px;
  margin: 8px auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-align: center;
}

.expedition-completed {
  color: #83c5a0;
  font-size: 13px;
}

@media (max-width: 600px) {
  #fighter-level-badge {
    font-size: 9px;
    padding: 0 5px;
  }

  header {
    gap: 6px;
  }

  .tools {
    gap: 4px;
  }
}



/* Compact quest introduction */
#start-panel.cover:not(.results) > h1 {
  max-width: 620px;
  font-size: clamp(30px, 4.2vw, 60px);
  line-height: 1.08;
  text-wrap: balance;
}

#start-panel.cover:not(.results) > p {
  max-width: 520px;
  font-size: clamp(14px, 1.5vw, 19px);
  line-height: 1.5;
}

@media (max-width: 600px) {
  #start-panel.cover:not(.results) > h1 {
    max-width: 100%;
    font-size: clamp(28px, 7vw, 38px);
  }

  #start-panel.cover:not(.results) > p {
    max-width: 100%;
    font-size: 14px;
  }
}


/* QUEST INTRO POLISH START */

#start-panel.cover:not(.results) > h1 {
  max-width: min(560px, 100%);
  font-size: clamp(28px, 3.8vw, 54px);
  line-height: 1.08;
  text-wrap: balance;
  overflow-wrap: break-word;
  margin-bottom: 12px;
}

#start-panel.cover:not(.results) > p {
  max-width: min(460px, 100%);
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.45;
  margin-bottom: 20px;
}

#start-panel.cover:not(.results) > small {
  font-size: 12px;
  line-height: 1.4;
}

#start-panel.cover:not(.results) > #start {
  max-width: 100%;
  white-space: normal;
}

#start-panel.cover:not(.results) > .archive-home {
  font-size: 12px;
  margin-top: 8px;
}

@media (max-width: 600px) {
  #start-panel.cover:not(.results) > h1 {
    max-width: 100%;
    font-size: clamp(26px, 6.5vw, 36px);
    margin-bottom: 10px;
  }

  #start-panel.cover:not(.results) > p {
    max-width: 100%;
    font-size: 14px;
    margin-bottom: 14px;
  }

  #start-panel.cover:not(.results) > small {
    font-size: 11px;
  }
}

/* QUEST INTRO POLISH END */







/* MOBILE KEYBOARD START */

@media (max-width: 768px) {

  input#answer {
    font-size: 16px !important;
    min-width: 0;
  }

  form#answer-form {
    min-width: 0;
  }

  body.answer-keyboard-open {
    overflow-anchor: none;
  }

  body.answer-keyboard-open .arena {
    min-height: 150px;
    max-height: var(--typing-arena-height, 240px);
    transition: none;
  }

  body.answer-keyboard-open .question-panel {
    margin-top: 8px;
    padding-top: 0;
  }

  body.answer-keyboard-open .prompt-card {
    top: 35px;
    padding: 8px 10px;
  }

  body.answer-keyboard-open #question {
    font-size: clamp(14px, 3.8vw, 18px);
    line-height: 1.3;
  }

  body.answer-keyboard-open .answer-dock {
    gap: 6px;
  }

  body.answer-keyboard-open input#answer,
  body.answer-keyboard-open #attack {
    min-height: 44px;
  }

  body.answer-keyboard-open .question-foot {
    margin-top: 4px;
  }

}

/* MOBILE KEYBOARD END */



/* MISSING ANSWER REPORT START */

button.missing-answer-report {
  appearance: none;
  border: 0;
  background: transparent;
  color: #d8c4ee;
  padding: 4px 2px;
  margin-left: 4px;
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  line-height: 1.5;
}

button.missing-answer-report:hover {
  color: #fff;
}

button.missing-answer-report:focus-visible {
  outline: 2px solid #b5a4ef;
  outline-offset: 3px;
}

button.missing-answer-report:disabled {
  opacity: .75;
  text-decoration: none;
  cursor: default;
}

@media (max-width: 768px) {
  button.missing-answer-report {
    min-height: 32px;
    font-size: 12px;
    margin-left: 0;
  }
}

/* MISSING ANSWER REPORT END */



/* GENERAL REPORT START */

#report-dialog #issue-type {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  margin: 8px 0 20px;
  border: 1px solid #77718c;
  border-radius: 6px;
  background: #141322;
  color: #f3efff;
  font: inherit;
  font-size: 16px;
}

#report-dialog #report-notes {
  font-size: 16px;
  min-height: 110px;
}

#report-dialog #report-status {
  font-size: 13px;
  margin-top: 12px;
}

#report-dialog #report-status:empty {
  display: none;
}

#report-dialog .report-privacy {
  display: block;
  margin-top: 14px;
  color: #aba4bb;
  font-size: 12px;
  line-height: 1.5;
}

#report-dialog #download-report {
  letter-spacing: .03em;
}

@media (max-width: 600px) {
  #report-dialog #download-report {
    width: 100%;
  }
}

/* GENERAL REPORT END */



/* ANSWER DISCOVERY START */

.cover.results .discovery-review-list > li.discovery-review-item {
  display: block;
  padding: 12px 0;
  min-width: 0;
}

.discovery-question {
  width: 100%;
  min-width: 0;
}

.discovery-question-summary {
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}

.discovery-question-summary::-webkit-details-marker {
  display: none;
}

.discovery-original-answer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
}

.discovery-original-answer .review-question {
  grid-column: 1 / -1;
}

.discovery-expand-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #c0afd9;
  font-size: 12px;
  margin-top: 10px;
  padding: 6px 0;
}

.discovery-expand-label::after {
  content: "+";
  font-size: 18px;
}

.discovery-question[open]
.discovery-expand-label::after {
  content: "−";
}

.discovery-browser {
  margin-top: 8px;
  padding: 14px;
  border: 1px solid #ffffff18;
  background: #10101b80;
  border-radius: 8px;
  text-align: left;
  min-width: 0;
}

.discovery-browser .discovery-title {
  margin: 0 0 12px;
  font-size: 15px;
  color: #e8e1ef;
}

.discovery-browser .discovery-search,
.discovery-browser select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #77718c70;
  border-radius: 5px;
  background: #141322;
  color: #f3efff;
  padding: 10px;
  font: inherit;
  font-size: 16px;
}

.discovery-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.discovery-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #bdb6ce;
  min-width: 0;
}

.discovery-browser .discovery-count {
  margin: 14px 0 6px;
  font-size: 11px;
  color: #a9a2b8;
}

.discovery-answer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #ffffff0e;
}

.discovery-answer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.discovery-tier {
  color: #a9a2b8;
  font-size: 10px;
}

.discovery-damage {
  font-size: 13px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: #b7bdcb;
}

.discovery-answer-row[data-rarity="1"] .discovery-damage {
  color: #9cdbb1;
}

.discovery-answer-row[data-rarity="2"] .discovery-damage {
  color: #9bbef5;
}

.discovery-answer-row[data-rarity="3"] .discovery-damage {
  color: #c9a6ec;
}

.discovery-answer-row[data-rarity="4"] .discovery-damage {
  color: #efc37e;
}

.discovery-answer-row[data-rarity="5"] .discovery-damage {
  color: #f8de87;
}

.discovery-your-answer {
  background: #ffffff07;
}

.discovery-your-label {
  color: #9cdbb1;
  font-size: 10px;
}

.discovery-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

.discovery-pagination[hidden] {
  display: none;
}

.discovery-pagination button {
  border: 1px solid #77718c70;
  background: #ffffff06;
  color: #e4dcef;
  border-radius: 5px;
  padding: 10px 12px;
  cursor: pointer;
}

.discovery-pagination button:disabled {
  opacity: .35;
  cursor: default;
}

.discovery-page {
  color: #bdb6ce;
  font-size: 11px;
}

.discovery-empty {
  color: #bdb6ce;
  font-size: 13px;
  padding: 12px 0;
}

@media (max-width: 600px) {
  .discovery-browser {
    padding: 10px;
  }

  .discovery-original-answer {
    grid-template-columns: 1fr;
  }

  .discovery-original-answer .review-strike {
    grid-column: 1;
  }

  .discovery-browser select {
    font-size: 16px;
    padding: 8px 4px;
  }

  .discovery-answer-info {
    font-size: 12px;
  }

  .discovery-damage {
    font-size: 12px;
  }
}

/* ANSWER DISCOVERY END */

