/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --border: #dfe2e8;
  --text: #0f1419;
  --text-2: #4b5563;
  --text-3: #6b7280;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0fc;
  --series-1: #2a78d6;
  --good: #11743f; --good-bg: #e3f5ea;
  --warn: #8a5a00; --warn-bg: #fdf1d6;
  --bad: #b42318; --bad-bg: #fde8e6;
  --radius: 14px;
  --shadow: 0 1px 2px #0000000d, 0 4px 16px #0000000a;
  --tap: 48px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1114; --surface: #1a1c20; --surface-2: #23262b; --border: #32363d;
    --text: #f1f2f4; --text-2: #c3c7ce; --text-3: #9aa0aa;
    --accent: #3987e5; --accent-soft: #1b2a3f; --series-1: #3987e5;
    --good: #5bd08c; --good-bg: #16301f;
    --warn: #f0c35a; --warn-bg: #36290c;
    --bad: #ff8f85; --bad-bg: #3a1815;
    --shadow: 0 1px 2px #0006;
  }
}
body.present {
  --bg: #0b0c0e; --surface: #17191d; --surface-2: #23262b; --border: #32363d;
  --text: #f4f5f7; --text-2: #c3c7ce; --text-3: #9aa0aa;
  --accent: #3987e5; --accent-soft: #1b2a3f; --series-1: #3987e5;
  --good: #5bd08c; --good-bg: #16301f; --warn: #f0c35a; --warn-bg: #36290c; --bad: #ff8f85; --bad-bg: #3a1815;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; justify-content: center; padding: 20px 16px 40px;
}
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

main { width: 100%; max-width: 460px; }
main.wide { max-width: 980px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 700; }
.brand .dot { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 15px; }

/* ---------- Forms & buttons ---------- */
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: .92rem; }
input, select {
  font: inherit; width: 100%; min-height: var(--tap); padding: 10px 14px;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border); border-radius: 10px;
}
input:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
input[aria-invalid="true"] { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: .85rem; margin-top: 4px; min-height: 1.1em; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 14px; }
.check input { width: 20px; min-height: 20px; height: 20px; }

