.brand--link {
  color: inherit;
  text-decoration: none;
}

.games-shell {
  max-width: 1280px;
  padding-top: clamp(0.9rem, 2vw, 1.4rem);
}

.game-board {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
  align-items: start;
  min-height: 680px;
}

.enemy-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.8rem;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.enemy-panel__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--brand);
  color: #fff;
  font: 700 1rem "Space Grotesk", "Trebuchet MS", sans-serif;
}

.enemy-panel__toggles {
  display: grid;
  justify-items: end;
  gap: 0.45rem;
}

.enemy-panel__toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  width: fit-content;
  font: 800 0.78rem "Space Grotesk", "Trebuchet MS", sans-serif;
  cursor: pointer;
}

.enemy-panel__toggle input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--accent);
}

.enemy-list {
  display: grid;
  align-content: start;
  gap: 0.7rem;
  padding: 0.85rem;
  overflow: auto;
}

.enemy-category {
  border: 1px solid #d5dfef;
  border-radius: 0.65rem;
  background: #fff;
  overflow: hidden;
}

.enemy-category__summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  color: var(--ink);
  cursor: pointer;
  font: 800 0.95rem "Space Grotesk", "Trebuchet MS", sans-serif;
  list-style: none;
}

.enemy-category__summary::-webkit-details-marker {
  display: none;
}

.enemy-category__summary::before {
  content: ">";
  color: var(--accent);
  font-weight: 900;
  transition: transform 0.2s ease;
}

.enemy-category[open] .enemy-category__summary::before {
  transform: rotate(90deg);
}

.enemy-category__label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.enemy-category__trophy {
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.enemy-category__summary strong {
  display: inline-grid;
  place-items: center;
  min-width: 1.55rem;
  min-height: 1.55rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.8rem;
}

.enemy-category__items {
  display: grid;
  gap: 0.45rem;
  padding: 0 0.65rem 0.65rem;
}

.enemy-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 58px;
  padding: 0.45rem 0.6rem;
  border-radius: 0.55rem;
  border-color: #d5dfef;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.enemy-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 4px 0 0 var(--accent);
}

.enemy-button.is-disabled {
  background: #f3f6fb;
  color: #8290a6;
  cursor: not-allowed;
}

.enemy-button__thumb {
  width: 42px;
  height: 42px;
  border-radius: 0.4rem;
  object-fit: cover;
  background: #dce6f5;
  box-shadow: 0 0 0 1px rgba(21, 42, 102, 0.12);
}

.enemy-button__name {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
}

.enemy-button__name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enemy-button__name-zh {
  color: #51627a;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.enemy-button__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.enemy-button__trophy {
  width: 1.7rem;
  height: 1.7rem;
  object-fit: contain;
}

.enemy-button__pending {
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: #e6ebf5;
  color: #6b7890;
  font: 800 0.68rem "Space Grotesk", "Trebuchet MS", sans-serif;
}

.battle-stage {
  --battle-visual-size: clamp(320px, 42vw, 460px);
  position: sticky;
  top: 1rem;
  display: grid;
  grid-template-columns: var(--battle-visual-size) minmax(360px, 1fr);
  grid-template-rows: auto auto auto auto 1fr;
  column-gap: clamp(1rem, 3vw, 2rem);
  row-gap: 0.75rem;
  align-items: start;
  min-width: 0;
}

.monster-column {
  display: contents;
}

.monster-frame {
  grid-column: 1;
  grid-row: 5;
  position: relative;
  width: 100%;
  height: var(--battle-visual-size);
  overflow: hidden;
  contain: layout paint;
  border-radius: 0.55rem;
  border: 1px solid var(--border);
  background: #dce6f5;
  box-shadow: 0 18px 36px rgba(21, 42, 102, 0.14);
}

.monster-image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: filter 0.8s ease, opacity 0.8s ease, transform 0.8s ease;
}

.monster-image.is-defeated {
  filter: grayscale(1) saturate(0);
  opacity: 0.44;
  transform: scale(1.02);
}

