:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-2: #f3ede4;
  --ink: #1f1a17;
  --ink-2: #5e554e;
  --ink-3: #8d837a;
  --line: #e6ddd1;
  --accent: #d6402b;
  --accent-ink: #ffffff;
  --accent-soft: #fbe3dd;
  --gold: #c99a1c;
  --ok: #2f7d4f;
  --dm-bg: #17110f;
  --dm-ink: #f7efe6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 25, 10, .06), 0 4px 16px rgba(40, 25, 10, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Georgia", "Times New Roman", serif;
  color-scheme: light;
}
/* Dark tokens: follow the OS unless the user forced light (data-theme="light"), or force dark (data-theme="dark").
   The two blocks must stay identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f;
    --surface: #1f1b17;
    --surface-2: #2a241f;
    --ink: #f3ece4;
    --ink-2: #c4b8ac;
    --ink-3: #8f8378;
    --line: #3a322b;
    --accent: #ee5a43;
    --accent-soft: #3b1f19;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    --dm-bg: #0d0907;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120f;
  --surface: #1f1b17;
  --surface-2: #2a241f;
  --ink: #f3ece4;
  --ink-2: #c4b8ac;
  --ink-3: #8f8378;
  --line: #3a322b;
  --accent: #ee5a43;
  --accent-soft: #3b1f19;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --dm-bg: #0d0907;
  color-scheme: dark;
}
.theme-toggle { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 1.05rem; line-height: 1; display: inline-grid; place-items: center; margin-left: 4px; }
.theme-toggle:hover { border-color: var(--ink-3); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }
h1 { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.container { max-width: 1180px; margin: 0 auto; padding: 24px 16px 80px; }

/* ---------- top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand b { color: var(--accent); }
.brand-mark { font-size: 1.4rem; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a, .nav button.link { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); background: none; border: 0; cursor: pointer; font-size: .95rem; }
.nav a:hover, .nav button.link:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.nav .who { color: var(--ink-3); font-size: .9rem; padding: 0 6px; }
/* account menu: hover (mouse), focus (keyboard) or .open (tap) shows the list */
.user-menu { position: relative; }
.nav .user-menu-btn { font-weight: 600; color: var(--ink); }
.user-menu-list { position: absolute; right: 0; top: 100%; z-index: 40; min-width: 180px; padding: 6px; margin: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  display: none; }
/* invisible bridge over the gap so the menu doesn't close while the mouse moves down to it */
.user-menu-list::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.user-menu:hover .user-menu-list, .user-menu:focus-within .user-menu-list, .user-menu.open .user-menu-list { display: grid; }
.nav .user-menu-list a { display: block; padding: 8px 12px; white-space: nowrap; }
.nav .user-menu-list a.sub { padding-left: 26px; font-size: .9rem; } /* sits under "My recipes" */

/* ---------- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; transition: transform .06s, background .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.danger { color: var(--accent); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 64px; }
label.field { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
label.field .hint { font-weight: 400; color: var(--ink-3); }
.error { color: var(--accent); font-size: .9rem; min-height: 1.2em; }

/* ---------- home / finder */
.hero { padding: 12px 0 8px; }
.hero p { margin: 0 0 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: .92rem; user-select: none; }
.tag:hover { border-color: var(--ink-3); }
.tag[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tag .count { color: var(--ink-3); font-size: .8rem; }
.tag[aria-pressed=true] .count { color: inherit; opacity: .7; }

/* finder folds: "I just need a recipe" and "Help me pick" */
.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 0 0 10px; }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer;
  font-weight: 700; font-size: 1.05rem; border-radius: var(--radius); user-select: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.fold[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.fold > summary:hover { background: var(--surface-2); }
.fold > summary:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.fold[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.fold-badge:empty { display: none; }
.fold-badge { font-size: .8rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold-body { padding: 16px; }
.hero .fold-note { margin: 8px 2px 0; }
.fold-body .chips:empty { min-height: 0; margin: 0; }
.fold-body > .tags:last-child, .fold-body > .filter-grid:last-child { margin-bottom: 0; }
.scope-row { margin: 0 0 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reset-filters { margin-left: auto; }
.reset-filters:disabled { opacity: .45; cursor: default; transform: none; }
.tag.fav-filter { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tag.fav-filter[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.fine-filters { margin: 0 0 16px; align-items: start; }
.tags.levels { margin: 0; }
.level-btn .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.level-btn.Easy .dot { background: var(--ok); } .level-btn.Medium .dot { background: var(--gold); } .level-btn.Expert .dot { background: var(--accent); }
.level-btn[aria-pressed=true] .dot { box-shadow: 0 0 0 2px var(--bg); }
.time-value { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--accent); margin-left: 6px; }

/* two-thumb range: two stacked native range inputs; only their thumbs take pointer events */
.range2 { position: relative; height: 34px; --a: 0; --b: 1; }
.range2-track { position: absolute; left: 11px; right: 11px; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--line); }
.range2-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--accent);
  left: calc(var(--a) * 100%); right: calc((1 - var(--b)) * 100%); }
.range2 input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; box-shadow: none;
  background: none; appearance: none; -webkit-appearance: none; pointer-events: none; z-index: 2; }
.range2 input[type=range]:focus { box-shadow: none; }
.range2 input[type=range]::-webkit-slider-runnable-track { background: none; border: 0; }
.range2 input[type=range]::-moz-range-track { background: none; border: 0; }
.range2 input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: grab;
  width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow); }
