:root {
  --navy: #06142b;
  --navy-2: #0b2343;
  --navy-3: #12365f;
  --blue: #62c7ff;
  --gold: #f4bd36;
  --mint: #81e6c1;
  --orange: #ff8a5c;
  --ink: #10213a;
  --muted: #b9c9df;
  --paper: #f8fbff;
  --panel: rgba(7, 20, 43, 0.84);
  --line: rgba(255, 255, 255, 0.15);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--navy);
  color: #eef5ff;
  font-family: Arial, "Noto Sans KR", "Malgun Gothic", sans-serif;
}

body.is-playing .site-header {
  min-height: 48px;
  padding-block: 6px;
}

body.is-playing .site-nav,
body.is-playing .menu-toggle {
  display: none;
}

body.is-playing .brand-mark {
  width: 32px;
  height: 32px;
}

body.is-playing .brand-long {
  font-size: 0.95rem;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(244, 189, 54, 0.52);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 14px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 16, 34, 0.95);
  backdrop-filter: blur(18px);
}

.brand,
.mini-brand,
.site-nav a,
.site-footer a {
  text-decoration: none;
}

.brand,
.mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark,
.mini-brand span {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.brand-short,
.menu-toggle {
  display: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.site-nav a:hover,
.site-footer a:hover {
  color: #fff;
}

.menu-toggle {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 900;
}

main {
  overflow: hidden;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  color: #fff;
  font-size: clamp(2.45rem, 6vw, 5.5rem);
  line-height: 1;
}

h2 {
  margin-bottom: 14px;
  color: #fff;
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  line-height: 1.12;
}

h3 {
  color: #fff;
}

.game-eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-hero {
  min-height: min(820px, calc(100vh - 66px));
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(28px, 5vw, 78px);
  background:
    linear-gradient(90deg, rgba(6, 20, 43, 0.98) 0 38%, rgba(6, 20, 43, 0.58)),
    url("assets/images/pattern-alfabeto-coreano-soft.webp") center / cover;
}

.game-hero__content {
  z-index: 1;
  max-width: 720px;
}

.hero-lead {
  color: #fff;
  font-size: clamp(1.12rem, 2vw, 1.5rem);
  font-weight: 800;
}

.game-hero__content p:not(.game-eyebrow),
.learning-section p,
.how-section p,
.panel-copy p,
.cta-band p,
.game-card p,
.settings-grid p {
  color: #d9e7f8;
  line-height: 1.65;
}

.game-tags,
.hero-actions,
.cta-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-tags {
  margin: 22px 0 24px;
}

.game-tags span,
.hud span,
.game-actions button,
.secondary-link,
.secondary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #dce9fb;
  font-weight: 900;
}

.game-tags span {
  padding: 9px 11px;
}

.primary-link,
.primary-button,
.secondary-link,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 8px;
  text-decoration: none;
}

.primary-link,
.primary-button {
  min-width: 172px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
}

.secondary-link,
.secondary-button {
  min-width: 140px;
}

.game-hero__visual {
  min-height: 340px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 72% 32%, rgba(255, 255, 255, 0.1), transparent 34%),
    linear-gradient(145deg, #07142c, #102b58);
}

.game-hero__visual img,
.game-start-panel img,
.game-result-panel img,
.game-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-hero__visual img {
  aspect-ratio: 16 / 9;
}

.asset-missing {
  display: none !important;
}

.learning-section,
.how-section,
.settings-section,
.related-games,
.cta-band,
.game-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 34px auto;
}

