/* ============================================================
   menu.css —— 主菜单 / 记录面板
   悬浮在棋盘正中央，背景半透明，能看到后面的棋盘。
   ============================================================ */

.menu-screen {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  background: rgba(247, 242, 231, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.menu-screen.hidden {
  display: none !important;
}

/* ---------------- 标题 ---------------- */

.game-title {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #3a332a;
  text-shadow: 0 2px 8px rgba(180, 140, 70, 0.22);
}

/* ---------------- 按钮 ---------------- */

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 180px;
}

.menu-btn {
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid rgba(165, 140, 95, 0.28);
  background: #fffdf9;
  color: #4a4238;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(150, 120, 70, 0.10);
  transition: background 0.1s, transform 0.1s;
  font-family: inherit;
}

.menu-btn:active {
  background: #f2ebdd;
  transform: scale(0.97);
}

.menu-btn-primary {
  background: #cf9633;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 0 rgba(150, 105, 25, 0.35);
}

.menu-btn-primary:active {
  background: #b9822a;
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(150, 105, 25, 0.35);
}

.menu-btn-back {
  margin-top: 4px;
  width: 180px;
}

/* ---------------- 记录：标签页 ---------------- */

.tabs {
  display: flex;
  gap: 8px;
  width: 220px;
}

.tab {
  flex: 1;
  height: 40px;
  border: 1px solid rgba(165, 140, 95, 0.28);
  background: #fffdf9;
  color: #6b6154;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}

.tab.active {
  background: #cf9633;
  color: #fff;
  border-color: transparent;
}

/* ---------------- 记录：面板 ---------------- */

.tab-panel {
  width: 220px;
  min-height: 130px;
  background: rgba(255, 253, 249, 0.9);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(165, 140, 95, 0.18);
  box-sizing: border-box;
}

.score-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fffdf9;
  border-radius: 8px;
  border: 1px solid rgba(165, 140, 95, 0.12);
}

.score-item .rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f0e3c8;
  color: #8a6a2a;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.score-item:nth-child(1) .rank {
  background: #f5d76e;
  color: #6a4a00;
}

.score-item:nth-child(2) .rank {
  background: #dcdcdc;
  color: #555;
}

.score-item:nth-child(3) .rank {
  background: #e4b98a;
  color: #6a3a10;
}

.score-item .score {
  font-size: 16px;
  font-weight: 700;
  color: #3a332a;
  font-variant-numeric: tabular-nums;
}

.score-item .captured {
  margin-left: auto;
  font-size: 12px;
  color: #8d8271;
}

.empty-text {
  text-align: center;
  color: #a3947c;
  font-size: 13px;
  margin: 30px 0;
}

/* ============================================================
   设置面板
   ============================================================ */

#settings-screen {
  justify-content: flex-start;
  overflow-y: auto;
  padding: 20px 16px;
  gap: 12px;
}

.settings-title {
  font-size: 26px;
  letter-spacing: 0.10em;
  margin: 0 0 4px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 260px;
  flex-shrink: 0;
}

.settings-section-title {
  margin: 4px 0 0;
  padding-left: 2px;
  font-size: 12px;
  color: #a3947c;
  letter-spacing: 0.08em;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px 6px 12px;
  min-height: 40px;
  background: #fffdf9;
  border: 1px solid rgba(165, 140, 95, 0.18);
  border-radius: 10px;
  font-size: 14px;
  color: #4a4238;
}

.settings-label {
  flex-shrink: 0;
}

/* 按键槽 */

.key-slots {
  display: flex;
  gap: 6px;
}

.key-slot {
  min-width: 48px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(165, 140, 95, 0.28);
  background: #faf6ed;
  color: #4a4238;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s;
}

.key-slot:active {
  background: #f0e8d5;
}

.key-slot.empty {
  color: #b9ad9a;
  font-weight: 400;
}

.key-slot.capturing {
  background: #fbeecb;
  border-color: #cf9633;
  color: #8a5f13;
  font-weight: 600;
}

/* 开关 */

.switch-btn {
  min-width: 56px;
  height: 28px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(165, 140, 95, 0.28);
  background: #fffdf9;
  color: #6b6154;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.switch-btn.on {
  background: #cf9633;
  color: #fff;
  border-color: transparent;
}

/* 触摸屏提示 */

.settings-note {
  width: 260px;
  margin: 4px 0;
  font-size: 12px;
  color: #a3947c;
  text-align: center;
}

/* 底部按钮 */

.settings-buttons {
  display: flex;
  gap: 10px;
  width: 260px;
  flex-shrink: 0;
  margin-top: 4px;
}

.settings-buttons .menu-btn {
  flex: 1;
  width: auto;
  padding: 0 10px;
}

/* ---------------- 世界榜单：限制高度，内部滚动 ---------------- */

#tab-world .world-list {
  max-height: 240px;
  margin: 0;
}