/*
 * The production home page: a directory of the daily games. Warm paper and ink, each game a card. System fonts only
 * (nothing to load, and the strict CSP stays simple). Every page here shares this one stylesheet.
 */
:root {
  color-scheme: light;
  --paper: #f7f1e6;
  --card: #fffdf8;
  --ink: #2b211c;
  --muted: #6f6158;
  --line: #e2d6c4;
  --accent: #c2410c;
  --live: #1f6f4a;
  font:
    16px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

/* The account page switches states with the hidden attribute; cards set display, which would otherwise win. */
[hidden] {
  display: none !important;
}

body {
  margin: 0 auto;
  max-width: 60rem;
  padding: max(24px, env(safe-area-inset-top)) 16px 40px;
  display: grid;
  gap: 32px;
  background: var(--paper);
}

a {
  color: inherit;
}

.masthead {
  text-align: center;
  padding-top: 24px;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  letter-spacing: -0.02em;
}

.lede {
  margin: 8px auto 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 16px;
}

.game {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 20px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  text-decoration: none;
}

.game.live {
  border-color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.12s ease;
}

.game.live:hover,
.game.live:focus-visible {
  transform: translateY(-2px);
}

.game.live:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.game.soon {
  opacity: 0.75;
}

.game-icon {
  font-size: 2rem;
}

.game-name {
  font-size: 1.35rem;
  font-weight: 700;
}

.game-line {
  color: var(--muted);
}

.game-cta {
  margin-top: 4px;
  font-weight: 700;
  color: var(--accent);
}

.game.soon .game-cta {
  color: var(--muted);
}

.footer {
  display: grid;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer p {
  margin: 0;
}

/* ---------------------------------------------------------------- text pages (privacy, terms, account) */
.page {
  max-width: 42rem;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.page h1 {
  margin: 0;
  font-size: 2rem;
}

.page h2 {
  margin: 16px 0 0;
  font-size: 1.2rem;
}

.page p,
.page ul {
  margin: 0;
}

.back {
  font-size: 0.9rem;
}

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fde9d9;
  border: 1px solid #f3c7a4;
}

.card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

/* The grid gap spaces a card's contents; default heading and paragraph margins would double it. */
.card > * {
  margin: 0;
}

.button {
  justify-self: start;
  font:
    700 1rem system-ui,
    sans-serif;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.button.danger {
  background: #9f2d14;
  border-color: #9f2d14;
  color: #fff;
}

.button:disabled {
  opacity: 0.6;
  cursor: default;
}

input {
  font: inherit;
  padding: 8px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  max-width: 20rem;
  width: 100%;
}

.error {
  color: #9f2d14;
}