.learning-section,
.how-section,
.settings-section {
  display: grid;
  gap: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.settings-section {
  position: relative;
  overflow: hidden;
  border: 3px solid #f6a800;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 213, 85, 0.24), transparent 30%),
    linear-gradient(135deg, #493016, #2a241d 58%, #392315);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 0 0 5px rgba(246, 168, 0, 0.1);
}

.settings-section::before {
  content: "CONFIGURA";
  position: absolute;
  top: 18px;
  right: 22px;
  color: rgba(255, 203, 72, 0.14);
  font-size: clamp(2rem, 6vw, 4.8rem);
  font-weight: 950;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.learning-section,
.how-section {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
}

.learning-list,
.how-section ol {
  margin: 0;
  color: #d9e7f8;
  line-height: 1.85;
}

.mobile-note {
  align-self: center;
  padding: 18px;
  border: 1px solid rgba(98, 199, 255, 0.35);
  border-radius: 8px;
  background: rgba(98, 199, 255, 0.1);
}

.mobile-note strong {
  display: block;
  margin-bottom: 8px;
  color: #fff;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.settings-section fieldset {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 207, 91, 0.68);
  border-radius: 8px;
  background: rgba(24, 19, 14, 0.78);
}

legend {
  padding: 0 6px;
  color: #fff;
  font-weight: 900;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: #eef5ff;
  font-weight: 800;
}

fieldset p {
  margin: 10px 0 0;
  font-size: 0.9rem;
}

.select-label {
  margin-bottom: 7px;
  color: #fff3cd;
  font-size: 0.84rem;
}

#gameMode {
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 12px;
  border: 1px solid rgba(255, 198, 57, 0.78);
  border-radius: 8px;
  background: #fff7df;
  color: #142038;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

#gameMode:focus-visible {
  outline: 3px solid rgba(255, 198, 57, 0.38);
  outline-offset: 2px;
}

.selected-mode-summary {
  width: fit-content;
  padding: 8px 11px;
  border: 1px solid rgba(255, 196, 48, 0.55);
  border-radius: 999px;
  background: rgba(255, 196, 48, 0.12);
  color: #ffe49a !important;
  font-size: 0.9rem;
  font-weight: 900;
}

.game-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 22% 8%, rgba(98, 199, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #0b2140, #061327 70%);
  box-shadow: var(--shadow);
}

#juego {
  border: 3px solid #23cbbf;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34), 0 0 0 5px rgba(35, 203, 191, 0.12);
}

#juego::before {
  content: "JUEGA";
  position: absolute;
  z-index: 0;
  right: 20px;
  top: 78px;
  color: rgba(78, 221, 208, 0.07);
  font-size: clamp(2.6rem, 8vw, 7rem);
  font-weight: 950;
  letter-spacing: 0.08em;
  pointer-events: none;
}

body.is-playing .game-shell {
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 8;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  height: calc(100vh - 48px);
  height: calc(100dvh - 48px);
  min-height: 0;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-x: hidden;
  overflow-y: auto;
  margin-top: 0;
  margin-bottom: 0;
}

.game-topbar,
.coach-panel,
.typing-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(13, 36, 68, 0.96);
  border-bottom: 1px solid var(--line);
}

.game-topbar {
  justify-content: space-between;
  background: linear-gradient(135deg, #0b3157, #0a2445);
  border-bottom-color: rgba(35, 203, 191, 0.62);
}

.hud-progress {
  border-color: #28d5c8 !important;
  background: rgba(17, 132, 142, 0.28) !important;
  color: #eafffd !important;
}

body.is-playing .game-topbar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(360px, 1.4fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px 12px;
}

.mini-brand {
  min-width: 210px;
  font-size: 0.92rem;
}

body.is-playing .mini-brand {
  min-width: 0;
  font-size: 0.82rem;
}

body.is-playing .mini-brand span {
  width: 30px;
  height: 30px;
}

.hud,
.game-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hud span,
.game-actions button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.hud [hidden] {
  display: none !important;
}

body.is-playing .hud,
body.is-playing .game-actions {
  gap: 6px;
}

body.is-playing .hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
}

body.is-playing .hud span,
body.is-playing .game-actions button {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 0.8rem;
}

body.is-playing .game-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
}

.hud img {
  width: 15px;
  height: 15px;
}

.game-actions img {
  width: 16px;
  height: 16px;
}

.game-actions button:hover,
.secondary-link:hover,
.secondary-button:hover {
  border-color: rgba(244, 189, 54, 0.65);
  color: #fff;
}

.screen-start,
.screen-play,
.screen-result {
  display: none;
}

.game-shell[data-status="idle"] .screen-start,
.game-shell[data-status="playing"] .screen-play,
.game-shell[data-status="paused"] .screen-play,
.game-shell[data-status="finished"] .screen-result {
  display: grid;
}

