:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-solid: #eceff5;
  --line: #e5e9f0;
  --text: #1d2129;
  --dim: #86909c;
  --accent: #0989E2;
  --accent-2: #36cfc9;
  --warn: #e07a3f;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

.game-card--dark {
  background: transparent;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 外层容器透明：去掉外壳给 rounded-2xl 加的边框 */
.ot_workspace__inner .game-card {
  border: 0;
  box-shadow: none;
}

.page {
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px 64px;
  display: grid;
  gap: 20px;
}

/* ---------- 顶部 ---------- */
.page__head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 20px;
}

.page__title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.page__sub {
  margin: 0;
  max-width: 620px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--dim);
}

/* ---------- 数据条 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  display: grid;
  gap: 6px;
}

.stat__label {
  font-size: 12px;
  color: var(--dim);
}

.stat__value {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.stat__value--accent {
  color: var(--accent);
  font-size: 17px;
}

/* ---------- 训练区 ---------- */
.board {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(31, 54, 96, 0.08);
}

.board__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #16203a 0%, #0a0f1c 78%);
  cursor: crosshair;
}

.board__stage.is-locked {
  cursor: default;
}

#stage {
  display: block;
  width: 100%;
  height: 100%;
}

.board__progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.board__progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0 99px 99px 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.12s linear;
}

.board__hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(7, 11, 19, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12.5px;
  color: rgba(233, 240, 250, 0.82);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.board__stage.has-overlay .board__hint {
  opacity: 0;
}

/* ---------- 结算 / 开始遮罩 ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 10, 18, 0.74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.overlay__panel {
  width: min(400px, 100%);
  padding: 26px 24px 22px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(26, 36, 56, 0.96), rgba(15, 22, 36, 0.96));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

.overlay__emoji {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1;
}

.overlay__title {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 600;
}

.overlay__desc {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--dim);
}

.overlay__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- 底部控制 ---------- */
.board__controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 4px 2px;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 6px;
  flex: none;
}

.field__label {
  font-size: 12px;
  color: var(--dim);
}

.field__select {
  padding: 9px 12px;
  min-width: 108px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-solid);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.field__select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.board__controls .btn--primary {
  margin-left: auto;
  min-width: 132px;
}

/* ---------- 按钮 ---------- */
.btn {
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 11px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.24s ease, background 0.24s ease, color 0.24s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(120deg, var(--accent), #0ea5e9);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(9,137,226, 0.24);
}

.btn--primary:hover {
  box-shadow: 0 14px 30px rgba(9,137,226, 0.34);
}

.btn--ghost {
  border-color: var(--line);
  background: #f0f2f5;
  color: #4e5969;
}

.btn--ghost:hover {
  background: #e5e9f0;
  color: #1d2129;
}

/* 音效开关：确保有可见背景 */
#soundBtn {
  background: rgba(9,137,226, 0.1);
  border-color: rgba(9,137,226, 0.35);
  color: var(--accent);
}

#soundBtn[aria-pressed="false"] {
  background: var(--panel-solid);
  border-color: var(--line);
  color: var(--dim);
}

/* ---------- 底部介绍 ---------- */
.intro-footer {
  margin-top: 4px;
}

.intro-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.intro-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(50, 70, 100, 0.08);
  padding: 24px 26px;
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 18px;
  align-items: center;
}

.intro-card__icon {
  grid-row: 1 / span 2;
  font-size: 30px;
}

.intro-card__title {
  align-self: end;
  margin: 0;
  font-size: 17px;
  margin-bottom: 6px;
  color: #2c3e50;
}

.intro-card__text {
  align-self: start;
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  color: #5a6a7e;
}

.intro-card__text strong {
  color: #0989E2;
  font-weight: 600;
}

/* 最近记录卡片：列表占据文本行 */
.intro-card--history .intro-card__title {
  align-self: center;
}

.intro-card--history .history {
  align-self: start;
}

.history {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 12.5px;
  color: var(--dim);
}

.history__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px dashed #e5e9f0;
}

.history__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.history__level {
  color: var(--text);
}

.history__meta {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.history__item.is-fail .history__level {
  color: var(--warn);
}

.history__empty {
  color: rgba(139, 154, 180, 0.7);
}

/* ---------- 响应式 ---------- */
@media (max-width: 680px) {
  .page {
    padding: 12px 14px 48px;
  }

  .page__head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .board__stage {
    aspect-ratio: 4 / 3;
  }

  .board__controls .btn--primary {
    margin-left: 0;
    flex: 1;
  }

  .board__hint {
    font-size: 11.5px;
    padding: 5px 12px;
  }
}
