:root {
  --bg: #120d0a;
  --panel: #1e1611;
  --panel-2: #2a1f17;
  --line: #3d2e22;
  --text: #f7f0e6;
  --muted: #b8a794;
  --amber: #ffb02e;
  --amber-dark: #c77f0a;
  --red: #e5484d;
  --green: #3dd68c;
  --green-dark: #1d7a4f;
  --blue: #6cb6ff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
}
h1, h2, h3 { line-height: 1.1; margin: 0 0 .4em; }
h1 {
  font-size: 1.7rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase;
}
h1 .accent, .accent { color: var(--amber); }
h2 { font-size: 1.05rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--amber); margin-top: 1.6rem; }
h3 { font-size: .95rem; }
a { color: var(--amber); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.wrap { max-width: 640px; margin: 0 auto; padding: 1rem 1rem 4rem; }

/* Header */
.sitehead { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #1c130c, var(--bg)); }
.sitehead .wrap { padding-top: 1.2rem; padding-bottom: 1rem; }
.tagline { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.topnav { display: flex; gap: .5rem; margin-top: .8rem; flex-wrap: wrap; }
.topnav a {
  display: inline-block; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: .85rem; background: var(--panel);
}
.topnav a[aria-current="page"] { background: var(--amber); color: #1a1206; border-color: var(--amber); }

/* Banners and badges */
.banner {
  margin: .9rem 0; padding: .7rem .9rem; border-radius: 10px; font-size: .9rem;
  background: #241a10; border: 1px solid var(--line); color: var(--muted);
}
.banner strong { color: var(--text); }
.badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
}
.badge.open { background: var(--green-dark); color: #eafff4; }
.badge.closed { background: var(--red); color: #fff; }
.st { font-weight: 700; font-size: .8rem; padding: .15rem .55rem; border-radius: 999px; display: inline-block; }
.st.awaiting_payment { background: #3a2f1d; color: var(--amber); }
.st.receipt_matched { background: #173a2b; color: var(--green); }
.st.receipt_flagged { background: #45191b; color: #ff8589; }
.st.confirmed { background: var(--green-dark); color: #eafff4; }

/* Buttons */
button {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: .55rem .9rem; cursor: pointer; font-weight: 600;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary {
  background: var(--amber); border-color: var(--amber); color: #1a1206; font-weight: 800;
  padding: .8rem 1.2rem; font-size: 1rem; width: 100%;
}
button.primary:not(:disabled):hover { background: #ffc35c; }
button.ghost { background: transparent; }
button.danger { border-color: var(--red); color: #ff8589; }
button.small { padding: .3rem .6rem; font-size: .8rem; }

/* Entry form */
.pickrow { margin: .7rem 0 1.1rem; }
.pickrow > strong { display: block; margin-bottom: .4rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.floors { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; }
.floors button { text-align: left; padding: .6rem .7rem; font-size: .9rem; border-radius: 10px; }
.floors button.chosen { background: var(--green-dark); border-color: var(--green); color: #eafff4; font-weight: 800; }
.floors button.chosen.locked { outline: 2px solid var(--green); outline-offset: 2px; }
.floors button.taken { opacity: .55; font-style: italic; }
.stakes { display: flex; gap: .5rem; }
.stakes button { flex: 1; padding: .8rem 0; font-size: 1.05rem; font-weight: 800; }
.stakes button.chosen { background: var(--amber); border-color: var(--amber); color: #1a1206; }
.stakes button.chosen.locked { outline: 2px solid var(--amber); outline-offset: 2px; }
label { display: block; margin: .7rem 0 .2rem; font-weight: 600; font-size: .9rem; }
input[type="text"], input[type="password"], input:not([type]) {
  width: 100%; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--line);
  background: #0d0a07; color: var(--text); font: inherit; margin-top: .3rem;
}
input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.error { color: #ff8589; font-weight: 600; min-height: 1.2em; }
.ok { color: var(--green); font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; margin: 1rem 0; }
legend { padding: 0 .4rem; font-weight: 700; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.entrycard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-top: 1rem; }
.entrycard dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; margin: .6rem 0; }
.entrycard dt { color: var(--muted); font-size: .85rem; }
.entrycard dd { margin: 0; font-weight: 700; }
.refcode { font-size: 1.4rem; font-weight: 900; letter-spacing: .08em; color: var(--amber); white-space: nowrap; }
#shot-preview { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); display: block; margin-top: .6rem; }
.statusline { font-weight: 700; margin: .8rem 0; }

/* Admin */
.adminbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }
.counts { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0 1rem; }
.counts .chip { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; font-size: .85rem; }
.counts .chip b { display: block; font-size: 1.2rem; }
.acard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: .9rem; margin: .7rem 0; }
.acard .head { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.acard .who { font-weight: 800; font-size: 1.05rem; }
.acard .picks { color: var(--muted); font-size: .9rem; margin: .2rem 0; }
.acard .ops { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.acard .note { color: #ff8589; font-size: .85rem; margin-top: .3rem; }
.acard .meta { color: var(--muted); font-size: .8rem; }

/* Presentation board */
.board { max-width: 1100px; margin: 0 auto; padding: 2vh 2.5vw 4vh; }
.boardhead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.boardtitle { font-size: clamp(1.6rem, 3.4vw, 3rem); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.badge.live { font-size: clamp(.9rem, 1.6vw, 1.3rem); padding: .4rem 1rem; }
.hero { display: flex; gap: 2.5vw; align-items: baseline; flex-wrap: wrap; margin: 2vh 0 3vh; }
.hero .big { font-size: clamp(3rem, 8vw, 6.5rem); font-weight: 900; color: var(--amber); line-height: 1; }
.hero .sub { color: var(--muted); font-size: clamp(1rem, 2vw, 1.5rem); }
.rankrow { display: grid; grid-template-columns: 3.2rem minmax(14rem, 24rem) 1fr 7.5rem; gap: 1rem; align-items: center; margin: .55vh 0; }
.rankrow .pos { font-size: clamp(1.3rem, 2.6vw, 2.2rem); font-weight: 900; color: var(--muted); text-align: right; }
.rankrow:first-of-type .pos { color: var(--amber); }
.rankrow .who { font-size: clamp(1rem, 1.8vw, 1.45rem); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rankrow .bar { height: clamp(1.4rem, 3.2vh, 2.4rem); background: var(--panel-2); border-radius: 8px; overflow: hidden; }
.rankrow .fill { height: 100%; background: linear-gradient(90deg, var(--amber-dark), var(--amber)); border-radius: 8px 0 0 8px; min-width: 0; transition: width .6s ease; }
.rankrow .amt { font-size: clamp(1rem, 2.2vw, 1.7rem); font-weight: 800; text-align: right; }
.rankrow .amt .pct { color: var(--muted); font-weight: 600; font-size: .75em; }
.pend { margin-top: 3vh; color: var(--muted); font-size: clamp(.9rem, 1.8vw, 1.3rem); }
.updated { color: var(--muted); font-size: .85rem; margin-top: 1vh; }
.flash { animation: flash 1s ease; }
@keyframes flash { 0% { background: rgba(255, 176, 46, .25); } 100% { background: transparent; } }
@media (max-width: 700px) {
  .rankrow { grid-template-columns: 2.2rem 7.5rem 1fr 5.5rem; gap: .5rem; }
}

/* bar widths (CSP-safe, no inline styles) */
.fill.w0 { width: 0%; }
.fill.w1 { width: 1%; }
.fill.w2 { width: 2%; }
.fill.w3 { width: 3%; }
.fill.w4 { width: 4%; }
.fill.w5 { width: 5%; }
.fill.w6 { width: 6%; }
.fill.w7 { width: 7%; }
.fill.w8 { width: 8%; }
.fill.w9 { width: 9%; }
.fill.w10 { width: 10%; }
.fill.w11 { width: 11%; }
.fill.w12 { width: 12%; }
.fill.w13 { width: 13%; }
.fill.w14 { width: 14%; }
.fill.w15 { width: 15%; }
.fill.w16 { width: 16%; }
.fill.w17 { width: 17%; }
.fill.w18 { width: 18%; }
.fill.w19 { width: 19%; }
.fill.w20 { width: 20%; }
.fill.w21 { width: 21%; }
.fill.w22 { width: 22%; }
.fill.w23 { width: 23%; }
.fill.w24 { width: 24%; }
.fill.w25 { width: 25%; }
.fill.w26 { width: 26%; }
.fill.w27 { width: 27%; }
.fill.w28 { width: 28%; }
.fill.w29 { width: 29%; }
.fill.w30 { width: 30%; }
.fill.w31 { width: 31%; }
.fill.w32 { width: 32%; }
.fill.w33 { width: 33%; }
.fill.w34 { width: 34%; }
.fill.w35 { width: 35%; }
.fill.w36 { width: 36%; }
.fill.w37 { width: 37%; }
.fill.w38 { width: 38%; }
.fill.w39 { width: 39%; }
.fill.w40 { width: 40%; }
.fill.w41 { width: 41%; }
.fill.w42 { width: 42%; }
.fill.w43 { width: 43%; }
.fill.w44 { width: 44%; }
.fill.w45 { width: 45%; }
.fill.w46 { width: 46%; }
.fill.w47 { width: 47%; }
.fill.w48 { width: 48%; }
.fill.w49 { width: 49%; }
.fill.w50 { width: 50%; }
.fill.w51 { width: 51%; }
.fill.w52 { width: 52%; }
.fill.w53 { width: 53%; }
.fill.w54 { width: 54%; }
.fill.w55 { width: 55%; }
.fill.w56 { width: 56%; }
.fill.w57 { width: 57%; }
.fill.w58 { width: 58%; }
.fill.w59 { width: 59%; }
.fill.w60 { width: 60%; }
.fill.w61 { width: 61%; }
.fill.w62 { width: 62%; }
.fill.w63 { width: 63%; }
.fill.w64 { width: 64%; }
.fill.w65 { width: 65%; }
.fill.w66 { width: 66%; }
.fill.w67 { width: 67%; }
.fill.w68 { width: 68%; }
.fill.w69 { width: 69%; }
.fill.w70 { width: 70%; }
.fill.w71 { width: 71%; }
.fill.w72 { width: 72%; }
.fill.w73 { width: 73%; }
.fill.w74 { width: 74%; }
.fill.w75 { width: 75%; }
.fill.w76 { width: 76%; }
.fill.w77 { width: 77%; }
.fill.w78 { width: 78%; }
.fill.w79 { width: 79%; }
.fill.w80 { width: 80%; }
.fill.w81 { width: 81%; }
.fill.w82 { width: 82%; }
.fill.w83 { width: 83%; }
.fill.w84 { width: 84%; }
.fill.w85 { width: 85%; }
.fill.w86 { width: 86%; }
.fill.w87 { width: 87%; }
.fill.w88 { width: 88%; }
.fill.w89 { width: 89%; }
.fill.w90 { width: 90%; }
.fill.w91 { width: 91%; }
.fill.w92 { width: 92%; }
.fill.w93 { width: 93%; }
.fill.w94 { width: 94%; }
.fill.w95 { width: 95%; }
.fill.w96 { width: 96%; }
.fill.w97 { width: 97%; }
.fill.w98 { width: 98%; }
.fill.w99 { width: 99%; }
.fill.w100 { width: 100%; }
.footnote { margin-top: 2rem; }

.inlineask { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inlineask input { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line, #444); background: var(--panel, #1c1c1c); color: var(--text, #eee); min-width: 180px; }

.receipt-img { max-width: 100%; max-height: 340px; border-radius: 8px; margin-top: 8px; display: block; }
