/* ============================================================
   The Scorekeeper — editorial ledger aesthetic
   Paper cream, warm ink, brass, felt-emerald, bordeaux
   Typography: Fraunces (display), Instrument Sans (body),
               JetBrains Mono (scores)
   ============================================================ */

:root {
  --paper: #f3ead9;
  --paper-2: #ede2cc;
  --paper-3: #e4d6ba;
  --ink: #1a1612;
  --ink-2: #3a332a;
  --ink-3: #6e6457;
  --rule: #c9b68f;
  --rule-soft: #d8c9a8;

  --brass: #a8813b;
  --brass-deep: #8a6527;
  --brass-soft: #d7b87a;

  --felt: #2c5747;
  --felt-deep: #1e3d31;

  --bordeaux: #8f3230;
  --bordeaux-deep: #6e2321;

  --gold-leaf: linear-gradient(180deg, #e2c07a 0%, #b38a3b 100%);

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 14px;

  --shadow-plate: 0 1px 0 rgba(26, 22, 18, 0.04),
                   0 10px 30px -18px rgba(26, 22, 18, 0.35);
  --shadow-lift: 0 2px 0 rgba(26, 22, 18, 0.05),
                 0 22px 50px -24px rgba(26, 22, 18, 0.45);

  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --display: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ----- reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
ol, ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }

/* ----- page -------------------------------------------------- */
body {
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 20% -10%, #f8f0df 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 20%, #ecdfc6 0%, transparent 55%),
    var(--paper);
  min-height: 100vh;
  font-feature-settings: "ss01", "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(rgba(60, 45, 20, 0.18) 1px, transparent 1px),
    radial-gradient(rgba(60, 45, 20, 0.10) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
}

/* ----- masthead --------------------------------------------- */
.masthead {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 56px) 0;
}

.masthead__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.masthead__mark {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.masthead__ornament {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(44px, 7vw, 72px);
  color: var(--brass);
  line-height: 0.8;
  transform: translateY(6px);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.masthead__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(36px, 6vw, 60px);
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: 1;
}

.masthead__meta {
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.masthead__edition { color: var(--brass-deep); font-weight: 600; }
.masthead__dot { opacity: 0.5; }

.masthead__dek {
  margin-top: 14px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(16px, 1.8vw, 20px);
  color: var(--ink-2);
  max-width: 50ch;
  font-variation-settings: "opsz" 20, "SOFT" 60;
}

.masthead__rule {
  margin: clamp(24px, 4vw, 40px) 0 0;
  border: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--rule) 8%,
    var(--rule) 92%,
    transparent 100%
  );
}

/* ----- stage ------------------------------------------------- */
.stage {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) clamp(20px, 5vw, 56px) 80px;
}

/* ----- section heading -------------------------------------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.section-head__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 38px);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 80, "SOFT" 40;
}

.eyebrow {
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 14px;
}

/* ----- buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-m);
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 14px;
  transition: transform 0.18s var(--ease-soft), background 0.18s, color 0.18s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, var(--shadow-plate);
}
.btn--primary:hover { background: #000; }

.btn--ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--rule);
}
.btn--ghost:hover { background: var(--paper-2); color: var(--ink); }

.btn--danger {
  background: var(--bordeaux);
  color: #fdf7ef;
}
.btn--danger:hover { background: var(--bordeaux-deep); }

.btn--danger-ghost {
  background: transparent;
  color: var(--bordeaux);
  border: 1px solid rgba(143, 50, 48, 0.3);
}
.btn--danger-ghost:hover { background: rgba(143, 50, 48, 0.08); }

.btn__plus {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--brass);
  color: var(--paper);
  font-weight: 700;
  font-size: 14px;
  line-height: 0;
  margin-right: 2px;
}

.linklike {
  background: transparent;
  color: var(--ink-2);
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 0 2px 1px;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}
.linklike:hover { color: var(--ink); border-color: var(--brass); }
.linklike--quiet { color: var(--ink-3); }

/* ----- games list ------------------------------------------- */
.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.game-card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-l);
  padding: 22px 22px 20px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s var(--ease-soft), box-shadow 0.25s, border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  animation: card-in 0.45s var(--ease-soft) both;
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold-leaf);
  opacity: 0;
  transition: opacity 0.25s;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--brass-soft);
  box-shadow: var(--shadow-lift);
  background: #f5ecd9;
}
.game-card:hover::before { opacity: 1; }

.game-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.game-card__name {
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-variation-settings: "opsz" 40, "SOFT" 50;
}

.game-card__date {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  padding-top: 4px;
}