#juego {
  scroll-margin-top: 12px;
}

@media (min-width: 769px) {
  .game-shell[data-status="playing"],
  .game-shell[data-status="paused"] {
    height: calc(100dvh - 60px);
    min-height: 0;
    max-height: 820px;
  }

  .game-shell[data-status="playing"] .falling-zone,
  .game-shell[data-status="paused"] .falling-zone {
    height: clamp(330px, 50dvh, 540px);
  }
}

.game-start-panel,
.game-result-panel {
  grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 520px;
  padding: 20px;
}

.panel-copy,
.result-summary {
  z-index: 1;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.game-start-panel img,
.game-result-panel img {
  min-height: 360px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(145deg, #07142c, #102b58);
}

.game-play-panel {
  grid-template-rows: 1fr auto;
}

body.is-playing .game-play-panel {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}

.falling-zone {
  position: relative;
  overflow: hidden;
  min-height: 530px;
  background:
    radial-gradient(circle at 20% 16%, rgba(98, 199, 255, 0.18), transparent 26%),
    linear-gradient(180deg, #091d3a, #071222 72%);
}

body.is-playing .falling-zone {
  min-height: 0;
}

.falling-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 100% 56px;
  pointer-events: none;
}

.falling-card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  gap: 4px;
  min-width: min(210px, calc(100% - 32px));
  max-width: min(260px, calc(100% - 32px));
  padding: 13px 18px;
  border: 1px solid rgba(244, 189, 54, 0.55);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.98);
  color: #0e2441;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.falling-card.is-bonus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(129, 230, 193, 0.16), 0 12px 32px rgba(0, 0, 0, 0.28);
}

.falling-card__korean {
  overflow-wrap: anywhere;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.falling-card__spanish {
  color: #52647d;
  font-size: 0.86rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.game-shell[data-display="korean"] .falling-card__spanish {
  display: none;
}

.game-shell[data-display="spanish"] .falling-card__korean {
  display: none;
}

.game-shell[data-display="spanish"] .falling-card__spanish {
  display: block;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.mode-badge {
  padding: 5px 9px;
  border: 1px solid rgba(129, 230, 193, 0.5);
  border-radius: 999px;
  background: rgba(129, 230, 193, 0.12);
  color: #dffbef;
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
}

.mode-badge[hidden] {
  display: none;
}

.falling-card.hit {
  border-color: var(--gold);
  background: #fff4d8;
  transform: scale(1.04);
  transition: transform 0.14s ease, background 0.14s ease;
}

.effect-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.answer-effect {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--gold);
  font-weight: 900;
  animation: popFade 520ms ease forwards;
}

.answer-effect img {
  width: 22px;
  height: 22px;
}

.paused-overlay {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 10, 23, 0.68);
  backdrop-filter: blur(8px);
}

.paused-overlay[hidden] {
  display: none;
}

.paused-overlay > div {
  display: grid;
  gap: 10px;
  width: min(320px, calc(100% - 36px));
  padding: 20px;
  border: 1px solid rgba(244, 189, 54, 0.55);
  border-radius: 8px;
  background: rgba(7, 20, 43, 0.94);
}

.paused-overlay h2 {
  margin-bottom: 4px;
  font-size: 1.35rem;
}

.paused-overlay button {
  min-height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 900;
}

.typing-panel {
  align-items: stretch;
  flex-direction: column;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

body.is-playing .typing-panel {
  gap: 8px;
  padding: 12px 12px 10px;
}

.typing-panel label {
  display: block;
  margin: 0;
  padding-top: 1px;
  color: #dce9fb;
  font-weight: 900;
  line-height: 1.35;
}

.answer-row {
  display: flex;
  gap: 10px;
}

.typing-panel input {
  min-height: 50px;
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  font-size: 1.05rem;
}

body.is-playing .typing-panel input,
body.is-playing .typing-panel button {
  min-height: 42px;
}

.typing-panel input.is-wrong {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 138, 92, 0.2);
  animation: shake 180ms ease;
}

.recommended-tag {
  display: inline-flex;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  background: #0c8a82;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
}

.dc-keyboard-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #dce9fb;
  font-size: 0.82rem;
}

