/* ICPA Hot Seat Challenge
   Art direction follows the approved screens: the arena still as a full-bleed
   backdrop, dark navy headings on its bright centre, and blue/gold show panels
   for the question, answers and forms. */

/* The layout was drawn for a 1920-wide booth display, and every size caps out
   in rem. On a 4K panel (3840 CSS px) those caps would hold the whole UI at
   half its intended physical size, so the root scales with the viewport above
   1920. At 1920 this is exactly 16px, and it never drops below it, so smaller
   screens render as before. */
html {
  font-size: clamp(16px, 0.8333vw, 30px);
}

:root {
  /* Show blues */
  --blue-900: #071c4d;
  --blue-800: #0d2c78;
  --blue-700: #14409f;
  --blue-600: #1b52c4;

  /* Gold */
  --gold-1: #fff3c4;
  --gold-2: #f6d36b;
  --gold-3: #d9a51f;
  --gold-4: #9a6c0a;
  --gold-face: linear-gradient(180deg, #fff6d5 0%, #f4cf68 28%, #d9a521 55%, #a97a0d 78%, #f0cd72 100%);

  /* Ink: the backdrop is bright in the middle, so headings are near-black. */
  --ink: #0d1330;
  --ink-soft: #24305c;
  --paper: #ffffff;

  --green-1: #34d17f;
  --green-2: #0f8a49;
  --red-1: #ff6a5e;
  --red-2: #c02017;
  --amber-1: #ffc22e;
  --amber-2: #e08200;

  --qbar-face: linear-gradient(180deg, #2a62cf 0%, #14409f 48%, #0b2a70 100%);

  --notch: 26px;
  --hex: polygon(var(--notch) 0, calc(100% - var(--notch)) 0, 100% 50%, calc(100% - var(--notch)) 100%, var(--notch) 100%, 0 50%);
  --shell: min(1500px, 92vw);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: #0b1740;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("../img/background.webp") center / cover no-repeat;
}

#field {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.flash {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease;
}

.flash.is-correct {
  opacity: 1;
  background: radial-gradient(circle at 50% 50%, rgba(20, 190, 110, 0.34) 0%, rgba(20, 190, 110, 0) 68%);
}

.flash.is-wrong {
  opacity: 1;
  background: radial-gradient(circle at 50% 50%, rgba(220, 45, 35, 0.34) 0%, rgba(220, 45, 35, 0) 68%);
}

.corner-logo {
  position: fixed;
  top: 2.2vh;
  right: 2.2vw;
  z-index: 7;
  width: clamp(90px, 8vw, 9.375rem);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.55));
}

body[data-screen="admin"] .corner-logo,
body[data-screen="pin"] .corner-logo { display: none; }

/* ---------- stage & screens ---------- */

.stage {
  position: relative;
  z-index: 4;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 3vh 3vw;
}

.screen {
  display: none;
  width: var(--shell);
  text-align: center;
  animation: rise 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.screen.is-active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- type ---------- */

.headline {
  margin: 0 0 1.6rem;
  font-size: clamp(2rem, 4.4vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.7);
}

.headline--sm { font-size: clamp(1.6rem, 3vw, 2.6rem); }
.headline--win { margin-bottom: 0.9rem; }

.fineprint {
  margin-top: 1.6rem;
  font-size: clamp(0.85rem, 1vw, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.fineprint strong { color: var(--blue-700); }

/* ---------- 1. attract ---------- */

.entry-logo {
  display: block;
  width: clamp(280px, 40vw, 38.75rem);
  height: auto;
  margin: 0 auto 1.2rem;
  filter: drop-shadow(0 12px 34px rgba(0, 0, 0, 0.42));
}

.attract__line {
  margin: 0 0 1.6rem;
  font-size: clamp(1.1rem, 2.1vw, 2.1rem);
  font-weight: 800;
  color: var(--ink);
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.75);
}

.startbtn {
  display: block;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.startbtn img {
  display: block;
  width: clamp(220px, 26vw, 26.875rem);
  height: auto;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.45));
}

.startbtn:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.06); }
.startbtn:active { transform: scale(0.98); }