.game-card__players {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 4px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.chip--leader {
  background: var(--ink);
  color: var(--paper);
}
.chip--leader::before {
  content: "★";
  color: var(--brass-soft);
  font-size: 10px;
}

.game-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.game-card__foot strong {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0;
}

/* ----- empty state ------------------------------------------ */
.empty {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  color: var(--ink-3);
  padding: 48px 0;
  text-align: center;
}
.empty--inline { padding: 24px 0; font-size: 15px; }

/* ----- crumbs & game head ----------------------------------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.crumbs__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  padding: 4px 8px;
  border-radius: var(--radius-s);
  transition: background 0.15s, color 0.15s;
}
.crumbs__back:hover { background: var(--paper-2); color: var(--ink); }

.crumbs__sep { opacity: 0.5; }
.crumbs__now { color: var(--ink); font-weight: 500; }

.game-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 34px;
}

.game-head__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 4.5vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variation-settings: "opsz" 120, "SOFT" 40;
}

.game-head__sub {
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8px;
}

.game-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----- leaderboard ------------------------------------------ */
.leaderboard {
  margin-bottom: 48px;
}

.leaderboard__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.rank {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 18px;
  align-items: start;
  padding: 20px 22px 18px;
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-l);
  transition: transform 0.45s var(--ease-spring), background 0.3s, border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}

.rank--1 {
  background: linear-gradient(180deg, #1a1612 0%, #2a2218 100%);
  color: var(--paper);
  border-color: var(--brass-deep);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, var(--shadow-lift);
  padding-top: 30px;
}
.rank--1 .rank__numeral { color: var(--brass-soft); }
.rank--1 .rank__name { color: var(--paper); }
.rank--1 .rank__score { color: var(--brass-soft); }
.rank--1 .rank__bar { background: rgba(215, 184, 122, 0.9); }
.rank--1 .rank__meta,
.rank--1 .rank__delta,
.rank--1 .rank__seat { color: rgba(215, 184, 122, 0.75); }

.rank--1::after {
  content: "Leading";
  position: absolute;
  top: 12px; right: 18px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-soft);
  font-weight: 600;
}

.rank__numeral {
  font-family: var(--display);
  font-weight: 300;
  font-size: 64px;
  line-height: 0.85;
  color: var(--brass);
  font-variation-settings: "opsz" 144, "SOFT" 80;
  min-width: 54px;
  text-align: center;
  align-self: center;
  padding-top: 4px;
}

.rank__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.rank__name {
  display: block;
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-variation-settings: "opsz" 60, "SOFT" 40;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.rank__score {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 34px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.rank__bar {
  display: block;
  height: 2px;
  background: var(--brass);
  border-radius: 2px;
  width: 0;
  transition: width 0.6s var(--ease-soft);
  margin-top: 10px;
}

.rank__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

.rank__seat { flex: 0 0 auto; }
.rank__delta {
  flex: 0 1 auto;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank.is-entering { animation: rank-flash 0.6s var(--ease-soft); }

/* ----- round entry ------------------------------------------ */
.round-entry {
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-l);
  padding: 24px 24px 20px;
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
}
.round-entry::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--felt-deep), var(--felt));
  opacity: 0.7;
}

.round-entry__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.round-entry__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.round-entry__field label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.round-entry__field label .roman {
  font-family: var(--display);
  font-size: 14px;
  color: var(--brass);
  letter-spacing: 0;
  font-variation-settings: "opsz" 40;
}

.round-entry__field input {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}
.round-entry__field input::placeholder { color: rgba(110, 100, 87, 0.6); font-weight: 400; }
.round-entry__field input:focus {
  outline: none;
  border-color: var(--brass);
  background: #fdf6e6;
  box-shadow: 0 0 0 3px rgba(168, 129, 59, 0.15);
}

.round-entry__submit {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.round-entry__hint {
  margin-top: 12px;
  color: var(--ink-3);
  font-size: 12px;
}
.round-entry__hint kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--paper);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
}

/* ----- history table ---------------------------------------- */
.history__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.history__key {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.history__key .minus { color: var(--bordeaux); }

.history__scroller {
  overflow-x: auto;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-l);
  background: var(--paper-2);
  scrollbar-width: thin;
}

