:root {
  --bg: #fff8e7;
  --card: #ffffff;
  --ink: #2f2a2a;
  --primary: #ff8e3c;
  --accent: #4da8da;
  --success: #2e9a57;
  --warn: #d9534f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff4d4 0%, var(--bg) 55%);
}

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
  display: grid;
  gap: 14px;
  grid-template-rows: auto auto auto 1fr auto;
}

.topbar,
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
}

.game-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.prompt,
.game-area,
.choices {
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
}

.prompt {
  min-height: 64px;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-area {
  display: grid;
  place-items: center;
  min-height: 180px;
}

.choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(56px, 1fr));
  gap: 10px;
}

button {
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
  width: 100%;
}

.ghost-btn {
  background: #f0f4ff;
  color: #30416d;
  padding: 0 14px;
}

.warn-btn {
  background: var(--warn);
  color: #fff;
}

.hidden {
  display: none;
}

.choice-btn {
  background: #f6f6ff;
  color: #23263b;
}

.choice-btn.correct {
  background: var(--success);
  color: #fff;
}

.choice-btn.wrong {
  background: #fce5e4;
  color: #7f2622;
}

.dot-grid {
  display: grid;
  grid-template-columns: repeat(5, 44px);
  gap: 8px;
}

.dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffd166;
}

.match-board {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px;
}

.drop-zone {
  min-height: 120px;
  border: 3px dashed #c8d6ff;
  border-radius: 12px;
  padding: 8px;
}

.drop-zone.good {
  border-color: var(--success);
}

.drag-num {
  background: var(--accent);
  color: #fff;
}

.seq-wrap {
  display: flex;
  gap: 10px;
  font-size: 2rem;
  align-items: center;
}

dialog {
  border: 0;
  border-radius: 16px;
  padding: 16px;
  width: min(420px, 90vw);
}

.controls {
  display: grid;
  gap: 10px;
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.45rem;
  }
  .choices {
    grid-template-columns: repeat(3, minmax(56px, 1fr));
  }
}