/* ---------- show panels (registration, PIN) ---------- */

.card {
  width: min(660px, 100%);
  margin: 0 auto;
  padding: 2.2rem 2.4rem 2.4rem;
  border: 2px solid var(--gold-3);
  border-radius: 18px;
  background: linear-gradient(180deg, #1c50b8 0%, #123c96 55%, #0c2a6e 100%);
  box-shadow: 0 22px 50px rgba(4, 14, 44, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-align: left;
}

.form { display: grid; gap: 1.3rem; }

.field { display: grid; gap: 0.45rem; }

.field__label {
  font-size: clamp(0.95rem, 1.15vw, 1.25rem);
  font-weight: 600;
  color: var(--gold-2);
}

.field__label--center { text-align: center; margin: 0 0 1rem; }

.field input {
  width: 100%;
  padding: 1.05rem 1.2rem;
  border: 2px solid #4f9be8;
  border-radius: 10px;
  background: #16181c;
  color: #fff;
  font: inherit;
  font-size: clamp(1.2rem, 1.5vw, 1.7rem);
  font-weight: 600;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input::placeholder { color: rgba(255, 255, 255, 0.34); font-weight: 400; }

.field input:focus {
  outline: none;
  border-color: var(--gold-2);
  box-shadow: 0 0 0 4px rgba(246, 211, 107, 0.25);
}

.formError {
  min-height: 1.3rem;
  margin: 0;
  font-size: clamp(0.95rem, 1.15vw, 1.2rem);
  font-weight: 600;
  color: #ffb3ad;
}

/* ---------- buttons ---------- */

.goldbtn {
  width: 100%;
  margin-top: 0.6rem;
  padding: 1rem 2rem;
  border: 1px solid var(--gold-4);
  border-radius: 999px;
  background: var(--gold-face);
  color: #2a1c00;
  font: inherit;
  font-size: clamp(1.15rem, 1.5vw, 1.7rem);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: filter 160ms ease, transform 160ms ease;
}

.goldbtn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.goldbtn:active { transform: translateY(0) scale(0.99); }

.goldbtn--auto { width: auto; min-width: 16rem; margin: 1.8rem auto 0; display: block; }
.goldbtn--sm { width: auto; padding: 0.7rem 1.6rem; font-size: 1rem; margin-top: 1.2rem; }

.ghostbtn {
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--gold-3);
  border-radius: 999px;
  background: rgba(10, 34, 92, 0.86);
  color: var(--gold-2);
  font: inherit;
  font-size: clamp(0.88rem, 1vw, 1.1rem);
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.ghostbtn:hover { background: var(--gold-3); color: #22180a; }

.linkback {
  margin-top: 1.4rem;
  padding: 0.5rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-soft);
  font: inherit;
  font-size: clamp(0.9rem, 1.05vw, 1.1rem);
  font-weight: 700;
  cursor: pointer;
}

.linkback:hover { background: #fff; }

.goldbtn:focus-visible,
.ghostbtn:focus-visible,
.startbtn:focus-visible,
.linkback:focus-visible,
input:focus-visible { outline: 3px solid var(--blue-700); outline-offset: 3px; }

/* ---------- 3 & 4. question / reveal ---------- */

.emblem-slot {
  width: clamp(150px, 17vw, 18.125rem);
  margin: 0 auto 1.4rem;
  line-height: 0;
}

.emblem-slot img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.4));
}

.qlabel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 0 0 1rem;
  font-size: clamp(0.85rem, 1.05vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Dot-capped rules either side of QUESTION-1, as on the approved screen. */
.qlabel::before,
.qlabel::after {
  content: "";
  width: clamp(48px, 7vw, 8.125rem);
  height: 3px;
  border-radius: 3px;
  background:
    radial-gradient(circle at 3px 50%, var(--ink) 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 3px) 50%, var(--ink) 3px, transparent 3.5px),
    linear-gradient(var(--ink), var(--ink)) center / 100% 2px no-repeat;
}

.qbar {
  position: relative;
  padding: 3px;
  background: var(--gold-face);
  clip-path: var(--hex);
  filter: drop-shadow(0 12px 26px rgba(4, 14, 44, 0.45));
}

.qbar__text {
  margin: 0;
  padding: 1.5rem 3rem;
  background: var(--qbar-face);
  clip-path: var(--hex);
  color: #fff;
  font-size: clamp(1.15rem, 2vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}

.qbar--answer { max-width: 60rem; margin: 1.6rem auto 0; }
.qbar--answer .qbar__text { padding: 1.2rem 2.6rem; font-size: clamp(1rem, 1.5vw, 1.6rem); }

.reveal__title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 3.2vw, 3rem);
  font-weight: 800;
  color: var(--blue-800);
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.75);
}

