@font-face {
  font-family: ToolSans;
  src: url("../assets/css/fonts/NanumSquareR.woff") format("woff");
  font-display: swap;
}
:root {
  --paper: #f4f3ec;
  --ink: #242d29;
  --sub: #626b64;
  --line: #d8ddd3;
  --green: #1f6b48;
  --signal: #c4f177;
  --red: #ad4339;
  --inset: #e9ece4;
  --muted: #80877f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ToolSans, "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  touch-action: manipulation;
}
button:hover {
  border-color: var(--green);
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
header,
main,
footer {
  max-width: 1000px;
  margin: auto;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
}
header > a:last-child {
  font-size: 13px;
  color: var(--sub);
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
}
.brand img {
  object-fit: contain;
}
main {
  padding: 12px 24px 48px;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 28px;
}
.kicker {
  font-size: 13px;
  color: var(--green);
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.25;
  letter-spacing: -1.5px;
  margin: 0 0 8px;
}
p {
  margin: 8px 0;
}
.intro p:last-child {
  color: var(--sub);
}
.mascot {
  object-fit: contain;
  transform: rotate(-7deg);
}
.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.modes button {
  border: 0;
  border-radius: 0;
  padding: 16px 8px;
  color: var(--muted);
  font-size: 12px;
}
.modes span {
  font-size: 16px;
  margin-left: 8px;
  color: var(--ink);
}
.modes button[aria-pressed="true"] {
  box-shadow: inset 0 -3px var(--green);
  color: var(--green);
}
.modes button[aria-pressed="true"] span {
  color: var(--green);
  font-weight: bold;
}
.game {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.game-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
}
.game-head h2 {
  font-size: 20px;
  margin: 0;
}
.game-head p {
  font-size: 14px;
  color: var(--sub);
  margin: 4px 0;
}
.game-head > span {
  font-size: 13px;
  white-space: nowrap;
  color: var(--sub);
  padding-top: 5px;
}
.pad {
  display: flex;
  min-height: 330px;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: var(--inset);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  transition: background 0.12s;
}
.pad:active {
  transform: none;
}
.pad strong {
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: -1px;
}
.pad-key {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 16px;
}
.lights {
  display: flex;
  gap: 10px;
  background: #29332e;
  padding: 12px 16px;
  border-radius: 30px;
  margin-bottom: 12px;
}
.lights i {
  width: 22px;
  height: 22px;
  background: #4a554d;
  border-radius: 50%;
}
.pad[data-phase="wait"] {
  background: #efe2da;
}
.pad[data-phase="wait"] .lights i:first-child {
  background: #ed7562;
}
.pad[data-phase="go"] {
  background: var(--signal);
  transition: none;
}
.pad[data-phase="go"] .lights i:last-child {
  background: #acff57;
  box-shadow: 0 0 12px #acff5777;
}
.pad[data-phase="early"] {
  background: #f2d6ce;
}
.game-foot {
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  gap: 8px;
}
.text-button {
  border: 0;
  padding: 4px;
  color: var(--sub);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.below {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  margin-top: 28px;
}
h2 {
  font-size: 16px;
  margin: 0 0 12px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.section-title span {
  font-size: 12px;
  color: var(--sub);
}
.trials {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  list-style: none;
  padding: 0;
  margin: 8px 0 20px;
  gap: 6px;
}
.trials li {
  padding: 12px 8px;
  border-top: 2px solid var(--line);
  color: var(--sub);
  font-size: 12px;
}
.trials b {
  display: block;
  font-size: 17px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.trials .filled {
  border-color: var(--green);
}
#result {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
#result-value {
  font-size: 36px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
#result-note,
.fine {
  font-size: 12px;
  color: var(--sub);
}
.actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.guide p {
  font-size: 13px;
  line-height: 1.9;
}
.guide .fine {
  font-size: 12px;
  margin: 16px 0;
}
.about {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding-top: 24px;
  max-width: 720px;
  color: var(--sub);
  font-size: 13px;
}
.about h2 {
  color: var(--ink);
}
footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 12px;
  color: var(--sub);
}
.ad-zone {
  margin: 36px 0 0;
  min-height: 120px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.ad-zone small {
  display: block;
  color: var(--muted);
  margin: 8px;
  font-size: 11px;
}
#board-area {
  padding: 0 24px 24px;
  background: var(--inset);
  min-height: 340px;
}
.board-top {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
}
.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 440px;
  margin: 0 auto 20px;
}
.board button {
  font-size: 24px;
  font-weight: 700;
  padding: 0;
  aspect-ratio: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.board button.done {
  opacity: 0.3;
  background: transparent;
}
.board.memory {
  grid-template-columns: repeat(3, 1fr);
  max-width: 330px;
}
.board.memory button {
  background: #d8dfd3;
  opacity: 1;
}
.board.memory button.lit {
  background: var(--signal);
  border-color: var(--green);
}
.board button.wrong {
  background: #f2b6a5;
}
#board-start {
  display: block;
  margin: auto;
  min-width: 180px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  background: var(--paper);
  padding: 12px;
  z-index: 5;
}
.skip:focus {
  top: 12px;
}
#share-status {
  font-size: 12px;
  color: var(--green);
}
@media (max-width: 600px) {
  header {
    padding: 16px;
  }
  main {
    padding: 4px 16px 32px;
  }
  .intro {
    padding: 20px 0;
  }
  .mascot {
    width: 64px;
    height: 64px;
  }
  .modes {
    margin-bottom: 16px;
  }
  .modes button {
    font-size: 11px;
  }
  .modes span {
    font-size: 14px;
    margin-left: 4px;
  }
  .game-head {
    padding: 16px;
  }
  .game-head h2 {
    font-size: 18px;
  }
  .game-head p {
    font-size: 12px;
    max-width: 230px;
  }
  .pad {
    min-height: 300px;
  }
  .game-foot {
    padding: 12px 16px;
    align-items: flex-start;
  }
  .game-foot > span {
    max-width: 240px;
  }
  .below {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .guide {
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
  .board {
    gap: 6px;
  }
  .board button {
    font-size: 22px;
  }
  #board-area {
    padding: 0 16px 20px;
  }
  .trials b {
    font-size: 16px;
  }
  .actions button {
    flex: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

.intro .mascot {
  width: 150px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  transform: none;
}
@media (max-width: 600px) {
  .intro .mascot {
    width: 84px;
    height: 70px;
    margin-left: 8px;
  }
}
.assessment-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  background: var(--inset);
  border-radius: 12px;
  margin-bottom: 12px;
}
.assessment-entry h2 {
  margin: 0;
  font-size: 19px;
}
.assessment-entry p {
  font-size: 13px;
  color: var(--sub);
}
.assessment-entry button {
  flex-shrink: 0;
}
.modes {
  grid-template-columns: repeat(6, 1fr);
}
.modes span {
  font-size: 14px;
  margin-left: 4px;
}
.extra-board {
  max-width: 600px;
  margin: 0 auto;
  padding: 8px 0 24px;
}
.aim-arena {
  height: 280px;
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  touch-action: manipulation;
}
.aim-target {
  position: absolute;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid var(--green);
  background: var(--signal);
  color: var(--green);
  border-radius: 50%;
  font-size: 36px;
  line-height: 1;
}
.timing-track {
  position: relative;
  height: 64px;
  margin: 64px 20px 40px;
  background: #d1d9ca;
  border-radius: 8px;
}
.timing-center {
  position: absolute;
  width: 10%;
  left: 45%;
  height: 100%;
  background: var(--signal);
  border-left: 1px solid var(--green);
  border-right: 1px solid var(--green);
}
.timing-track i {
  position: absolute;
  left: 0;
  top: -10px;
  width: 6px;
  height: 84px;
  background: var(--ink);
  transform: translateX(-3px);
  border-radius: 3px;
}
.timing-hit {
  display: block;
  min-width: 220px;
  margin: auto;
}
.color-word {
  display: block;
  text-align: center;
  font-size: 64px;
  margin: 28px 0;
}
.color-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.color-choices button {
  font-size: 18px;
  padding: 16px 8px;
  background: var(--paper);
}
.next-game {
  display: block;
  margin: 4px auto 24px;
  min-width: 240px;
}
.report-card {
  margin-top: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.report-card h3 {
  font-size: 27px;
  margin: 4px 0;
}
.report-score {
  font-size: 32px;
  color: var(--green);
  font-weight: 700;
}
.skill-row {
  display: grid;
  grid-template-columns: 88px 1fr 160px;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 13px;
}
.skill-row b {
  text-align: right;
  font-size: 12px;
}
.skill-row meter {
  width: 100%;
  height: 16px;
  accent-color: var(--green);
}
#save-report {
  margin-top: 12px;
}
.about details {
  margin-top: 20px;
}
.about summary {
  cursor: pointer;
}
@media (max-width: 600px) {
  .assessment-entry {
    display: block;
    padding: 20px;
  }
  .assessment-entry button {
    width: 100%;
    margin-top: 12px;
  }
  .modes {
    grid-template-columns: repeat(3, 1fr);
  }
  .modes button {
    padding: 12px 4px;
  }
  .skill-row {
    grid-template-columns: 72px 1fr;
    gap: 8px;
  }
  .skill-row b {
    grid-column: 2;
  }
  .report-card {
    padding: 20px;
  }
  .color-choices {
    grid-template-columns: repeat(2, 1fr);
  }
  .color-word {
    font-size: 56px;
  }
  .timing-track {
    margin-left: 12px;
    margin-right: 12px;
  }
}
.exam-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.exam-actions button {
  white-space: nowrap;
}
.modes {
  grid-template-columns: repeat(4, 1fr);
}
.beat-dots {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin: 40px 0;
}
.beat-dots span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}
.beat-dots span.pulse {
  background: var(--signal);
  border: 3px solid var(--green);
}
.beat-dots span.hit {
  box-shadow: inset 0 0 0 3px var(--green);
}
.rhythm-tap {
  display: block;
  min-height: 100px;
  width: 100%;
  font-size: 24px;
}
.tap-button {
  display: block;
  min-height: 210px;
  width: 100%;
  font-size: 64px;
  font-weight: bold;
  background: var(--signal);
  color: var(--green);
  border-radius: 16px;
  user-select: none;
  -webkit-user-select: none;
}
.pairs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.pairs-grid button {
  aspect-ratio: 1;
  font-size: 36px;
  background: var(--paper);
}
.pairs-grid button.matched {
  background: #d8e6c5;
  opacity: 0.6;
}
.mole-grid,
.shade-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 360px;
  margin: auto;
}
.mole-grid button,
.shade-grid button {
  aspect-ratio: 1;
  padding: 4px;
  background: var(--paper);
  border-radius: 10px;
}
.mole-grid img {
  width: 100%;
  height: 100%;
  max-height: 96px;
  object-fit: contain;
  pointer-events: none;
}
.decoy-cue {
  display: block;
  width: 100%;
  min-height: 240px;
  font-size: 30px;
  background: var(--paper);
}
.decoy-cue[data-go="yes"] {
  background: var(--signal);
  color: var(--green);
}
.decoy-cue[data-go="no"] {
  background: #f2d6ce;
  color: var(--red);
}
.game-catalog {
  max-width: none;
}
.game-catalog table {
  width: 100%;
  border-collapse: collapse;
}
.game-catalog th,
.game-catalog td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.game-catalog th {
  color: var(--ink);
  min-width: 120px;
}
.faq {
  max-width: none;
}
.faq summary {
  font-size: 15px;
  color: var(--ink);
  font-weight: bold;
}
@media (max-width: 600px) {
  .modes {
    grid-template-columns: repeat(3, 1fr);
  }
  .exam-actions {
    margin-top: 12px;
  }
  .assessment-entry .exam-actions button {
    margin: 0;
    flex: 1;
    width: auto;
    min-width: 140px;
  }
  .pairs-grid button {
    font-size: 28px;
  }
  .beat-dots {
    gap: 4px;
  }
  .beat-dots span {
    font-size: 13px;
  }
  .game-catalog th {
    min-width: 100px;
  }
  .decoy-cue {
    font-size: 25px;
  }
}
/* Battle training: transparent character sprites on one uninterrupted arena */
.intro .mascot {
  width: 120px;
  height: 130px;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 8px 8px #263d2520);
}
.intro {
  padding-top: 16px;
  padding-bottom: 20px;
}
.battle-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 0 24px;
}
.battle-menu-card {
  display: flex;
  align-items: center;
  text-align: left;
  justify-content: space-between;
  background: #e6eadf;
  border: 1px solid #d0d8c8;
  border-radius: 14px;
  padding: 12px 24px;
  overflow: hidden;
  min-height: 152px;
}
.battle-menu-card > span {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  gap: 4px;
}
.battle-menu-card small {
  font-size: 11px;
  letter-spacing: 0.2px;
  color: var(--green);
}
.battle-menu-card strong {
  font-size: 24px;
  letter-spacing: -0.7px;
}
.battle-menu-card span span {
  font-size: 12px;
  color: var(--sub);
}
.battle-menu-card img {
  object-fit: contain;
  flex-shrink: 0;
  max-width: 38%;
  filter: drop-shadow(0 8px 6px #243b2420);
  transition: transform 0.18s;
}
.battle-menu-card:hover img {
  transform: translateY(-4px) rotate(3deg);
}
.assessment-entry {
  padding: 20px 24px;
  margin-bottom: 16px;
  background: transparent;
  border: 1px solid var(--line);
}
.modes {
  gap: 4px;
  border: 0;
}
.modes button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 4px;
  background: #e9ece44d;
}
.modes button[aria-pressed="true"] {
  background: #e0e9d7;
  border-color: #a8bca0;
  box-shadow: none;
}
.modes button:hover {
  background: #e1e8d9;
}
.game {
  border-color: #bfcdb8;
}
.game-head {
  background: #e8edde;
}
.game-badge {
  text-align: center;
  font-weight: bold;
  color: var(--green);
  padding: 12px 16px;
  background: #dcebc9;
  margin: 0;
}
.round-complete {
  border-color: var(--green);
}
#exam-meter {
  display: block;
  width: 100%;
  height: 8px;
  margin: 0 0 12px;
  accent-color: var(--green);
}
.battle-board {
  max-width: none;
  padding: 0;
  margin: 0 -24px -24px;
}
.battle-arena {
  position: relative;
  height: 390px;
  overflow: hidden;
  isolation: isolate;
  background: #1e342c;
  border-top: 1px solid #42594a;
  color: #eef2dc;
}
.battle-arena:before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 68% 75%, #50654377, transparent 55%);
  pointer-events: none;
}
.battle-arena:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  border-top: 1px solid #73876855;
  transform: rotate(-2deg);
  pointer-events: none;
}
.battle-hud {
  position: absolute;
  top: 14px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  z-index: 3;
}
.battle-hud span {
  color: #d4e0bc;
}
.battle-hud b {
  color: #f1d07c;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
}
.enemy-health {
  position: absolute;
  left: 42%;
  right: 7%;
  top: 58px;
  z-index: 4;
}
.enemy-health strong {
  font-size: 13px;
  display: inline-block;
}
.enemy-health output {
  display: block;
  text-align: right;
  font-size: 18px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.hp-track {
  height: 16px;
  background: #101e19;
  border: 1px solid #76956577;
  border-radius: 3px;
  position: relative;
  overflow: visible;
}
.hp-track i {
  display: block;
  height: 100%;
  width: 100%;
  background: #8fbd62;
}
.hp-threshold {
  position: absolute;
  width: 2px;
  background: #ffdd7b;
  top: -4px;
  height: 22px;
}
.execute-window .hp-track i {
  background: #e9c56b;
}
.battle-hero {
  position: absolute;
  bottom: 32px;
  left: 4%;
  width: 29%;
  height: 230px;
  object-fit: contain;
  z-index: 2;
  transform-origin: bottom center;
  filter: drop-shadow(0 12px 8px #0004);
}
.battle-enemy {
  position: absolute;
  bottom: 30px;
  right: 4%;
  width: 51%;
  height: 255px;
  object-fit: contain;
  z-index: 2;
  filter: drop-shadow(0 14px 8px #0004);
  transform-origin: bottom center;
  animation: enemy-idle 2.6s ease-in-out infinite;
}
.battle-feedback {
  position: absolute;
  top: 142px;
  left: 25%;
  right: 3%;
  text-align: center;
  font-size: clamp(20px, 4vw, 32px);
  font-weight: bold;
  z-index: 7;
  color: #fff5bf;
  pointer-events: none;
  text-shadow: 0 2px 10px #0b1713;
}
.battle-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  background: #e0e7d8;
}
.battle-controls > span {
  font-size: 13px;
  color: var(--sub);
}
.battle-action {
  min-width: 210px;
  min-height: 56px;
  font-size: 19px;
  box-shadow: 0 3px 0 #123f2c;
}
.battle-projectile {
  position: absolute;
  left: 25%;
  top: 64%;
  width: 34px;
  height: 7px;
  background: #ffe2a2;
  border-radius: 8px;
  box-shadow: 0 0 15px #ffe2a2;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
}
.shooting .battle-projectile {
  animation: projectile 0.18s linear both;
}
.battle-impact {
  position: absolute;
  top: 50%;
  left: 68%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff1ad;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
}
.casting-smite .battle-impact {
  animation: smite-burst 0.45s ease-out both;
}
.hit-success .battle-impact {
  animation: hit-burst 0.4s ease-out both;
}
.hit-success .battle-enemy {
  animation: defeat 0.7s ease-out both;
}
.hit-miss .battle-enemy {
  animation: enemy-flinch 0.25s ease-out;
}
.hit-miss .battle-feedback {
  color: #ffcab0;
}
.attack {
  animation: hero-strike 0.3s ease-out;
}
.enemy-defeated .enemy-health {
  opacity: 0.65;
}
.battle-menu-card:focus-visible {
  outline-offset: 3px;
}
@keyframes enemy-idle {
  50% {
    transform: translateY(-5px);
  }
}
@keyframes projectile {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(320px);
  }
}
@keyframes hero-strike {
  45% {
    transform: translateX(14px) rotate(8deg);
  }
}
@keyframes hit-burst {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 0 #fff2b7;
  }
  100% {
    opacity: 0;
    transform: scale(15);
    box-shadow: 0 0 0 6px #fff2b700;
  }
}
@keyframes smite-burst {
  0% {
    opacity: 1;
    transform: translateY(-180px) scale(3);
  }
  50% {
    opacity: 1;
    transform: translateY(0) scale(8);
    box-shadow: 0 0 20px 12px #f9e18b99;
  }
  100% {
    opacity: 0;
    transform: scale(15);
  }
}
@keyframes defeat {
  30% {
    transform: translateX(8px) rotate(5deg);
    filter: brightness(1.7);
  }
  100% {
    opacity: 0.1;
    transform: translateY(20px);
  }
}
@keyframes enemy-flinch {
  40% {
    transform: translateX(8px);
  }
}
@media (max-width: 600px) {
  .intro .mascot {
    width: 86px;
    height: 105px;
    object-fit: contain;
  }
  .battle-menu {
    gap: 10px;
    margin-bottom: 16px;
  }
  .battle-menu-card {
    padding: 12px;
    min-height: 150px;
    position: relative;
    align-items: flex-start;
  }
  .battle-menu-card strong {
    font-size: 19px;
  }
  .battle-menu-card span span {
    max-width: 130px;
    font-size: 11px;
  }
  .battle-menu-card img {
    position: absolute;
    right: -4px;
    bottom: 0;
    width: 88px;
    height: 90px;
    max-width: 65%;
    opacity: 0.95;
  }
  .battle-menu-card > span {
    max-width: 100%;
    gap: 2px;
  }
  .battle-menu-card small {
    font-size: 10px;
  }
  .assessment-entry {
    padding: 16px;
  }
  .battle-board {
    margin: 0 -16px -20px;
  }
  .battle-arena {
    height: 330px;
  }
  .battle-hud {
    left: 16px;
    right: 16px;
    font-size: 12px;
  }
  .enemy-health {
    left: 38%;
    right: 5%;
    top: 52px;
  }
  .enemy-health output {
    font-size: 16px;
  }
  .battle-enemy {
    right: 0;
    width: 60%;
    height: 205px;
    bottom: 32px;
  }
  .battle-hero {
    left: 1%;
    width: 37%;
    height: 180px;
  }
  .battle-feedback {
    top: 126px;
    left: 28%;
    font-size: 22px;
  }
  .battle-controls {
    padding: 16px;
    display: block;
    text-align: center;
  }
  .battle-action {
    width: 100%;
    margin-top: 10px;
  }
  .battle-controls > span {
    font-size: 12px;
  }
  .battle-projectile {
    left: 25%;
    top: 67%;
  }
  @keyframes projectile {
    0% {
      opacity: 1;
      transform: translateX(0);
    }
    90% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      transform: translateX(135px);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .battle-enemy,
  .attack,
  .battle-impact,
  .battle-projectile {
    animation: none !important;
  }
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
}
.lane-arena {
  height: 460px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 65% 45%, #68865055, transparent 65%), #263d30;
  color: #fff8dd;
}
.lane-arena::before {
  content: "";
  position: absolute;
  inset: 22% -10% 8%;
  transform: rotate(-9deg);
  border-block: 2px solid #a1b78322;
  background: #a7a27a19;
  z-index: -1;
}
.lane-enemies {
  position: absolute;
  inset: 65px 3% 62px 38%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 8px;
}
.lane-unit {
  border: 2px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: #e0e8d6;
  padding: 12px 4px 5px;
  min-width: 0;
  position: relative;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition:
    opacity 0.18s,
    background 0.15s,
    border-color 0.15s;
}
.lane-unit:hover,
.lane-unit.selected {
  background: #c2d9a414;
  border-color: #e4c26a;
}
.lane-unit img {
  width: 110px;
  max-width: 100%;
  height: 102px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 7px 4px #10211888);
}
.lane-unit.ranged img {
  transform: scale(0.82);
  filter: hue-rotate(35deg) drop-shadow(0 7px 4px #10211888);
}
.lane-unit small {
  font-size: 11px;
  font-weight: 600;
}
.lane-health {
  display: block;
  width: 75%;
  height: 8px;
  border: 1px solid #f7ebc55c;
  background: #101f18;
  overflow: hidden;
  border-radius: 2px;
}
.lane-health i {
  display: block;
  width: 100%;
  height: 100%;
  background: #ea7562;
}
.lane-hero {
  position: absolute;
  width: 28%;
  height: 180px;
  object-fit: contain;
  left: 3%;
  top: 39%;
  filter: drop-shadow(0 10px 5px #10211866);
}
.lane-hero.attack {
  animation: hero-strike 0.22s ease-out;
}
.lane-allies {
  position: absolute;
  left: 6%;
  top: 17%;
  display: flex;
  width: 30%;
}
.lane-allies img {
  width: 36%;
  height: 75px;
  object-fit: contain;
  filter: hue-rotate(135deg);
}
.lane-allies.firing {
  animation: lane-ally 0.25s ease-out;
}
.lane-message {
  position: absolute;
  bottom: 18px;
  left: 12px;
  right: 12px;
  text-align: center;
  color: #fff0b8;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}
.lane-unit:disabled {
  cursor: default;
  opacity: 0.18;
  border-color: transparent;
  background: transparent;
}
.lane-unit.secured {
  opacity: 0.12;
}
.lane-unit.lane-hit:not(:disabled) img {
  animation: lane-hit 0.18s ease-out;
}
.lane-shot {
  position: absolute;
  left: 24%;
  top: 60%;
  width: 9px;
  height: 9px;
  background: #ffe18f;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 14px #ffe18f;
}
.lane-shot.flying {
  animation: lane-projectile 0.18s linear;
}
.lane-footer {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}
.lane-footer > span:first-child {
  font-weight: 700;
  color: #386344;
}
@keyframes lane-projectile {
  from {
    opacity: 1;
    left: 24%;
    top: 60%;
  }
  to {
    opacity: 0;
    left: var(--target-x);
    top: var(--target-y);
  }
}
@keyframes lane-hit {
  50% {
    filter: brightness(1.8);
    translate: 3px 0;
  }
}
@keyframes lane-ally {
  50% {
    translate: 6px 0;
  }
}
@media (max-width: 600px) {
  .lane-arena {
    height: 430px;
  }
  .lane-enemies {
    inset: 65px 2% 65px 29%;
    gap: 16px 3px;
  }
  .lane-unit {
    padding: 9px 2px 4px;
    border-radius: 12px;
  }
  .lane-unit img {
    height: 86px;
  }
  .lane-health {
    width: 90%;
    height: 7px;
  }
  .lane-hero {
    width: 30%;
    left: 0;
    height: 135px;
    top: 43%;
  }
  .lane-allies {
    left: 1%;
    top: 20%;
    width: 27%;
  }
  .lane-allies img {
    height: 60px;
  }
  .lane-message {
    font-size: 13px;
  }
  .lane-footer {
    padding: 13px 16px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lane-hero.attack,
  .lane-unit.lane-hit img,
  .lane-allies.firing,
  .lane-shot.flying {
    animation: none;
  }
}
.header-tools button {
  padding: 5px 9px;
  font-size: 12px;
}
.header-tools a {
  color: var(--sub);
}
@media (max-width: 600px) {
  .header-tools {
    gap: 8px;
    font-size: 11px;
  }
  .header-tools button {
    font-size: 11px;
    padding: 4px 6px;
  }
  header {
    padding: 12px 16px;
  }
  .brand {
    font-size: 13px;
    gap: 6px;
  }
}
