:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --text: #1c1b18;
  --muted: #64625b;
  --line: #e4e2da;
  --accent: #4b3fe0;
  --accent-soft: #ecebff;
  --win: #e7f3dc;
  --win-line: #b9d99c;
  --gold: #b07a12;
  --silver: #6f7680;
  --shadow: 0 1px 2px rgba(20, 18, 10, .06), 0 6px 20px rgba(20, 18, 10, .06);
  --radius: 14px;
  --maxw: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312; --surface: #1d1d1b; --surface-2: #232320; --text: #edece7; --muted: #a3a199;
    --line: #34332f; --accent: #8f86ff; --accent-soft: #26244a; --win: #1f2b18; --win-line: #3c5a2a;
    --gold: #e0b04a; --silver: #b4bac2; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
main { max-width: var(--maxw); margin: 0 auto; padding: 16px 16px 40px; min-height: 70vh; outline: none; }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: var(--maxw); margin: 0 auto; padding: 10px 16px; display: grid;
  grid-template-columns: 1fr auto; grid-template-areas: "brand years" "tools tools"; gap: 10px 12px; align-items: center; }
.brand { grid-area: brand; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-mark { font-size: 26px; line-height: 1; }
.brand-text { font-weight: 800; font-size: 18px; line-height: 1.1; }
.brand-text small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.years { grid-area: years; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.years a { padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px; }
.years a.on { background: var(--accent); color: #fff; }
.tools { grid-area: tools; display: flex; gap: 8px; }
.tools select { flex: 1; min-width: 0; height: 44px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.search-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 44px; padding: 0 14px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; white-space: nowrap; }
.search-btn span { display: none; }
@media (min-width: 760px) {
  .top-inner { grid-template-columns: auto auto 1fr; grid-template-areas: "brand years tools"; }
  .tools { justify-content: flex-end; }
  .tools select { flex: 0 1 300px; }
  .search-btn span { display: inline; }
}

/* ---------- Hero ---------- */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin: 4px 0 18px; display: grid; gap: 14px; }
.hero h1 { margin: 0; font-size: clamp(22px, 5.4vw, 34px); line-height: 1.15; letter-spacing: -.01em; }
.hero p { margin: 0; color: var(--muted); }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.stat b { font-size: 15px; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #2fb37a); border-radius: 99px; }
.cta { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; }
.cta.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Tiles ---------- */
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 6px 2px 10px; }
.section-title h2 { margin: 0; font-size: 19px; }
.section-title span { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; } }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 150px; padding: 14px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.tile:hover, .tile:focus-visible { transform: translateY(-2px); border-color: var(--accent); }
.tile .emo { font-size: 26px; line-height: 1; }
.tile .day { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tile .name { font-weight: 800; font-size: 16px; line-height: 1.2; }
.tile .winners { margin-top: auto; display: grid; gap: 3px; font-size: 14px; line-height: 1.25; }
.tile .winners div { display: flex; gap: 6px; align-items: baseline; }
.tile.done { background: var(--win); border-color: var(--win-line); }
.tile.next { border: 2px dashed var(--accent); }
.tile.soon { opacity: .72; }
.chip { align-self: flex-start; margin-top: auto; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.tile.next .chip { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- Category page ---------- */
.crumbs { margin: 2px 0 12px; font-size: 14px; }
.crumbs a { text-decoration: none; }
.cat-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.cat-head .emo { font-size: 42px; line-height: 1; }
.cat-head h1 { margin: 0; font-size: clamp(22px, 5.6vw, 32px); line-height: 1.15; }
.cat-head p { margin: 2px 0 0; color: var(--muted); }
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.pick { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.pick .rank { font-weight: 800; font-size: 14px; }
.pick.r1 .rank { color: var(--gold); } .pick.r2 .rank { color: var(--silver); }
.pick h3 { margin: 0; font-size: 20px; line-height: 1.2; }
.pick .note { color: var(--muted); font-size: 14px; margin-top: -6px; }
.ccard { position: relative; aspect-ratio: 1.586; width: 100%; max-width: 300px; border-radius: 14px; padding: 14px 16px; color: #fff;
  background: linear-gradient(135deg, var(--c1, #44475a), var(--c2, #22232c)); box-shadow: 0 10px 24px rgba(0,0,0,.25); overflow: hidden; }
.ccard::after { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; height: 120%; background: rgba(255,255,255,.08); transform: rotate(25deg); }
.ccard .iss { font-weight: 800; letter-spacing: .04em; font-size: 15px; text-transform: uppercase; opacity: .95; }
.ccard .chipi { position: absolute; left: 16px; top: 42%; width: 40px; height: 30px; border-radius: 6px; background: linear-gradient(135deg, #f3d77c, #b9932d); }
.ccard .nm { position: absolute; left: 16px; right: 16px; bottom: 12px; font-size: 14px; font-weight: 600; opacity: .95; line-height: 1.2; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 10px; font-size: 18px; }
.md { overflow-wrap: anywhere; }
.md h4, .md h5 { margin: 16px 0 6px; font-size: 16px; }
.md h4:first-child, .md h5:first-child { margin-top: 0; }
.md p { margin: 8px 0; } .md ul, .md ol { margin: 6px 0 10px; padding-left: 22px; } .md li { margin: 3px 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.collapsible { position: relative; max-height: 340px; overflow: hidden; }
.collapsible.open { max-height: none; }
.collapsible:not(.open)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, var(--surface)); }
.more { margin-top: 8px; background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; padding: 8px 0; cursor: pointer; min-height: 44px; }
.compare { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 14px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-height: 56px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.pager a small { color: var(--muted); }
.pager a.nx { text-align: right; }
.pager span { visibility: hidden; }
.empty { text-align: center; padding: 26px 16px; color: var(--muted); }
.empty .big { font-size: 40px; }

/* ---------- Card search ---------- */
.search-box { position: sticky; top: 118px; z-index: 5; margin-bottom: 12px; }
@media (min-width: 760px) { .search-box { top: 74px; } }
.search-box input { width: 100%; height: 50px; padding: 0 16px; font: inherit; font-size: 17px; color: var(--text); background: var(--surface);
  border: 2px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.search-box input:focus { outline: none; border-color: var(--accent); }
.results { display: grid; gap: 10px; }
.res { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; }
.res h3 { margin: 0; font-size: 17px; }
.res .wins { display: flex; flex-wrap: wrap; gap: 6px; }
.res .wins a { font-size: 13px; padding: 5px 10px; border-radius: 999px; text-decoration: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.res .wins a.g { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }

/* ---------- About ---------- */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding: 12px 12px 12px 52px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }

/* ---------- Footer & misc ---------- */
.foot { border-top: 1px solid var(--line); padding: 20px 16px 36px; color: var(--muted); font-size: 13px; text-align: center; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-bottom: 10px; }
.foot nav a { text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 2px; }
.foot p { max-width: 640px; margin: 6px auto; }
.skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%;
  animation: sh 1.2s infinite; border: 1px solid var(--line); border-radius: var(--radius); min-height: 150px; }
.hero-skel { min-height: 140px; margin: 4px 0 18px; }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .tile { transition: none; } }
