/* awesome-outbid — one stylesheet, no dependencies.
   Shares its design language with awesome-daily-minigames: tile wordmark,
   raised cards that lift on hover, pill chips, three-state theme. */

/* ------------------------------------------------------------------ tokens */
:root {
  --green: #2f9e4f;   /* money */
  --gold: #e0a52b;    /* the #1 spot */
  --rose: #d1495b;    /* nsfw marker */

  --bg: #fffdf9;
  --bg-raised: #ffffff;
  --bg-sunken: #f4f1ea;
  --border: #e4ded1;
  --border-strong: #c9c1ae;
  --text: #191713;
  --text-muted: #6b6459;
  --accent: #1f8a45;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 8px 20px -12px rgb(0 0 0 / 28%);

  --radius: 12px;
  --shell: 1140px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

/* Declared twice on purpose: once for "follow the OS" (the default, and what a
   missing data-theme means) and once for an explicit choice, so the toggle
   wins in both directions. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f100e;
    --bg-raised: #181a16;
    --bg-sunken: #1f221c;
    --border: #2c3028;
    --border-strong: #40453a;
    --text: #ecebe4;
    --text-muted: #9c9c8f;
    --accent: #58c47c;
    --accent-contrast: #08150c;
    --gold: #f0bf51;
    --rose: #f08897;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 26px -14px rgb(0 0 0 / 75%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f100e;
  --bg-raised: #181a16;
  --bg-sunken: #1f221c;
  --border: #2c3028;
  --border-strong: #40453a;
  --text: #ecebe4;
  --text-muted: #9c9c8f;
  --accent: #58c47c;
  --accent-contrast: #08150c;
  --gold: #f0bf51;
  --rose: #f08897;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 10px 26px -14px rgb(0 0 0 / 75%);
}

/* -------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.shell { width: min(100% - 2.5rem, var(--shell)); margin-inline: auto; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 12px; top: 12px; z-index: 20;
  background: var(--accent); color: var(--accent-contrast);
  padding: 0.5rem 0.85rem; border-radius: 8px;
}

code, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--bg-sunken); padding: 0.1em 0.35em; border-radius: 5px; }
pre {
  background: var(--bg-sunken); border: 1px solid var(--border);
  padding: 0.9rem 1rem; border-radius: var(--radius); overflow-x: auto;
}
pre code { background: none; padding: 0; }

/* ---------------------------------------------------------------- masthead */
.masthead {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0 1.6rem;
}

.masthead__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap;
}

.masthead__actions { display: flex; align-items: center; gap: 0.5rem; }

.wordmark { display: flex; align-items: center; gap: 5px; text-decoration: none; }
.wordmark__text { font-weight: 700; letter-spacing: -0.02em; margin-left: 4px; }

.tile {
  display: grid; place-items: center;
  width: 27px; height: 27px; border-radius: 5px;
  border: 2px solid var(--border-strong);
  font: 700 13px/1 var(--mono);
  color: var(--text-muted);
}
.tile--gold, .tile--green { color: #fff; border-color: transparent; }
.tile--gold { background: var(--gold); }
.tile--green { background: var(--green); }

.icon-button {
  font: inherit; cursor: pointer; line-height: 1;
  padding: 0.42rem 0.6rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text-muted);
}
.icon-button:hover { border-color: var(--border-strong); color: var(--text); }

h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.85rem);
  letter-spacing: -0.025em; line-height: 1.08;
}
.tagline { margin: 0 0 0.5rem; color: var(--text-muted); max-width: 62ch; font-size: 1.05rem; }
.tagline strong { color: var(--text); }

.statline {
  margin: 0.7rem 0 0; display: flex; gap: 1.15rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.82rem; color: var(--text-muted);
}
.statline b { color: var(--accent); font-size: 1.05rem; }

