:root {
  --ink: #1f2933;
  --muted: #667085;
  --paper: #ffffff;
  --mist: #f5fbff;
  --teal: #12a594;
  --teal-dark: #087b72;
  --coral: #f56b5f;
  --sun: #f6c945;
  --leaf: #58b368;
  --sky: #4d91ff;
  --violet: #7b61ff;
  --line: #d9e4ec;
  --shadow: 0 18px 50px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(135deg, rgba(77, 145, 255, 0.12), rgba(18, 165, 148, 0.08) 40%, rgba(246, 201, 69, 0.12)),
    var(--mist);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.page-wrap {
  min-height: 100vh;
  padding: 24px;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: calc(100vh - 48px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 228, 236, 0.85);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.08);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: conic-gradient(from 160deg, var(--teal), var(--sky), var(--coral), var(--sun), var(--teal));
  font-size: 21px;
  font-weight: 900;
}

.brand-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.good {
  border-color: rgba(18, 165, 148, 0.32);
  background: rgba(18, 165, 148, 0.1);
  color: var(--teal-dark);
}

.pill.warm {
  border-color: rgba(245, 107, 95, 0.34);
  background: rgba(245, 107, 95, 0.1);
  color: #ad342a;
}

.stage {
  min-height: 100%;
  display: grid;
  align-items: center;
}

.panel {
  overflow: hidden;
  border: 1px solid rgba(217, 228, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
}

.start-panel {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 620px;
}

.start-copy {
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.start-copy h1 {
  margin: 0;
  max-width: 580px;
  font-size: 44px;
  line-height: 1.08;
}

.start-copy p {
  margin: 0;
  max-width: 500px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.start-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.set-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.set-summary span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(77, 145, 255, 0.22);
  background: rgba(77, 145, 255, 0.08);
  color: #285fad;
  font-size: 13px;
  font-weight: 900;
}

.start-art {
  min-height: 420px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(160deg, rgba(18, 165, 148, 0.12), rgba(77, 145, 255, 0.1)),
    #ecfff9;
}

.hero-photo-grid {
  width: min(430px, 88%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hero-photo-tile {
  position: relative;
  min-height: 150px;
  margin: 0;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(31, 41, 51, 0.14);
  background:
    radial-gradient(circle at 18% 18%, rgba(246, 201, 69, 0.26), transparent 34%),
    radial-gradient(circle at 82% 22%, rgba(77, 145, 255, 0.18), transparent 32%),
    #f9fcff;
}

.hero-photo-tile:nth-child(2n) {
  transform: translateY(18px);
}

.hero-photo-tile img {
  width: 84%;
  height: 84%;
  margin: 8% auto;
  display: block;
  object-fit: contain;
}

.hero-photo-tile span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.word-cloud {
  width: min(420px, 86%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cloud-tile {
  min-height: 88px;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(31, 41, 51, 0.08);
  font-size: 24px;
  font-weight: 900;
}

.cloud-tile:nth-child(2n) {
  transform: translateY(18px);
}

.cloud-tile small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.primary-btn,
.ghost-btn,
.icon-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-btn {
  padding: 0 20px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 22px rgba(18, 165, 148, 0.24);
}

.ghost-btn {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.icon-btn {
  width: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.ghost-btn:active,
.icon-btn:active,
.choice-btn:active,
.picture-choice:active {
  transform: translateY(1px);
}

.game-panel {
  min-height: 650px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.progress-wrap {
  height: 9px;
  background: #e7eef5;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--sky), var(--sun));
  transition: width 240ms ease;
}

.question-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: 26px;
  padding: 32px;
  align-items: center;
}

.art-board {
  min-height: 390px;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 251, 255, 0.92)),
    #eaf2f8;
}

.word-art {
  width: min(380px, 92%);
  aspect-ratio: 1.22;
}

.drawing-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 18%, rgba(246, 201, 69, 0.3), transparent 30%),
    radial-gradient(circle at 84% 20%, rgba(77, 145, 255, 0.2), transparent 28%),
    radial-gradient(circle at 62% 90%, rgba(18, 165, 148, 0.14), transparent 36%),
    #ffffff;
}

.drawing-card img {
  width: 74%;
  height: 74%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(31, 41, 51, 0.14));
}

.drawing-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(31, 41, 51, 0.08);
}

.drawing-label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.12);
  font-size: 22px;
  font-weight: 1000;
  line-height: 1.1;
  text-align: center;
}

.mini-art .drawing-label {
  left: 8px;
  right: 8px;
  bottom: 8px;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 16px;
}

.drawing-fallback {
  display: none;
  padding: 12px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.drawing-card.image-missing .drawing-fallback {
  display: grid;
}

.question-main {
  min-width: 0;
}

.mode-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(77, 145, 255, 0.12);
  color: #285fad;
  font-size: 14px;
  font-weight: 900;
}

.prompt {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--muted);
}

.big-word {
  margin: 0;
  font-size: 48px;
  line-height: 1.05;
  word-break: break-word;
}

.meaning {
  min-height: 48px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px dashed rgba(18, 165, 148, 0.46);
  background: rgba(18, 165, 148, 0.08);
  color: var(--teal-dark);
  font-size: 16px;
  font-weight: 800;
}

.meaning.is-hidden {
  color: var(--muted);
  border-color: var(--line);
  background: #f7fafc;
  font-weight: 700;
}

.letter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 26px 0;
}

.letter-box {
  width: 42px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef7ff;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  text-transform: uppercase;
}