.dc-keyboard-tools[hidden] {
  display: none;
}

.keyboard-toggle {
  min-height: 36px !important;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.virtual-korean-keyboard {
  width: min(100%, 820px);
  margin: 2px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 8px;
  background: #071b35;
}

.virtual-korean-keyboard[hidden] {
  display: none;
}

@media (min-width: 769px) {
  .game-shell[data-status="playing"][data-keyboard-open="true"] .falling-zone {
    height: clamp(190px, 28dvh, 300px);
  }
}

@media (min-width: 769px) and (max-height: 800px) {
  .game-shell[data-keyboard-open="true"] .dc-keyboard-row button {
    min-width: 38px;
    min-height: 36px !important;
    padding: 2px 4px;
  }

  .game-shell[data-keyboard-open="true"] .virtual-korean-keyboard {
    padding: 5px;
  }
}

.dc-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 5px;
}

.dc-keyboard-row:last-child {
  margin-bottom: 0;
}

.dc-keyboard-row button {
  min-width: 46px;
  min-height: 46px !important;
  border: 1px solid #bfd3e8;
  border-radius: 7px;
  padding: 4px 5px;
  background: #fff !important;
  color: #071b35 !important;
}

.dc-keyboard-row button span {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
}

.dc-keyboard-row button small {
  display: block;
  color: #60758c;
  font-size: 0.62rem;
}

.dc-keyboard-controls button {
  min-width: 92px;
}

.virtual-korean-keyboard.is-shifted [data-key="q"],
.virtual-korean-keyboard.is-shifted [data-key="w"],
.virtual-korean-keyboard.is-shifted [data-key="e"],
.virtual-korean-keyboard.is-shifted [data-key="r"],
.virtual-korean-keyboard.is-shifted [data-key="t"] {
  border-color: #ff9d00;
  background: #fff2d4 !important;
}

@media (max-width: 640px) {
  .dc-keyboard-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .virtual-korean-keyboard {
    overflow-x: auto;
  }

  .dc-keyboard-row {
    min-width: 540px;
  }
}

.typing-panel button {
  min-height: 50px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 900;
}

.feedback {
  margin: 0;
  color: var(--muted);
}

.coach-panel {
  border-bottom: 0;
  background: rgba(10, 28, 54, 0.98);
}

body.is-playing .coach-panel {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  flex: 0 0 auto;
  gap: 10px;
  padding: 8px 12px;
}

@media (max-height: 700px) {
  body.is-playing .game-topbar {
    padding: 6px 10px;
  }

  body.is-playing .falling-zone {
    height: clamp(150px, 28dvh, 230px);
  }

  body.is-playing .typing-panel {
    gap: 5px;
    padding: 9px 10px 7px;
  }

  body.is-playing .typing-panel input,
  body.is-playing .typing-panel button {
    min-height: 38px;
  }

  body.is-playing .coach-panel {
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 6px 10px 8px;
  }

  body.is-playing .coach-avatar {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }
}

@media (max-height: 700px) and (min-width: 769px) {
  .game-shell[data-status="playing"][data-keyboard-open="true"] .falling-zone,
  .game-shell[data-status="paused"][data-keyboard-open="true"] .falling-zone {
    height: 120px;
  }
}

.coach-avatar {
  position: relative;
  width: 118px;
  height: 118px;
  flex: 0 0 118px;
}

body.is-playing .coach-avatar {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
}

body.is-playing .coach-panel .game-eyebrow {
  margin-bottom: 2px;
  font-size: 0.62rem;
}

body.is-playing .coach-panel strong {
  margin-bottom: 2px;
}

body.is-playing .coach-panel span {
  line-height: 1.32;
}

.coach-avatar img,
.coach-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.coach-avatar img {
  display: none;
  object-fit: contain;
}

.coach-avatar[data-coach-state="idle"] img[data-state="idle"],
.coach-avatar[data-coach-state="success"] img[data-state="success"],
.coach-avatar[data-coach-state="warning"] img[data-state="warning"] {
  display: block;
}