.monster-image.is-damaged {
  animation: enemy-damage-shake 1s ease-in-out;
}

@keyframes enemy-damage-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-7px) rotate(-1deg);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(7px) rotate(1deg);
  }
}

.victory-banner {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(255, 212, 102, 0.94);
  color: #543200;
  font: 800 0.95rem "Space Grotesk", "Trebuchet MS", sans-serif;
  text-transform: uppercase;
}

.challenge-panel {
  grid-column: 2;
  grid-row: 5;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-self: stretch;
  position: relative;
  height: var(--battle-visual-size);
  min-height: 0;
  min-width: 0;
}

.enemy-title {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: center;
  margin: 0;
  text-align: center;
  width: 100%;
  font-size: clamp(2.15rem, 4.6vw, 3.1rem);
  line-height: 1;
}

.life-meter {
  grid-column: 1 / -1;
  grid-row: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.75rem;
  row-gap: 0.55rem;
  min-height: 1.75rem;
  padding: 0.15rem 0 0.35rem;
}

.life-heart {
  position: relative;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.2rem;
  background: #c8d2e2;
  transform: rotate(-45deg);
  filter: drop-shadow(0 1px 0 rgba(21, 42, 102, 0.18));
}

.life-heart::before,
.life-heart::after {
  content: "";
  position: absolute;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: inherit;
}

.life-heart::before {
  top: -0.52rem;
  left: 0;
}

.life-heart::after {
  top: 0;
  left: 0.52rem;
}

.life-heart.is-filled {
  background: #e8273f;
}

.life-heart.is-breaking {
  z-index: 2;
  background: #ff1238;
  box-shadow: 0 0 0 0.35rem rgba(255, 18, 56, 0.24), 0 0 1rem rgba(255, 18, 56, 0.78);
  animation: heart-break-flash 1.05s ease-out forwards;
}

.life-heart__shard {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 0.68rem;
  height: 1.05rem;
  clip-path: polygon(50% 0, 100% 76%, 12% 100%);
  background: linear-gradient(135deg, #fff, #ff1238 58%, #9f1022);
  box-shadow: 0 0 0.45rem rgba(255, 18, 56, 0.75);
  transform: translate(-50%, -50%) rotate(var(--rot));
  animation: heart-shard-burst 1.02s cubic-bezier(0.12, 0.78, 0.24, 1) forwards;
}

.life-heart__shard:nth-child(even) {
  width: 0.5rem;
  height: 0.9rem;
  background: linear-gradient(135deg, #ffd8df, #e8273f 62%, #7e0d1a);
}

@keyframes heart-break-flash {
  0% {
    transform: rotate(-45deg) scale(1);
  }

  28% {
    transform: rotate(-45deg) scale(1.45);
    filter: drop-shadow(0 0 0.7rem rgba(255, 18, 56, 0.92));
  }

  45% {
    transform: rotate(-45deg) scale(1.16);
    filter: drop-shadow(0 0 0.55rem rgba(255, 18, 56, 0.86));
  }

  100% {
    background: #c8d2e2;
    box-shadow: none;
    filter: drop-shadow(0 1px 0 rgba(21, 42, 102, 0.18));
    transform: rotate(-45deg) scale(1);
  }
}

@keyframes heart-shard-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.65) rotate(var(--rot));
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(1.3) rotate(calc(var(--rot) + 130deg));
  }
}

.attack-zone,
.defense-zone {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  border-radius: 1.1rem;
  background: #1299e6;
  overflow: hidden;
  padding: clamp(1rem, 2.5vw, 1.35rem);
}

.attack-zone.is-idle {
  grid-template-rows: minmax(0, 1fr);
  padding: clamp(1rem, 2.5vw, 1.35rem);
}

.attack-zone.is-phase-entering.is-entering-attack {
  animation: phase-enter-from-left 0.42s cubic-bezier(0.18, 0.82, 0.24, 1) both;
}