.range2 input[type=range]::-moz-range-thumb { pointer-events: auto; cursor: grab;
  width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow); }
.range2 input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
.range2 input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
.range2-ends { display: flex; justify-content: space-between; padding: 0 2px; }
.filter-label { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 0 0 6px 2px; }
.chip.no { background: var(--surface-2); text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.user-link { font-weight: 600; text-decoration: none; border-bottom: 1px dotted currentColor; }
.user-link:hover { color: var(--accent); }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 2px 0 0; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; color: #2a211b; flex: none; }
.search-box { position: relative; max-width: 620px; }
.search-box input { padding: 14px 16px 14px 44px; font-size: 1.05rem; border-radius: 12px; }
.search-box .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.ac-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 320px; overflow: auto; }
.ac-list li { padding: 8px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.ac-list li[aria-selected=true], .ac-list li:hover { background: var(--surface-2); }
.ac-list li .uses { color: var(--ink-3); font-size: .82rem; }
.ac-list li mark { background: none; color: var(--accent); font-weight: 700; }
.ac-list li.new { color: var(--ink-2); font-style: italic; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; min-height: 34px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--accent-soft);
  color: var(--ink); font-weight: 600; font-size: .92rem; }
.chip button { border: 0; background: none; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; line-height: 1; color: var(--ink-2); }
.chip button:hover { background: rgba(0,0,0,.08); color: var(--ink); }
.chip.clear { background: none; padding: 5px 8px; color: var(--ink-3); cursor: pointer; border: 0; font-weight: 500; }

.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); }
.results-head h2 { margin: 0; }
/* profile page: collapsible Recipe Box / Favorites sections */
.profile-tools { display: flex; justify-content: flex-end; margin: 28px 0 0; }
.section-fold { border-top: 1px solid var(--line); margin-top: 14px; }
.section-fold > summary { list-style: none; display: flex; align-items: baseline; gap: 12px; padding: 18px 4px 14px; cursor: pointer; user-select: none; }
.section-fold > summary::-webkit-details-marker { display: none; }
.section-fold > summary h2 { margin: 0; }
.section-fold > summary::after { content: ""; margin-left: auto; align-self: center; width: 9px; height: 9px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .15s; }
.section-fold[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.section-fold > summary:hover h2 { color: var(--accent); }
.section-fold > summary:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-radius: 8px; }
.section-fold > .tiles { margin-bottom: 8px; }

