/* 青蛙大王 · Unit 4 — Duolingo 风格近似 */
:root {
  --duo-green: #58cc02;
  --duo-green-dark: #46a302;
  --duo-green-light: #89e219;
  --duo-blue: #1cb0f6;
  --duo-blue-dark: #1899d6;
  --duo-purple: #7769e4;
  --duo-bg: #6acb3d;
  --duo-bg-soft: #2a9d3d;
  --surface: #ffffff;
  --text: #3c3c3c;
  --text-muted: #777777;
  --radius: 14px;
  --radius-pill: 999px;
  --shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(circle at 20% 15%, #b8f57c 0%, #6fdb47 30%, #2baf49 100%);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.bg-floaters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-floaters span {
  position: absolute;
  font-size: 22px;
  opacity: 0.38;
  animation: float-cartoon 11s linear infinite;
}

.bg-floaters span:nth-child(1) { left: 7%; top: 12%; animation-delay: 0s; }
.bg-floaters span:nth-child(2) { left: 82%; top: 9%; animation-delay: 1.2s; }
.bg-floaters span:nth-child(3) { left: 15%; top: 70%; animation-delay: 2.1s; }
.bg-floaters span:nth-child(4) { left: 88%; top: 64%; animation-delay: 3.3s; }
.bg-floaters span:nth-child(5) { left: 44%; top: 18%; animation-delay: 4.1s; }
.bg-floaters span:nth-child(6) { left: 55%; top: 78%; animation-delay: 5.2s; }

.bg-floaters span:nth-child(odd) {
  color: rgba(19, 120, 29, 0.7);
}

.bg-floaters span:nth-child(1),
.bg-floaters span:nth-child(5) {
  animation-name: frog-hop;
}

.bg-floaters span:nth-child(even) {
  color: rgba(255, 255, 255, 0.75);
}

@keyframes float-cartoon {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-18px) rotate(8deg) scale(1.08); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}

@keyframes frog-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-24px) scale(1.08); }
  60% { transform: translateY(-8px) scale(1.02); }
}

#app {
  max-width: 920px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
  position: relative;
  z-index: 1;
}

.game-title {
  margin: 8px 0 10px;
  text-align: center;
  color: #fff9c7;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: 0 3px 0 #2e6d1d;
}

.game-layout {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 10px;
  min-height: 0;
}

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

.route-panel {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  padding: 10px 6px;
}

.route-panel__title {
  color: #f7ffcf;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}

.stone-route {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stone-node {
  width: 92px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #d9d9d9, #a3a3a3);
  color: #344;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 6px;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.7), 0 3px 0 rgba(0,0,0,0.15);
}

.stone-node--left {
  transform: translateX(-10px) rotate(-6deg);
}

.stone-node--right {
  transform: translateX(10px) rotate(6deg);
}

.stone-node--current {
  background: linear-gradient(180deg, #ffd267, #ffac33);
  color: #4d2f00;
}

.stone-node--done {
  background: linear-gradient(180deg, #e5f2d8, #9fd578);
}

.stone-connector {
  width: 22px;
  height: 14px;
  border-radius: 999px;
  background: rgba(101, 74, 40, 0.45);
}

.stone-connector--left {
  transform: translateX(-3px) rotate(-25deg);
}

.stone-connector--right {
  transform: translateX(3px) rotate(25deg);
}

.top-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 8px 0 4px;
}

.top-bar__reward-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar__rewards {
  display: flex;
  gap: 8px;
  justify-self: start;
}

.top-bar__spacer {
  width: 1px;
}

.top-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  width: auto;
}

.mini-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 4px;
}

.reward-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: default;
}

.reward-pill--crown {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.45);
}

.reward-pill__num {
  min-width: 1.3em;
  text-align: center;
}

.reward-pill__icon {
  font-size: 23px;
}

.frog-track-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.frog-track {
  position: relative;
  width: min(220px, 48vw);
  height: 16px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.2);
  overflow: visible;
}

.frog-track__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--duo-green-light), var(--duo-green));
  transition: width 0.35s ease;
}

.frog-track__frog {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
  transition: left 0.35s ease;
  z-index: 2;
}

.frog-track__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.unit-tag {
  font-size: 10px;
  opacity: 0.75;
  letter-spacing: 0.04em;
}

.character-area {
  position: relative;
  padding: 8px 0 12px;
  min-height: 110px;
}

