/* Styling for LogoMapper's static content pages (about, how-to-play, coverage, privacy, contact).
 *
 * These pages are deliberately plain documents rather than game screens: no globe, no canvas, no
 * game-core.js. They exist so the site has real, crawlable prose — the game pages themselves are a
 * WebGL app whose content lives in teams.json and is invisible to a crawler. Added 2026-08-06 after
 * an AdSense review failed with "Low value content".
 *
 * Reuses style.css's :root custom properties (--bg, --panel, --accent, etc.) so the colour scheme
 * can never drift from the game. style.css must be loaded FIRST on every page that uses this file.
 */

.page-wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  /* Game pages lock scrolling for the globe; content pages must scroll normally. */
  overflow-y: auto;
  height: auto;
}

.page-wrap h1 {
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 0.5rem 0 0.25rem;
  color: var(--accent);
}

.page-wrap .lede {
  font-size: 1.05rem;
  color: var(--text-dim, #a8b3c1);
  margin: 0 0 2rem;
}

.page-wrap h2 {
  font-size: 1.25rem;
  margin: 2.25rem 0 0.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--accent-2);
}

.page-wrap h2:first-of-type { border-top: none; padding-top: 0; }

.page-wrap h3 {
  font-size: 1.02rem;
  margin: 1.4rem 0 0.4rem;
  color: #dfe7ef;
}

.page-wrap p,
.page-wrap li {
  line-height: 1.65;
  color: #c6d0da;
}

.page-wrap ul, .page-wrap ol { padding-left: 1.35rem; }
.page-wrap li { margin: 0.35rem 0; }

.page-wrap a { color: var(--accent); }
.page-wrap a:hover { color: var(--accent-2); }

.page-wrap strong { color: #eef3f8; }

/* Coverage tables — the league/team breakdown. Wide on desktop, scrollable on mobile rather than
   forcing the page body to scroll sideways. */
.table-scroll { overflow-x: auto; margin: 1rem 0 1.5rem; }

.page-wrap table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

.page-wrap th, .page-wrap td {
  text-align: left;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}

.page-wrap th {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

.page-wrap td.num { text-align: right; font-variant-numeric: tabular-nums; }

.page-wrap tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

/* Callout box for the "play the game" nudge at the end of each page. */
.page-cta {
  margin: 2.5rem 0 0;
  padding: 1rem 1.15rem;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.6rem;
}

.page-cta p { margin: 0 0 0.6rem; }
.page-cta a { font-weight: 600; }

.page-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.87rem;
  color: #8895a4;
}

.page-footer a { margin-right: 0.9rem; display: inline-block; }

@media (max-width: 640px) {
  .page-wrap { padding: 1rem 1rem 3rem; }
  .page-wrap h1 { font-size: 1.55rem; }
  .page-wrap th, .page-wrap td { padding: 0.4rem 0.55rem; }
}

/* ---- Leaderboard page (added 2026-08-06) ---------------------------------- */

.board-status {
  padding: 1rem 1.15rem;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.6rem;
  color: #a8b3c1;
}

.board-status.hidden,
#board-table.hidden,
.board-you.hidden { display: none; }

/* Wide enough for a rank plus the "you" tag, which lives in this cell rather than the Total cell —
   Total is right-aligned, and an inline tag there pushes the number out of column. */
#board-table td.rank {
  width: 5.5rem;
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The player's own row. Uses a left border plus a tint rather than a loud background so it reads as
   "this one is yours" without turning the table into a traffic light. */
#board-table tr.is-you {
  background: rgba(79, 209, 197, 0.10);
}

#board-table tr.is-you td {
  border-bottom-color: rgba(79, 209, 197, 0.35);
}

#board-table tr.is-you td.rank {
  box-shadow: inset 3px 0 0 var(--accent);
}

.you-tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #062220;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.board-you {
  margin-top: 1rem;
  color: #8895a4;
  font-size: 0.92rem;
}

/* Q1-Q5 per-question columns. Seven columns is wide for a phone, so the surrounding .table-scroll
   handles overflow — but shrinking the padding and de-emphasising the per-question cells relative
   to the total keeps it readable without scrolling on most screens. */
#board-table td.total {
  font-weight: 600;
  color: var(--text);
}

/* The base rule right-aligns td.num but not th.num, so the Q1-Q5 headers would sit left of their
   own numbers without this. */
#board-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#board-table td.q {
  color: #93a1b2;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  font-variant-numeric: tabular-nums;
}

/* A row submitted before per-question scores existed. */
#board-table .q-none { color: #4d5866; }

@media (max-width: 640px) {
  #board-table th,
  #board-table td { padding: 0.4rem 0.35rem; font-size: 0.86rem; }
  #board-table td.rank { width: 4.5rem; }
  .you-tag { margin-left: 0.35rem; padding: 0.05rem 0.3rem; font-size: 0.66rem; }
}

/* Mode tabs on the leaderboard. Each daily mode has its own board — scores aren't comparable
   across modes (different team pools, and USA uses a steeper scoring curve). */
.board-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
}

.board-tab {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.board-tab:hover,
.board-tab:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.board-tab.is-active {
  background: rgba(79, 209, 197, 0.12);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ---- Your History (history.html) ------------------------------------------------------------
   Personal stats computed entirely from this browser's saved localStorage games — no API calls.
   Series colors are a dataviz-validated dark-surface trio (see SKILL.md's history-page section):
   Daily #2fa8a0 / Footy #dd6b20 / USA #9085e9 — deliberately darker steps of the site's accent
   hues, NOT the raw --accent/--accent-2 values, which fail the dark-band lightness check. */

.hist-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem 0.9rem;
  margin: 1.25rem 0;
}

.hist-panel h2 { margin: 0 0 0.25rem; border: none; padding: 0; }
.hist-sub { color: var(--text-dim); font-size: 0.85rem; margin: 0 0 0.9rem; }

.hist-legend { display: flex; gap: 1.1rem; flex-wrap: wrap; margin: 0 0 0.5rem; font-size: 0.85rem; }
/* Shared by the legend, the stat tiles and the tooltip — the colored mark that carries series
   identity next to plain-ink text. */
.hist-legend .swatch, .hist-tile .swatch, .hist-tooltip .swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 0.4rem; vertical-align: -1px;
}

.hist-chart-wrap { position: relative; }
.hist-chart-wrap svg { display: block; width: 100%; height: auto; }

.hist-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
  z-index: 5;
}
.hist-tooltip.hidden { display: none; }
.hist-tooltip .tt-date { color: var(--text-dim); }
.hist-tooltip .num { font-variant-numeric: tabular-nums; font-weight: 600; }

.hist-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin: 0.9rem 0 1.4rem;
}

.hist-tile {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.hist-tile .tile-mode { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 0.35rem; }
.hist-tile .tile-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.hist-tile .tile-note { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.3rem; }

.hist-empty {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
}
.hist-empty.hidden, .hist-hidable.hidden { display: none; }

@media (max-width: 640px) {
  .hist-tiles { grid-template-columns: 1fr; }
}

/* Top/bottom-guess tile rows (Your History). Two stacked stats inside one tile: label pill,
   distance value, and the team it happened on. */
.hist-tile .tile-duo { display: grid; gap: 0.45rem; }
.hist-tile .tile-duo > div { display: flex; align-items: baseline; gap: 0.55rem; flex-wrap: wrap; }
.hist-tile .duo-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim); min-width: 3.6rem;
}
.hist-tile .duo-value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hist-tile .duo-team { font-size: 0.78rem; color: var(--text-dim); }
