/* Guilty Gambit — guiltygambit.com
   One stylesheet for every page. No external fonts, scripts or trackers. */

:root {
  --bg: #12161b;
  --bg-raised: #1b2129;
  --bg-sunk: #0d1014;
  --line: #2b333e;
  --ink: #f4eddd;
  --ink-soft: #b9bec7;
  --ink-faint: #8a909b;
  --gold: #f2b33d;
  --gold-deep: #d9972a;

  /* The colours of the chips under the pieces, as in the game. */
  --devastated: #3d74f0;
  --guilt: #e0363d;
  --unaffected: #f2cc4d;
  --berserk: #22a85c;
  --bloodlust: #0e0e12;
  --shame: #b56cff;
  --absolve: #ffd45a;

  --radius: 18px;
  --wrap: 1120px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-underline-offset: 0.18em; }
a:hover { color: #ffd27a; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: #1a1408; padding: 0.6rem 1rem; border-radius: 0 0 10px 0; font-weight: 700;
}
.skip:focus { left: 0; z-index: 10; }

/* ---------- Header ---------- */

.site-header { padding: 1.1rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem;
}
.wordmark:hover { color: var(--ink); }
.wordmark .chip { width: 1.5rem; height: 1.5rem; }

.site-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600;
  padding: 0.4rem 0.8rem; border-radius: 999px;
}
.site-nav a:hover { color: var(--ink); background: var(--bg-raised); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--bg-raised); }

/* ---------- Chips: the striped markers under the pieces ---------- */

