:root {
  --bg: #f3f6f3; --card: #fff; --ink: #1b2a1f; --muted: #5d6b61; --line: #dbe3dc;
  --brand: #14532d; --brand-ink: #fff; --accent: #f59e0b; --bad: #b42318; --good: #15803d;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1511; --card: #17211b; --ink: #e8f0ea; --muted: #9bab9f; --line: #2a3a2f;
          --brand: #22c55e; --brand-ink: #04210f; --bad: #f97066; --good: #4ade80; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
.top { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem;
       background: #14532d; color: #fff; position: sticky; top: 0; z-index: 5; }
.top a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.15rem; }
.faq-link { padding: .4rem .7rem; border: 1px solid #ffffff66; border-radius: 999px; }
main { padding: 1rem; max-width: 40rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem 1rem 2rem; }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.card.prose h2 { margin-top: 1.2rem; }
.hero p { color: var(--muted); }
.grid { display: grid; gap: 1rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .75rem; }
input, select, button, .button {
  font: inherit; width: 100%; min-height: 48px; padding: .6rem .8rem; margin-top: .25rem;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
button, .button { background: var(--brand); color: var(--brand-ink); border: 0; font-weight: 700; cursor: pointer;
                  display: inline-block; text-align: center; text-decoration: none; margin-top: 0; }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.code-input { text-transform: uppercase; letter-spacing: .15em; }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: .15em; }
.code.big { display: block; font-size: 2rem; }
.share { display: grid; gap: .75rem; align-items: center; }
.row { display: flex; gap: .5rem; align-items: center; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--bad); font-weight: 600; margin: 0 0 .75rem; }
.error.banner { background: var(--card); border: 1px solid var(--bad); border-radius: 10px; padding: .75rem 1rem; }
.pill { font-size: .75rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.pill-open { color: var(--good); border-color: var(--good); }
.pill-closed { color: var(--accent); border-color: var(--accent); }
ul.teams, ul.bets, ol.standings { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
ul.teams li { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; }
ul.teams li.winner { border-color: var(--accent); border-width: 2px; }
ul.bets li, ol.standings li { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap;
                              border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
.ratio { font-family: ui-monospace, Menlo, monospace; font-weight: 700; background: var(--bg); padding: .1rem .5rem; border-radius: 6px; }
.pos { color: var(--good); } .neg { color: var(--bad); }
form.inline { display: flex; gap: .5rem; margin-top: .5rem; }
form.inline input { flex: 1; min-width: 0; margin-top: 0; }
form.inline .ratio-input { flex: 0 0 5.5rem; }
form.inline button { width: auto; flex: 0 0 auto; }
.card form + form { margin-top: .5rem; }
ul { padding-left: 1.2rem; }

@media (min-width: 640px) {
  main { padding: 1.5rem; }
  .grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .share { grid-template-columns: 1fr auto; }
  .share button { width: auto; }
  button, .button { width: auto; min-width: 9rem; }
  form > button { margin-top: .25rem; }
  h1 { font-size: 1.9rem; }
}
@media (min-width: 960px) { main { max-width: 52rem; } }
