/* ===========================================================================
   GBBS Fantasy — "Modern Artisan Bakery" design system.
   Warm flour-cream paper, ivory card surfaces, burnt-caramel accents,
   butter highlights, espresso ink. Fraunces for display, Inter for UI.

   No build step, no Tailwind — this file owns everything. Every class the
   JS render code references is defined below (see the inventory in the
   handoff report). CSS custom-property NAMES are kept stable because a few
   inline styles in the JS resolve var(--cream), var(--ink-soft) and
   var(--danger-deep) directly — do not rename those three.
   =========================================================================== */

:root {
  /* --- surfaces --- */
  --flour: #f6efe1;          /* page background (warm flour cream) */
  --cream: #f6efe1;          /* alias: referenced inline in admin.js (recessed panels) */
  --cream-2: #fffbf4;        /* ivory card surface */
  --cream-3: #fbf5ea;        /* slightly recessed inner surface */
  --cream-hi: #fff7ea;       /* light text/ink on dark caramel */

  /* --- ink --- */
  --ink: #2a1e16;            /* espresso body text */
  --cocoa: #33241a;          /* dark-chocolate headings */
  --ink-soft: #7a6650;       /* muted brown (labels, meta) — referenced inline */
  --ink-faint: #a2917c;      /* faint brown (placeholders, disabled) */

  /* --- accents --- */
  --crust: #b45a1f;          /* primary burnt-caramel / copper */
  --crust-deep: #8f4517;     /* pressed / hover depth */
  --crust-soft: #f2e1cd;     /* caramel tint wash (hover backgrounds) */
  --butter: #d99a2b;         /* golden butter highlight */
  --butter-soft: #f2d38a;    /* light butter (gradients, fills) */
  --plum: #7b3b4e;           /* supporting deep rye/plum (contrast chips) */
  --plum-soft: #efdde2;

  /* --- lines --- */
  --line: #e7d2b4;           /* soft caramel border */
  --line-soft: #efe3cd;      /* faint divider */

  /* --- status --- */
  --danger: #b8443a;         /* warm red-brown */
  --danger-deep: #8c2f26;    /* danger text — referenced inline */
  --danger-soft: #f4dcd6;
  --good: #5f7a46;           /* warm olive (success) */
  --good-soft: #e4ecd6;
  --info: #b06a1f;           /* caramel info */
  --info-soft: #f3e4cd;

  /* --- rank chips --- */
  --gold: #e0a93b;
  --gold-2: #c8891f;
  --silver: #c7b8a2;
  --silver-2: #a99a83;
  --bronze: #bd7a44;
  --bronze-2: #9c5d2e;

  /* --- geometry --- */
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --focus: rgba(180, 90, 31, 0.60);
  --shadow: 0 1px 2px rgba(74, 44, 18, 0.05), 0 10px 26px rgba(96, 58, 24, 0.10);
  --shadow-sm: 0 1px 2px rgba(74, 44, 18, 0.06), 0 4px 12px rgba(96, 58, 24, 0.08);
  --shadow-lg: 0 2px 6px rgba(74, 44, 18, 0.08), 0 20px 48px rgba(70, 40, 14, 0.18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  background-color: var(--flour);
  /* Layered warmth + a whisper of paper grain (CSS-only, no external assets). */
  background-image:
    radial-gradient(1100px 520px at 12% -12%, rgba(217, 154, 43, 0.14), transparent 58%),
    radial-gradient(980px 480px at 100% -4%, rgba(180, 90, 31, 0.10), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  /* no background-attachment: fixed — it janks / is ignored on iOS Safari */
}

h1, h2, h3, .display {
  font-family: 'Fraunces', 'Georgia', serif;
  font-optical-sizing: auto;
  color: var(--cocoa);
  letter-spacing: -0.01em;
  font-weight: 700;
}
h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.08; margin: 6px 0 14px; }
em, .flavor { font-style: italic; }

a { color: var(--crust); font-weight: 600; text-underline-offset: 2px; }
a:hover { color: var(--crust-deep); }

/* Visible focus ring everywhere (accessibility). */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Crust ribbon + header ------------------------------------------ */
.bunting {
  height: 12px;
  background:
    linear-gradient(90deg, var(--crust-deep), var(--crust) 30%, var(--butter) 62%, var(--crust) 92%);
  box-shadow: inset 0 -1px 0 rgba(74, 44, 18, 0.18);
}

.app-header { position: sticky; top: 0; z-index: 30; }

.header-inner {
  position: relative;
  background: var(--cream-2);
  border-bottom: 1.5px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(96, 58, 24, 0.07);
}
.brand { display: flex; flex-direction: column; line-height: 1.02; margin-right: auto; }
.brand-mark {
  font-family: 'Fraunces', serif; font-optical-sizing: auto;
  font-weight: 900; font-size: 26px; color: var(--crust);
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 11px; color: var(--ink-soft); font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; margin-top: 3px;
}
.app-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-link {
  text-decoration: none; color: var(--cocoa); font-weight: 700;
  padding: 8px 15px; border-radius: var(--radius-pill); font-size: 15px;
  transition: background-color .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--crust-soft); color: var(--crust-deep); }