.defense-zone.is-phase-entering.is-entering-defend {
  animation: phase-enter-from-right 0.42s cubic-bezier(0.18, 0.82, 0.24, 1) both;
}

.attack-zone h2,
.defense-zone h2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: -0.35rem 0 0.8rem;
  color: #050505;
  text-align: center;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1;
}

.attack-zone.is-idle h2 {
  display: none;
}

.zone-heading__icon {
  width: 1.45em;
  height: 1.45em;
  object-fit: contain;
}

@keyframes phase-enter-from-left {
  0% {
    opacity: 0;
    transform: translateX(-1.6rem) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes phase-enter-from-right {
  0% {
    opacity: 0;
    transform: translateX(1.6rem) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .attack-zone.is-phase-entering.is-entering-attack,
  .defense-zone.is-phase-entering.is-entering-defend {
    animation: none;
  }
}

.character-grid {
  display: grid;
  min-height: 0;
  gap: clamp(0.65rem, 2vw, 1.25rem);
}

.challenge-card {
  display: grid;
  gap: 1rem;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.challenge-card--attack {
  grid-template-rows: minmax(0, 1fr) auto;
}

.attack-zone.is-idle .challenge-card--attack {
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.attack-prompt {
  display: grid;
  place-items: center;
  min-height: 0;
  height: 100%;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.2);
  color: #050505;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.attack-prompt-content {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 1.1vw, 0.7rem);
  max-width: 100%;
  transform: translateY(-0.35rem);
}

.attack-pair {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.02em;
  max-width: 100%;
}

.attack-pair__main,
.attack-pair__context {
  display: inline-grid;
  place-items: center;
}

.attack-pair__main {
  font-size: clamp(4.15rem, 9vw, 6.6rem);
  line-height: 1;
}

.attack-pair__context {
  color: #5d6978;
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  line-height: 1;
}

.attack-meaning {
  max-width: min(100%, 28rem);
  color: #234064;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: clamp(1.15rem, 2.5vw, 1.65rem);
  font-weight: 900;
  line-height: 1.08;
}

.attack-prompt--idle {
  justify-self: center;
  align-self: center;
  align-content: center;
  width: min(100%, 20rem);
  height: auto;
  min-height: min(100%, 21.5rem);
  padding: clamp(1rem, 3vw, 1.35rem);
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: clamp(1.65rem, 3.7vw, 2.8rem);
  line-height: 1.05;
  text-align: center;
  overflow-wrap: break-word;
}

.attack-prompt__idle-text {
  display: block;
}

.next-question.has-best-record {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 5.75rem;
  padding: 0.7rem 1rem;
}

.round-best-record {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  max-width: 100%;
  color: #fff7e8;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 900;
  line-height: 1.2;
}

.round-best-record__trophy {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  object-fit: contain;
}

.tone-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.65rem, 2vw, 1rem);
}

.character-tile,
.phrase-option {
  display: grid;
  place-items: center;
  width: 100%;
  border: 2px solid rgba(255, 255, 255, 0.58);
  background: #eef8ff;
  color: #102033;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(8, 48, 94, 0.12);
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.character-tile:not(:disabled):hover,
.phrase-option:not(:disabled):hover {
  border-color: #fff;
  background: #fff;
  box-shadow: 0 12px 22px rgba(8, 48, 94, 0.18);
  transform: translateY(-1px);
}

.character-tile:disabled,
.phrase-option:disabled {
  cursor: default;
  opacity: 1;
}

.character-tile {
  place-content: center;
  min-height: 64px;
  padding: 0.35rem 0.25rem;
  border-radius: 0.5rem;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: clamp(1rem, 1.9vw, 1.36rem);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.character-tile--long {
  font-size: clamp(0.88rem, 1.65vw, 1.16rem);
}

.character-tile.is-correct,
.phrase-option.is-correct {
  border-color: #0f6b25;
  background: #177a2b;
  color: #fff;
}

.phrase-grid {
  display: grid;
  align-content: stretch;
  min-height: 0;
  overflow: auto;
  gap: clamp(0.8rem, 2vw, 1rem);
}

.idiom-card {
  display: grid;
  align-content: center;
  gap: 0.9rem;
  min-height: 100%;
  min-width: 0;
  padding: 0.8rem;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.16);
}

.idiom-card__meaning {
  color: #05203a;
  font: 800 clamp(1.02rem, 2vw, 1.24rem) "Space Grotesk", "Trebuchet MS", sans-serif;
  line-height: 1.35;
  text-align: center;
}

.idiom-card__phrase {
  color: #050505;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.idiom-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.phrase-option {
  gap: 0.18rem;
  min-height: 58px;
  padding: 0.52rem 0.4rem;
  border-radius: 0.45rem;
  line-height: 1.15;
  text-align: center;
}

.phrase-option__hanzi,
.phrase-option__pinyin {
  display: block;
}

.phrase-option__hanzi {
  font-size: clamp(1.08rem, 2.1vw, 1.35rem);
}

.phrase-option__pinyin {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: clamp(0.72rem, 1.35vw, 0.88rem);
  font-weight: 800;
  opacity: 0.82;
}

.character-tile.is-wrong,
.phrase-option.is-wrong {
  border-color: #9f1712;
  background: #c92c22;
  color: #fff;
}

.answer-feedback {
  grid-column: 1;
  grid-row: 2;
  position: static;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 4.5rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.78);
  color: #102033;
  font: 900 1.25rem "Space Grotesk", "Trebuchet MS", sans-serif;
}

.answer-feedback.is-round {
  background: #f08a18;
  color: #fff;
}

.answer-feedback.is-correct {
  background: #177a2b;
  color: #fff;
}

.answer-feedback.is-wrong {
  background: #c92c22;
  color: #fff;
}

.answer-feedback.is-report {
  background: #f08a18;
  color: #fff;
}

.answer-feedback.is-correct,
.answer-feedback.is-wrong,
.answer-feedback.is-round,
.answer-feedback.is-report {
  padding: 0;
}

.answer-feedback__text {
  min-width: 8.5rem;
  text-align: center;
}

.answer-feedback:not(.is-report) .answer-feedback__text {
  display: none;
}

.answer-feedback.is-report .answer-feedback__text {
  display: none;
}

.next-question {
  border-color: var(--accent-dark);
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.answer-feedback:not(.is-report) .next-question {
  width: 100%;
  min-height: 4.5rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
}

.answer-feedback.is-report .next-question {
  width: 100%;
  min-height: 4.5rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
}

.answer-feedback.is-round .next-question.has-best-record {
  min-height: 5.75rem;
}

.next-question:disabled {
  border-color: #c4ccda;
  background: #d5dce8;
  color: #718098;
  cursor: not-allowed;
}

.combat-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: rgba(7, 15, 31, 0.55);
}

.combat-report {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(960px, 100%);
  max-height: min(760px, calc(100vh - 2rem));
  overflow: hidden;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: #f7fbff;
  box-shadow: 0 24px 70px rgba(7, 15, 31, 0.32);
}

.combat-report__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--brand);
  color: #fff;
}

