/* BothPlay: dark ground, one lime accent, Unbounded for headings, Manrope for everything else. */
:root {
  --bg: #0E0F13;
  --surface: #171920;
  --raised: #20232C;
  --line: #2A2D37;
  --line-strong: #3B3F4B;
  --text: #F2F1EC;
  --muted: #A7AAB4;
  --faint: #868994;
  --accent: #C6F24E;
  --accent-ink: #0E0F13;
  --friend: #7AA7FF;
  --danger: #FF9A8A;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --gutter: 16px;
}
@media (min-width: 760px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }
p { margin: 0; }

/* ---------- frame ---------- */
.top, .foot, .page, .hero, main > section { width: 100%; max-width: 1180px; margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 22px; padding-bottom: 22px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.logo span { color: var(--accent); }
.page { padding-top: 24px; padding-bottom: 24px; }
.narrow { max-width: 720px; margin-left: 0; }
.foot { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; margin-top: 72px; padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--faint); }
.foot a { color: var(--muted); }

/* ---------- type ---------- */
h1, h2, h3, .title { font-family: var(--display); font-weight: 700; margin: 0; }
h1 { font-size: clamp(34px, 5.6vw, 58px); line-height: 1.04; letter-spacing: -0.035em; }
.title { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.08; letter-spacing: -0.03em; }
h2 { font-size: clamp(21px, 2.6vw, 27px); line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-family: var(--body); font-weight: 700; font-size: 17px; line-height: 1.3; }
.lede { font-size: clamp(17px, 1.7vw, 19px); color: var(--muted); max-width: 36em; }
.soft { color: var(--muted); }
.small { font-size: 14px; }
.field { font-weight: 700; font-size: 15px; }

/* ---------- layout ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.tight { gap: 8px; }
.between { justify-content: space-between; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; font-weight: 700; color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn.go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.go:hover { color: var(--accent-ink); filter: brightness(1.06); }
.btn.small { min-height: 44px; padding: 8px 16px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.pill { min-height: 46px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: none; font-size: 14px; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"], label.chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
label.chip input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent-ink); }

.input { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 16px; }
.input::placeholder { color: var(--faint); }
.input.code { font-family: var(--display); font-size: 24px; letter-spacing: 0.05em; text-transform: uppercase; }
.input.code::placeholder { letter-spacing: 0.05em; }
textarea.input { min-height: 96px; resize: vertical; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.card.outline { background: none; border-color: var(--line-strong); }
.msg { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--raised); }
.msg.bad { color: var(--danger); }
.dismiss { flex: 0 0 auto; width: 44px; height: 44px; margin: -10px -10px -10px 0; border: none; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.dismiss:hover { color: var(--text); }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 40px; padding-bottom: 72px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 56px; padding-top: 64px; } }
.hero-copy { gap: 24px; }
.hero-form { gap: 14px; }
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps > div { border-top: 2px solid var(--accent); padding-top: 16px; }
.steps b { display: block; font-size: 18px; margin-bottom: 6px; }

/* ---------- add games ---------- */
.setup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 900px) { .setup { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
.search { flex: 1 1 280px; max-width: 380px; display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.game { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.game.owned { border-color: var(--accent); }
.plain { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.plain li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.count-inline { font-family: var(--body); font-size: 17px; font-weight: 500; margin-left: 6px; }
.bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; max-width: 1180px; margin: 32px auto 0; padding: 14px var(--gutter); background: var(--bg); border-top: 1px solid var(--line); }
#saveErr { color: var(--danger); font-size: 14px; }

/* ---------- code ---------- */
.code-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: stretch; }
@media (min-width: 900px) { .code-row { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.big-code { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 9vw, 76px); line-height: 1; letter-spacing: 0.03em; color: var(--accent); }

/* ---------- results ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.person { display: flex; gap: 14px; align-items: center; padding: 18px; }
form.person { flex-direction: column; align-items: stretch; gap: 8px; }
.avatar { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; color: var(--accent-ink); }
.totals { display: flex; flex-wrap: wrap; gap: 16px 48px; align-items: flex-end; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.totals > div { display: flex; flex-direction: column; gap: 6px; }
.total { font-family: var(--display); font-weight: 700; font-size: clamp(56px, 9vw, 84px); line-height: 0.9; letter-spacing: -0.04em; color: var(--accent); }
.total.muted-total { color: var(--text); font-size: clamp(36px, 5vw, 48px); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; font-weight: 700; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.results li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; padding: 16px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.results .name { font-weight: 700; font-size: 17px; }
.results .how { font-size: 14px; color: var(--muted); }
.tag { display: inline-block; padding: 5px 11px; border-radius: 8px; background: var(--raised); font-size: 13px; font-weight: 700; }
.tag.cross { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 560px) { .results li { grid-template-columns: minmax(0, 1fr); } }
.pick { gap: 14px; padding: 40px 28px; }
.pick-name { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 6vw, 52px); line-height: 1.05; letter-spacing: -0.03em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- additions ---------- */
.search.wide { max-width: 520px; flex: none; }
.solo { border-top: 1px solid var(--line); padding-top: 12px; }
.solo summary { cursor: pointer; color: var(--muted); min-height: 44px; display: flex; align-items: center; }
.solo .btn { margin-top: 12px; }
.person.off { opacity: 0.55; }
.linkish { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 700; min-height: 32px; }
.share-actions { margin-left: auto; align-self: center; }
@media (max-width: 760px) { .share-actions { margin-left: 0; } }
a.tag { color: var(--text); text-decoration: none; }
a.tag:hover { text-decoration: underline; }
.results .meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 560px) { .results .meta { justify-content: flex-start; } }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.linkish.danger { color: var(--danger); }
.prose h2 { margin-top: 12px; font-size: 20px; }
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.prose p, .prose li { max-width: 40em; }
.plays { width: 100%; border-collapse: collapse; }
.plays th, .plays td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.plays thead th { color: var(--muted); font-size: 14px; font-weight: 700; }
.plays tbody th { font-weight: 700; width: 40%; }
.gamelist li a { font-weight: 700; color: var(--text); text-decoration: none; }
.gamelist li a:hover { color: var(--accent); }
.game-nav { margin-top: 8px; }

/* Best buys on the "needs" tab */
.best-buys .plain li { flex-wrap: wrap; }
.best-buys .plain li > span:first-child { flex: 1 1 260px; min-width: 0; }

/* Sponsored indie pick */
.spotlight { display: flex; gap: 18px; align-items: center; border: 1px solid var(--line); }
.spotlight img { width: 184px; aspect-ratio: 460 / 215; object-fit: cover; border-radius: 10px; flex: none; background: var(--raised); }
@media (max-width: 560px) {
  .spotlight { flex-direction: column; align-items: stretch; }
  .spotlight img { width: 100%; }
}
.totals > .share-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
