/* Self-hosted web fonts. Generated by scripts/vendor-fonts.js - do not edit by hand.
   Outfit and Fredoka are licensed under the SIL Open Font License 1.1.

   font-display: swap keeps text visible in the fallback face while the web font loads,
   so a slow font never blocks the first paint. The unicode-range on each face means a
   browser only downloads latin-ext if the page actually uses a character from it. */

/* Fredoka 700 - latin-ext */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/fredoka-700-latin-ext-f1bff8a6.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Fredoka 700 - latin */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/fredoka-700-latin-1747b34e.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Outfit 400 700 - latin-ext */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/outfit-400-700-latin-ext-9e38b3f1.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Outfit 400 700 - latin */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/outfit-400-700-latin-92684e4a.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Theme palettes, copied from src/index.css by generate-content-pages.js. */

[data-theme="default"] {
  --theme-bg-solid: #1c1917;
  --theme-bg: linear-gradient(to bottom right, #1c1917, #78350f, #1c1917);
  --theme-bg-card: rgba(120, 53, 15, 0.4);
  --theme-bg-card-hover: rgba(146, 64, 14, 0.5);
  --theme-bg-input: rgba(28, 25, 23, 0.6);
  --theme-bg-row: rgba(28, 25, 23, 0.4);
  --theme-bg-row-current: rgba(146, 64, 14, 0.4);
  --theme-text: #fef3c7;
  --theme-text-muted: rgba(254, 243, 199, 0.8);
  --theme-text-dim: rgba(254, 243, 199, 0.6);
  --theme-accent: #f59e0b;
  --theme-accent-hover: #fbbf24;
  --theme-accent-text: #1c1917;
  --theme-border: rgba(180, 83, 9, 0.3);
  --theme-title: #FFF7CD;
  --theme-dice-dots: #292524;
}

[data-theme="dark"] {
  --theme-bg-solid: #0f172a;
  --theme-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --theme-bg-card: rgba(30, 41, 59, 0.6);
  --theme-bg-card-hover: rgba(51, 65, 85, 0.7);
  --theme-bg-input: rgba(15, 23, 42, 0.8);
  --theme-bg-row: rgba(30, 41, 59, 0.4);
  --theme-bg-row-current: rgba(51, 65, 85, 0.6);
  --theme-text: #f1f5f9;
  --theme-text-muted: rgba(203, 213, 225, 0.9);
  --theme-text-dim: rgba(148, 163, 184, 0.8);
  --theme-accent: #38bdf8;
  --theme-accent-hover: #7dd3fc;
  --theme-accent-text: #0f172a;
  --theme-border: rgba(71, 85, 105, 0.5);
  --theme-title: #9CD5FF;
  --theme-dice-dots: #1e293b;
}

[data-theme="light-glass"] {
  --theme-bg-solid: #e0f2fe;
  --theme-bg: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 50%, #bae6fd 100%);
  --theme-bg-card: rgba(255, 255, 255, 0.5);
  --theme-bg-card-hover: rgba(255, 255, 255, 0.7);
  --theme-bg-input: rgba(255, 255, 255, 0.8);
  --theme-bg-row: rgba(255, 255, 255, 0.4);
  --theme-bg-row-current: rgba(186, 230, 253, 0.5);
  --theme-text: #0c4a6e;
  --theme-text-muted: rgba(7, 89, 133, 0.9);
  --theme-text-dim: rgba(3, 105, 161, 0.7);
  /* Darker than sky-600 so white button text clears WCAG AA: #0284c7 was 4.10:1,
     and the lighter hover it replaced was 2.77:1. This is 6.36:1, and as text it
     holds 4.79:1 even on the darkest stop of the background. Hover goes darker. */
  --theme-accent: #04649b;
  --theme-accent-hover: #075985;
  --theme-accent-text: #ffffff;
  --theme-border: rgba(255, 255, 255, 0.6);
  --theme-title: #0369a1;
  --theme-dice-dots: #0c4a6e;
}

[data-theme="green"] {
  --theme-bg-solid: #0d2818;
  --theme-bg: linear-gradient(135deg, #0d2818 0%, #1a3d2a 50%, #0d2818 100%);
  --theme-bg-card: rgba(26, 61, 42, 0.5);
  --theme-bg-card-hover: rgba(34, 85, 58, 0.6);
  --theme-bg-input: rgba(13, 40, 24, 0.7);
  --theme-bg-row: rgba(26, 61, 42, 0.4);
  --theme-bg-row-current: rgba(34, 85, 58, 0.5);
  --theme-text: #d4edda;
  --theme-text-muted: rgba(212, 237, 218, 0.9);
  --theme-text-dim: rgba(195, 230, 203, 0.7);
  --theme-accent: #28a745;
  --theme-accent-hover: #34ce57;
  --theme-accent-text: #0d2818;
  --theme-border: rgba(40, 167, 69, 0.4);
  --theme-title: #90ee90;
  --theme-dice-dots: #1a3d2a;
}

[data-theme="violet"] {
  --theme-bg-solid: #1e0d2e;
  --theme-bg: linear-gradient(135deg, #1e0d2e 0%, #2d1b4e 50%, #1e0d2e 100%);
  --theme-bg-card: rgba(45, 27, 78, 0.5);
  --theme-bg-card-hover: rgba(88, 28, 135, 0.6);
  --theme-bg-input: rgba(30, 13, 46, 0.7);
  --theme-bg-row: rgba(45, 27, 78, 0.4);
  --theme-bg-row-current: rgba(88, 28, 135, 0.5);
  --theme-text: #e9d5ff;
  --theme-text-muted: rgba(233, 213, 255, 0.9);
  --theme-text-dim: rgba(216, 180, 254, 0.7);
  /* A shade lighter than violet-500 so the dark button text clears WCAG AA:
     #8b5cf6 was 4.30:1. This is 5.72:1, and as text it holds 4.78:1 on the
     lightest stop of the background, where the old one fell to 3.97:1. */
  --theme-accent: #9d7af9;
  --theme-accent-hover: #b39dfb;
  --theme-accent-text: #1e0d2e;
  --theme-border: rgba(139, 92, 246, 0.4);
  --theme-title: #c4b5fd;
  --theme-dice-dots: #2d1b4e;
}
/* Shared styles for the static content pages (rules, how-to-play, score-sheet, strategy).
   Generated into public/content-<hash>.css by scripts/generate-content-pages.js, after
   the app's theme palettes, so every colour here comes from the app's --theme-* variables.
   The theme itself is set on <html> by a script in each page's <head>. */

:root {
  color-scheme: dark;
  --bg: var(--theme-bg-solid);
  --bg-gradient: var(--theme-bg);
  --surface: var(--theme-bg-card);
  --accent-soft: var(--theme-bg-row-current);
  --text: var(--theme-text);
  /* The app's text-muted is 90% of the text colour on most themes - too close to tell
     apart in running copy. text-dim gives the lede and nav a visible step down. */
  --muted: var(--theme-text-dim);
  --border: var(--theme-border);
  --accent: var(--theme-accent);
  --accent-text: var(--theme-accent-text);
  /* Links sit in body copy, where the base accent is too dark on the dark themes. */
  --link: var(--theme-accent-hover);
  --title: var(--theme-title);
  --shadow: none;
}

/* text-dim drops below 4.5:1 on these two, so they keep the stronger muted shade. */
[data-theme="dark"] { --muted: var(--theme-text-muted); }

[data-theme="light-glass"] {
  color-scheme: light;
  --muted: var(--theme-text-muted);
  /* The app's white glass border disappears against a pale page, and its sky-blue
     accent is too light for links in running text. */
  --border: rgba(3, 105, 161, 0.18);
  --link: var(--theme-title);
  --shadow: 0 1px 2px rgba(12, 74, 110, 0.06), 0 4px 16px rgba(12, 74, 110, 0.06);
}

* { box-sizing: border-box; }

/* The gradient sits on <html>, as in the app, so it spans the whole page and the solid
   colour shows through on iOS overscroll. */
html {
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  background-color: var(--bg);
  background-image: var(--bg-gradient);
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 1.25rem; }

/* ---- header / nav ---- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

/* The app's wordmark (.yahtzee-title in src/index.css) at header size: same face, same
   glassy fill in the theme's title colour, shadows scaled down to match. */
.brand {
  font-family: 'Fredoka', 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-decoration: none;
  margin-right: auto;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.5) 20%,
    var(--title) 45%,
    var(--title) 75%,
    rgba(0, 0, 0, 0.25) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---- content ---- */

main { padding: 2.5rem 0 3.5rem; }

/* Headings take the app's display face; body copy stays in Outfit, as in the app. */
h1, h2, h3 {
  font-family: 'Fredoka', 'Outfit', system-ui, sans-serif;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: var(--title);
}

.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 2rem; }

h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.75rem;
  scroll-margin-top: 1rem;
}

h3 { font-size: 1.08rem; margin: 1.75rem 0 0.5rem; }

p { margin: 0 0 1rem; }

ul, ol { margin: 0 0 1rem; padding-left: 1.3rem; }
li { margin-bottom: 0.4rem; }

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

strong { font-weight: 600; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ---- tables ---- */

.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; }

table {
  width: 100%;
  /* Scroll the table rather than letting narrow screens crush the columns into
     one-word-per-line. Without this the score sheet is unreadable on a phone. */
  min-width: 30rem;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: var(--accent-soft);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }

td.num, th.num { text-align: right; white-space: nowrap; }

/* ---- callout ---- */

.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin: 0 0 1.5rem;
  box-shadow: var(--shadow);
}