.combat-report__header h2,
.combat-report__header p {
  margin: 0;
}

.combat-report__header h2 {
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  line-height: 1;
}

.combat-report__header p {
  margin-top: 0.35rem;
  font-weight: 800;
  opacity: 0.9;
}

.combat-report__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.combat-report__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-color: #ffe6a8;
  background: #ffd466;
  color: #5b3600;
  font-weight: 900;
}

.combat-report__download span[aria-hidden="true"] {
  font-size: 1.25rem;
  line-height: 0.8;
}

.combat-report__download:disabled {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.75);
  cursor: wait;
}

.combat-report__close {
  border-color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 900;
}

.combat-report__content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-height: 0;
  overflow: auto;
  padding: 1.1rem;
}

.combat-report__section {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-width: 0;
}

.combat-report__section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.combat-report__list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.combat-report__item,
.combat-report__empty {
  border-radius: 0.65rem;
  border: 1px solid #d6e1ef;
  background: #fff;
  padding: 0.8rem;
}

.combat-report__item {
  display: grid;
  gap: 0.45rem;
  border-left: 0.45rem solid #c92c22;
}

.combat-report__item.is-correct {
  border-left-color: #177a2b;
}

.combat-report__item p {
  margin: 0;
  color: #24364f;
  font-weight: 500;
  line-height: 1.32;
}