.rounds {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.rounds thead th {
  background: var(--paper-3);
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
}

.rounds thead th:first-child {
  text-align: left;
  color: var(--brass-deep);
}

.rounds tbody td {
  padding: 11px 14px;
  text-align: right;
  border-bottom: 1px solid rgba(201, 182, 143, 0.4);
  color: var(--ink);
}

.rounds tbody td:first-child {
  font-family: var(--display);
  font-style: italic;
  color: var(--ink-3);
  text-align: left;
  font-size: 14px;
  font-variation-settings: "opsz" 20, "SOFT" 80;
  width: 1%;
  white-space: nowrap;
}

.rounds tbody td:last-child {
  width: 1%;
  padding-right: 10px;
}

.rounds tbody tr:hover td { background: rgba(168, 129, 59, 0.06); }
.rounds tbody tr:last-child td { border-bottom: 0; }

.score-cell.neg { color: var(--bordeaux); }
.score-cell.pos { color: var(--ink); }
.score-cell.zero { color: var(--ink-3); }

.rounds tfoot td {
  padding: 14px;
  font-weight: 700;
  font-size: 16px;
  border-top: 1px solid var(--ink);
  background: var(--paper-3);
  text-align: right;
  color: var(--ink);
}
.rounds tfoot td:first-child {
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  font-weight: 600;
}
.rounds tfoot td.is-leader {
  color: var(--brass-deep);
}
.rounds tfoot td.is-leader::after {
  content: " ★";
  color: var(--brass);
  font-size: 12px;
}

.row-delete {
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rounds tbody tr:hover .row-delete { opacity: 1; }
.row-delete:hover { color: var(--bordeaux); }

/* ----- dialogs ---------------------------------------------- */
.dialog {
  border: 0;
  border-radius: var(--radius-l);
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  width: min(520px, 92vw);
  font-family: var(--body);
}

.dialog::backdrop {
  background: rgba(26, 22, 18, 0.5);
  backdrop-filter: blur(3px);
}

.dialog[open] { animation: dialog-in 0.28s var(--ease-soft); }

.dialog__form {
  padding: 28px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dialog__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 60, "SOFT" 40;
}

.dialog__sub {
  color: var(--ink-3);
  font-size: 14px;
  margin-top: -10px;
}

.dialog__menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field__label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.field__input {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.field__input:focus {
  outline: none;
  background: #fdf6e6;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(168, 129, 59, 0.15);
}

.players-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 420px) {
  .players-grid { grid-template-columns: 1fr; }
}

.player-field {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  padding-left: 44px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.player-field:focus-within {
  background: #fdf6e6;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(168, 129, 59, 0.15);
}
.player-field span {
  position: absolute;
  left: 14px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 14px;
  color: var(--brass);
  font-variation-settings: "opsz" 30;
  letter-spacing: 0.04em;
}
.player-field input {
  border: 0;
  background: transparent;
  padding: 12px 14px;
  font-size: 15px;
  width: 100%;
}
.player-field input:focus { outline: none; }

.error {
  color: var(--bordeaux);
  font-size: 13px;
  background: rgba(143, 50, 48, 0.08);
  padding: 10px 12px;
  border-radius: var(--radius-s);
  border-left: 2px solid var(--bordeaux);
}

/* ----- colophon --------------------------------------------- */
.colophon {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 40px auto 0;
  padding: 0 clamp(20px, 5vw, 56px) 48px;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.colophon hr {
  border: 0;
  border-top: 1px solid var(--rule-soft);
  margin: 0 0 18px;
}
.colophon p { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.colophon__sep { opacity: 0.4; }

/* ----- animations ------------------------------------------- */
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rank-flash {
  0%   { background: #fdf6e6; }
  100% { background: var(--paper-2); }
}
.rank--1.is-entering { animation: rank-flash-dark 0.6s var(--ease-soft); }
@keyframes rank-flash-dark {
  0%   { box-shadow: 0 0 0 3px rgba(215, 184, 122, 0.45), var(--shadow-lift); }
  100% { box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, var(--shadow-lift); }
}

/* ----- staggered reveals for index -------------------------- */
.games .game-card:nth-child(1) { animation-delay: 0.00s; }
.games .game-card:nth-child(2) { animation-delay: 0.05s; }
.games .game-card:nth-child(3) { animation-delay: 0.10s; }
.games .game-card:nth-child(4) { animation-delay: 0.15s; }
.games .game-card:nth-child(5) { animation-delay: 0.20s; }
.games .game-card:nth-child(n+6) { animation-delay: 0.25s; }

.leaderboard__list .rank { animation: card-in 0.45s var(--ease-soft) both; }
.leaderboard__list .rank:nth-child(1) { animation-delay: 0.00s; }
.leaderboard__list .rank:nth-child(2) { animation-delay: 0.05s; }
.leaderboard__list .rank:nth-child(3) { animation-delay: 0.10s; }
.leaderboard__list .rank:nth-child(4) { animation-delay: 0.15s; }

/* ----- responsive tweaks ------------------------------------ */
@media (max-width: 640px) {
  .section-head { align-items: flex-start; }
  .rank__numeral { font-size: 44px; }
  .rank__score { font-size: 24px; }
  .game-head__title { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