.screen--reveal.is-timeout .reveal__title { color: var(--red-2); }

/* ---------- answers ---------- */

.options {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 3.6rem;
  margin: 1.5rem 0 2.4rem;
}

/* Gold diamonds between the two columns, as on the approved screen. */
.options::before,
.options::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--gold-face);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: inset 0 0 0 3px var(--blue-700);
  pointer-events: none;
}

.options::before { top: 25%; }
.options::after  { top: 75%; }

.options[data-rows="1"]::before { top: 50%; }
.options[data-rows="1"]::after  { display: none; }

.opt {
  display: block;
  width: 100%;
  padding: 2.5px;
  border: 0;
  background: var(--gold-face);
  clip-path: var(--hex);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 160ms ease, filter 160ms ease;
  animation: optIn 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.opt:nth-child(1) { animation-delay: 0.05s; }
.opt:nth-child(2) { animation-delay: 0.12s; }
.opt:nth-child(3) { animation-delay: 0.19s; }
.opt:nth-child(4) { animation-delay: 0.26s; }

@keyframes optIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.opt__in {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 4.1rem;
  padding: 0.75rem 1.8rem;
  background: var(--qbar-face);
  clip-path: var(--hex);
  transition: background 180ms ease, color 180ms ease;
}

.opt__key {
  flex: none;
  color: var(--gold-2);
  font-size: clamp(1.05rem, 1.7vw, 1.9rem);
  font-weight: 800;
  transition: color 180ms ease;
}

.opt__txt {
  color: #fff;
  font-size: clamp(1rem, 1.55vw, 1.8rem);
  font-weight: 600;
  line-height: 1.2;
}

.opt:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.12); }
.opt:disabled { cursor: default; }

.opt.is-locked .opt__in {
  background: linear-gradient(180deg, var(--amber-1) 0%, var(--amber-2) 100%);
  animation: throb 700ms ease-in-out infinite;
}

.opt.is-locked .opt__key,
.opt.is-locked .opt__txt { color: #2f1d00; }

.opt.is-correct .opt__in {
  background: linear-gradient(180deg, var(--green-1) 0%, var(--green-2) 100%);
  animation: none;
}

.opt.is-correct .opt__key,
.opt.is-correct .opt__txt { color: #03230f; }

.opt.is-wrong .opt__in {
  background: linear-gradient(180deg, var(--red-1) 0%, var(--red-2) 100%);
  animation: shake 400ms ease;
}

.opt.is-wrong .opt__key,
.opt.is-wrong .opt__txt { color: #2b0603; }

.opt.is-dim { opacity: 0.4; }

@keyframes throb {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.22); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* ---------- 5. winner ---------- */

/* "No lifeline needed with ICPAMOX-CV" is a landscape lockup — sized on its
   own so it lands with the same weight as the square badge elsewhere. */
body[data-screen="win"] .emblem-slot {
  width: clamp(300px, 40vw, 45rem);
  margin-bottom: clamp(0.8rem, 3vh, 2.4rem);
}


.win__line {
  margin: 0 0 0.6rem;
  font-size: clamp(1rem, 1.8vw, 1.9rem);
  font-weight: 600;
  color: var(--ink-soft);
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.7);
}

.win__score {
  margin: 0 0 1.4rem;
  font-size: clamp(0.9rem, 1.2vw, 1.3rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-700);
}

.claim {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.1rem 2rem;
  border: 2px dashed var(--gold-2);
  border-radius: 10px;
  background: var(--blue-800);
  color: #fff;
  font-size: clamp(1rem, 1.5vw, 1.7rem);
  font-weight: 600;
}

/* ---------- quiz chrome ---------- */

.timerbar,
.quizfoot { display: none; }

body[data-screen="quiz"] .timerbar { display: block; }
body[data-screen="quiz"] .quizfoot { display: flex; }

.timerbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 7;
  width: 100%;
  height: 5px;
  background: rgba(10, 30, 80, 0.2);
}

.timerbar span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold-3), var(--gold-1));
  box-shadow: 0 0 12px rgba(217, 165, 31, 0.9);
  transform-origin: left center;
  transition: transform 1s linear, background 400ms ease;
}

