/* Sumo Sort — Ember Night, the game's only theme (same tokens as res/values/brand_colors.xml). */

@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit_medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit_bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ground: #221A1D;
  --surface: #32262B;
  --tube-fill: #2B2025;
  --outline: #8A727C;
  --text: #F4E8DC;
  --text-2: #C9B5A8;
  --accent: #F4B64A;
  --on-accent: #221A1D;
  --warning: #EC7392;
  --ball-sand: #EADBA8;
  --ball-teal: #62C4B6;
  --ball-peach: #F28C63;
  --ball-amber: #F4B64A;
  --ball-rose: #EC7392;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Brand header ---------- */

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 0 24px;
}

.mascot {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
}
.mascot img { width: 96px; height: auto; display: block; }
.brand--small .mascot { width: 84px; height: 84px; }
.brand--small .mascot img { width: 60px; }

.wordmark {
  margin: 18px 0 0;
  font-weight: 700;
  font-size: clamp(30px, 7vw, 40px);
  letter-spacing: 0.12em;
  line-height: 1.1;
  color: var(--text);
}
.wordmark a { color: inherit; text-decoration: none; }
.brand--small .wordmark { font-size: 26px; }
.tagline { margin: 6px 0 0; color: var(--text-2); font-size: 18px; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border-radius: 22px;
  padding: 24px;
  margin: 16px 0;
}
.card--accent { border: 2px solid var(--accent); }

h1 {
  font-weight: 700;
  font-size: clamp(30px, 6vw, 38px);
  line-height: 1.15;
  margin: 8px 0 6px;
}
.meta { color: var(--text-2); margin: 0 0 8px; }

h2 {
  font-weight: 700;
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
h3 { font-weight: 700; font-size: 18px; margin: 18px 0 6px; }

p { margin: 0 0 12px; }
p:last-child, ul:last-child { margin-bottom: 0; }
ul { margin: 0 0 12px; padding-left: 22px; }
li { margin: 4px 0; }
li::marker { color: var(--accent); }
strong { color: var(--text); font-weight: 700; }
.muted { color: var(--text-2); }

/* Numbered balls as section markers, colored like the game's balls. */
.ball {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  color: var(--on-accent);
  background: var(--ball-sand);
}
.ball--teal { background: var(--ball-teal); }
.ball--peach { background: var(--ball-peach); }
.ball--amber { background: var(--ball-amber); }
.ball--rose { background: var(--ball-rose); }

/* ---------- Contents ---------- */

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.toc a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--tube-fill);
  border: 1px solid var(--outline);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}
.toc a:hover { border-color: var(--accent); }

/* ---------- Data table ---------- */

.table-wrap { overflow-x: auto; margin: 8px 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid #4a3a41; }
th { color: var(--text-2); font-weight: 700; white-space: nowrap; }
td:first-child { font-weight: 700; color: var(--text); min-width: 140px; }

/* ---------- Home page ---------- */

.tube {
  display: block;
  margin: 28px auto 8px;
  width: 120px;
  height: auto;
}
.lead { font-size: 19px; text-align: center; color: var(--text); max-width: 560px; margin: 8px auto 0; }
.chip {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 15px;
}
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 28px 0 8px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 26px;
  border-radius: 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}
.button--quiet { background: var(--surface); color: var(--text); }

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

footer {
  color: var(--text-2);
  text-align: center;
  font-size: 15px;
  padding: 32px 0 48px;
}
footer a { color: var(--text-2); }

/* Visible only while a value still has to be filled in before going live. */
.todo { color: var(--warning); font-weight: 700; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .card { padding: 20px 18px; border-radius: 20px; }
  h2 { font-size: 20px; }
  .ball { width: 32px; height: 32px; font-size: 15px; }
}

@media (prefers-reduced-motion: no-preference) {
  .toc a, .button { transition: border-color 0.15s ease, transform 0.15s ease; }
  .button:hover { transform: translateY(-1px); }
}
