/* ============================================================
   游戏工坊 · 学生端样式（关卡列表 + 闯关答题）
   ============================================================
   与 tower.css / lab.css 同一套暖纸质配色。
   手机端（<760px）自动切换为单栏卡片。
   ============================================================ */

.game-host {
  --g-paper: #efeee3;
  --g-white: #faf9f2;
  --g-ink: #2c4034;
  --g-soft: #7a806d;
  --g-line: #d9dccd;
  --g-gold: #a87c4b;
  --g-green: #526d4e;
  --g-tip: #eaf0e2;
  --g-warn: #f4ead9;
  --g-wrong: #f6e0d4;
  color: var(--g-ink);
  font-family: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.8;
  padding: 4px 2px 24px;
}
.game-host *, .game-host *::before, .game-host *::after { box-sizing: border-box; }
.game-host button { font-family: inherit; cursor: pointer; }

.game-loading, .game-empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--g-soft);
  background: var(--g-white);
  border: 1px solid var(--g-line);
  border-radius: 14px;
}
.game-loading b, .game-empty b {
  display: block;
  color: var(--g-ink);
  font-size: 17px;
  margin-bottom: 6px;
}

/* ---------- 顶部 ---------- */
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.game-top-title h2 { margin: 0; font-size: 21px; }
.game-top-title p { margin: 2px 0 0; font-size: 13px; color: var(--g-soft); }
.game-star-sum {
  font-size: 20px;
  font-weight: 600;
  color: var(--g-gold);
  background: var(--g-warn);
  border: 1px solid #e3d3b7;
  border-radius: 20px;
  padding: 4px 16px;
  white-space: nowrap;
}

/* ---------- 关卡卡片 ---------- */
.game-featured-head {
  margin: 4px 0 10px;
  font-size: 13px;
  color: var(--g-green);
  font-weight: 600;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.game-card {
  background: var(--g-white);
  border: 1px solid var(--g-line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s ease, transform .15s ease;
}
.game-card:hover { border-color: var(--g-gold); transform: translateY(-2px); }
.game-card.perfect { border-color: var(--g-gold); background: #fdfaf1; }
.game-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.game-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--g-tip);
  color: var(--g-green);
  font-size: 14px;
  font-weight: 600;
}
.game-stars i {
  font-style: normal;
  font-size: 16px;
  color: #d8d5c4;
}
.game-stars i.on { color: var(--g-gold); }
.game-card h4 { margin: 2px 0 0; font-size: 16px; }
.game-sub { margin: 0; font-size: 12.5px; color: var(--g-soft); }
.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  font-size: 12px;
  color: var(--g-soft);
}
.game-best { font-size: 12px; color: var(--g-green); }
.game-card-foot { margin-top: auto; padding-top: 8px; }
.game-go { font-size: 13px; color: var(--g-gold); font-weight: 600; }

/* ---------- 闯关 ---------- */
.game-run-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.game-run-back {
  border: 1px solid var(--g-line);
  background: var(--g-white);
  color: var(--g-ink);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13.5px;
}
.game-run-back:hover { background: var(--g-tip); }
.game-run-title b { display: block; font-size: 16px; }
.game-run-title span { font-size: 12px; color: var(--g-soft); }
.game-run-progress {
  flex: 1;
  min-width: 120px;
  height: 8px;
  background: var(--g-white);
  border: 1px solid var(--g-line);
  border-radius: 6px;
  overflow: hidden;
}
.game-run-progress i {
  display: block;
  height: 100%;
  background: var(--g-green);
  transition: width .25s ease;
}

