/* The daily challenge's page (rendered by the server, packages/server/src/challenge.ts): the
   game's colours and type, the day's map behind the top. */
@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/barlow-condensed-latin-500-normal.woff2) format('woff2');
}

@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/barlow-condensed-latin-700-normal.woff2) format('woff2');
}

:root {
  --panel: rgba(17, 21, 18, 0.9);
  --panel-edge: rgba(214, 222, 196, 0.14);
  --text: #e6e8dc;
  --muted: #9aa190;
  --accent: #e2b950;
  --font: 'Barlow Condensed', system-ui, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #121510;
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
}

a {
  color: var(--accent);
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

/* The top: the day's map, darkened, behind the challenge and its board (a class per picture:
   the page allows no inline styles). */
.shot-valley {
  --shot: url(/menu/valley.webp);
}

.shot-autumn {
  --shot: url(/menu/autumn.webp);
}

.shot-winter {
  --shot: url(/menu/winter.webp);
}

.shot-desert {
  --shot: url(/menu/desert.webp);
}

.shot-islands {
  --shot: url(/menu/islands.webp);
}

.ch-hero {
  position: relative;
  isolation: isolate;
  padding-bottom: 28px;
}

.ch-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(12, 14, 11, 0.45) 0%, rgba(12, 14, 11, 0.86) 62%, #121510 100%),
    var(--shot) center / cover no-repeat;
  filter: saturate(0.9);
}

.ch-top {
  display: flex;
  align-items: center;
  gap: 16px 28px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 20px;
}

.ch-logo {
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-decoration: none;
  white-space: nowrap;
}

.ch-top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 18px;
}

.ch-top nav a {
  color: var(--muted);
  text-decoration: none;
}

.ch-top nav a:hover,
.ch-top nav a[aria-current] {
  color: var(--accent);
}

.ch-top nav a[aria-current] {
  border-bottom: 2px solid var(--accent);
}

.ch-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 32px 48px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 0;
}

.ch-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ch-today h1 {
  font-size: clamp(38px, 10.5vw, 88px);
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.6);
}

/* The challenge's icon beside its name, not over it. */
.ch-today h1 span {
  font-size: 0.6em;
  vertical-align: 0.12em;
}

.ch-goal-big {
  margin: 12px 0 14px;
  font-size: 24px;
  line-height: 1.3;
}

.ch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}

.ch-chips span {
  padding: 4px 13px;
  border: 1px solid rgba(226, 185, 80, 0.45);
  border-radius: 16px;
  background: rgba(226, 185, 80, 0.1);
  color: #f0dfae;
  font-size: 16px;
}

.ch-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin: 0;
}

.ch-play {
  display: inline-block;
  padding: 15px 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #1b1a12;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 4px 24px rgba(226, 185, 80, 0.35);
}

.ch-play:hover {
  background: #efc960;
}

.ch-count {
  color: var(--muted);
  font-size: 17px;
}

.ch-count b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.ch-free {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
}

/* The boards: today, yesterday, the week. */
.ch-boards {
  padding: 18px 20px 14px;
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  background: var(--panel);
}

.ch-boards-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ch-boards h2 {
  font-size: 26px;
}

.ch-tabs {
  display: flex;
  gap: 4px;
}

.ch-tabs button {
  padding: 4px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.ch-tabs button[aria-selected='true'] {
  background: var(--accent);
  color: #1b1a12;
}

/* Without the script every board shows; with it, the chosen one. */
.js .ch-tab:not(.on) {
  display: none;
}

.ch-board {
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.ch-board td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ch-rank {
  width: 40px;
  text-align: center;
  font-weight: 700;
}

.ch-name {
  overflow-wrap: anywhere;
}

.ch-score {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}

.ch-extra {
  width: 64px;
  text-align: right;
  color: var(--muted);
}

.ch-ok {
  color: #6ee787;
  font-size: 14px;
}

.ch-board tr.me td {
  background: rgba(226, 185, 80, 0.14);
}

.ch-board tr.me .ch-name::before {
  content: attr(data-you) ' · ';
  color: var(--accent);
}

.ch-empty,
.ch-sub,
.ch-note {
  margin: 6px 0;
  color: var(--muted);
  font-size: 16px;
}

/* Below the top: yesterday's winner, the seven kinds, questions. */
.ch-more {
  display: block;
  padding-top: 10px;
}

.ch-more section {
  margin: 0 0 36px;
}

.ch-more h2 {
  margin-bottom: 14px;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.ch-winner-name {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
}

.ch-winner-name span {
  color: var(--accent);
}

.ch-kinds {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ch-kind {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.ch-kind.today {
  border-color: var(--accent);
  background: rgba(226, 185, 80, 0.1);
}

.ch-day {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ch-icon {
  font-size: 22px;
}

.ch-kind strong {
  font-size: 22px;
}

.ch-goal {
  color: #c9cdbd;
  font-size: 15px;
  line-height: 1.25;
}

.ch-record {
  margin-top: auto;
  padding-top: 6px;
  color: var(--accent);
  font-size: 14px;
}

.ch-faq details {
  max-width: 860px;
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-edge);
}

.ch-faq summary {
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.ch-faq p {
  margin: 8px 0 2px;
  color: #c9cdbd;
}

.ch-end {
  margin: 0 0 40px;
}

.ch-button {
  padding: 12px 22px;
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}

.ch-button:hover {
  border-color: var(--accent);
}

.ch-foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 30px;
  border-top: 1px solid var(--panel-edge);
  color: var(--muted);
  font-size: 16px;
}

@media (max-width: 1050px) {
  .ch-kinds {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 860px) {
  .ch-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding-top: 14px;
  }

  .ch-top {
    padding: 12px 16px;
  }

  .ch-top nav {
    font-size: 16px;
    gap: 4px 14px;
  }

  .ch-goal-big {
    font-size: 20px;
  }

  .ch-play {
    width: 100%;
    text-align: center;
    font-size: 24px;
  }

  .ch-boards {
    padding: 14px 12px 10px;
  }
}