.coach-fallback {
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 189, 54, 0.48);
  border-radius: 50%;
  background: var(--navy-3);
  color: var(--gold);
  font-weight: 900;
}

.coach-avatar.has-active-asset .coach-fallback {
  display: none;
}

.coach-panel strong,
.coach-panel span {
  display: block;
}

.coach-panel strong {
  margin-bottom: 5px;
  color: #fff;
}

.coach-panel span {
  color: #d1e0f3;
  line-height: 1.5;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.result-grid span,
.review-box {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.result-grid span {
  min-height: 76px;
  display: grid;
  gap: 5px;
  padding: 12px;
  color: #cddcf0;
  font-size: 0.9rem;
}

.result-grid strong {
  color: #fff;
  font-size: 1.3rem;
}

.review-box {
  margin-bottom: 18px;
  padding: 14px;
}

.review-box h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1rem;
}

.review-box ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-box li {
  display: grid;
  gap: 2px;
  min-width: 112px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(244, 189, 54, 0.16);
  color: #fff4d8;
  font-weight: 900;
}

.review-box small {
  color: #d9e7f8;
  font-weight: 700;
}

.related-games__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.game-card img {
  aspect-ratio: 4 / 3;
  background: #102b58;
}

.game-card h3,
.game-card p,
.game-card a,
.game-card span {
  margin-left: 14px;
  margin-right: 14px;
}

.game-card h3 {
  margin-top: 14px;
  margin-bottom: 8px;
}

.game-card a,
.game-card span {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--gold);
  font-weight: 900;
  text-decoration: none;
}

.all-games-link {
  margin-top: 18px;
}

.cta-band {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(6, 20, 43, 0.9), rgba(6, 20, 43, 0.92)),
    url("assets/images/pattern-alfabeto-coreano-soft.webp") center / cover;
  text-align: center;
}

.cta-actions {
  justify-content: center;
  margin: 20px 0 18px;
}

.tagline {
  margin-bottom: 0;
  color: #fff !important;
  font-weight: 900;
}

.site-footer {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, minmax(130px, 1fr));
  gap: 24px;
  padding: 32px clamp(16px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: #071326;
  color: var(--muted);
}

.site-footer strong,
.site-footer h3 {
  color: #fff;
}

.site-footer nav,
.site-footer div {
  display: grid;
  align-content: start;
  gap: 8px;
}

.site-footer h3,
.site-footer p {
  margin-bottom: 4px;
}

@keyframes popFade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -110%) scale(0.9);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  33% { transform: translateX(-5px); }
  66% { transform: translateX(5px); }
}

@media (max-width: 1024px) {
  .game-hero,
  .game-start-panel,
  .game-result-panel,
  .learning-section,
  .how-section {
    grid-template-columns: 1fr;
  }

  .game-hero {
    min-height: auto;
  }

  .game-topbar,
  .coach-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .hud,
  .game-actions {
    justify-content: stretch;
  }

  .hud span,
  .game-actions button {
    flex: 1 1 132px;
  }

  .settings-grid,
  .related-games__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 768px) {
  .brand-long,
  .site-nav {
    display: none;
  }

  .brand-short,
  .menu-toggle {
    display: inline-flex;
  }

  .site-header.is-open .site-nav {
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 6px);
    display: grid;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(6, 16, 34, 0.98);
  }

  .settings-grid,
  .related-games__grid,
  .result-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .game-shell,
  .learning-section,
  .how-section,
  .settings-section,
  .related-games,
  .cta-band {
    width: min(100% - 22px, 1200px);
  }
}

@media (max-width: 480px) {
  .game-hero__visual {
    min-height: 0;
  }

  .game-hero__visual img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    object-position: center;
  }
}

@media (max-width: 430px) {
  .site-header {
    padding: 12px;
  }

  .game-hero {
    padding: 20px 14px;
  }

  .game-start-panel,
  .game-result-panel {
    padding: 12px;
  }

  .falling-zone {
    min-height: 440px;
  }

  .answer-row {
    flex-direction: column;
  }

  .coach-avatar {
    width: 104px;
    height: 104px;
    flex-basis: 104px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