.timerbar span.is-urgent { background: linear-gradient(90deg, var(--red-2), var(--red-1)); }

.quizfoot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0.9rem;
  z-index: 5;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.counter {
  font-size: clamp(0.85rem, 1vw, 1.1rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.clock {
  min-width: 3.2rem;
  padding: 0.25rem 0.8rem;
  border: 2px solid var(--gold-3);
  border-radius: 999px;
  background: var(--blue-800);
  color: var(--gold-2);
  font-size: clamp(0.9rem, 1.1vw, 1.2rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.clock.is-urgent { color: #ffd9d5; border-color: var(--red-2); background: var(--red-2); }

/* ---------- booth PIN ---------- */

.card--pin { width: min(420px, 100%); padding: 1.8rem 2rem 2.2rem; }

.pindots {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.pindots i {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  transition: background 150ms ease, transform 150ms ease;
}

.pindots i.is-on {
  background: var(--gold-2);
  border-color: var(--gold-2);
  transform: scale(1.12);
}

.pindots.is-bad { animation: shake 400ms ease; }

.pinpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.pinkey {
  padding: 1.1rem 0;
  border: 2px solid #4f9be8;
  border-radius: 12px;
  background: #16181c;
  color: #fff;
  font: inherit;
  font-size: clamp(1.4rem, 1.7vw, 1.9rem);
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.pinkey:hover { background: var(--blue-700); border-color: var(--gold-2); }
.pinkey:active { transform: scale(0.96); }
.pinkey--alt { color: var(--gold-2); font-size: 1.2rem; }

/* ---------- booth console ---------- */

/* Logo up top, question block in the lower half — the approved composition,
   but centred so nothing clips on a shorter screen. */
body[data-screen="quiz"] .stage,
body[data-screen="reveal"] .stage { padding-bottom: 7vh; }

body[data-screen="quiz"] .emblem-slot,
body[data-screen="reveal"] .emblem-slot {
  /* 20% larger than the original 140/15vw/280 so the logo reads from across
     the booth. Reveal matches it, so the badge does not jump size when the
     answer comes up. */
  /* Width is what we want on the booth display; the 40vh cap only bites on a
     short laptop window, where the full-size badge would push the options off
     the bottom. At 1080 and up it never applies. */
  width: min(clamp(211px, 23vw, 26.5rem), 40vh);
  margin-bottom: clamp(1.7rem, 8.5vh, 6.6rem);
}

/* A laptop window shorter than the booth display cannot carry the full-size
   badge and the lower question together — the options run off the bottom. Below
   900px tall the badge and the gap under it both step down; the booth screen
   (1080 and up) never sees this. */
@media (max-height: 900px) {
  body[data-screen="quiz"] .emblem-slot,
  body[data-screen="reveal"] .emblem-slot {
    width: min(clamp(190px, 21vw, 26.5rem), 34vh);
    margin-bottom: clamp(0.9rem, 4.5vh, 2.6rem);
  }
}

body[data-screen="admin"] .stage {
  display: block;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

body[data-screen="admin"] .backdrop { filter: brightness(0.45) saturate(0.7); }
body[data-screen="admin"] #field { opacity: 0.25; }

.screen--admin {
  width: min(117.5rem, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 4vh 2vw 4rem;
  text-align: left;
}

.adminhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.adminhead .headline { margin: 0; color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7); }

.adminactions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.stat {
  padding: 1.4rem 1.6rem;
  border: 2px solid var(--gold-3);
  border-radius: 14px;
  background-color: var(--blue-800);
  background-image: linear-gradient(180deg, #164399 0%, #0a2668 100%);
}

.stat b {
  display: block;
  font-size: clamp(2.2rem, 2.8vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--gold-2);
}

.stat span {
  font-size: clamp(0.78rem, 0.92vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(226, 238, 255, 0.85);
}

.panel {
  max-width: 100%;
  min-width: 0;
  margin-bottom: 1.6rem;
  padding: 1.6rem 1.8rem;
  border: 2px solid var(--gold-3);
  border-radius: 16px;
  background-color: var(--blue-800);
  background-image: linear-gradient(180deg, #164399 0%, #0a2668 100%);
}

.panel__title {
  margin: 0 0 1.1rem;
  font-size: clamp(0.85rem, 1vw, 1.1rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.linkbar__urls { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.linkbar__url {
  padding: 0.55rem 1.1rem;
  border: 1px solid #4f9be8;
  border-radius: 8px;
  background: #16181c;
  color: #fff;
  font-size: clamp(0.95rem, 1.2vw, 1.3rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  user-select: all;
}

.linkbar__note {
  margin: 0.9rem 0 0;
  font-size: clamp(0.8rem, 0.95vw, 1rem);
  color: rgba(226, 238, 255, 0.7);
  word-break: break-all;
}

.linkbar__warn {
  margin: 0.8rem 0 0;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--gold-2);
  border-radius: 6px;
  background: rgba(246, 211, 107, 0.16);
  font-size: clamp(0.85rem, 1vw, 1.05rem);
  line-height: 1.45;
  color: #ffeab5;
}

.linkbar__warn[hidden] { display: none; }

.linkbar__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.linkbar__actions[hidden] { display: none; }

.settingsgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem 2rem;
  align-items: center;
}

.field--inline input { padding: 0.75rem 1rem; border-radius: 10px; }

.check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(0.95rem, 1.1vw, 1.25rem);
  color: #e8f0ff;
  cursor: pointer;
}

.check input { width: 1.5rem; height: 1.5rem; flex: none; accent-color: var(--gold-3); }

.savedNote {
  margin-left: 1rem;
  font-size: clamp(0.9rem, 1vw, 1.1rem);
  color: var(--green-1);
  opacity: 0;
  transition: opacity 200ms ease;
}

.savedNote.is-on { opacity: 1; }

.tablewrap {
  max-width: 100%;
  min-width: 0;
  border: 2px solid var(--gold-3);
  border-radius: 16px;
  overflow: auto;
  max-height: 52vh;
  background: var(--blue-900);
}

.leads {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.95rem, 1.1vw, 1.3rem);
  background: var(--blue-900);
}

.leads th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 1rem 1.2rem;
  background: var(--blue-700);
  font-size: clamp(0.75rem, 0.88vw, 0.98rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--gold-2);
}

.leads td {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(120, 180, 255, 0.18);
  color: #dfe9ff;
}

.leads tbody tr:nth-child(even) td { background: rgba(20, 64, 159, 0.35); }
.leads tr td:first-child { color: #fff; font-weight: 700; }
.leads .pending { color: rgba(223, 233, 255, 0.6); font-style: italic; }

.adminDot {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 8;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  opacity: 0.22;
  transition: opacity 200ms ease;
}

.adminDot:hover { opacity: 0.9; }
body[data-screen="quiz"] .adminDot { display: none; }

/* ---------- on-screen keyboard ----------
   Fixed pixel sizes on purpose: a 55" and an 85" booth screen get the same
   comfortable key size, so the pad stays within arm's reach either way. */

.kb {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: none;
  justify-content: center;
  pointer-events: none;
}

body.kb-open .kb { display: flex; animation: kbIn 240ms cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes kbIn {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

.kb__inner {
  width: 1040px;
  max-width: 96vw;
  padding: 16px 20px 22px;
  border: 2px solid var(--gold-3);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, #1a4bad 0%, #0f327f 60%, #08215a 100%);
  box-shadow: 0 -18px 48px rgba(4, 14, 44, 0.55);
  pointer-events: auto;
}

.kb__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kb__label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.kb__done {
  padding: 0.625rem 1.75rem;
  border: 1px solid var(--gold-4);
  border-radius: 999px;
  background: var(--gold-face);
  color: #2a1c00;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 800;
  cursor: pointer;
}

.kb__done:hover { filter: brightness(1.08); }

.kb__rows { display: grid; gap: 0.625rem; }
.kb__row { display: flex; justify-content: center; gap: 0.625rem; }

.kb__key {
  width: 86px;
  height: 68px;
  padding: 0;
  border: 2px solid #4f9be8;
  border-radius: 0.75rem;
  background: #16181c;
  color: #fff;
  font: inherit;
  font-size: 1.625rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.kb__key:hover { background: var(--blue-700); border-color: var(--gold-2); }
.kb__key:active { transform: scale(0.94); background: var(--gold-3); color: #22180a; }

.kb__key--space { width: 21.25rem; font-size: 1.1875rem; letter-spacing: 0.1em; }
.kb__key--wide { width: 8.75rem; }
.kb__key--alt { color: var(--gold-2); }

/* Blank cell that holds 0 in the middle column of the dial pad. */
.kb__key--filler { background: none; border-color: transparent; pointer-events: none; }

.kb__rows[data-mode="numeric"] .kb__key { width: 7.375rem; height: 4.75rem; font-size: 2rem; }
.kb__rows[data-mode="numeric"] .kb__key--wide { width: 7.375rem; font-size: 1.625rem; }

/* Lift the form clear of the keyboard while it is open. */
body.kb-open .stage { place-items: start center; padding-top: 2vh; }
body.kb-open .screen--register .headline { font-size: clamp(1.3rem, 2.4vw, 2rem); margin-bottom: 0.8rem; }
body.kb-open .card { padding: 1.5rem 1.8rem 1.8rem; }
body.kb-open .form { gap: 0.9rem; }
body.kb-open .field input { padding: 0.8rem 1.1rem; font-size: clamp(1.1rem, 1.3vw, 1.5rem); }
body.kb-open .linkback { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  :root { --notch: 20px; }
  .qbar__text { padding: 1.2rem 2.2rem; }
  .options { gap: 0.8rem 2.6rem; }
  .opt__in { min-height: 3.4rem; padding: 0.6rem 1.3rem; }
}

@media (max-width: 820px) {
  :root { --notch: 15px; }
  .options { grid-template-columns: minmax(0, 1fr); gap: 0.65rem; }
  .options::before, .options::after { display: none; }
  .card { padding: 1.5rem 1.4rem 1.8rem; }
  .qbar__text { padding: 1rem 1.5rem; }
  .adminhead { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 900px) {
  .screen--admin { padding: 3vh 4vw 3rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
  .stat { padding: 1rem 1.1rem; }
  .settingsgrid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .panel { padding: 1.3rem 1.4rem; }
  .leads { font-size: 0.95rem; }
  .leads th, .leads td { padding: 0.8rem 0.9rem; }
}

@media (max-width: 760px) {
  .kb__inner { padding: 12px 12px 16px; }
  .kb__rows, .kb__row { gap: 7px; }
  .kb__key { width: 48px; height: 50px; font-size: 18px; border-radius: 10px; }
  .kb__key--space { width: 176px; font-size: 14px; }
  .kb__key--wide { width: 78px; }
  .kb__rows[data-mode="numeric"] .kb__key { width: 72px; height: 58px; font-size: 24px; }
  .kb__rows[data-mode="numeric"] .kb__key--wide { width: 72px; font-size: 19px; }
  .kb__done { padding: 8px 20px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.panel[hidden] { display: none; }
