/* Phone-first: one column, 16px gutters, system fonts, light and dark. The roll card keeps the game's dark look in both themes because
   the tier colours are made for a dark ground. */
:root {
  --page: #f4f5f7;
  --text: #1b1d22;
  --muted: #565b66;
  --accent: #1f5fd1;
  --accent-text: #ffffff;
  --card: #14161c;
  --card-text: #f2f3f5;
  --card-muted: #a8adb8;
  --surface: #ffffff;
  --line: #d3d7de;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d0e12;
    --text: #f2f3f5;
    --muted: #a8adb8;
    --accent: #5b94ff;
    --accent-text: #0d0e12;
    --card: #1a1d25;
    --surface: #161920;
    --line: #2d313b;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.brand, main, noscript {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}
.brand { padding-top: 24px; padding-bottom: 8px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
main { padding-bottom: 32px; }
p { margin: 0; }
.loading { padding: 32px 0; color: var(--muted); }
.roll {
  margin: 8px 0 24px;
  padding: 24px 16px;
  border-radius: 16px;
  background: var(--card);
  color: var(--card-text);
  text-align: center;
}
.day { color: var(--card-muted); font-size: 0.95rem; }
.number { margin-top: 8px; font-size: clamp(3rem, 20vw, 5rem); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tier { margin-top: 4px; font-size: 1.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.badges { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.badge { font-weight: 600; overflow-wrap: anywhere; }
.badge-emoji { margin-right: 4px; }
.ep { margin-top: 20px; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.percentile { margin-top: 8px; color: var(--card-muted); }
.flag { margin-top: 12px; font-size: 2rem; line-height: 1; }
.cta {
  display: block;
  padding: 16px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.cta:focus-visible, button:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.coming-soon { padding: 16px; border-radius: 12px; border: 2px dashed var(--muted); text-align: center; font-weight: 700; }
.message { margin: 8px 0 24px; padding: 32px 16px; border-radius: 16px; background: var(--card); color: var(--card-text); text-align: center; }
.message h1 { margin: 0; font-size: 1.5rem; }
.message button {
  margin-top: 16px;
  padding: 10px 20px;
  border: 2px solid var(--card-text);
  border-radius: 10px;
  background: transparent;
  color: var(--card-text);
  font: inherit;
  font-weight: 600;
}
.odds { margin-top: 24px; color: var(--muted); font-size: 0.9rem; text-align: center; }
.privacy { margin-top: 8px; color: var(--muted); font-size: 0.85rem; text-align: center; }

/* The privacy policy and delete pages (body.doc): the same page colours as the share page, a little wider, set as reading text. */
.doc .brand, .doc main { max-width: 640px; }
.doc main { padding-bottom: 48px; }
.doc a { color: var(--accent); }
.doc a:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 0; font-weight: 600; }
.doc-nav a[aria-current] { color: var(--text); text-decoration: none; }
.doc h1 { margin: 16px 0 4px; font-size: 1.75rem; line-height: 1.2; }
.doc h2 { margin: 32px 0 8px; font-size: 1.25rem; line-height: 1.3; }
.doc h3 { margin: 20px 0 6px; font-size: 1.05rem; line-height: 1.3; }
.doc p, .doc ul, .doc ol { margin: 0 0 12px; }
.doc ul, .doc ol { padding-left: 24px; }
.doc li { margin-bottom: 6px; }
.doc li > ul, .doc li > ol { margin-top: 6px; }
.doc .updated { margin-bottom: 16px; color: var(--muted); }
.doc #summary { padding: 16px 16px 4px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
.doc #summary h2 { margin-top: 0; }
.doc table { width: 100%; margin: 12px 0; border-collapse: collapse; background: var(--surface); }
.doc th, .doc td { padding: 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc thead th { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.doc tbody th { font-weight: 600; }
.doc-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }
/* On a phone each table row becomes a card: the first cell is its title, each other cell carries its column name. */
@media (max-width: 599px) {
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .doc table, .doc tbody, .doc tr, .doc th, .doc td { display: block; width: 100%; }
  .doc tr { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .doc th, .doc td { border: 0; padding: 8px 12px; }
  .doc tbody th { background: var(--page); }
  .doc td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
}