/* The guides live here: one strip, above the list, deliberately secondary. */
.guidebar {
  margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px dashed var(--border);
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
}
.guidebar__label {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); font-weight: 700; white-space: nowrap;
}
.guidebar__links { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.guidebar a {
  font-size: 0.85rem; text-decoration: none; color: var(--text-muted);
  padding: 0.22rem 0.6rem; border-radius: 999px;
  border: 1px solid transparent;
}
.guidebar a:hover { color: var(--text); border-color: var(--border); background: var(--bg); }
.guidebar a.all { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- controls */
.controls { margin: 1.4rem 0 0.4rem; display: grid; gap: 0.8rem; }

.search { position: relative; display: flex; gap: 0.5rem; }
.search input {
  flex: 1; font: inherit; padding: 0.7rem 0.9rem; color: var(--text);
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.button {
  font: inherit; cursor: pointer; white-space: nowrap;
  padding: 0.7rem 1.05rem; border-radius: 10px; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-raised); color: var(--text);
}
.button:hover { border-color: var(--border-strong); }
.button--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.button--primary:hover { filter: brightness(1.06); }
.button--ghost { background: transparent; color: var(--text-muted); }

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  font: inherit; font-size: 0.85rem; cursor: pointer;
  padding: 0.28rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-raised); color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-contrast); font-weight: 600;
}
.chip__count { font-size: 0.75rem; opacity: 0.7; font-variant-numeric: tabular-nums; }

.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin: 1.5rem 0 0.75rem; flex-wrap: wrap;
}
.results-bar h2 { margin: 0; font-size: 1.05rem; letter-spacing: -0.01em; }
.results-bar .count { color: var(--text-muted); font-family: var(--mono); font-size: 0.85rem; }

/* ------------------------------------------------------------------- cards */
.groups { display: grid; gap: 2rem; }
.group[hidden] { display: none; }
.group__head { margin: 0 0 0.75rem; }
.group__head h3 {
  margin: 0 0 0.2rem; font-size: 1.15rem; letter-spacing: -0.015em;
  display: flex; align-items: center; gap: 0.5rem;
}
.group__n {
  font: 700 0.7rem/1 var(--mono); color: var(--accent-contrast);
  background: var(--accent); padding: 0.22rem 0.4rem; border-radius: 5px;
}
.group__head p { margin: 0; color: var(--text-muted); font-size: 0.92rem; max-width: 70ch; }

.results { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }

.card {
  position: relative; display: flex; flex-direction: column; gap: 0.35rem;
  padding: 0.9rem 1rem;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover, .card:focus-within {
  border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow);
}
.card[hidden] { display: none; }
.card--original { border-left: 3px solid var(--gold); }
.card--nsfw { border-left: 3px solid var(--rose); }

.card__title { margin: 0; font-size: 1rem; font-weight: 650; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.card__title a { font-family: var(--mono); color: var(--accent); text-decoration: none; }
.card__title a:hover { text-decoration: underline; }
.card__ranks { margin: 0; font-size: 0.78rem; color: var(--text-muted); }
.card__what { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--text-muted); }
.card__meta { margin: 0.45rem 0 0; font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }

.badge {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; line-height: 1;
  padding: 0.25rem 0.36rem; border-radius: 4px; text-transform: uppercase;
}
.badge--nsfw { background: var(--rose); color: #fff; }
.badge--first { background: var(--gold); color: #3a2600; }

.empty { color: var(--text-muted); padding: 2rem 0; text-align: center; }

.named { margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.named h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.named p { color: var(--text-muted); font-size: 0.92rem; max-width: 70ch; margin: 0 0 0.8rem; }
.named__codes { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.named__codes code {
  background: var(--bg-raised); border: 1px solid var(--border);
  padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.78rem;
}

.note, .warn {
  padding: 0.85rem 1rem; border-radius: var(--radius); font-size: 0.9rem;
  border: 1px solid var(--border); background: var(--bg-sunken); color: var(--text-muted);
  margin: 1.1rem 0;
}
.warn { border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.warn strong { color: var(--text); }

/* ------------------------------------------------------------ contributors */
.contributors { margin: 3rem 0 0; padding-top: 1.6rem; border-top: 1px solid var(--border); }
.contributors h2 { margin: 0 0 0.3rem; font-size: 1.25rem; letter-spacing: -0.015em; }
.contributors > p { margin: 0 0 1.1rem; color: var(--text-muted); max-width: 66ch; font-size: 0.95rem; }

.wall { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.who {
  display: flex; align-items: center; gap: 0.55rem; text-decoration: none;
  padding: 0.45rem 0.8rem 0.45rem 0.45rem;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 999px;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.who:hover { border-color: var(--accent); transform: translateY(-1px); }
.who img, .who__fallback {
  width: 30px; height: 30px; border-radius: 50%; display: block;
  background: var(--bg-sunken);
}
.who__fallback {
  display: grid; place-items: center;
  font: 700 12px/1 var(--mono); color: var(--text-muted);
}
.who__name { font-weight: 600; font-size: 0.9rem; }
.who__n { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }

/* ------------------------------------------------------------------ guides */
.guide { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2.6rem; margin: 2rem 0 4rem; }
.toc { position: sticky; top: 1.5rem; align-self: start; }
.toc__title {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin: 0 0 0.6rem; font-weight: 700;
}
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc a {
  display: flex; gap: 0.55rem; padding: 0.38rem 0.6rem; border-radius: 8px;
  color: var(--text-muted); text-decoration: none; font-size: 0.88rem; line-height: 1.35;
}
.toc a span { font: 600 0.72rem/1.5 var(--mono); color: var(--text-muted); }
.toc a:hover { background: var(--bg-sunken); color: var(--text); }
.toc a.on { background: var(--bg-sunken); color: var(--text); font-weight: 650; }
.toc a.on span { color: var(--accent); }

@media (max-width: 900px) {
  .guide { grid-template-columns: 1fr; gap: 1.4rem; }
  .toc { position: static; }
  .toc ol { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.4rem; }
  .toc a { white-space: nowrap; border: 1px solid var(--border); }
}

.prose { min-width: 0; max-width: 74ch; }
.prose h1 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.3rem); margin: 0 0 1rem; }
.prose h2 {
  font-size: 1.35rem; margin: 2.4rem 0 0.6rem; letter-spacing: -0.015em;
  padding-top: 0.9rem; border-top: 1px solid var(--border);
}
.prose h3 { font-size: 1.08rem; margin: 1.7rem 0 0.4rem; }
.prose p, .prose li { color: var(--text-muted); }
.prose li { margin: 0.25rem 0; }
.prose strong { color: var(--text); font-weight: 650; }
.prose a { color: var(--accent); }
.prose blockquote {
  margin: 1.1rem 0; padding: 0.8rem 1rem;
  border-left: 3px solid var(--gold); background: var(--bg-sunken);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p { margin: 0; }
.prose table {
  width: 100%; border-collapse: collapse; margin: 1.1rem 0; font-size: 0.9rem;
  display: block; overflow-x: auto;
}
.prose th, .prose td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text); background: var(--bg-sunken); white-space: nowrap; font-weight: 650; }
.prose td { color: var(--text-muted); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.pager {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--border);
}
.pager a { text-decoration: none; font-weight: 600; font-size: 0.92rem; color: var(--accent); }
.pager .next { margin-left: auto; }

.cards-plain { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin: 1.2rem 0; }

/* ------------------------------------------------------------------ footer */
.footer {
  margin-top: 3.5rem; border-top: 1px solid var(--border);
  background: var(--bg-raised); padding: 1.6rem 0 2.6rem;
}
.footer p { margin: 0 0 0.4rem; color: var(--text-muted); font-size: 0.88rem; }
.footer a { color: var(--accent); }
