/* Dolar Zone Trading Tournament
   Banknote palette: engraved note green, mint paper, seal gold.
   Scoreboard type (Big Shoulders Display) for names and figures, DM Sans for reading. */
:root {
  --note: #0C3326;
  --note-2: #164A38;
  --note-3: #082519;
  --leaf: #2E7D5B;
  --paper: #E6EDE4;
  --paper-hi: #F5F8F3;
  --ink: #13241D;
  --muted: #56685F;
  --line: #C7D3C8;
  --gold: #B8912F;
  --gold-hi: #D9B658;
  --red: #A8322A;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--paper-hi); }
img { max-width: 100%; height: auto; }
a { color: var(--note-2); text-underline-offset: 3px; }
a:hover { color: var(--leaf); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--note); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.02; letter-spacing: .005em; margin: 0 0 .45em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.8rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.fine { font-size: .85rem; color: var(--muted); }

/* Top bar */
.topbar { background: var(--note); color: var(--paper); border-bottom: 3px solid var(--gold); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.45rem; line-height: 1; }
.brand:hover { color: #fff; }
.brand small { display: block; font-family: var(--body); font-weight: 500; font-size: .74rem; color: var(--gold-hi); margin-top: 3px; letter-spacing: .01em; }
.seal-mini { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gold-hi); box-shadow: inset 0 0 0 3px var(--note), inset 0 0 0 4px var(--gold-hi); display: grid; place-items: center; color: var(--gold-hi); font-size: 1.1rem; }
#nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
#nav a { color: var(--paper); text-decoration: none; padding: 8px 12px; border-radius: 3px; font-weight: 500; font-size: .95rem; }
#nav a:hover { background: var(--note-2); color: #fff; }
#nav a[aria-current] { background: var(--note-2); color: var(--gold-hi); }
#nav a.nav-cta { background: var(--gold); color: var(--note); font-weight: 700; margin-left: 6px; }
#nav a.nav-cta:hover { background: var(--gold-hi); }
#nav .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: var(--note); font-size: .78rem; font-weight: 700; text-align: center; }
.nav-toggle { display: none; background: transparent; color: var(--paper); border: 1.5px solid var(--gold-hi); border-radius: 3px; padding: 7px 14px; font: 600 .95rem var(--body); cursor: pointer; }
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  #nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  #nav.open { display: flex; }
  #nav a.nav-cta { margin: 6px 0 0; text-align: center; }
}
.announce { background: var(--gold-hi); color: var(--note); font-weight: 600; padding: 10px 0; font-size: .95rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 3px; border: 2px solid var(--note); font: 700 1rem var(--body); cursor: pointer; text-decoration: none; background: var(--note); color: #fff; line-height: 1.1; }
.btn:hover { background: var(--note-2); border-color: var(--note-2); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--note); }
.btn-gold:hover { background: var(--gold-hi); border-color: var(--gold-hi); color: var(--note); }
.btn-ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn-ghost:hover { background: rgba(255,255,255,.08); color: inherit; border-color: currentColor; }
.btn-line { background: #fff; color: var(--note); border-color: var(--line); }
.btn-line:hover { background: var(--paper); color: var(--note); border-color: var(--note-2); }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #8C2821; border-color: #8C2821; }
.btn-sm { padding: 7px 12px; font-size: .88rem; }
.btn[disabled], .btn.is-off { opacity: .5; pointer-events: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Hero: the standings board is the centerpiece */
.hero { background: var(--note); color: var(--paper); position: relative; overflow: hidden; padding: 60px 0 76px; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-radial-gradient(circle at 92% 18%, transparent 0 13px, rgba(217,182,88,.07) 13px 14px),
    repeating-radial-gradient(circle at 4% 120%, transparent 0 17px, rgba(217,182,88,.05) 17px 18px); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 52px; align-items: center; }
.hero h1 { color: #fff; max-width: 9.5em; }
.hero .lead { font-size: 1.15rem; max-width: 33em; color: #CFE0D4; }
.hero .actions { margin-top: 26px; }
.seal { margin-top: 34px; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; text-align: center; color: var(--gold-hi);
  border: 2px solid var(--gold-hi); box-shadow: inset 0 0 0 6px var(--note), inset 0 0 0 7px var(--gold-hi); transform: rotate(-9deg); font-size: .82rem; line-height: 1.15; }
.seal b { display: block; font-family: var(--display); font-size: 1.55rem; font-weight: 900; margin-top: 2px; }
.board { background: var(--note-3); border: 1px solid #2A5C48; border-radius: 6px; padding: 22px 22px 12px; }
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2px solid var(--gold); padding-bottom: 12px; margin-bottom: 4px; }
.board-head h2 { font-size: 1.9rem; color: #fff; margin: 0; }
.board-head p { margin: 4px 0 0; color: #9FB8A9; font-size: .9rem; }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 8px; padding: 11px 0; border-bottom: 1px dashed #1E4636; }
.board li:last-child { border-bottom: 0; }
.board .who { font-weight: 600; color: #fff; }
.board .who small { display: block; font-weight: 400; color: #8FA99A; font-size: .82rem; }
.pos { font-family: var(--display); font-weight: 900; font-size: 1.8rem; color: var(--gold-hi); line-height: 1; }
.board .empty { color: #9FB8A9; padding: 28px 0; }
.board-foot { padding: 12px 0 6px; }
.board-foot a { color: var(--gold-hi); }
.gain { font-family: var(--display); font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.gain.up { color: var(--leaf); }
.gain.down { color: var(--red); }
.gain.none { color: var(--muted); }
.board .gain.up { color: #7FD6A4; }
.board .gain.down { color: #F09A8F; }
.board .gain.none { color: #7C9486; }
.data .gain { font-size: 1.25rem; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 36px; } .seal { display: none; } }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--paper); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head p { max-width: 38em; margin: 0; color: var(--muted); }

/* Tournament rows (a ledger, not cards) */
.tlist { border-top: 3px solid var(--ink); }
.trow { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr 1.1fr auto; gap: 18px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.trow .name { font-family: var(--display); font-size: 1.75rem; font-weight: 800; line-height: 1; text-decoration: none; color: var(--ink); }
.trow .name:hover { color: var(--leaf); }
.trow .sub { font-size: .88rem; color: var(--muted); margin-top: 6px; }
.fig { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.12rem; }
.fig small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.fig.big { font-family: var(--display); font-size: 1.7rem; font-weight: 800; }
.trow .go { text-align: right; }
@media (max-width: 900px) {
  .trow { grid-template-columns: 1fr 1fr; }
  .trow > :first-child { grid-column: 1 / -1; }
  .trow .go { grid-column: 1 / -1; text-align: left; }
}

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: s; }
.steps li { counter-increment: s; border-top: 2px solid var(--note); padding-top: 14px; }
.steps li::before { content: counter(s); display: block; font-family: var(--display); font-weight: 900; font-size: 2.6rem; color: var(--gold); line-height: 1; margin-bottom: 8px; }
.steps h3 { font-size: 1.35rem; margin-bottom: .3em; }
.steps p { color: var(--muted); margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { border: 1.5px solid var(--note-2); color: var(--note-2); padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: .9rem; }

.prose { max-width: 70ch; }
.prose p { white-space: pre-line; }
.figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 22px 0 30px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 700px) { .figs { grid-template-columns: 1fr 1fr; } }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* Badges */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-pending { background: #F3E3B3; color: #6B5310; }
.badge-approved, .badge-active, .badge-open { background: #CDE9D8; color: #1D5C45; }
.badge-live { background: var(--gold-hi); color: var(--note); }
.badge-rejected, .badge-blocked, .badge-expired { background: #F2D0CC; color: #7E231C; }
.badge-finished, .badge-hidden { background: #DDE3DE; color: #3F4F47; }

/* Forms */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 26px; }
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 1.8rem; }
.auth { max-width: 470px; margin: 48px auto 64px; }
.field { margin-bottom: 16px; }
label, .label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .93rem; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 3px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--note-2); outline: none; box-shadow: 0 0 0 3px rgba(184,145,47,.35); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--note-2); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.errors { background: #F8E5E2; border-left: 4px solid var(--red); padding: 12px 16px; margin-bottom: 18px; border-radius: 3px; }
.errors ul { margin: 0; padding-left: 18px; }

.alert { padding: 12px 16px; border-radius: 4px; margin: 16px 0; border-left: 4px solid; font-weight: 500; }
.alert-success { background: #E3F2E8; border-color: var(--leaf); }
.alert-error { background: #F8E5E2; border-color: var(--red); }
.alert-info { background: #F6EED4; border-color: var(--gold); }
.flash-area { padding-top: 6px; }

/* Checkout */
.checkout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .checkout { grid-template-columns: 1fr; } }
.summary { background: var(--note); color: var(--paper); border-radius: 6px; padding: 24px; position: sticky; top: 16px; }
.summary h2 { color: #fff; font-size: 1.9rem; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 16px 0 0; }
.summary dt { color: #9FB8A9; }
.summary dd { margin: 0; font-weight: 700; text-align: right; }
.amount-big { font-family: var(--display); font-weight: 900; font-size: 3.4rem; color: var(--gold-hi); line-height: 1; margin-top: 18px; }
.methods { display: grid; gap: 8px; margin-bottom: 18px; }
.method { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; margin: 0; }
.method b { display: block; }
.method span span { font-weight: 400; color: var(--muted); font-size: .88rem; }
.method:has(input:checked) { border-color: var(--note-2); background: #EEF5EF; box-shadow: inset 4px 0 0 var(--note-2); }
.pay-box { border: 2px solid var(--note); border-radius: 6px; padding: 18px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin-bottom: 22px; background: #fff; }
.pay-box[hidden] { display: none; }
@media (max-width: 560px) { .pay-box { grid-template-columns: 1fr; } }
.qr { width: 150px; height: 150px; padding: 6px; background: #fff; border: 1px solid var(--line); }
.addr { font-family: var(--mono); font-size: .92rem; word-break: break-all; background: var(--paper); padding: 10px 12px; border-radius: 3px; margin: 6px 0 10px; }
.warn { color: #7E231C; font-size: .88rem; font-weight: 500; }

/* Credentials */
.cred { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 14px 0 0; padding: 16px; background: var(--paper); border-radius: 4px; }
.cred dt { color: var(--muted); }
.cred dd { margin: 0; font-family: var(--mono); font-weight: 600; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; word-break: break-all; }
.entry { border-top: 1px solid var(--line); padding: 20px 0; }
.entry:first-of-type { border-top: 3px solid var(--ink); }
.entry-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.entry-head h3 { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--note-2); font: 600 .85rem var(--body); text-decoration: underline; cursor: pointer; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
table.data { width: 100%; border-collapse: collapse; }
.data th, .data td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: .94rem; }
.data th { font-weight: 700; background: var(--paper); white-space: nowrap; }
.data tr:last-child td { border-bottom: 0; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data .mono { font-family: var(--mono); font-size: .85rem; }
.data input, .data select { padding: 7px 8px; min-width: 96px; }
.data .posc { font-family: var(--display); font-weight: 900; font-size: 1.4rem; color: var(--gold); }
.data tr.me td { background: #FBF5E2; }
.empty-state { padding: 34px 20px; text-align: center; color: var(--muted); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 3px; text-decoration: none; border: 1.5px solid var(--line); color: var(--ink); font-weight: 600; font-size: .92rem; background: #fff; }
.tabs a[aria-current] { background: var(--note); color: #fff; border-color: var(--note); }

/* Admin */
.is-admin { background: #EEF2ED; }
.admin-main { padding: 34px 0 60px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.stat b { display: block; font-family: var(--display); font-weight: 900; font-size: 2.5rem; line-height: 1; margin-top: 6px; }
.stat.hot { background: var(--note); color: var(--paper); border-color: var(--note); }
.stat.hot b { color: var(--gold-hi); }
@media (max-width: 800px) { .stats { grid-template-columns: 1fr 1fr; } }
.proof { max-width: 100%; border: 1px solid var(--line); border-radius: 4px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-all; }

/* Footer */
.foot { background: var(--ink); color: #B8C7BD; padding: 36px 0; margin-top: 40px; }
.foot a { color: var(--gold-hi); }
.foot-in { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
.foot-brand { font-family: var(--display); font-size: 1.4rem; color: #fff; display: block; margin-bottom: 8px; }
.foot .fine { color: #8C9E93; }
@media (max-width: 700px) { .foot-in { grid-template-columns: 1fr; } }
.is-admin .foot { display: none; }