/* ---------- tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(40,25,10,.12); }
.tile-art { height: 110px; display: grid; place-items: center; font-size: 3rem; position: relative; }
.tile-art .cat { position: absolute; left: 10px; bottom: 8px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255,255,255,.85); color: #2a211b; padding: 2px 8px; border-radius: 999px; }
.tile-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile-title { font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.tile-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); margin-top: auto; }
.tile-match { font-size: .8rem; color: var(--ok); }
.level { font-weight: 700; }
.level.Easy { color: var(--ok); } .level.Medium { color: var(--gold); } .level.Expert { color: var(--accent); }
.stars { color: var(--gold); white-space: nowrap; }
.empty { padding: 48px 16px; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-2); }

/* ---------- recipe page */
.back { display: inline-block; margin-bottom: 14px; color: var(--ink-2); text-decoration: none; }
.back:hover { color: var(--ink); }
.recipe-head { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: start; }
.recipe-head .art { width: 120px; height: 120px; border-radius: 20px; display: grid; place-items: center; font-size: 4rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin: 20px 0; }
.fact { padding: 12px 14px; outline: 1px solid var(--line); }
.fact .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.fact .v { font-weight: 700; font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.fav-btn[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.rate { display: inline-flex; align-items: center; gap: 2px; }
.rate button { border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--line); padding: 0 1px; }
.rate button.on { color: var(--gold); }
.rate:hover button { color: var(--gold); }
.rate button:hover ~ button { color: var(--line); }
.cook { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 32px; margin-top: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); cursor: pointer; align-items: baseline; }
.ing-list li:last-child { border-bottom: 0; }
.ing-list li .q { font-weight: 700; min-width: 70px; color: var(--ink-2); }
.ing-list li .note { color: var(--ink-3); }
.ing-list li.done { text-decoration: line-through; opacity: .45; }
.keep-btn { width: 100%; margin-top: 14px; }
.keep-help { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; line-height: 1.5; }
.keep-help textarea { margin-top: 8px; font-size: .85rem; }
kbd { font: 600 .8em var(--font); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 4px 0 18px 48px; cursor: pointer; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: .9rem; }
.steps li.done { opacity: .45; }
.steps li.done::before { content: "✓"; background: var(--ok); }
.nominate-box { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--dm-bg); color: var(--dm-ink);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nominate-box b { color: #ff7a5f; }
.comments { margin-top: 36px; max-width: 760px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment .who { font-weight: 700; } .comment .when { color: var(--ink-3); font-size: .82rem; margin-left: 6px; }
.comment p { margin: 4px 0 0; white-space: pre-wrap; }

/* ---------- forms */
.form { display: grid; gap: 18px; max-width: 860px; }
.form .row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.ing-row { display: grid; grid-template-columns: 110px 1fr 1fr 36px; gap: 8px; align-items: start; margin-bottom: 8px; }
.ing-row .ac-wrap { position: relative; }
.step-row { display: grid; grid-template-columns: 28px 1fr 36px; gap: 8px; align-items: start; margin-bottom: 8px; }
.step-row .n { font-weight: 700; padding-top: 10px; color: var(--ink-3); }
.icon-btn { width: 36px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-3); }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- creator's tips & notes (under the directions) */
.tips { margin-top: 12px; padding: 16px 20px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.tips h2 { margin: 0 0 2px; }
.tips-by { margin: 0 0 10px; }
.tips ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.tips li::marker { color: var(--gold); }
.tips.empty-tips { background: none; border-style: dashed; color: var(--ink-2); font-size: .92rem; }

/* ---------- modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(15, 10, 5, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; padding: 24px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { margin-bottom: 4px; }
.modal form { display: grid; gap: 12px; margin-top: 14px; }
.modal .switch { text-align: center; font-size: .9rem; color: var(--ink-2); }
.modal .switch button { border: 0; background: none; color: var(--accent); cursor: pointer; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 40px); opacity: 0; background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 10px; font-weight: 600; transition: all .2s; z-index: 60; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--accent); color: #fff; }

/* ---------- deathmatch */
.dm-hero { background: var(--dm-bg); color: var(--dm-ink); border-radius: 20px; padding: 28px 24px; margin-bottom: 20px; position: relative; overflow: hidden; }
.dm-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 20%, rgba(238, 90, 67, .35), transparent 50%); pointer-events: none; }
.dm-hero h1 { font-family: var(--font); font-weight: 900; text-transform: uppercase; letter-spacing: .02em; margin: 0; font-size: clamp(1.6rem, 5vw, 2.8rem); }
.dm-hero h1 span { color: #ff6a4d; }
.dm-hero p { margin: 6px 0 0; color: #cdbfb2; position: relative; z-index: 1; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px;
  /* overflow-x alone would make overflow-y auto too, and the tabs' -1px margin would then show a vertical scrollbar */
  overflow-x: auto; overflow-y: hidden; }
.subtabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 600; }
.subtabs a.active { color: var(--ink); border-color: var(--accent); }
.season-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.theme-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; }