.nav-active {
  background: linear-gradient(135deg, var(--crust), #c56a24);
  color: var(--cream-hi);
  box-shadow: 0 2px 8px rgba(143, 69, 23, 0.28);
}
.nav-active:hover { background: linear-gradient(135deg, var(--crust-deep), var(--crust)); color: var(--cream-hi); }
.header-right { display: flex; align-items: center; gap: 10px; }
.who { font-weight: 700; color: var(--ink-soft); font-size: 14px; }

/* ---------- Layout --------------------------------------------------------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 84px; }
.grid { display: grid; gap: 18px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Cards ---------------------------------------------------------- */
.card {
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-title {
  margin: 0 0 14px;
  font-size: 21px;
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  flex-wrap: wrap;
}
.card-title .muted, .card-title .small { font-weight: 600; }
.card-hint { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 12px; }

/* eyebrow micro-label helper */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--crust);
}

/* --- Your standing: warm caramel hero --- */
.standing-card {
  position: relative;
  background:
    radial-gradient(130% 150% at 100% 0%, rgba(217, 154, 43, 0.55), transparent 52%),
    linear-gradient(135deg, var(--crust-deep) 0%, var(--crust) 58%, #c1692a 100%);
  border: 1px solid rgba(70, 35, 10, 0.28);
  color: var(--cream-hi);
  box-shadow: 0 2px 6px rgba(74, 44, 18, 0.12), 0 16px 40px rgba(96, 52, 18, 0.22);
}
.standing-card .card-title,
.standing-card h2 { color: #fff7ea; }
.standing-card .card-hint,
.standing-card .muted { color: rgba(255, 247, 234, 0.86); }
.standing-card a { color: #fff7ea; text-decoration: underline; }
.standing-card .btn-primary {
  background: #fff7ea; color: var(--crust-deep);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 8px rgba(60, 32, 10, 0.28);
}
.standing-card .btn-primary:hover { background: #fff; filter: none; }
.standing-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  flex: 1 1 120px;
  background: rgba(255, 251, 244, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  padding: 14px 14px; text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.stat-num {
  font-family: 'Fraunces', serif; font-optical-sizing: auto;
  font-size: 34px; font-weight: 900; color: var(--cocoa); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 12px; color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 700; margin-top: 6px;
}
.standing-card .empty {
  background: rgba(255, 251, 244, 0.16);
  border-color: rgba(255, 247, 234, 0.5);
  color: #fff7ea;
}

/* ---------- Buttons -------------------------------------------------------- */
.btn {
  font-family: inherit; font-weight: 700; font-size: 16px;
  border: 1.5px solid transparent; border-radius: var(--radius-pill);
  padding: 12px 20px; cursor: pointer;
  transition: transform .05s ease, filter .15s ease, background-color .15s ease, box-shadow .15s ease;
  background: var(--cream-3); color: var(--ink);
  min-height: 44px; line-height: 1.1;
}
.btn:hover { filter: brightness(0.98); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

.btn-primary {
  background: linear-gradient(180deg, #c1692a, var(--crust));
  color: var(--cream-hi);
  border-color: rgba(70, 35, 10, 0.25);
  box-shadow: 0 2px 0 var(--crust-deep), 0 6px 16px rgba(143, 69, 23, 0.28),
              inset 0 1px 0 rgba(255, 233, 200, 0.35);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--crust), var(--crust-deep)); filter: none; }
.btn-primary:active { box-shadow: 0 1px 0 var(--crust-deep), 0 3px 8px rgba(143, 69, 23, 0.28); }

.btn-secondary {
  background: linear-gradient(180deg, var(--butter-soft), var(--butter));
  color: #4a3410; border-color: rgba(120, 80, 20, 0.28);
  box-shadow: 0 2px 0 #b07f1e, inset 0 1px 0 rgba(255, 245, 220, 0.6);
}
.btn-secondary:hover { background: linear-gradient(180deg, var(--butter), #c88f24); filter: none; }

.btn-ghost {
  background: transparent; border-color: var(--line); color: var(--cocoa);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--crust-soft); border-color: var(--crust); color: var(--crust-deep); filter: none; }

.btn-danger {
  background: linear-gradient(180deg, #c14b40, var(--danger));
  color: #fff; border-color: rgba(90, 25, 18, 0.3);
  box-shadow: 0 2px 0 var(--danger-deep), 0 6px 16px rgba(140, 47, 38, 0.24);
}
.btn-danger:hover { background: linear-gradient(180deg, var(--danger), var(--danger-deep)); filter: none; }

.btn-sm { padding: 8px 14px; font-size: 14px; min-height: 38px; }
.btn-block { display: block; width: 100%; }

/* status toggle pills (admin) */
.btn-pill { background: var(--cream-3); border-color: var(--line); color: var(--cocoa); box-shadow: none; }
.btn-pill:hover { background: var(--crust-soft); }
.btn-pill.on {
  background: linear-gradient(135deg, var(--crust), #c56a24);
  color: var(--cream-hi); border-color: var(--crust-deep);
  box-shadow: 0 2px 8px rgba(143, 69, 23, 0.25);
}

/* ---------- Forms ---------------------------------------------------------- */
label {
  font-weight: 700; color: var(--cocoa); font-size: 14.5px;
  display: block; margin-bottom: 6px;
}
input, select, textarea {
  font-family: inherit; font-size: 16.5px; width: 100%;
  padding: 12px 13px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); min-height: 46px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--crust);
  box-shadow: 0 0 0 3px var(--focus);
}
textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
select {
  appearance: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%238f4517' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
.field { margin-bottom: 15px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 140px; }
.muted { color: var(--ink-soft); font-size: 14px; }
.error-text {
  color: var(--danger-deep); font-weight: 700; font-size: 14px;
  margin-top: 6px; min-height: 18px;
}

/* ---------- Badges / chips ------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--cream-3); border: 1px solid var(--line); color: var(--cocoa);
  font-variant-numeric: tabular-nums;
}
/* multiplier tiers: 1.5x deep caramel · 1.25x butter · 1.0x neutral */
.badge-mult1 { background: linear-gradient(135deg, var(--crust), #c56a24); border-color: var(--crust-deep); color: var(--cream-hi); }
.badge-mult2 { background: linear-gradient(135deg, var(--butter-soft), var(--butter)); border-color: #bd8a1f; color: #4a3410; }
.badge-mult3 { background: var(--cream-3); border-color: var(--line); color: var(--ink-soft); }

.chip {
  font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: var(--radius-pill);
  text-transform: uppercase; letter-spacing: 0.05em; display: inline-block;
}
.chip-draft { background: #ece0cb; color: #7a6650; }
.chip-approved { background: var(--crust-soft); color: var(--crust-deep); }
.chip-sent { background: var(--good-soft); color: #3f5a2b; }
.chip-failed { background: var(--danger-soft); color: var(--danger-deep); }
.chip-needs_review { background: #f7e3bd; color: #8a6410; }

/* ---------- Team slots ----------------------------------------------------- */
.team-list { display: grid; gap: 12px; }
.team-slot {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; background: var(--cream-2);
  box-shadow: var(--shadow-sm);
}
.team-slot.dead {
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.015) 0 6px, transparent 6px 12px),
    #f1eadd;
  opacity: 0.85;
}
.slot-rank {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 18px;
  background: linear-gradient(135deg, var(--butter-soft), var(--butter));
  color: #4a3410; box-shadow: inset 0 1px 0 rgba(255, 245, 220, 0.7);
}
.team-slot.dead .slot-rank { background: #ddd0bd; color: #857258; }
.slot-main { flex: 1 1 auto; min-width: 0; }
.slot-name { font-weight: 800; font-size: 17px; color: var(--cocoa); }
.slot-name.struck { text-decoration: line-through; color: var(--ink-faint); text-decoration-color: var(--ink-faint); }
.slot-meta {
  font-size: 13px; color: var(--ink-soft); display: flex; gap: 6px;
  flex-wrap: wrap; align-items: center; margin-top: 5px;
}

/* ---------- Leaderboard ---------------------------------------------------- */
.lb { width: 100%; border-collapse: collapse; }
.lb th, .lb td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line-soft); }
.lb th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-soft); font-weight: 800;
}
.lb tr.lb-row { cursor: pointer; transition: background-color .12s ease; }
.lb tr.lb-row:hover { background: var(--crust-soft); }
.lb tr.lb-me { background: #fbeecb; }
.lb tr.lb-me:hover { background: #f7e6bb; }
.lb .num {
  text-align: right; font-variant-numeric: tabular-nums;
  font-weight: 800; color: var(--cocoa);
}
.lb .rankcell { width: 58px; }

/* rank chips (top-3 gold / silver / bronze) */
.rank-badge {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 14px;
  color: var(--ink-soft); background: transparent;
  font-variant-numeric: tabular-nums;
}
.rank-badge.rank-top { color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.4); }
.rank-badge.rank-1 { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #4a3410; }
.rank-badge.rank-2 { background: linear-gradient(135deg, var(--silver), var(--silver-2)); color: #3d3327; }
.rank-badge.rank-3 { background: linear-gradient(135deg, var(--bronze), var(--bronze-2)); color: #fff; }

/* expandable week breakdown — bakery-receipt feel */
.lb-detail td {
  background: var(--cream-3);
  border-top: 2px dashed var(--line);
  padding: 6px 12px 14px;
}
.lb-week { margin: 10px 0 4px; }
.lb-week h4 { margin: 0 0 6px; font-size: 14px; color: var(--crust-deep); letter-spacing: 0.01em; }
.lb-line {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 14px; padding: 3px 0;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px dotted var(--line);
}
.lb-line:last-child { border-bottom: 0; }
.lb-line .lbl { color: var(--ink-soft); }
.lb-line > span:last-child { font-weight: 700; color: var(--cocoa); }
.caret {
  transition: transform .15s ease; display: inline-block;
  color: var(--crust); margin-right: 2px;
}
.caret.open { transform: rotate(90deg); }

/* ---------- Board ---------------------------------------------------------- */
.post {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; background: var(--cream-2); margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.post-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; align-items: baseline; }
.post-author { font-weight: 800; color: var(--crust-deep); }
.post-time { font-size: 12px; color: var(--ink-soft); }
.post-body { white-space: pre-wrap; word-break: break-word; }

/* ---------- Draft ---------------------------------------------------------- */
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.cast-chip {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 12px; background: var(--cream-2);
  cursor: pointer; font-weight: 700; text-align: center; color: var(--cocoa);
  transition: border-color .12s ease, background-color .12s ease, transform .05s ease;
  min-height: 52px; display: grid; place-items: center;
}
.cast-chip:hover { border-color: var(--crust); background: var(--crust-soft); }
.cast-chip:active { transform: translateY(1px); }
.cast-chip.picked {
  opacity: 0.55; cursor: default; color: var(--ink-soft);
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.02) 0 6px, transparent 6px 12px),
    #f1eadd;
  border-style: dashed;
}
.cast-chip.picked:hover { border-color: var(--line); background: #f1eadd; }
.draft-slot {
  display: flex; align-items: center; gap: 12px; border: 2px dashed var(--line);
  border-radius: var(--radius-sm); padding: 14px; background: var(--cream-3); min-height: 66px;
}
.draft-slot.filled { border-style: solid; background: var(--cream-2); box-shadow: var(--shadow-sm); }
.draft-slot .slot-rank { width: 34px; height: 34px; font-size: 16px; }
.draft-slot .slot-tag { font-weight: 800; color: var(--crust); font-variant-numeric: tabular-nums; }
.draft-slot .slot-baker { flex: 1 1 auto; font-weight: 800; color: var(--cocoa); }
.reorder { display: flex; gap: 4px; }

/* ---------- Tabs (admin) --------------------------------------------------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab-btn {
  border: 1.5px solid var(--line); background: var(--cream-2); border-radius: var(--radius-pill);
  padding: 9px 16px; font-weight: 700; cursor: pointer; color: var(--cocoa);
  font-size: 15px; font-family: inherit; min-height: 42px;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.tab-btn:hover { background: var(--crust-soft); border-color: var(--crust); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--crust), #c56a24);
  color: var(--cream-hi); border-color: var(--crust-deep);
  box-shadow: 0 2px 8px rgba(143, 69, 23, 0.26);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Results grid --------------------------------------------------- */
.results-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.results-table th, .results-table td {
  padding: 10px 8px; border-bottom: 1px solid var(--line-soft); text-align: center;
}
.results-table th:first-child, .results-table td:first-child { text-align: left; }
.results-table thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-soft); font-weight: 800; background: var(--cream-3);
}
.results-table tbody tr:nth-child(even) { background: rgba(122, 102, 80, 0.045); }
.results-table tbody tr:hover { background: var(--crust-soft); }
.results-table select { width: auto; padding: 8px 28px 8px 10px; min-height: 40px; }
.results-table input[type="checkbox"], .results-table input[type="radio"] {
  width: 22px; height: 22px; min-height: 0; accent-color: var(--crust);
}
.table-scroll { overflow-x: auto; }

/* sticky results header (scoped: needs a scroll region with a max-height) */
#tab-results .table-scroll { max-height: 66vh; overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); }
#tab-results .results-table thead th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }

/* checkbox / radio sizing across the console */
input[type="checkbox"], input[type="radio"] { accent-color: var(--crust); }

/* finale panel — golden wash, visually distinct */
.finale-card {
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(217, 154, 43, 0.28), transparent 55%),
    linear-gradient(135deg, #fbeecb, #f6e2b0);
  border: 1px solid #e6c877;
  box-shadow: 0 2px 6px rgba(120, 85, 25, 0.10), inset 0 1px 0 rgba(255, 250, 235, 0.7);
}
.finale-card .card-title { color: var(--crust-deep); }

/* ---------- Toasts --------------------------------------------------------- */
.toast-root {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(92vw, 460px);
}
.toast {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 14px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  font-weight: 700; font-size: 15px;
  opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease;
}
.toast-in { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--danger-soft); color: var(--danger-deep); border: 1.5px solid var(--danger); }
.toast-success { background: var(--good-soft); color: #3c5729; border: 1.5px solid var(--good); }
.toast-info { background: var(--info-soft); color: var(--crust-deep); border: 1.5px solid var(--crust); }
.toast-close {
  background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer;
  color: inherit; padding: 0 4px; min-height: 0;
}

/* ---------- Modal ---------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(42, 30, 22, 0.5);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 90; padding: 16px;
  opacity: 0; transition: opacity .15s ease;
}
.modal-overlay.modal-shown { opacity: 1; }
.modal {
  background: var(--cream-2); border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); width: min(92vw, 440px); padding: 22px;
}
.modal-title { margin: 0 0 12px; font-size: 21px; }
.modal-body { margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- States --------------------------------------------------------- */
.empty {
  text-align: center; color: var(--ink-soft); padding: 26px 16px 22px;
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: var(--cream-3);
  font-size: 15px;
}
/* a small flavour sprig above empty-state copy (inline SVG, no assets) */
.empty::before {
  content: '';
  display: block; width: 34px; height: 34px; margin: 0 auto 8px;
  opacity: 0.7;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45a1f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M12 7c-2 0-3.4-1.2-3.4-3.2C10.6 3.8 12 5 12 7zm0 0c2 0 3.4-1.2 3.4-3.2C13.4 3.8 12 5 12 7z'/%3E%3Cpath d='M12 12c-2.2 0-3.7-1.3-3.7-3.4C10.5 8.6 12 9.9 12 12zm0 0c2.2 0 3.7-1.3 3.7-3.4C13.5 8.6 12 9.9 12 12z'/%3E%3Cpath d='M12 17c-2.2 0-3.7-1.3-3.7-3.4C10.5 13.6 12 14.9 12 17zm0 0c2.2 0 3.7-1.3 3.7-3.4C13.5 13.6 12 14.9 12 17z'/%3E%3C/svg%3E");
}
.standing-card .empty::before { filter: brightness(0) invert(1); opacity: 0.85; }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--crust);
  animation: spin .8s linear infinite; margin: 22px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center-narrow { max-width: 452px; margin: 40px auto; }

/* login flourish (inline SVG whisk + wheat, sits above the auth card) */
.login-crest {
  display: block; width: 72px; height: 72px; margin: 8px auto 2px;
  color: var(--crust);
}

/* ---------- Utilities ------------------------------------------------------ */
.list-reset { list-style: none; padding: 0; margin: 0; }
.stack > * + * { margin-top: 14px; }
.flex { display: flex; }
.between { justify-content: space-between; align-items: center; }
.gap { gap: 10px; }
.wrap-flex { flex-wrap: wrap; }
.pt { padding-top: 12px; }
.hidden { display: none !important; }
.right { text-align: right; }
.small { font-size: 13px; }

/* tabular figures for all numeric surfaces */
.num, .stat-num, .lb-line, .rank-badge, .badge, .slot-tag { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
