/* The smaller menu pages as game screens: Academy, Milestones, Music, FAQ,
   About, Features, Replays and Players. Each wraps its old content in the
   trophy-hall frame from public/achievements-hall.css (.ach-hall +
   .ach-hall-frame + iron brackets) and adds .mh-hall, which re-points the
   theme tokens so the older rules read light-on-dark in both themes.
   Linked last in views/layout.jsx so it wins over each page's own sheet. */

.mh-hall {
  --text: #f6e9cc;
  --papyrus-text: #f6e9cc;
  --surface-border: rgba(255, 220, 160, 0.16);
  --surface-subtle: rgba(18, 14, 10, 0.62);
  --surface-hover: rgba(255, 210, 58, 0.1);
  --cloud-bg: rgba(18, 14, 10, 0.62);
  --cloud-bg2: rgba(18, 14, 10, 0.62);
  --panel-bg: rgba(18, 14, 10, 0.62);
  --music-accent: #ffd23a;
  --music-accent-soft: rgba(255, 210, 58, 0.16);
  --music-card-bg: rgba(30, 24, 16, 0.97);
  --mh-gold: #ffd23a;
  --mh-ink-dim: #d4c39f;
  --mh-edge: rgba(255, 220, 160, 0.16);
  --mh-panel: rgba(18, 14, 10, 0.62);
  font-family: "Comfortaa", sans-serif;
  color: var(--text);
}
.mh-hall .ach-hall-frame.mh-frame {
  width: auto;
  max-width: 880px;
  padding: 16px 20px 22px;
  box-sizing: border-box;
}
.mh-hall .ach-hall-frame.mh-narrow { max-width: 780px; }
.mh-hall .ach-hall-frame button { margin: 0; }
.mh-hall .text { color: var(--text); }