.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; margin: 16px 0 28px; }
.contender { background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.contender.mine { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.contender .big { font-size: 3.4rem; line-height: 1; }
.contender .seed { font-size: .75rem; font-weight: 800; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }
.contender h3 { font-size: 1.2rem; margin: 0; }
.contender h3 a { text-decoration: none; } .contender h3 a:hover { text-decoration: underline; }
.contender .btn { margin-top: auto; }
.vs { display: grid; place-items: center; font-weight: 900; font-size: 1.8rem; color: var(--accent); font-style: italic; }
.tally { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; margin: 0 0 6px; }
.tally > div:first-child { background: var(--accent); } .tally > div:last-child { background: var(--ink-3); }
.tally-labels { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.countdown { text-align: center; font-weight: 700; color: var(--ink-2); margin: 4px 0 0; }

.bracket-wrap { overflow-x: auto; padding-bottom: 8px; }
.bracket { display: grid; grid-template-columns: repeat(3, minmax(210px, 1fr)) minmax(170px, .8fr); gap: 22px; min-width: 860px; }
.round { display: flex; flex-direction: column; }
.round-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.round h4 { margin: 0 0 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.match { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: .9rem; }
.match.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.match .wk { font-size: .7rem; font-weight: 700; padding: 3px 10px; color: var(--ink-3); background: var(--surface-2); display: flex; justify-content: space-between; }
.match.open .wk { color: var(--accent); }
.slot { display: grid; grid-template-columns: 22px 1fr auto; gap: 6px; padding: 7px 10px; align-items: center; }
.slot + .slot { border-top: 1px solid var(--line); }
.slot .sd { color: var(--ink-3); font-size: .78rem; font-weight: 700; }
.slot a { text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot a:hover { text-decoration: underline; }
.slot .v { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.slot.win { font-weight: 700; } .slot.win .v { color: var(--accent); }
.slot.lose { opacity: .45; }
.slot.tbd { color: var(--ink-3); font-style: italic; }
.round-body.champion { justify-content: center; }
.champ-card { text-align: center; padding: 18px 12px; border-radius: 16px; background: var(--dm-bg); color: var(--dm-ink); }
.champ-card .big { font-size: 2.6rem; }
.champ-card a { color: #ffd36b; font-weight: 800; text-decoration: none; }
.champ-card.tbd { background: var(--surface-2); color: var(--ink-3); }

.noms { display: grid; gap: 8px; margin: 12px 0 24px; }
.nom { display: grid; grid-template-columns: 34px 44px 1fr auto auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px; }
.nom .rank { font-weight: 800; color: var(--ink-3); text-align: center; }
.nom .em { font-size: 1.8rem; text-align: center; }
.nom a { font-weight: 700; text-decoration: none; } .nom a:hover { text-decoration: underline; }
.nom .cnt { font-weight: 800; color: var(--accent); white-space: nowrap; }
.nom.cut { opacity: .55; }
.cutline { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); padding: 4px 0; border-top: 2px dashed var(--accent); margin-top: 4px; }

.hof { display: grid; gap: 18px; }
.hof-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.hof-card header { padding: 14px 18px; background: var(--dm-bg); color: var(--dm-ink); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.hof-card header h3 { margin: 0; font-size: 1.15rem; }
.hof-card header span { color: #cdbfb2; font-size: .88rem; }
.podium { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1px; background: var(--line); }
.podium > div { background: var(--surface); padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.podium .medal { font-size: 2.4rem; }
.podium .lbl { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.podium a { font-weight: 800; font-size: 1.1rem; text-decoration: none; } .podium a:hover { text-decoration: underline; }
.hof-card footer { padding: 10px 18px; font-size: .88rem; color: var(--ink-2); border-top: 1px solid var(--line); }
.admin-box { margin-top: 28px; padding: 16px; border: 1px dashed var(--gold); border-radius: var(--radius); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.admin-box h3::before { content: "🔧 "; }
/* Settings + password reset pages */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.settings-grid h2 { margin-top: 0; }
form.stack { display: grid; gap: 12px; }
.panel.narrow { max-width: 440px; margin: 24px auto; }
.panel.narrow h1 { margin-top: 0; }
/* Admin page */
.admin-box h3 { margin-top: 0; }
.admin-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-inline input { flex: 1 1 200px; max-width: 320px; }
.admin-users { display: grid; }
.admin-user { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-user:last-child { border-bottom: 0; }
.admin-user.banned > div:first-child { opacity: .6; }
.admin-actions { display: flex; gap: 6px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--gold); color: #fff; }
.badge.bad { background: var(--accent); }
.comment .btn.ghost { margin-left: 4px; }

@media (max-width: 760px) {
  .cook { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .recipe-head { grid-template-columns: 1fr; }
  .recipe-head .art { width: 72px; height: 72px; font-size: 2.4rem; order: -1; }
  .versus { grid-template-columns: 1fr; }
  .vs { font-size: 1.3rem; }
  .podium { grid-template-columns: 1fr; }
  .ing-row { grid-template-columns: 80px 1fr 36px; }
  .ing-row .note-in { grid-column: 1 / 3; }
  .nom { grid-template-columns: 26px 32px 1fr auto; }
  .nom .act { grid-column: 1 / -1; justify-self: end; }
  .nav { margin-left: 0; width: 100%; }
}
