/* Black and white only, matched to the public sites:
   ROAR MMA (data-theme=dark)    roarmma.com.au: Montserrat, #181a1b page, 800 UPPERCASE headings, square corners
   ROAR Active (data-theme=light) roar.com.au:   Montserrat, white page, black text, 600 sentence-case headings, square corners */
:root, [data-theme=dark] {
  --bg: #181a1b; --panel: #222425; --panel2: #2c2e30; --line: #3a3c3e;
  --text: #fff; --muted: rgba(255,255,255,.62);
  --ink: #fff; --on-ink: #000;          /* primary button / "signed in" fill */
  --h-weight: 800; --h-case: uppercase; --h-spacing: .01em;
}
[data-theme=light] {
  --bg: #fff; --panel: #f4f4f4; --panel2: #ebebeb; --line: #dcdcdc;
  --text: #000; --muted: #5c5c5c;
  --ink: #000; --on-ink: #fff;
  --h-weight: 600; --h-case: none; --h-spacing: 0;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 Montserrat, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; border-radius: 0; }
[hidden] { display: none !important; }
h1, h2, .h { font-weight: var(--h-weight); text-transform: var(--h-case); letter-spacing: var(--h-spacing); }

/* header */
.bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { height: 30px; width: auto; display: block; }
.sub { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: var(--h-case); letter-spacing: .04em; white-space: nowrap; }
.who { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); white-space: nowrap; }
@media (max-width: 480px) { .brand:has(+ .who:not([hidden])) .sub { display: none; } .who { gap: 6px; } }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 80px; }
h1 { font-size: 22px; margin: 0 0 4px; line-height: 1.2; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.card { background: var(--panel); border: 1px solid var(--line); padding: 16px; margin-bottom: 12px; }
.narrow { max-width: 380px; margin: 40px auto; }
.err { min-height: 1.2em; font-size: 14px; font-weight: 600; margin: 8px 0 0; }

input[type=password], input[type=search], input[type=text], input[type=date], select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); padding: 12px 14px; outline: none; min-height: 48px;
}
input:focus, select:focus { border-color: var(--text); }
[data-theme=dark] input[type=date] { color-scheme: dark; }
#pin, .pin { font-size: 24px; letter-spacing: .3em; text-align: center; margin: 14px 0 10px; }
button { cursor: pointer; border: 0; background: none; }
.primary { width: 100%; background: var(--ink); color: var(--on-ink); padding: 14px; font-weight: 700; min-height: 48px; text-transform: var(--h-case); letter-spacing: .04em; }
.primary:active { opacity: .8; }
.ghost { background: var(--panel); border: 1px solid var(--line); min-width: 48px; min-height: 48px; font-size: 22px; }
.link { color: var(--muted); text-decoration: underline; padding: 4px; }
.back { margin: 0 0 10px; text-decoration: none; font-size: 15px; font-weight: 600; }

.controls { display: grid; gap: 10px; margin-bottom: 14px; }
.datepick { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; }
.toggle { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--text); }
@media (min-width: 640px) { .controls { grid-template-columns: 1fr 1.2fr auto; align-items: center; } }

/* class list */
.list { display: grid; gap: 8px; }
.cls { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; text-align: left; width: 100%; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--text); padding: 14px; }
.cls:active { background: var(--panel2); }
.cls .name { font-size: 17px; font-weight: var(--h-weight); text-transform: var(--h-case); }
.cls .meta { color: var(--muted); font-size: 13px; }
.cls .cap { text-align: right; font-size: 13px; color: var(--muted); }
.cls .cap b { display: block; color: var(--text); font-size: 18px; }
.cls.past { opacity: .5; border-left-color: var(--line); }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }

.classhead { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.counts { display: grid; grid-template-columns: auto auto; gap: 0 6px; align-items: baseline; font-size: 12px; color: var(--muted); white-space: nowrap; }
.counts b { font-size: 22px; color: var(--text); text-align: right; }

/* photos (initials fallback when PGM has none) */
.ph { flex: none; width: 44px; height: 44px; background: var(--panel2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; font-weight: 800; font-size: 15px; color: var(--muted); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }

.add label { display: block; margin-bottom: 8px; }
.results { display: grid; gap: 6px; margin-top: 8px; }
.res { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); padding: 8px 10px; text-align: left; width: 100%; min-height: 60px; }
.res .num, .att .num { color: var(--muted); font-size: 13px; }
.res .go { background: var(--ink); color: var(--on-ink); padding: 8px 12px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.res.warn .go { background: transparent; color: var(--text); border: 1px dashed var(--text); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: 2px; text-transform: uppercase; letter-spacing: .04em; }
.tag.warn { border-style: dashed; border-color: var(--text); color: var(--text); }
.tag.done { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* attendees */
.att { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); padding: 10px 12px; min-height: 66px; }
.att .nm { font-weight: 600; }
.att.on { border-color: var(--text); }
.sw { position: relative; width: 64px; height: 36px; background: var(--panel2); border: 2px solid var(--line); flex: none; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; background: var(--muted); transition: transform .15s, background .15s; }
.sw[aria-checked=true] { background: var(--ink); border-color: var(--ink); }
.sw[aria-checked=true]::after { transform: translateX(28px); background: var(--on-ink); }
.sw:disabled { opacity: .45; }
.section-label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 14px 2px 2px; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(92vw, 520px); background: var(--ink); color: var(--on-ink); padding: 12px 16px; font-size: 15px; font-weight: 600; z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.toast.bad, .toast.warn { background: var(--bg); color: var(--text); border: 2px dashed var(--text); }
.spin { display: inline-block; width: 18px; height: 18px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: s .7s linear infinite; vertical-align: -3px; }
@keyframes s { to { transform: rotate(360deg); } }

/* ================= kiosk ================= */
.kiosk main { max-width: 980px; padding: 24px 24px 60px; }
.kiosk .bar { padding: 16px 24px; }
.kiosk .brand img { height: 40px; }
.k-hero { text-align: center; margin: 4vh 0 24px; }
.k-hero h1 { font-size: clamp(30px, 5vw, 52px); margin-bottom: 8px; }
.k-hero p { color: var(--muted); font-size: 18px; margin: 0; }
.k-search { font-size: 26px !important; min-height: 72px !important; text-align: center; border-width: 2px !important; }
.k-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 20px; }
.k-person { background: var(--panel); border: 2px solid var(--line); padding: 14px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.k-person:active, .k-person:focus-visible { border-color: var(--text); }
.k-person .ph { width: 120px; height: 120px; font-size: 38px; }
.k-person .nm { font-size: 19px; font-weight: 700; }
.k-me { display: flex; align-items: center; gap: 18px; margin: 10px 0 22px; }
.k-me .ph { width: 96px; height: 96px; font-size: 32px; }
.k-me h1 { font-size: clamp(26px, 4vw, 40px); margin: 0; }
.k-classes { display: grid; gap: 12px; }
.k-class { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; width: 100%; text-align: left; background: var(--panel); border: 2px solid var(--line); padding: 20px; min-height: 92px; }
.k-class:active { border-color: var(--text); }
.k-class .name { font-size: 22px; font-weight: var(--h-weight); text-transform: var(--h-case); }
.k-class .meta { color: var(--muted); font-size: 15px; }
.k-class .go { background: var(--ink); color: var(--on-ink); font-weight: 800; padding: 14px 20px; font-size: 17px; text-transform: var(--h-case); white-space: nowrap; }
.k-class.done { border-color: var(--text); }
.k-class.done .go { background: transparent; color: var(--text); border: 2px solid var(--text); }
.k-done { text-align: center; margin-top: 8vh; display: grid; justify-items: center; gap: 14px; }
.k-done .ph { width: 180px; height: 180px; font-size: 56px; border: 4px solid var(--text); }
.k-done h1 { font-size: clamp(34px, 6vw, 60px); margin: 0; }
.k-done p { font-size: 22px; color: var(--muted); margin: 0; }
.k-big-btn { background: var(--panel); border: 2px solid var(--line); padding: 16px 26px; font-size: 18px; font-weight: 700; }
.k-foot { position: fixed; right: 12px; bottom: 10px; }
.k-foot button { color: var(--muted); font-size: 12px; opacity: .5; padding: 10px; }
#setupClub { margin-top: 14px; }
.link.full { width: 100%; margin-top: 10px; }