/* ── Shared pieces ── */
.mh-hall .mh-title {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 clamp(1.3rem, 1rem + 1.2vw, 1.8rem)/1.15 "Cinzel", serif;
  letter-spacing: 0.04em;
  color: #ffe9b0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}
.mh-hall .mh-title i { color: var(--mh-gold); margin: 0; }
.mh-hall .mh-title-center { justify-content: center; }
.mh-hall .mh-subtitle {
  margin: 0 0 8px;
  font: 700 0.95rem/1.2 "Cinzel", serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffe9b0;
}
.mh-hall .mh-panel {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--mh-panel);
  border: 1px solid var(--mh-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 12px rgba(0, 0, 0, 0.35);
}
.mh-hall a:not([class]) { color: #ffe27a; }

/* ── About ── */
.mh-about p.text { line-height: 1.65; margin: 0 0 12px; font-size: 0.95rem; }
.mh-about p.text:last-child { margin: 16px 0 0; text-align: center; font-family: "Cinzel", serif; font-weight: 700; color: #ffe27a; }

/* ── Features ── */
.mh-features .mh-frame { display: flex; flex-direction: column; gap: 12px; }
.mh-feature-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.mh-feature-list li {
  position: relative;
  padding-left: 18px;
  line-height: 1.45;
  font-size: 0.9rem;
  color: var(--mh-ink-dim);
}
.mh-feature-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--mh-gold);
}
.mh-feature-list strong { color: #fff; }

/* ── FAQ ── */
.mh-faq .faq-wrapper { padding-bottom: 22px; }
.mh-faq .faq-header { padding: 0 0 12px; margin-bottom: 16px; border-bottom: 1px solid var(--mh-edge); }
.mh-faq .faq-header h1 {
  font: 700 clamp(1.25rem, 1rem + 1.1vw, 1.7rem)/1.15 "Cinzel", serif;
  color: #ffe9b0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}
.mh-faq .faq-header h1 i { color: var(--mh-gold); }
.mh-faq .faq-header > p { color: var(--mh-ink-dim); opacity: 1; }
.mh-faq .faq-section { margin-bottom: 18px; }
.mh-faq .faq-category {
  font: 700 0.8rem/1 "Cinzel", serif;
  letter-spacing: 0.1em;
  color: var(--mh-gold);
  opacity: 1;
}
.mh-faq .faq-item {
  background: var(--mh-panel);
  border: 1px solid var(--mh-edge);
  border-radius: 10px;
}
.mh-faq .faq-item[open] { border-color: rgba(255, 210, 58, 0.45); }
.mh-faq .faq-question { color: #fff; }
.mh-faq .faq-question:hover { background: rgba(255, 210, 58, 0.06); }
.mh-faq .faq-chevron { color: var(--mh-gold); }
.mh-faq .faq-answer { color: var(--mh-ink-dim); opacity: 1; }
.mh-faq .faq-footer { color: var(--mh-ink-dim); border-top-color: var(--mh-edge); }
.mh-faq .faq-link { color: #ffe27a; }

/* ── Milestones (the page draws its own dark cards inline) ── */
.milestones-page.mh-hall { display: block !important; }
.milestones-page .milestone-featured { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }

/* ── Music ── */
.music-page.mh-hall { display: block; }
.mh-hall .music-panel { display: flex; flex-direction: column; gap: 16px; }
.mh-hall .music-intro { color: var(--mh-ink-dim); }
.mh-hall .music-subheading { font-family: "Cinzel", serif; color: #ffe9b0; }
.mh-hall .music-now {
  border: 1px solid rgba(255, 210, 58, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* ── Academy ── */
.academy-page-wrap.mh-hall { display: block; }
.mh-hall .academy-page-panel { max-width: 900px; }
.mh-hall .academy-page-subtitle { color: var(--mh-ink-dim); opacity: 1; }
.mh-hall .academy-progress-block,
.mh-hall .academy-episode-card {
  background: var(--mh-panel);
  border-color: var(--mh-edge);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 3px 8px rgba(0, 0, 0, 0.3);
}
.mh-hall .academy-progress-row { font-family: "Cinzel", serif; }
.mh-hall .academy-progress-value { color: var(--mh-gold); }
.mh-hall .academy-progress-track { background: rgba(0, 0, 0, 0.5); height: 12px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); }
.mh-hall .academy-progress-fill { background: linear-gradient(180deg, #ffe48a 0%, #f0b52e 55%, #c98a12 100%); }
.mh-hall .academy-episode-title { font-family: "Cinzel", serif; color: #fff; }
.mh-hall .academy-episode-summary { color: var(--mh-ink-dim); opacity: 1; font-size: 0.88rem; }
.mh-hall .academy-episode-card.is-completed { border-color: rgba(255, 210, 58, 0.5); }
.mh-hall .academy-episode-card.is-locked { opacity: 0.6; }
.mh-hall .academy-episode-action {
  border: 2px solid #7a5310;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe48a 0%, #f0b52e 55%, #c98a12 100%);
  color: #3d2000;
  font-family: "Cinzel", serif;
  font-weight: 800;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 3px 0 #6b4410;
}
.mh-hall .academy-episode-action:hover { opacity: 1; filter: brightness(1.06); }
.mh-hall .academy-episode-action.locked,
.mh-hall .academy-episode-card.is-archive .academy-episode-action {
  border: 1px solid rgba(200, 150, 12, 0.55);
  background: linear-gradient(180deg, rgba(48, 44, 40, 0.92), rgba(22, 20, 18, 0.95));
  color: var(--text);
  box-shadow: none;
}
.mh-hall .academy-episode-action.locked { opacity: 0.7; }
.mh-hall .academy-episode-status.lock { background: rgba(0, 0, 0, 0.45); color: var(--mh-ink-dim); }
.mh-hall .academy-onboarding-card {
  border: 2px solid #6ad06a;
  background: linear-gradient(135deg, rgba(60, 120, 60, 0.4), var(--mh-panel) 60%);
}
.mh-hall .academy-onboarding-card .academy-episode-action {
  border-color: #2f6b2f;
  background: linear-gradient(180deg, #a5ec8f 0%, #6ad06a 55%, #3f9a3f 100%);
  color: #10280f;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 #255a25;
}
.mh-hall .academy-archive { border-top-color: var(--mh-edge); }
.mh-hall .academy-archive-title { font-family: "Cinzel", serif; color: #ffe9b0; opacity: 1; }
.mh-hall .academy-archive-subtitle { color: var(--mh-ink-dim); opacity: 1; }
.mh-hall .academy-episode-card.is-archive { background: rgba(0, 0, 0, 0.25); box-shadow: none; }

/* ── Replays ── */
.mh-replays .replays-page { max-width: 860px; margin: 0 auto; padding: 16px 20px 22px; }
.mh-replays .replays-page-header { margin-bottom: 4px; }
.mh-replays .replays-page-header .mh-title { margin: 0; }
.mh-replays .replays-quota {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 210, 58, 0.35);
  color: var(--mh-ink-dim);
  font-size: 0.8rem;
}
.mh-replays .replays-section-title {
  margin: 18px 0 8px;
  font: 700 0.95rem/1.2 "Cinzel", serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffe9b0;
}
.mh-replays .replays-section-hint {
  font-family: "Comfortaa", sans-serif;
  text-transform: none;
  letter-spacing: 0;
  color: var(--mh-ink-dim);
}
.mh-replays .replays-row,
.mh-replays .replays-empty,
.mh-replays .replays-missing {
  background: var(--mh-panel);
  border: 1px solid var(--mh-edge);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 3px 8px rgba(0, 0, 0, 0.3);
}
.mh-replays .replays-empty,
.mh-replays .replays-missing { color: var(--mh-ink-dim); opacity: 1; font-size: 0.9rem; line-height: 1.5; }
.mh-replays .replays-row:hover { border-color: rgba(255, 210, 58, 0.55); }
.mh-replays .replays-row-title { font-family: "Cinzel", serif; }
.mh-replays .replays-row-title i { color: var(--mh-gold); }
.mh-replays .replays-row-mode { background: rgba(0, 0, 0, 0.45); color: var(--mh-ink-dim); }

/* ── Players ── */
.mh-players .players-container { max-width: 760px; margin: 0 auto; padding: 16px 20px 22px; }
.mh-players .players-header { margin-bottom: 14px; gap: 10px 14px; }
.mh-players .players-title { margin: 0; flex: 1; }
.mh-players .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(200, 150, 12, 0.55);
  background: linear-gradient(180deg, rgba(48, 44, 40, 0.92), rgba(22, 20, 18, 0.95));
  color: var(--text);
  font: 700 0.82rem/1 "Cinzel", serif;
  text-decoration: none;
  cursor: pointer;
}
.mh-players .back-link i { color: var(--mh-gold); }
.mh-players .players-count {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 210, 58, 0.35);
  color: var(--mh-ink-dim);
  font-size: 0.78rem;
}
.mh-players .players-search,
.mh-players .players-search-locked {
  border-radius: 10px;
  border: 1px solid var(--mh-edge);
  background: rgba(0, 0, 0, 0.45);
  color: var(--mh-ink-dim);
}
.mh-players .players-search-input { color: var(--text); background: transparent; }
.mh-players .players-search-icon { color: var(--mh-gold); }
.mh-players .player-card {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--mh-panel);
  border: 1px solid var(--mh-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 3px 8px rgba(0, 0, 0, 0.3);
}
.mh-players .player-card:hover { border-color: rgba(255, 210, 58, 0.55); transform: translateY(-1px); }
.mh-players .player-rank { font-family: "Cinzel", serif; color: var(--mh-ink-dim); opacity: 1; min-width: 34px; }
.mh-players .player-card:nth-child(1) .player-rank { color: #ffd23a; }
.mh-players .player-card:nth-child(2) .player-rank { color: #d8dde3; }
.mh-players .player-card:nth-child(3) .player-rank { color: #d98c4a; }
.mh-players .player-name { font-family: "Cinzel", serif; font-weight: 700; color: #fff; }
.mh-players .player-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-player-crest svg { width: 30px; height: auto; }
.mh-players .player-stat { color: var(--mh-ink-dim); opacity: 1; }
.mh-players .player-stat i { color: var(--mh-gold); }
.mh-players .player-action-btn {
  border-radius: 10px;
  border: 1px solid rgba(200, 150, 12, 0.55);
  background: linear-gradient(180deg, rgba(48, 44, 40, 0.92), rgba(22, 20, 18, 0.95));
  color: var(--text);
}
.mh-players .player-action-btn:hover:not(:disabled) { border-color: rgba(230, 206, 106, 0.9); color: #fff; }
.mh-players .player-action-btn i { color: var(--mh-gold); }
.mh-players .player-you-badge { color: var(--mh-gold); }
.mh-players .players-empty,
.mh-players .players-list-footer {
  border-radius: 12px;
  background: var(--mh-panel);
  border: 1px solid var(--mh-edge);
  color: var(--mh-ink-dim);
}

@media (max-width: 600px) {
  .mh-hall.ach-hall { padding: 16px 6px 28px; }
  .mh-hall .ach-hall-frame.mh-frame,
  .mh-replays .replays-page,
  .mh-players .players-container { padding: 12px 10px 16px; }
  .mh-players .player-card { padding: 9px 10px; gap: 10px; }
  .mh-players .player-rank { min-width: 26px; }
}
