/* Quiz Arena. Big, friendly, readable on a phone at arm's length. */
:root {
  --ink: #16202e;
  --muted: #5b6574;
  --paper: #ffffff;
  --wash: #f3f5f9;
  --line: #d9dee7;
  --primary: #17458F;
  --primary-ink: #ffffff;
  --accent: #F7A81B;
  --accent-ink: #16202e;
  --flair: #872175;
  --good: #1a7f4b;
  --good-wash: #e5f4ec;
  --bad: #b3261e;
  --bad-wash: #fbe9e8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .07);
  --font: "Open Sans", "Helvetica Neue", Arial, sans-serif;
}
/* Brand skins. ClarkMorgan and Shine colours are placeholders until confirmed. */
[data-theme="clarkmorgan"] { --primary: #0f3b57; --accent: #2bb5a8; --accent-ink: #062b2a; --flair: #0f3b57; }
[data-theme="shine"] { --primary: #3b2a6b; --accent: #ffb703; --accent-ink: #2a1c00; --flair: #e85d04; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--wash); color: var(--ink);
  font-family: var(--font); font-size: 18px; line-height: 1.5;
}
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }

.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--paper); border-bottom: 4px solid var(--accent);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--primary); min-width: 0; }
.brand-logo { height: 52px; width: auto; }
.brand-logo[src=""], .brand-badge[src=""] { display: none; }
.brand-name { font-weight: 800; font-stretch: 80%; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-badge { height: 44px; width: auto; }

main { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }
.loading { color: var(--muted); text-align: center; padding: 60px 0; }
.foot { text-align: center; color: var(--muted); font-size: 14px; padding: 0 16px 32px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 10px; font-stretch: 80%; }
h1 { font-size: clamp(32px, 8vw, 48px); font-weight: 800; color: var(--primary); }
h2 { font-size: clamp(26px, 6vw, 34px); font-weight: 800; color: var(--primary); }
h3 { font-size: 20px; font-weight: 800; }
p { margin: 0 0 14px; }
.eyebrow { font-size: 14px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--flair); margin-bottom: 6px; }
.lead { font-size: 19px; color: var(--ink); }
.muted { color: var(--muted); }

.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.hero { background: var(--primary); color: var(--primary-ink); padding: 28px 22px; position: relative; overflow: hidden; }
.hero h1, .hero .eyebrow { color: var(--primary-ink); }
.hero .eyebrow { color: var(--accent); }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: var(--accent); opacity: .18; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 26px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 19px; font-weight: 800; text-decoration: none; transition: transform .08s ease, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible, input:focus-visible, select:focus-visible, .chip:focus-visible, .order-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-dark { background: var(--primary); color: var(--primary-ink); }
.btn-ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 2px var(--line); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 12px; }

label.field { display: block; font-weight: 700; margin-bottom: 14px; }
label.field span { display: block; margin-bottom: 6px; }
input[type="text"], select {
  width: 100%; min-height: 54px; padding: 10px 14px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--paper); font-size: 19px;
}
input[type="text"]:focus, select:focus { border-color: var(--primary); outline: none; }

.round-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.round-icon { width: 64px; height: 64px; border-radius: 50%; flex: none; background: var(--wash); }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 4px 0 18px; }
.progress > i { display: block; height: 100%; background: var(--accent); }

.q { padding: 16px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 800; font-size: 16px; margin-right: 8px; flex: none; }
.q-text { display: flex; align-items: flex-start; gap: 4px; font-weight: 600; margin-bottom: 10px; }

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip {
  min-height: 56px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper);
  font-weight: 800; font-size: 19px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

.order { display: grid; gap: 8px; }
.order-item {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  min-height: 56px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); cursor: pointer;
}
.order-item b { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--wash); }
.order-item .pos { margin-left: auto; font-weight: 800; color: var(--primary); white-space: nowrap; }
.order-item[data-picked] { border-color: var(--primary); background: #eef3fb; }
.order-reset { margin-top: 6px; background: none; border: 0; color: var(--primary); font-weight: 700; text-decoration: underline; cursor: pointer; padding: 6px 0; }

.dingbat {
  display: grid; place-items: center; min-height: 120px; padding: 16px; margin-bottom: 10px;
  border: 2px dashed var(--line); border-radius: 12px; background: var(--wash);
  font-weight: 800; font-size: clamp(22px, 6vw, 30px); letter-spacing: .06em; text-align: center; white-space: pre; line-height: 1.25;
}
.photo { border-radius: 12px; overflow: hidden; margin-bottom: 10px; aspect-ratio: 482 / 214; background: var(--wash); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.bank { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 700; color: var(--primary); }

.joker { display: flex; gap: 14px; align-items: center; background: #fff7e6; border: 2px solid var(--accent); }
.joker img { width: 72px; height: 72px; object-fit: contain; flex: none; }

.result { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; margin-bottom: 8px; }
.result.ok { background: var(--good-wash); }
.result.no { background: var(--bad-wash); }
.result.half { background: #fff4dc; }
.result.half .mark { background: #b7791f; }
.result .mark { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; }
.result.ok .mark { background: var(--good); }
.result.no .mark { background: var(--bad); }
.result small { display: block; color: var(--muted); font-size: 15px; }
.result .yours { font-size: 15px; color: var(--muted); }

.score-big { font-size: 64px; font-weight: 800; font-stretch: 75%; color: var(--primary); line-height: 1; }
.score-big small { font-size: 28px; color: var(--muted); }

.board { width: 100%; border-collapse: collapse; }
.board td, .board th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.board th { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.board td.n { width: 36px; font-weight: 800; color: var(--muted); }
.board td.s { text-align: right; font-weight: 800; font-size: 20px; color: var(--primary); }
.board tr.me td { background: #fff7e6; }
.tag { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--flair); color: #fff; margin-left: 6px; vertical-align: middle; }

.donate { background: var(--flair); color: #fff; }
.donate h3, .donate p { color: #fff; }
.sticky-go { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--wash) 30%); }

@media (min-width: 640px) {
  .chips.hl { grid-template-columns: 1fr 1fr; max-width: 360px; }
  .card { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.play { width: 100%; margin-bottom: 12px; }
.play .plays { font-weight: 600; opacity: .8; }
.play.is-playing { background: var(--accent); color: var(--accent-ink); }
.music-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.music-inputs .field { margin-bottom: 0; }
@media (max-width: 420px) { .music-inputs { grid-template-columns: 1fr; } }

.to-beat { position: relative; z-index: 1; background: rgba(255,255,255,.12); border: 2px solid var(--accent); border-radius: 14px; padding: 14px 16px; margin: 6px 0 18px; }
.to-beat-label { font-size: 14px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.to-beat-score { font-size: 52px; font-weight: 800; font-stretch: 75%; line-height: 1; margin-top: 4px; }
.to-beat-score small { font-size: 24px; opacity: .75; }
.to-beat-team { font-size: 22px; font-weight: 800; margin-top: 4px; }
.to-beat-ask { font-size: 18px; margin-top: 6px; color: var(--accent); font-weight: 700; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; margin: 4px 0 14px; cursor: pointer; }
.consent input { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.small { font-size: 14px; margin-top: 10px; }
input[type="email"] { width: 100%; min-height: 54px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); font-size: 19px; }