.combat-report__pinyin {
  display: inline-block;
  margin-left: 0.35rem;
  color: #62718a;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
}

.combat-report__item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  color: #51627a;
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.combat-report__result {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  background: #c92c22;
  color: #fff;
  font: 1000 1.05rem/1 "Space Grotesk", "Trebuchet MS", sans-serif;
  text-align: center;
}

.combat-report__item.is-correct .combat-report__result {
  background: #177a2b;
}

.combat-report__attack-word {
  display: flex;
  justify-content: center;
  color: #050505;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 2.1rem;
  font-weight: 1000;
  line-height: 1;
}

.combat-report__attack-word .attack-prompt-content {
  gap: 0.45rem;
  transform: none;
}

.combat-report__attack-word .attack-pair__main {
  font-size: clamp(3.35rem, 6.6vw, 5.1rem);
}

.combat-report__attack-word .attack-pair__context {
  font-size: clamp(1.55rem, 3.5vw, 2.55rem);
}

.combat-report__attack-word .attack-meaning {
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.combat-report__explanation {
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  background: #edf4ff;
}

.combat-report__empty {
  color: #62718a;
  font-weight: 800;
}

.timer-row {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) minmax(4.1rem, auto);
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.72);
}

.start-row {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  justify-content: center;
}

.timer-label {
  color: #050505;
  font: 700 clamp(1.45rem, 3.2vw, 2.1rem) "Space Grotesk", "Trebuchet MS", sans-serif;
}

.timer-track {
  position: relative;
  height: clamp(1.4rem, 4vw, 2.15rem);
  border-radius: 999px;
  background: #d6dce6;
  overflow: visible;
}

.timer-bar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #f02013;
  transition: none;
}

.timer-bar.is-high {
  background: #22b94f;
}

.timer-bar.is-mid {
  background: #ff9f1c;
}

.timer-bar.is-low {
  background: #f02013;
}

.timer-bar.is-running {
  transition: width 1s linear;
}

.timer-shatter {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 0;
  height: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.timer-shatter::before {
  content: "";
  position: absolute;
  width: 3.4rem;
  height: 3.4rem;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34) 0 28%, rgba(255, 18, 56, 0.24) 54%, transparent 72%);
  box-shadow: 0 0 0 0.45rem rgba(255, 18, 56, 0.28), 0 0 1.4rem rgba(255, 18, 56, 0.86);
  transform: translate(-50%, -50%) scale(0.2);
  animation: timer-shatter-ring 1.02s ease-out forwards;
}

.timer-shatter span {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.72rem;
  height: 1.12rem;
  clip-path: polygon(50% 0, 100% 78%, 15% 100%);
  background: linear-gradient(135deg, #fff, #ff1238 58%, #9f1022);
  box-shadow: 0 0 0.5rem rgba(255, 18, 56, 0.78);
  transform: translate(-50%, -50%) rotate(var(--rot));
  animation: timer-shatter-piece 1.05s cubic-bezier(0.12, 0.78, 0.24, 1) forwards;
}

.timer-shatter span:nth-child(even) {
  width: 0.56rem;
  height: 0.98rem;
  background: linear-gradient(135deg, #ffd8df, #e8273f 62%, #7e0d1a);
}

@keyframes timer-shatter-ring {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.18);
  }

  35% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.75);
  }
}

@keyframes timer-shatter-piece {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.65) rotate(var(--rot));
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(1.3) rotate(calc(var(--rot) + 130deg));
  }
}

.timer-actions {
  display: grid;
  place-items: center end;
  min-width: 4.1rem;
}