.game-q {
  background: var(--g-white);
  border: 1px solid var(--g-line);
  border-radius: 14px;
  padding: 20px 22px 22px;
}
.game-q-type {
  display: inline-block;
  font-size: 12px;
  color: var(--g-green);
  background: var(--g-tip);
  border-radius: 20px;
  padding: 2px 12px;
  margin-bottom: 8px;
}
.game-q-title {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.game-q-hint { font-size: 12.5px; color: var(--g-soft); margin: 6px 0 0; }
.game-play {
  display: inline-block;
  border: 1px solid var(--g-gold);
  background: var(--g-warn);
  color: var(--g-gold);
  border-radius: 10px;
  padding: 9px 22px;
  font-size: 15px;
  font-weight: 600;
}
.game-play:hover { background: #f0e3cb; }
.game-play:active { transform: scale(.97); }

.game-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 6px;
}
.game-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--g-line);
  background: var(--g-white);
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 15px;
  color: var(--g-ink);
  transition: border-color .12s ease, background .12s ease;
}
.game-opt:hover:not(:disabled) { border-color: var(--g-green); background: var(--g-tip); }
.game-opt:disabled { cursor: default; opacity: .75; }
.game-opt i {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--g-paper);
  border: 1px solid var(--g-line);
  font-size: 13px;
  flex-shrink: 0;
}
.game-opt.correct {
  border-color: var(--g-green);
  background: var(--g-tip);
  opacity: 1;
}
.game-opt.correct i { background: var(--g-green); border-color: var(--g-green); color: #fff; }
.game-opt.wrong {
  border-color: #cf8a6a;
  background: var(--g-wrong);
  opacity: 1;
}
.game-opt.wrong i { background: #cf8a6a; border-color: #cf8a6a; color: #fff; }

.game-feedback { margin-top: 6px; }
.game-answer {
  border-radius: 10px;
  padding: 12px 16px;
  margin: 10px 0;
  font-size: 15px;
}
.game-answer.ok { background: var(--g-tip); border: 1px solid #c5d6b5; color: var(--g-green); }
.game-answer.no { background: var(--g-wrong); border: 1px solid #e3c4ae; color: #8a4f2d; }
.game-answer p { margin: 6px 0 0; font-size: 13.5px; color: var(--g-soft); }
.game-next {
  border: none;
  background: var(--g-green);
  color: #fff;
  border-radius: 9px;
  padding: 10px 26px;
  font-size: 15px;
  font-weight: 600;
}
.game-next:hover { background: #3f5a3b; }

/* ---------- 结算 ---------- */
.game-result {
  background: var(--g-white);
  border: 1px solid var(--g-line);
  border-radius: 16px;
  padding: 34px 26px;
  text-align: center;
}
.game-result-stars i {
  font-style: normal;
  font-size: 40px;
  color: #d8d5c4;
  letter-spacing: 6px;
}
.game-result-stars i.on { color: var(--g-gold); }
.game-result-score { font-size: 34px; font-weight: 600; margin-top: 4px; }
.game-result-score small { font-size: 16px; color: var(--g-soft); font-weight: 400; }
.game-result-rate { color: var(--g-soft); margin: 4px 0 0; }
.game-result-wrong { color: var(--g-gold); margin: 8px 0 0; }
.game-result-acts {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.game-act {
  border: 1px solid var(--g-line);
  background: var(--g-white);
  color: var(--g-ink);
  border-radius: 9px;
  padding: 9px 20px;
  font-size: 14px;
}
.game-act:hover { background: var(--g-tip); }
.game-act.primary { background: var(--g-green); border-color: var(--g-green); color: #fff; }
.game-act.primary:hover { background: #3f5a3b; }
.game-act.alt { background: var(--g-paper); }
.game-result-note { margin: 16px 0 0; font-size: 12px; color: var(--g-soft); }

.game-toast {
  position: sticky;
  bottom: 12px;
  justify-self: center;
  background: rgba(44, 64, 52, .94);
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
}

/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  .game-grid { grid-template-columns: 1fr; }
  .game-top { flex-direction: column; align-items: flex-start; }
  .game-q { padding: 16px 14px 18px; }
  .game-result { padding: 26px 16px; }
}