.chip {
  --c: var(--unaffected);
  display: inline-block; flex: none;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background:
    radial-gradient(circle, var(--c) 0 46%, transparent 47%),
    repeating-conic-gradient(var(--c) 0 30deg, #f6f1e6 30deg 45deg);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(0, 0, 0, 0.18);
}
.chip.devastated { --c: var(--devastated); }
.chip.guilt { --c: var(--guilt); }
.chip.unaffected { --c: var(--unaffected); }
.chip.berserk { --c: var(--berserk); }
.chip.bloodlust { --c: var(--bloodlust); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 0 1px #3a3f48; }

/* ---------- Hero ---------- */

.hero { padding: clamp(1.5rem, 5vw, 4rem) 0 0; text-align: center; }
.hero p.lede { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--ink-soft); max-width: 40ch; margin: 0 auto 1.6rem; }

.pill {
  display: inline-block; margin-bottom: 1.2rem;
  padding: 0.35rem 0.9rem; border-radius: 999px;
  background: var(--bg-raised); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 0.92rem; font-weight: 600;
}
.pill b { color: var(--gold); font-weight: 700; }

.actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

.button {
  display: inline-block; padding: 0.8rem 1.5rem; border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 0;
  background: var(--gold); color: #1a1408;
  box-shadow: 0 3px 0 var(--gold-deep);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.button:hover { color: #1a1408; background: #ffc65a; }
.button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-deep); }
.button.quiet { background: var(--bg-raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.button.quiet:hover { background: #242c36; color: var(--ink); }

.hero-shot {
  margin: clamp(2rem, 5vw, 3.5rem) auto 0;
  border-radius: clamp(14px, 2.4vw, 28px);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line);
}

/* ---------- Sections ---------- */

section { padding: clamp(3rem, 8vw, 6rem) 0; }
.section-head { max-width: 46rem; margin-bottom: 2rem; }
.section-head p { color: var(--ink-soft); font-size: 1.12rem; }
.eyebrow, .section-head p.eyebrow, .credit p.eyebrow { color: var(--gold); font-weight: 700; font-size: 0.92rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.6rem; }
.band { background: var(--bg-sunk); border-block: 1px solid var(--line); }

/* ---------- The die and the four reactions ---------- */

.roll { display: grid; gap: 2rem; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: start; }

.tray {
  background: #1f5a45;
  background-image: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.10), transparent 60%);
  border: 12px solid #3a2416; border-radius: 22px;
  box-shadow: inset 0 6px 18px rgba(0, 0, 0, 0.45), 0 10px 30px rgba(0, 0, 0, 0.4);
  padding: 1.6rem 1.2rem 1.3rem; text-align: center;
}

.die {
  width: 5.5rem; height: 5.5rem; margin: 0 auto 1.1rem;
  background: #f7f2e7; border-radius: 1rem;
  box-shadow: 0 6px 0 #cfc7b6, 0 12px 18px rgba(0, 0, 0, 0.35);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 0.7rem; gap: 0.15rem;
}
.die i { border-radius: 50%; background: transparent; margin: 12%; }
.die i.on { background: var(--pip, #26262c); }
.die.rolling { animation: tumble 0.5s ease-in-out; }
@keyframes tumble {
  0% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-1.4rem) rotate(140deg); }
  70% { transform: translateY(0) rotate(320deg); }
  100% { transform: translateY(0) rotate(360deg); }
}

.tray .button { width: 100%; }
.verdict { min-height: 4.6em; margin: 1rem 0 0; color: #eaf5ef; font-weight: 600; }
.verdict b { display: block; font-size: 1.15rem; }

.reactions { display: grid; gap: 0.9rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
}
.card h3 { margin-bottom: 0.3em; }
.card p { color: var(--ink-soft); margin: 0; }
.card p + p { margin-top: 0.6em; }

.reaction { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; }
.reaction .odds { color: var(--ink-faint); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.reaction.lit { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 179, 61, 0.25); transform: translateY(-2px); }

/* ---------- Feature grids ---------- */

.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card .tag {
  display: inline-block; margin-bottom: 0.7rem; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: #1a1408; background: var(--gold);
}
.card .tag.purple { background: var(--shame); color: #1b0d2b; }
.card .tag.green { background: var(--berserk); color: #06180e; }
.card .tag.plain { background: #303946; color: var(--ink); }

.split { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.split img { border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--line); }

/* ---------- Screens ---------- */

.screens { display: grid; gap: 1.2rem; grid-template-columns: 0.62fr 1fr 1.72fr; align-items: end; }
.screens figure { margin: 0; }
.screens img { width: 100%; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--line); }
.screens .phone img { border-radius: 26px; }
.screens .pad img { border-radius: 20px; }
.screens .mac img { border-radius: 12px; }
figcaption { color: var(--ink-faint); font-size: 0.92rem; margin-top: 0.7rem; text-align: center; }

/* ---------- Credit ---------- */

.credit { text-align: center; }
.credit .big { font-size: clamp(1.3rem, 2.8vw, 1.8rem); font-weight: 800; max-width: 30ch; margin: 0 auto 0.8rem; text-wrap: balance; }
.credit p { color: var(--ink-soft); max-width: 60ch; margin-inline: auto; }
.credit p.big { color: var(--ink); max-width: 30ch; }
/* The second credit: who made the app. Set apart from the first, which is for the game's creator. */
.credit p.big.made { margin-top: 2.6rem; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--ink-faint); font-size: 0.95rem; }
.site-footer .wrap { display: flex; gap: 1rem 2rem; justify-content: space-between; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); }
.site-footer p { margin: 0; max-width: 46ch; }

/* ---------- Article pages: rules, support, privacy ---------- */

.page-head { padding: clamp(2rem, 6vw, 4rem) 0 1rem; }
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.page-head p { color: var(--ink-soft); font-size: 1.15rem; max-width: 52ch; }

.prose { padding-bottom: clamp(3rem, 8vw, 5rem); }
.prose h2 { font-size: 1.6rem; margin-top: 2.4rem; padding-top: 0.4rem; scroll-margin-top: 1rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--gold); }
.prose strong { color: #fff8e8; }

.note {
  background: var(--bg-raised); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: 12px; padding: 1rem 1.2rem; margin: 1.4rem 0; color: var(--ink-soft);
}
.note.ours { border-left-color: var(--shame); }
.note p:last-child { margin-bottom: 0; }

.toc { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 1.2rem 0 0; list-style: none; }
.toc a {
  display: inline-block; padding: 0.3rem 0.8rem; border-radius: 999px; text-decoration: none;
  background: var(--bg-raised); border: 1px solid var(--line); color: var(--ink-soft); font-weight: 600; font-size: 0.95rem;
}
.toc a:hover { color: var(--ink); border-color: var(--gold); }

table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.4rem; }
th, td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-faint); font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
td .chip { width: 1.3rem; height: 1.3rem; vertical-align: -0.25rem; margin-right: 0.5rem; }
td:nth-child(1), td:nth-child(2) { white-space: nowrap; }
.table-scroll { overflow-x: auto; }

details {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.2rem 1.2rem; margin-bottom: 0.7rem;
}
summary { cursor: pointer; font-weight: 700; padding: 0.8rem 0; list-style-position: outside; }
details p { color: var(--ink-soft); }
details[open] summary { color: var(--gold); }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .roll, .split { grid-template-columns: 1fr; }
  .tray { max-width: 320px; margin-inline: auto; width: 100%; }
  .grid-3 { grid-template-columns: 1fr; }
  .screens { grid-template-columns: 1fr 1.62fr; }
  .screens .mac { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .reactions, .grid-2 { grid-template-columns: 1fr; }
  .site-header .wrap { justify-content: center; }
  /* Four links have to fit across a phone. */
  .site-nav { gap: 0.1rem; justify-content: center; }
  .site-nav a { padding: 0.35rem 0.6rem; font-size: 0.97rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .die.rolling { animation: none; }
  .button, .reaction { transition: none; }
}