.letter-box.blank {
  border: 2px solid var(--coral);
  background: rgba(245, 107, 95, 0.08);
  color: var(--coral);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(58px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.choice-btn {
  min-height: 66px;
  border-radius: 8px;
  border: 2px solid #dfe9f2;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.choice-btn:hover {
  border-color: var(--sky);
  background: #f2f7ff;
}

.choice-btn.correct,
.picture-choice.correct {
  border-color: var(--teal);
  background: rgba(18, 165, 148, 0.12);
}

.choice-btn.wrong,
.picture-choice.wrong {
  border-color: var(--coral);
  background: rgba(245, 107, 95, 0.12);
}

.choice-btn:disabled,
.picture-choice:disabled {
  cursor: default;
}

.picture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.picture-choice {
  min-height: 150px;
  padding: 8px;
  border-radius: 8px;
  border: 2px solid #dfe9f2;
  background: #fff;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.picture-choice:hover {
  border-color: var(--sky);
  background: #f7fbff;
}

.picture-choice .mini-art {
  width: 100%;
  height: 124px;
}

.listen-card {
  width: min(360px, 100%);
  min-height: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 18px 0 4px;
  border-radius: 8px;
  border: 2px solid rgba(77, 145, 255, 0.26);
  background: linear-gradient(135deg, rgba(77, 145, 255, 0.12), rgba(246, 201, 69, 0.16)), #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  font-weight: 1000;
}

.listen-card .svg-icon {
  width: 28px;
  height: 28px;
  color: var(--sky);
}

.word-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.word-choice-btn {
  min-height: 62px;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #dfe9f2;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  font-weight: 1000;
}

.word-choice-btn:hover,
.spell-tile:hover {
  border-color: var(--sky);
  background: #f2f7ff;
}

.word-choice-btn.correct,
.spell-tile.correct {
  border-color: var(--teal);
  background: rgba(18, 165, 148, 0.12);
}

.word-choice-btn.wrong,
.spell-tile.wrong {
  border-color: var(--coral);
  background: rgba(245, 107, 95, 0.12);
}

.spell-answer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0 12px;
}

.spell-slot {
  width: 39px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 2px solid rgba(77, 145, 255, 0.32);
  background: #f7fbff;
  color: var(--ink);
  font-size: 26px;
  font-weight: 1000;
  text-transform: uppercase;
}

.spell-grid {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.spell-tile {
  min-width: 46px;
  height: 52px;
  padding: 0 13px;
  border-radius: 8px;
  border: 2px solid #dfe9f2;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 25px;
  font-weight: 1000;
  text-transform: uppercase;
}

.spell-tile:disabled {
  cursor: default;
  opacity: 0.42;
}

.spell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.spell-actions .ghost-btn:disabled {
  cursor: default;
  opacity: 0.52;
  transform: none;
}

.feedback {
  min-height: 86px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 32px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
}

.feedback strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.feedback p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.feedback.is-good strong {
  color: var(--teal-dark);
}

.feedback.is-bad strong {
  color: #b03930;
}

.result-panel {
  padding: 34px;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(360px, 1.18fr);
  gap: 28px;
  align-items: start;
}

.score-box {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcff;
  text-align: center;
}

.score-number {
  margin: 0;
  color: var(--teal-dark);
  font-size: 76px;
  line-height: 1;
  font-weight: 1000;
}

.stars {
  margin-top: 12px;
  color: var(--sun);
  font-size: 34px;
  line-height: 1;
}

.result-title {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.2;
}

.result-copy {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

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

.stat {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat b {
  display: block;
  margin-bottom: 4px;
  font-size: 24px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.review-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.review-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #fff7f6;
  border: 1px solid rgba(245, 107, 95, 0.26);
}

.review-item b {
  font-size: 17px;
}

.review-item span {
  color: var(--muted);
  font-size: 14px;
}

.empty-review {
  margin: 18px 0;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(88, 179, 104, 0.3);
  background: rgba(88, 179, 104, 0.1);
  color: #27643a;
  font-weight: 800;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.svg-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 860px) {
  .page-wrap {
    padding: 12px;
  }

  .app-shell {
    min-height: calc(100vh - 24px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-row {
    justify-content: flex-start;
  }

  .start-panel,
  .question-layout,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .start-panel,
  .game-panel {
    min-height: 0;
  }

  .start-copy {
    padding: 28px;
  }

  .start-copy h1 {
    font-size: 34px;
  }

  .start-copy p {
    font-size: 16px;
  }

  .start-art {
    min-height: 330px;
    order: -1;
  }

  .question-layout {
    padding: 20px;
    gap: 18px;
  }

  .art-board {
    min-height: 260px;
  }

  .big-word {
    font-size: 38px;
  }

  .feedback {
    grid-template-columns: 1fr;
    padding: 18px 20px;
  }

  .feedback .primary-btn {
    width: 100%;
  }

  .result-panel {
    padding: 20px;
  }
}

@media (max-width: 560px) {
  .brand-title {
    font-size: 18px;
  }

  .pill {
    min-height: 32px;
    font-size: 13px;
  }

  .word-cloud {
    grid-template-columns: 1fr;
  }

  .hero-photo-grid {
    grid-template-columns: 1fr;
  }

  .hero-photo-tile {
    min-height: 128px;
  }

  .hero-photo-tile:nth-child(2n) {
    transform: none;
  }

  .cloud-tile:nth-child(2n) {
    transform: none;
  }

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

  .picture-grid {
    grid-template-columns: 1fr;
  }

  .word-choice-grid {
    grid-template-columns: 1fr;
  }

  .letter-box {
    width: 36px;
    height: 46px;
    font-size: 24px;
  }

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

  .score-number {
    font-size: 62px;
  }
}
