/* 天智 · 单词练习游戏壳 */
.head h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4.5vw, 40px);
  color: #12315f;
  letter-spacing: -0.03em;
}

.head .sub,
.sub {
  font-size: 15px;
  line-height: 1.75;
  color: #5a6b86;
  font-weight: 650;
  max-width: 760px;
}

.controls {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #dbe7f8;
  box-shadow: 0 10px 26px rgba(33, 70, 135, 0.08);
}

.group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.lab {
  min-width: 42px;
  font-size: 14px;
  font-weight: 900;
  color: #507a68;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seg button {
  border: 1px solid #dbe7f8;
  background: #fff;
  color: #294b7f;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 850;
  font-size: 14px;
  cursor: pointer;
}

.seg button.on {
  background: linear-gradient(180deg, #2c6bff, #1d4dcc);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(37, 99, 255, 0.18);
}

.stat {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat .item {
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #e5eefb;
  text-align: center;
}

.stat .item.best {
  background: #fff8e8;
  border-color: rgba(255, 180, 61, 0.35);
}

.stat .num {
  font-size: 24px;
  font-weight: 950;
  color: #12315f;
  line-height: 1.1;
}

.stat .cap {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #758398;
}

.board {
  display: grid;
  gap: 12px;
  margin: 8px 0 16px;
}

.board .card {
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
}

.board .card .inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.42s ease;
}

.board .card.open .inner,
.board .card.matched .inner {
  transform: rotateY(180deg);
}

.board .card .face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  border-radius: 18px;
  border: 2px solid #dbe7f8;
  box-shadow: 0 8px 20px rgba(33, 70, 135, 0.08);
}

.board .card .back {
  background: linear-gradient(135deg, #fff7df, #eef7ff);
  font-size: 28px;
}

.board .card .front {
  transform: rotateY(180deg);
  background: #fff;
}

.board .card .front.emoji {
  font-size: clamp(34px, 8vw, 52px);
}

.board .card .front.word {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.board .card .front .en {
  font-size: clamp(16px, 3.5vw, 22px);
  font-weight: 950;
  color: #12315f;
}

.board .card .front .cn {
  font-size: 13px;
  font-weight: 800;
  color: #5a6b86;
}

.board .card.wrong .front {
  border-color: #ffb4b4;
  animation: wobble 0.35s ease;
}

.board .card.matched .front {
  border-color: #77ddbd;
  background: #f3fff9;
}

@keyframes wobble {
  0%,
  100% {
    transform: rotateY(180deg);
  }
  50% {
    transform: rotateY(180deg) scale(0.96);
  }
}

.prompt {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dbe7f8;
}

.listen-btn {
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #2c6bff, #1d4dcc);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(37, 99, 255, 0.2);
}

.prompt .hint {
  font-size: 15px;
  font-weight: 750;
  color: #526173;
}

.prompt .again {
  border: 0;
  background: #eef4ff;
  color: #2563ff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 850;
  cursor: pointer;
}

.opts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.opts button {
  aspect-ratio: 1;
  border: 2px solid #dbe7f8;
  border-radius: 18px;
  background: #fff;
  font-size: clamp(34px, 8vw, 48px);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(33, 70, 135, 0.06);
  transition: transform 0.15s ease;
}

.opts button:hover {
  transform: translateY(-2px);
}

.opts button.correct {
  border-color: #77ddbd;
  background: #f3fff9;
}

.opts button.wrong {
  border-color: #ffb4b4;
  animation: wobble 0.35s ease;
}

.stage {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dbe7f8;
}

.stage .emoji {
  font-size: clamp(48px, 12vw, 72px);
}

.stage .cn {
  font-size: 20px;
  font-weight: 900;
  color: #12315f;
}

.stage .say,
.hintbtn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: #eef4ff;
  color: #2563ff;
  font-weight: 850;
  cursor: pointer;
}

.slots,
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.slots .slot,
.tiles .tile {
  min-width: 42px;
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 950;
}

.slots .slot {
  border: 2px dashed #c5d8f5;
  background: #f8fbff;
  color: #12315f;
}

.tiles .tile {
  border: 0;
  background: linear-gradient(180deg, #2c6bff, #1d4dcc);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(37, 99, 255, 0.18);
}

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

.dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dbe7f8;
}

.dots span.on {
  background: #2563ff;
}

.dots span.done {
  background: #2aa86a;
}

.cheer {
  min-height: 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 850;
  color: #1f8b7b;
  margin: 8px 0;
}

.done,
.done-box {
  display: none;
  margin: 16px auto;
  max-width: 520px;
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid #dbe7f8;
  box-shadow: 0 16px 38px rgba(34, 74, 136, 0.12);
  text-align: center;
}

.done.show,
.done-box.show {
  display: block;
}

.done .big,
.done-box .big {
  font-size: 24px;
  font-weight: 950;
  color: #12315f;
  margin-bottom: 8px;
}

.done .small,
.done-box .small {
  font-size: 15px;
  line-height: 1.7;
  color: #526173;
  font-weight: 700;
  margin-bottom: 14px;
}

.done .record {
  color: #c86910;
  font-weight: 900;
}

.btn.primary,
.btn.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  margin: 4px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  border: 0;
}

.btn.primary {
  background: linear-gradient(180deg, #2c6bff, #1d4dcc);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 255, 0.18);
}

.btn.ghost {
  background: #fff;
  color: #174075;
  border: 1px solid #dbe7f8;
}

.note {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #e5eefb;
  font-size: 14px;
  line-height: 1.7;
  color: #5a6b86;
  font-weight: 650;
}

@media (max-width: 560px) {
  .controls {
    padding: 14px;
  }
  .stat {
    width: 100%;
  }
  .stat .item {
    flex: 1;
  }
}
