/* menu.css — dùng chung cho Trang chủ, Học (danh sách cấp), Luyện (danh sách 11 dạng)
   và các trang danh sách/chi tiết dạng "thẻ" khác. Cùng bảng màu trầm ấm (gỗ/đồng)
   với play.css (mục 7 quy tắc thiết kế chung dac-ta-giao-dien.md), KHÔNG lặp lại
   toàn bộ style bàn cờ vì các trang này không có bàn cờ tương tác (trừ trang chi
   tiết bài sát cục, dùng chung 1 phần khung + tự thêm style bàn cờ riêng). */

:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --wood-dark: #241a12;
  --wood-mid: #3a2a1a;
  --wood-panel: #4a3826;
  --wood-accent: #caa06a;
  --wood-accent-soft: #e4d2ab;
  --red-accent: #b3261e;
  --red-accent-hover: #8f1e18;
  --green-accent: #2e7d4f;
  --text-main: #f2e9d8;
  --text-muted: #cbbfa6;
  --card-bg: #352616;
  --card-border: #5a442c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: radial-gradient(ellipse at top, var(--wood-mid) 0%, var(--wood-dark) 70%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #2e2115 0%, #241a12 100%);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* ---------- Header dùng chung ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #4a3826 0%, #3a2a1a 100%);
  border-bottom: 2px solid #5a442c;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar__title {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--wood-accent-soft);
  letter-spacing: 0.02em;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #6b5236;
  background: #4a3826;
  color: var(--text-main);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-decoration: none;
}

.icon-btn:hover {
  background: #5a442c;
}

/* ---------- Nội dung cuộn ---------- */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px calc(88px + env(safe-area-inset-bottom));
}

.page-content--no-nav {
  padding-bottom: 20px;
}

.section-title {
  margin: 18px 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--wood-accent-soft);
}

.section-title:first-child {
  margin-top: 4px;
}

.section-subtitle {
  margin: -6px 0 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- Thẻ (card) dùng chung ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card--clickable {
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.15s ease;
}

.card--clickable:hover {
  border-color: var(--wood-accent);
}

.card--clickable:active {
  transform: scale(0.98);
}

.card--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.card__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.card__subtitle {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--wood-panel);
  color: var(--wood-accent-soft);
  white-space: nowrap;
}

.badge--soon {
  background: #4a4038;
  color: #cbbfa6;
}

.badge--demo {
  background: #6b3a1e;
  color: #ffd9b0;
}

.badge--featured {
  background: #7a1f1f;
  color: #ffd7d0;
}

.badge--trap {
  background: #5a2a5a;
  color: #f0d0f5;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.mini-puzzle-list {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.mini-puzzle {
  background: var(--wood-panel);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
}

.mini-puzzle:hover {
  border-color: var(--wood-accent);
}

.mini-puzzle__level {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ---------- Bottom nav (5 mục cố định) ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  display: flex;
  background: linear-gradient(0deg, #3a2a1a 0%, #4a3826 100%);
  border-top: 2px solid #5a442c;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 8;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  text-decoration: none;
}

.bottom-nav__item span.bottom-nav__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.bottom-nav__item[aria-current="page"] {
  color: var(--wood-accent-soft);
  background: rgba(202, 160, 106, 0.14);
}

.bottom-nav__item:disabled,
.bottom-nav__item.is-soon {
  color: #8a7d6a;
}

/* ---------- Toast "Sắp có" ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  background: #2e2115;
  border: 1px solid var(--wood-accent);
  color: var(--wood-accent-soft);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  z-index: 20;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
}

/* ---------- Hero / chào mừng ở Trang chủ ---------- */
.hero {
  background: linear-gradient(160deg, var(--wood-panel) 0%, #2e2115 100%);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 6px;
}

.hero__title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--wood-accent-soft);
}

.hero__subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 4px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
}

.quick-action:hover {
  border-color: var(--wood-accent);
}

.quick-action__icon {
  font-size: 1.6rem;
}

/* ---------- Nút cơ bản ---------- */
button,
.btn {
  background: var(--red-accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

button:disabled {
  background: #6b6156;
  color: #cfc6b8;
  cursor: not-allowed;
}

button:hover:not(:disabled),
.btn:hover {
  background: var(--red-accent-hover);
}

.btn-primary {
  width: 100%;
  background: var(--green-accent);
  padding: 13px 10px;
  font-size: 1rem;
}

.btn-primary:hover:not(:disabled) {
  background: #256b41;
}

.btn-secondary {
  width: 100%;
  background: var(--wood-panel);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover:not(:disabled) {
  background: #5a442c;
}

.empty-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 30px 10px;
}