.note > :last-child { margin-bottom: 0; }
.note p:first-child { margin-top: 0; }

/* ---- call to action ---- */

.cta {
  display: inline-block;
  /* Also used on the score sheet's print <button>, which would otherwise keep the
     browser's own font, size and border. */
  font: inherit;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: 9999px;
  margin: 0.5rem 0 0;
}

.cta:hover { filter: brightness(1.08); }

/* ---- faq ---- */

.faq { margin: 0 0 1.5rem; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow);
}

.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { margin-bottom: 0.6rem; }
.faq details > :last-child { margin-bottom: 0; }

/* ---- footer ---- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.75rem 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer .spacer { margin-left: auto; }

/* ---- printable score sheet ---- */

.sheet { font-size: 0.9rem; min-width: 34rem; }
.sheet th, .sheet td { padding: 0.35rem 0.5rem; }
.sheet .player-col { width: 3.2rem; }
.sheet .fill { background: repeating-linear-gradient(transparent, transparent); }
.sheet tr.subtotal { font-weight: 600; background: var(--accent-soft); }
.sheet tr.section th { background: var(--accent-soft); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

@media print {
  @page { margin: 12mm; }
  /* Paper is white whatever the theme; without this a dark theme prints its pale text. */
  :root {
    color-scheme: light;
    --text: #000;
    --muted: #444;
    --title: #000;
    --link: #000;
    --border: #666;
    --surface: #fff;
    --accent-soft: #eee;
  }
  html { background: #fff; }
  body { color: #000; font-size: 11pt; }
  .site-header, .site-footer, .no-print { display: none !important; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  h1 { font-size: 18pt; margin-bottom: 0.25rem; }
  .lede { font-size: 10pt; margin-bottom: 0.75rem; }
  table { box-shadow: none; border: 1px solid #000; }
  th, td { border-bottom: 1px solid #666; }
  thead th, .sheet tr.subtotal, .sheet tr.section th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet .player-col { width: 2.6rem; }
  table, .sheet { min-width: 0; }
  a { text-decoration: none; color: #000; }
}