.btn {
  font: inherit; font-weight: 600; min-height: var(--tap); padding: 10px 18px; border-radius: 10px; border: 0;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; width: 100%; margin-top: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: #c62828; color: #fff; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.btn.sm { width: auto; min-height: 36px; padding: 6px 12px; margin: 0; font-size: .88rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }

/* ---------- Messages, pills, spinner ---------- */
.msg { padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: .95rem; }
.msg.ok { background: var(--good-bg); color: var(--good); }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.live { background: var(--good-bg); color: var(--good); }
.pill.ended::before { border-radius: 2px; } /* square vs dot: state is not color-only */
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 8px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Check-in states ---------- */
.state { text-align: center; padding: 8px 0 4px; }
.state h1 { margin-top: 14px; }
.badge { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; }
.badge.ok { background: var(--good-bg); color: var(--good); }
.badge.err { background: var(--bad-bg); color: var(--bad); }
.badge svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.badge.ok path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .1s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Toasts & dialogs ---------- */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(92vw, 420px); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: .95rem; }
.toast.err { background: #c62828; color: #fff; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 22px; width: min(92vw, 400px); box-shadow: 0 10px 40px #0005; }
dialog::backdrop { background: #0008; }
dialog .row { margin-top: 16px; justify-content: flex-end; }

/* ---------- Admin ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 16px; width: fit-content; }
.tab { font: inherit; font-weight: 600; border: 0; background: transparent; color: var(--text-2); padding: 8px 16px; border-radius: 9px; cursor: pointer; min-height: 40px; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.session { display: grid; gap: 10px; }
.session-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.session-title { font-weight: 700; font-size: 1.05rem; }
.attendees { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-size: .9rem; }
.attendees .line { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.attendees .line:last-child { border: 0; }
.sync { font-size: .8rem; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.kpi .v { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--text-2); font-size: .85rem; margin-top: 4px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-head h2 { margin: 0; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 160px) 1fr 44px; gap: 10px; align-items: center; font-size: .9rem; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-track { height: 18px; border-radius: 0 6px 6px 0; position: relative; cursor: default; }
.bar-fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.tl { width: 100%; height: 190px; display: block; }
.tl text { fill: var(--text-3); font-size: 11px; }
.tl .grid { stroke: var(--border); stroke-width: 1; }
.tl rect.col { fill: var(--series-1); }
.tl rect.hit { fill: transparent; }
.tl rect.hit:hover + rect.col, .tl g:hover rect.col { filter: brightness(1.2); }
#tip { position: fixed; pointer-events: none; z-index: 60; background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: .82rem; opacity: 0; transition: opacity .1s; max-width: 240px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--text-2); font-weight: 600; font-size: .82rem; }
td, th { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.legend-note { font-size: .82rem; color: var(--text-3); margin-top: 10px; }

/* ---------- Presenter ---------- */
body.present { align-items: flex-start; }
body.present main { max-width: 460px; }
.stage { text-align: center; width: 100%; max-width: 900px; margin: 0 auto; }
.stage h1 { font-size: clamp(1.4rem, 4vw, 2.4rem); }
#qr { background: #fff; padding: 14px; border-radius: 18px; width: min(56vh, 88vw); margin: 14px auto 0; }
#qr svg { width: 100%; height: auto; display: block; }
#bar-wrap { width: min(56vh, 88vw); margin: 14px auto 0; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
#bar { height: 100%; background: var(--accent); width: 100%; transform-origin: left; border-radius: 99px; }
.url { font-size: .8rem; color: var(--text-3); margin: 10px 0 0; word-break: break-all; }
.big-count { font-size: clamp(2.6rem, 8vw, 4.5rem); font-weight: 800; line-height: 1; margin-top: 14px; font-variant-numeric: tabular-nums; }
.big-count small { display: block; font-size: 1rem; font-weight: 500; color: var(--text-2); margin-top: 6px; }
.latest { color: var(--text-2); min-height: 1.5em; margin-top: 6px; }
.controls { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; transition: opacity .3s; }
.controls.idle { opacity: 0; pointer-events: none; }

/* ---------- Raffle ---------- */
body.raffle {
  --gold: #f5c451; --gold-2: #ffe08a; --gold-3: #c8841f; --trophy-ink: #2a1c00; --violet: #8b5cf6;
  --confetti: #f5c451, #ffe08a, #3987e5, #7fb4f5, #5bd08c, #ff8f85, #b78cf2, #ffffff;
  overflow-x: hidden;
}

/* Setup card */
.raffle-card { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); }
.raffle-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.trophy {
  width: 52px; height: 52px; flex: none; padding: 11px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-3)); box-shadow: 0 6px 24px color-mix(in srgb, var(--gold) 40%, transparent);
  fill: none; stroke: var(--trophy-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.stepper { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; }
.stepper .btn { margin: 0; width: auto; font-size: 1.4rem; padding: 0; }
.stepper input { text-align: center; font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 8px; margin-top: 10px; }
.chip {
  font: inherit; font-weight: 600; flex: 1; min-height: 36px; border-radius: 99px; cursor: pointer;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.draw-btn {
  min-height: 58px; font-size: 1.15rem; letter-spacing: .02em; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 40%, transparent);
}
.draw-btn::after { /* a light sweep across the button */
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 30%, #ffffff40 50%, transparent 70%);
  animation: sweep 3.2s ease-in-out infinite;
}
@keyframes sweep { 60%, 100% { transform: translateX(100%); } }

/* End-of-day raffle: which sessions count */
.session-checks { max-height: 210px; overflow-y: auto; }
.session-checks .check { margin: 8px 0 0; }
/* Setup can be taller than the screen: the footer follows the content instead of covering the Draw button. */
body.raffle:has(#setup:not(.hidden)) { flex-wrap: wrap; align-content: flex-start; padding-bottom: 24px; }
body.raffle:has(#setup:not(.hidden)) .hsd-footer { position: static; width: 100%; margin-top: 24px; }

/* Stage */
.raffle-stage { max-width: 1400px; padding-top: 2vh; }
.eyebrow { text-transform: uppercase; letter-spacing: .35em; font-size: .8rem; font-weight: 700; color: var(--gold); }
.stage-title {
  font-size: clamp(2rem, 5.5vw, 3.6rem) !important; font-weight: 800; margin-top: 6px;
  background: linear-gradient(90deg, #fff, var(--gold-2), #fff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stage-sub { color: var(--text-2); font-size: clamp(1rem, 2vw, 1.3rem); margin-top: 4px; min-height: 1.5em; }
.stage-sub.done { color: var(--gold-2); font-weight: 700; animation: rise .6s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* 3-2-1 */
.countdown {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; pointer-events: none;
  font-size: min(40vh, 40vw); font-weight: 900; color: #fff; text-shadow: 0 0 60px var(--accent), 0 0 120px var(--violet);
}
.countdown.pop { animation: count .75s ease-out forwards; }
@keyframes count {
  from { transform: scale(1.7); opacity: 0; }
  20% { transform: scale(1); opacity: 1; }
  75% { transform: scale(.95); opacity: 1; }
  to { transform: scale(.8); opacity: 0; }
}

/* Winner slots */
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 28px auto 0; width: 100%; }
.slots > .slot { flex: 0 1 var(--slot-w); }
.slots.xl { --slot-w: 680px; --slot-font: clamp(2.2rem, 7vw, 5rem); --slot-pad: 48px 28px; }
.slots.lg { --slot-w: 400px; --slot-font: clamp(1.4rem, 3.6vw, 2.4rem); --slot-pad: 30px 18px; }
.slots.md { --slot-w: 210px; --slot-font: clamp(1.1rem, 2.4vw, 1.6rem); --slot-pad: 22px 14px; }
.slots.sm { --slot-w: 165px; --slot-font: 1.05rem; --slot-pad: 16px 10px; }
.slots.xs { --slot-w: 135px; gap: 8px; --slot-font: .88rem; --slot-pad: 12px 8px; }
.slot {
  position: relative; overflow: hidden; border: 2px solid transparent; border-radius: var(--radius);
  padding: var(--slot-pad); display: grid; place-items: center; min-height: 2.6em;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--border) border-box;
  animation: enter .45s calc(var(--i) * 25ms) ease-out backwards;
}
@keyframes enter { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.slot.spinning {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--angle), var(--accent), var(--violet), transparent 40%, var(--accent)) border-box;
  animation: enter .45s calc(var(--i) * 25ms) ease-out backwards, spin-border 1.1s linear infinite;
}
@keyframes spin-border { to { --angle: 360deg; } }
.slot-name { font-size: var(--slot-font); font-weight: 800; line-height: 1.15; color: var(--text-3); overflow-wrap: anywhere; }
.slot.spinning .slot-name { filter: blur(.4px); }
.rank {
  position: absolute; top: 6px; left: 8px; font-size: .7rem; font-weight: 800; letter-spacing: .05em;
  color: var(--text-3); opacity: 0; transition: opacity .3s;
}
.slots.xs .rank, .slots.sm .rank { font-size: .6rem; top: 3px; left: 6px; }
.slots.xl .rank { display: none; }
.slot.landed {
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--gold) 16%, var(--surface)), var(--surface)) padding-box,
    linear-gradient(135deg, var(--gold-2), var(--gold), var(--gold-3)) border-box;
  box-shadow: 0 0 28px color-mix(in srgb, var(--gold) 35%, transparent);
  animation: land .6s ease-out, glow 2.4s 1s ease-in-out infinite;
}
.slot.landed .slot-name { color: #fff; }
.slot.landed .rank { opacity: 1; color: var(--gold); }
.slot.landed::after { /* white flash at the moment of landing */
  content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; animation: flash .5s ease-out;
}
@keyframes land { 0% { transform: scale(1); } 35% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes flash { from { opacity: .55; } }
@keyframes glow { 50% { box-shadow: 0 0 44px color-mix(in srgb, var(--gold) 55%, transparent); } }
/* Sound and fullscreen icons, bottom-right corner */
.corner-tools { position: fixed; right: 16px; bottom: 16px; display: flex; gap: 8px; z-index: 45; transition: opacity .3s; }
.corner-tools.idle { opacity: 0; pointer-events: none; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0;
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border); color: var(--text-2);
  backdrop-filter: blur(8px); opacity: .7; transition: opacity .2s, color .2s, border-color .2s;
}
.icon-btn:hover, .icon-btn:focus-visible { opacity: 1; color: var(--text); border-color: var(--accent); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .off, .icon-btn.is-off .on { display: none; }
.icon-btn.is-off .off { display: block; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; }

/* ---------- HSD event theme (presenter and raffle) ----------
   Matches the event poster: black, two glowing periwinkle spheres meeting in the middle, film grain. */
body.hsd {
  --bg: #030308; --surface: #0d0d22; --surface-2: #17183a; --border: #2c2e62;
  --text: #f4f5ff; --text-2: #c3c7f0; --text-3: #8f94c8;
  --accent: #6b74f0; --accent-soft: #1e2052; --series-1: #6b74f0; --violet: #9a8cff;
  --gold: #aab4ff; --gold-2: #e4e8ff; --gold-3: #5b63e0; --trophy-ink: #0b0c3a;
  --confetti: #6b74f0, #8d95f2, #aab4ff, #e4e8ff, #ffffff, #9a8cff, #5fb0ff;
  background: var(--bg);
}
/* Room for the fixed logo footer on the projector pages. */
body.hsd:has(.hsd-footer:not(.inline)) { padding-bottom: 110px; }
.hsd-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
/* Vignette: the spheres fade into black towards the screen edges, as on the poster. */
.hsd-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 75% 85% at 50% 50%, transparent 45%, #000000d9 100%); }
.orb { position: absolute; left: 50%; aspect-ratio: 1; border-radius: 50%; translate: -50% 0; filter: blur(1.5px); }
.orb-top {
  width: max(150vh, 105vw); bottom: 54vh;
  background: radial-gradient(circle at 50% 96%, #8b93f0 0%, #6168dd 12%, #4046bd 27%, #25267d 44%, #0f0e38 62%, #040309 82%);
  box-shadow: 0 40px 140px -40px #6f77e699;
  animation: orb-top 14s ease-in-out infinite alternate;
}
.orb-bottom {
  width: max(140vh, 98vw); top: 62vh;
  background: radial-gradient(circle at 42% 4%, #6a74e4 0%, #434ac2 16%, #282a88 34%, #121246 56%, #040309 80%);
  box-shadow: 0 -30px 120px -50px #6f77e677;
  animation: orb-bottom 16s ease-in-out infinite alternate;
}
@keyframes orb-top { to { transform: translateY(-1.5vh) scale(1.01); } }
@keyframes orb-bottom { to { transform: translateY(1.5vh) scale(1.01); } }
.grain {
  position: absolute; inset: 0; opacity: .2; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.hsd .card { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(16px); border-color: #ffffff1a; }
body.hsd .brand .dot { background: linear-gradient(135deg, var(--accent), var(--violet)); }
body.hsd .stage h1:not(.stage-title), body.hsd .big-count, body.hsd .latest, body.hsd .url, body.hsd .stage-sub, body.hsd .eyebrow { text-shadow: 0 2px 18px #000a; }
/* Gradient text can't take text-shadow (it shows through the letters), so it gets a drop-shadow filter. */
body.hsd .stage-title { filter: drop-shadow(0 3px 16px #000b); }
body.hsd .eyebrow { color: #fff; }
body.hsd .btn.secondary, body.hsd .btn.ghost { background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(8px); color: var(--text); }

/* QR on the presenter: a white card that glows against the spheres. Smaller to leave room for the footer. */
body.hsd #qr { width: min(44vh, 80vw); margin-top: 10px; box-shadow: 0 0 0 1px #ffffff26, 0 24px 90px -10px #6f77e6cc; }
body.hsd #bar-wrap { width: min(44vh, 80vw); background: #ffffff1c; }
body.hsd #bar { background: linear-gradient(90deg, var(--accent), var(--violet), #e4e8ff); }

/* Logos and the HSD mark, centred along the bottom like the poster. */
.hsd-footer {
  position: fixed; left: 0; right: 0; bottom: 14px; z-index: 5; pointer-events: none;
  display: flex; justify-content: center; align-items: center; gap: clamp(20px, 4vw, 56px);
}
.hsd-logo { width: clamp(46px, 8vh, 80px); height: auto; border-radius: 50%; box-shadow: 0 6px 24px #000a; }
.hsd-brand { text-align: center; color: #fff; text-shadow: 0 2px 16px #000c; }
.hsd-tagline { font-size: clamp(.55rem, 1.25vh, .8rem); letter-spacing: .3em; opacity: .92; }
.hsd-mark { font-size: clamp(1.5rem, 4.4vh, 2.7rem); font-weight: 800; line-height: 1.1; margin-top: 4px; }
.hsd-sub { font-size: clamp(.42rem, .9vh, .58rem); font-weight: 600; letter-spacing: .04em; }
@media (max-width: 560px) {
  .hsd-tagline { letter-spacing: .15em; }
}
/* Privacy page: footer sits under the card instead of being fixed over the content. */
.hsd-footer.inline { position: static; margin-top: 28px; }

/* Privacy policy page */
body.present main.policy-main { max-width: 720px; }
.policy h2 { margin: 22px 0 8px; }
.policy h3 { font-size: .95rem; margin: 14px 0 6px; color: var(--text-2); }
.policy ul { margin: 0 0 12px; padding-left: 20px; }
.policy li { margin-bottom: 6px; }
.policy a, .policy-note a { color: var(--gold-2, #c3c7f0); }
.policy-note { text-align: center; margin: 12px 0 0; }

/* "Continue with Google" above the check-in form */
.google-btn { display: flex; justify-content: center; min-height: 44px; margin-top: 8px; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0 2px; color: var(--text-3); font-size: .85rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

@media (max-width: 560px) {
  .card { padding: 18px; }
  .bar-row { grid-template-columns: 90px 1fr 36px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .badge.ok path { stroke-dashoffset: 0; }
  .orb, .draw-btn::after, .slot, .slot.landed, .slot.landed::after { animation: none !important; }
}

/* Settings tab */
.setting { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting:first-child { padding-top: 0; }
.setting:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.setting code { color: var(--text-2); font-size: .8rem; overflow-wrap: anywhere; }
.setting.removing input, .setting.removing textarea { opacity: .5; text-decoration: line-through; }
.setting textarea { width: 100%; font: inherit; font-size: .85rem; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); resize: vertical; -webkit-text-security: disc; }
#view-settings .row input { flex: 1; min-width: 180px; }