.frog-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.frog-name-tag {
  margin-bottom: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff6cf;
  border: 2px solid #f0cf6a;
  color: #5b4b1d;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.frog-actor {
  position: relative;
  display: inline-block;
  font-size: 72px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.frog-crown {
  display: none;
}

.frog-outfit {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  font-size: 36px;
  line-height: 1;
  max-width: none;
  white-space: normal;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.frog-actor[data-mood="nod"] {
  animation: frog-nod 0.55s ease;
}

@keyframes frog-nod {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  30% {
    transform: rotate(-6deg) translateY(-2px);
  }
  60% {
    transform: rotate(6deg) translateY(-1px);
  }
}

.praise-pop {
  position: absolute;
  right: 18%;
  top: 4px;
  font-size: 40px;
  font-weight: 900;
  color: #ffd93b;
  text-shadow: 0 3px 0 #cc7d00, 0 5px 12px rgba(0, 0, 0, 0.2);
}

.praise-pop--hidden {
  opacity: 0;
  transform: translateY(12px) scale(0.8);
}

.praise-pop:not(.praise-pop--hidden) {
  animation: praise-bounce 0.65s ease forwards;
}

@keyframes praise-bounce {
  0% { opacity: 0; transform: translateY(12px) scale(0.8); }
  40% { opacity: 1; transform: translateY(-6px) scale(1.1); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.sparkle-burst {
  position: absolute;
  left: 50%;
  top: 22px;
  width: 1px;
  height: 1px;
  pointer-events: none;
  opacity: 0;
}

.sparkle-burst--on {
  opacity: 1;
}

.sparkle-burst--on::before,
.sparkle-burst--on::after {
  content: "✨ ✨ ✨";
  position: absolute;
  font-size: 18px;
  color: #ffe26c;
  animation: sparkle-splash 0.8s ease forwards;
}

.sparkle-burst--on::after {
  content: "⭐ ✨ ⭐";
  animation-delay: 0.06s;
}

@keyframes sparkle-splash {
  0% { transform: translate(-50%, 0) scale(0.4); opacity: 0; }
  35% { transform: translate(-50%, -14px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -28px) scale(1.2); opacity: 0; }
}

.eye-flash {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  opacity: 0;
}

.eye-flash--on {
  animation: eye-flash-anim 0.9s ease forwards;
}

@keyframes eye-flash-anim {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  25% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

.challenge-zone {
  flex: 1;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 20px 16px 24px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  min-height: 280px;
}

.screen-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 12px;
  text-align: center;
}

.screen-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.screen-title-row .screen-title {
  margin-bottom: 0;
}

.prompt {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 16px;
  line-height: 1.35;
  color: var(--text);
}

.prompt--sub {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
}

.word-hero {
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  margin: 8px 0 16px;
  letter-spacing: 0.02em;
}

.audio-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-audio {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, var(--duo-purple), #5c52c4);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 0 #4338a8;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-audio:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #4338a8;
}

.btn-audio--blue {
  background: linear-gradient(180deg, var(--duo-blue), var(--duo-blue-dark));
  box-shadow: 0 4px 0 #137fb0;
}

.btn-audio--blue:active {
  box-shadow: 0 2px 0 #137fb0;
}

.btn-audio--inline {
  width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 12px;
  padding: 0;
  font-size: 22px;
  box-shadow: 0 4px 0 #137fb0;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice-btn {
  padding: 16px 12px;
  border-radius: var(--radius);
  border: 2px solid #e5e5e5;
  background: #fafafa;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  min-height: 56px;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}

.choice-btn:active {
  transform: scale(0.98);
}

.choice-btn--selected {
  border-color: var(--duo-blue);
  background: #e8f7ff;
}

.choice-btn--correct {
  border-color: var(--duo-green);
  background: #e8f8e0;
}

.choice-btn--wrong {
  border-color: #ff4b4b;
  background: #ffe8e8;
}

.choice-btn:disabled {
  opacity: 0.85;
  cursor: default;
}

.emoji-card {
  font-size: 40px;
  text-align: center;
}

.inline-blank {
  border-bottom: 3px solid var(--duo-blue);
  min-width: 72px;
  display: inline-block;
  vertical-align: baseline;
  padding: 0 4px;
  min-height: 1.2em;
}

.drag-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.drag-tile,
.tile {
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #ddd;
  background: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.drag-tile--ghost {
  opacity: 0.5;
}

.drop-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 12px;
  border-radius: var(--radius);
  background: #f3f3f3;
  margin-bottom: 12px;
}

.drop-slot {
  min-width: 88px;
  min-height: 44px;
  border: 2px dashed #bbb;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.drop-slot--filled {
  border-style: solid;
  border-color: var(--duo-blue);
  background: #e8f7ff;
}

.drop-slot--tile {
  min-width: 100px;
  padding: 6px 8px;
}

.drop-slot .drag-tile {
  cursor: pointer;
  margin: 0;
}

.answer-key {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #e8f8e0;
  border: 2px solid var(--duo-green);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.answer-key--hidden {
  display: none;
}

.order-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.order-tile {
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #ddd;
  background: #fafafa;
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
}

.order-tile--used {
  opacity: 0.35;
  pointer-events: none;
}

.order-built {
  min-height: 52px;
  padding: 10px;
  border-radius: var(--radius);
  background: #f3f3f3;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 360px;
  margin: 0 auto;
}

.match-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  padding: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  word-break: break-word;
}

.match-cell--open {
  background: #fff;
  border-color: var(--duo-blue);
}

.match-cell--matched {
  background: #e8f8e0;
  border-color: var(--duo-green);
  cursor: default;
  pointer-events: none;
}

.match-cell--peek {
  background: #fff7e6;
}

.dialogue-box {
  background: #f3f3f3;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.dialogue-box--yellow {
  background: #fff6cf;
  border: 2px solid #f0cf6a;
}

.challenge-zone--yellow .dialogue-box,
.challenge-zone--yellow .order-built,
.challenge-zone--yellow .drop-line,
.challenge-zone--yellow .spell-line {
  background: #fff6cf;
  border: 2px solid #f0cf6a;
}

.scene-card {
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #e0e0e0;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.scene-card__bg {
  position: relative;
  min-height: 158px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px;
}

.scene-card__decor {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 18px;
  opacity: 0.9;
  z-index: 3;
}

.scene-card__name {
  position: absolute;
  left: 8px;
  top: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid #d7d7d7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  color: #555;
}

.scene-card__actor {
  font-size: 46px;
  animation: actor-bob 1.2s ease-in-out infinite;
  z-index: 4;
}

.scene-card__bubble {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #d7d7d7;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  z-index: 5;
}

.scene-card__caption {
  font-size: 13px;
  padding: 8px 10px;
  color: #666;
  background: #fafafa;
}

.scene-card__set {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.scene-card__set-item {
  position: absolute;
  font-size: 24px;
  line-height: 1;
  opacity: 0.95;
}

.scene-card__set-item--back {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  opacity: 0.7;
}

.scene-card__set-item--left {
  left: 10px;
  bottom: 38px;
  animation: side-bob 2.4s ease-in-out infinite;
}

.scene-card__set-item--center {
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  font-size: 30px;
  animation: center-pulse 2s ease-in-out infinite;
}

.scene-card__set-item--right {
  right: 10px;
  bottom: 38px;
  animation: side-bob 2.5s ease-in-out infinite reverse;
}

.scene-card__set-item--ground {
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  font-size: 16px;
  opacity: 0.8;
}

.review-sticker-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 10px;
}

.review-sticker {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff8d0;
  border: 2px solid #ffd56a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 0 #e5b84f;
  animation: sticker-pop 0.9s ease-in-out infinite;
}

.review-sticker:nth-child(2) { animation-delay: 0.1s; }
.review-sticker:nth-child(3) { animation-delay: 0.2s; }
.review-sticker:nth-child(4) { animation-delay: 0.3s; }

@keyframes sticker-pop {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.08); }
}

.scene-card--playground .scene-card__bg { background: linear-gradient(180deg, #8ed9ff, #7cca5e); }
.scene-card--school .scene-card__bg { background: linear-gradient(180deg, #b6e2ff, #8ebeff); }
.scene-card--classroom .scene-card__bg { background: linear-gradient(180deg, #ffe8b1, #ffd19a); }
.scene-card--gym .scene-card__bg { background: linear-gradient(180deg, #c3d7ff, #8fb0ff); }
.scene-card--art .scene-card__bg { background: linear-gradient(180deg, #ffd1f0, #ffb4d5); }
.scene-card--track .scene-card__bg { background: linear-gradient(180deg, #9de0ff, #d9b36d); }
.scene-card--booth .scene-card__bg { background: linear-gradient(180deg, #ffd28a, #ffa768); }
.scene-card--final .scene-card__bg { background: linear-gradient(180deg, #c9a7ff, #7f8dff); }
.scene-card--mountain .scene-card__bg { background: linear-gradient(180deg, #a4d7ff, #85b97c); }
.scene-card--finish .scene-card__bg { background: linear-gradient(180deg, #ffb5c6, #ffd37c); }

@keyframes actor-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes side-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes center-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.08); }
}

.story-map {
  margin: 8px 0 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.story-map__node {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  color: #6a6a6a;
  background: #f1f1f1;
  border: 2px solid #ddd;
  border-radius: 999px;
  padding: 4px 8px;
}

.story-map__node--on {
  color: #2f5d12;
  background: #e5f6d8;
  border-color: #98d173;
}

.story-map__node--current {
  background: #fff2bf;
  border-color: #ffb84d;
}

.story-map__link {
  flex: 0 0 14px;
  height: 4px;
  border-radius: 999px;
  background: #d8d8d8;
}

.story-map__link--on {
  background: #9ad56f;
}


.hint-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: #e8f7ff;
  color: var(--duo-blue-dark);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}


.action-bar {
  padding: 12px 0 16px;
}

.action-bar--triple {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 8px;
  align-items: stretch;
}

.action-bar--double {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 8px;
  align-items: stretch;
}

.btn-ghost {
  padding: 14px 8px;
  border-radius: var(--radius);
  border: 2px solid #ffffff;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s;
}

.btn-ghost:active {
  transform: scale(0.98);
}

.btn-grade {
  padding: 14px 8px;
  border-radius: var(--radius);
  border: 2px solid #ff9600;
  background: linear-gradient(180deg, #ffb020, #ff9600);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #c47200;
  transition: transform 0.08s, opacity 0.15s;
}

.btn-grade:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #c47200;
}

.btn-grade:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: 0 4px 0 #d4a574;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--duo-green);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--duo-green-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.15s;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--duo-green-dark);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: 0 4px 0 #a3d18a;
}

.btn-primary:not(:disabled) {
  animation: btn-glow 1.1s ease-in-out infinite;
}

@keyframes btn-glow {
  0%, 100% { filter: saturate(1); }
  50% { filter: saturate(1.2) brightness(1.08); }
}

.level-celebration {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(16, 72, 24, 0.62);
  color: #fff;
  text-align: center;
}

.level-celebration--hidden {
  display: none;
}

.level-celebration__fireworks {
  font-size: 38px;
  animation: fireworks-pop 0.9s ease-in-out infinite;
}

.level-celebration__text {
  margin-top: 14px;
  font-size: 34px;
  font-weight: 900;
  color: #ffef82;
  text-shadow: 0 3px 0 #a76a00;
}

@keyframes fireworks-pop {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.14); opacity: 1; }
}

.btn-secondary {
  margin-top: 12px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  border: 2px solid #ddd;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.screen--loading {
  text-align: center;
  padding: 40px 0;
}

.loading-text {
  color: var(--text-muted);
  font-weight: 600;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-overlay--hidden {
  display: none;
}

.modal {
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__title {
  margin: 0 0 8px;
  font-size: 22px;
  text-align: center;
}

.modal__hint {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.level-btn {
  padding: 14px 4px;
  border-radius: 12px;
  border: 2px solid #e5e5e5;
  background: #fafafa;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}

.level-btn--current {
  border-color: var(--duo-green);
  background: #e8f8e0;
}

.level-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.name-input {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 2px solid #d7d7d7;
  padding: 0 12px;
  font-size: 18px;
  margin-bottom: 12px;
}

.name-evolution {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -2px 0 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7ffe4, #e9ffd0);
  border: 2px solid #bde68e;
}

.name-evolution__frog,
.name-evolution__king {
  font-size: 30px;
  animation: modal-frog-hop 1.4s ease-in-out infinite;
}

.name-evolution__king {
  animation-delay: 0.35s;
}

.name-evolution__arrow {
  font-size: 15px;
  font-weight: 800;
  color: #6b9938;
  letter-spacing: 0.02em;
  animation: modal-magic-glow 1.2s ease-in-out infinite;
}

@keyframes modal-frog-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.08); }
}

@keyframes modal-magic-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.leaderboard-list {
  border: 2px solid #ececec;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.cloud-config-panel {
  border: 2px dashed #d9d9d9;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fafafa;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-rank {
  font-weight: 900;
  color: #6d6d6d;
}

.leaderboard-name {
  font-weight: 800;
}

.leaderboard-score {
  font-weight: 900;
  color: #c47a00;
}

.leaderboard-row--me {
  background: #fff7dc;
}

.letter-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.letter-tile {
  width: 36px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 2px solid #ccc;
  background: #fff;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  user-select: none;
}

.letter-tile--small {
  width: 32px;
  height: 38px;
  font-size: 14px;
}

.spell-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 10px;
  background: #f3f3f3;
  border-radius: var(--radius);
  margin-bottom: 10px;
}

.mode-badge {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--duo-purple);
  margin-bottom: 8px;
}

@media (min-width: 420px) {
  .prompt {
    font-size: 24px;
  }
}

@media (max-width: 760px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
  .route-panel {
    order: 2;
  }
  .stone-route {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .stone-connector {
    display: none;
  }
  .top-bar__reward-row {
    flex-direction: column;
    gap: 8px;
  }
}