.timer-text {
  min-width: 4.1rem;
  color: #050505;
  font: 800 1.3rem "Space Grotesk", "Trebuchet MS", sans-serif;
  text-align: right;
}

.start-button {
  min-width: 8.5rem;
  min-height: 3rem;
  border-color: var(--accent-dark);
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
}

.start-button.is-awaiting-start {
  animation: start-button-jiggle 1.45s ease-in-out infinite;
  transform-origin: 50% 55%;
}

.start-button:disabled {
  border-color: #c4ccda;
  background: #d5dce8;
  color: #718098;
  cursor: not-allowed;
}

@keyframes start-button-jiggle {
  0%,
  68%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  74% {
    transform: translateX(-3px) rotate(-2deg);
  }

  80% {
    transform: translateX(3px) rotate(2deg);
  }

  86% {
    transform: translateX(-2px) rotate(-1deg);
  }

  92% {
    transform: translateX(2px) rotate(1deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .start-button.is-awaiting-start {
    animation: none;
  }
}

.outcome-splash {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: rgba(255, 212, 102, 0.95);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(8rem, calc(var(--battle-visual-size) * 0.5), 15rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 8px 18px rgba(21, 42, 102, 0.3), 0 0 0.18em rgba(255, 255, 255, 0.34);
  transform: rotate(-18deg);
}

.outcome-splash.is-defeat {
  color: rgba(190, 32, 28, 0.9);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1020px) {
  .game-board {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 0.9rem;
  }

  .battle-stage {
    --battle-visual-size: clamp(330px, 36vw, 380px);
    grid-template-columns: var(--battle-visual-size) minmax(260px, 1fr);
    column-gap: clamp(0.8rem, 2vw, 1.2rem);
  }

  .challenge-panel {
    height: max(var(--battle-visual-size), 390px);
  }

  .enemy-list {
    grid-template-columns: 1fr;
  }

  .attack-prompt--idle {
    font-size: clamp(1.45rem, 3.1vw, 2.35rem);
  }
}

@media (max-width: 820px) {
  .game-board {
    grid-template-columns: 1fr;
  }

  .enemy-panel {
    min-height: auto;
  }

  .enemy-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .battle-stage {
    --battle-visual-size: min(460px, calc(100vw - 2rem));
    position: relative;
    top: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    row-gap: 1rem;
  }

  .monster-column {
    display: grid;
    gap: 0.75rem;
    align-content: start;
  }

  .enemy-title,
  .life-meter,
  .monster-frame,
  .challenge-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .challenge-panel {
    height: auto;
    min-height: 0;
  }

  .attack-zone,
  .defense-zone {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: clamp(1rem, 2.5vw, 1.35rem);
  }

  .challenge-card,
  .challenge-card--attack {
    height: auto;
  }

  .challenge-card--attack {
    grid-template-rows: auto auto;
  }

  .attack-prompt {
    height: auto;
    min-height: clamp(7.25rem, 22vw, 11rem);
    padding: clamp(1rem, 3vw, 1.4rem) 0.8rem;
  }

  .monster-frame {
    width: var(--battle-visual-size);
    height: var(--battle-visual-size);
    justify-self: center;
  }

  .combat-report__content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .enemy-list,
  .tone-options,
  .idiom-options {
    grid-template-columns: 1fr;
  }

  .attack-prompt {
    min-height: clamp(8.5rem, 38vw, 12rem);
  }

  .attack-pair__main {
    font-size: clamp(3.4rem, 17vw, 4.8rem);
  }

  .attack-pair__context {
    font-size: clamp(1.7rem, 8vw, 2.6rem);
  }

  .phrase-grid {
    overflow: visible;
  }

  .answer-feedback {
    margin-top: 0;
  }

  .character-tile {
    min-height: 48px;
  }

  .timer-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .timer-actions {
    justify-content: space-between;
  }

  .combat-report-overlay {
    padding: 0.65rem;
  }

  .combat-report__header {
    display: grid;
  }

  .combat-report__actions {
    flex-wrap: wrap;
    justify-self: start;
  }
}
