/* ============================================================================
   Arena - the employee surface. Phone only, dark, read at arm's length in a
   noisy room. Every value here resolves from tokens.css, so applying the NICE
   palette later is a one-file change.

   Deliberate departures from the previous build: content is left-aligned rather
   than centred down the middle, there is one accent moment per screen instead
   of a gradient on every element, and numbers sit on their own optical baseline
   because they are the point of the whole exercise.
   ========================================================================== */

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-left: max(var(--space-5), env(safe-area-inset-left));
  padding-right: max(var(--space-5), env(safe-area-inset-right));
  padding-bottom: max(var(--space-6), env(safe-area-inset-bottom));
}
/* "safe" keeps the top of the content reachable: plain centring on a flex
   container clips the overflow above the scroll origin on short viewports. */
.shell--centred { justify-content: safe center; }
.shell__inner { width: 100%; max-width: 30rem; margin: 0 auto; }

/* --- masthead -------------------------------------------------------------- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: max(var(--space-4), env(safe-area-inset-top));
  padding-bottom: var(--space-4);
}
.brandmark {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}
.brandmark__rule {
  display: inline-block;
  width: var(--space-6);
  height: 2px;
  background: var(--brand-solid);
  transform: translateY(-0.2em);
}

/* --- event banner ----------------------------------------------------------
   The supplied artwork already carries the wordmark, tagline and dates, so it
   is used whole rather than rebuilt in markup. */
.banner {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  margin-bottom: var(--space-8);
}

/* Compact mark for in-app mastheads: the tagline is dropped because it stops
   being legible below roughly 40px tall. Below about 34px the wordmark itself
   starts to break down, so this is the floor rather than a preference. */
.masthead__mark { height: 2.25rem; width: auto; }
@media (max-width: 22.5rem) { .masthead__mark { height: 2rem; } }

/* --- sign in --------------------------------------------------------------- */
.lede { margin-bottom: var(--space-10); }
.lede__eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--brand-300);
  margin-bottom: var(--space-3);
}
.lede__title {
  /* Capped independently of --text-4xl: the column stops growing at 34rem, so
     letting a viewport-driven clamp run to 64px overflowed short laptop screens. */
  font-size: clamp(2.5rem, 9vw, 3.25rem);
  font-weight: var(--weight-black);
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin-bottom: var(--space-4);
}
/* Separate elements rather than <br>, so screen readers do not run the lines
   together as one word. */
.lede__line { display: block; }
.lede__sub {
  color: var(--text-secondary);
  font-size: var(--text-lg);
  max-width: 26ch;
}

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.step[hidden] { display: none; }

.linkish {
  background: none;
  border: 0;
  padding: var(--space-2) 0;
  color: var(--brand-300);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkish:disabled { color: var(--text-muted); text-decoration: none; cursor: default; }

.otp-input {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: 0.4em;
  text-align: center;
  padding-left: 0.4em;
}

/* --- score ----------------------------------------------------------------
   One hero number, no gradient card. The figure carries the emphasis. */
.score {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) 0 var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.score__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}
.score__value {
  font-size: var(--text-4xl);
  font-weight: var(--weight-black);
  line-height: 0.9;
}
.score__rank { text-align: right; color: var(--text-secondary); font-size: var(--text-sm); }
.score__rank strong { display: block; color: var(--text-primary); font-size: var(--text-xl); font-weight: var(--weight-bold); }

/* --- stats ---------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.stats__cell { background: var(--surface-base); padding: var(--space-4) var(--space-2) var(--space-5); }
.stats__num { font-size: var(--text-xl); font-weight: var(--weight-bold); }
.stats__lbl { font-size: var(--text-2xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: var(--space-1); }

/* --- qualification -------------------------------------------------------- */
.qual {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  padding: var(--space-4);
  border-radius: var(--radius-card);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.qual[data-state="yes"] { background: var(--success-bg); border-color: var(--success-500); color: var(--success-text); }
.qual[data-state="no"] { background: var(--surface-raised); border-color: var(--border-subtle); color: var(--text-secondary); }
.qual__meter { flex: 1; height: 4px; border-radius: var(--radius-pill); background: var(--border-subtle); overflow: hidden; }
.qual__fill { display: block; height: 100%; background: var(--brand-gradient); transition: width var(--dur-slow) var(--ease-out); }

/* --- section headings ----------------------------------------------------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: var(--space-8) 0 var(--space-3);
}
.section-head h2 {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}
.section-head__meta { font-size: var(--text-xs); color: var(--text-muted); }

/* --- booth checklist ------------------------------------------------------ */
.booths { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.booth {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-1);
  border-bottom: 1px solid var(--border-subtle);
}
.booth__tick {
  flex: none;
  width: 1.5rem; height: 1.5rem;
  display: grid; place-items: center;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.booth[data-visited="true"] .booth__tick { background: var(--success-500); border-color: var(--success-500); color: #fff; }
.booth__name { font-weight: var(--weight-semibold); }
.booth__bu { display: block; font-size: var(--text-xs); color: var(--text-muted); }

/* --- question ------------------------------------------------------------- */
.round { flex: 1; display: flex; flex-direction: column; padding-top: var(--space-4); }
.round__meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.booth-tag {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--brand-300);
}

.countdown { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
.countdown__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success-500); animation: pulse 2s var(--ease-inout) infinite; }
.countdown[data-urgent="true"] { color: var(--accent-solid); }
.countdown[data-urgent="true"] .countdown__dot { background: var(--accent-solid); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.question {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-6);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

/* Radio group rather than buttons: assistive tech announces it as a single
   choice with a position, and arrow keys move between options for free. */
.options { border: 0; margin: 0 0 var(--space-5); padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.option { position: relative; display: block; }
.option__input { position: absolute; opacity: 0; width: 0; height: 0; }
.option__face {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--tap-min);
  padding: var(--space-4);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--surface-raised);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.option__face:active { transform: scale(0.99); }
.option__key {
  flex: none;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  border-radius: var(--radius-control);
  background: var(--surface-sunken);
  font-family: var(--font-num);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.option__text { font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.option__input:checked + .option__face { border-color: var(--brand-solid); background: var(--brand-quiet); }
.option__input:checked + .option__face .option__key { background: var(--brand-solid); color: var(--text-on-brand); }
.option__input:focus-visible + .option__face { box-shadow: var(--focus-ring); }

/* --- result --------------------------------------------------------------- */
.result { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: var(--space-6) 0; }
.result__verdict {
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2);
}
.result[data-correct="true"] .result__verdict { color: var(--success-text); }
.result[data-correct="false"] .result__verdict { color: var(--text-secondary); }
.result__place { color: var(--text-secondary); margin-bottom: var(--space-8); }

.award { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-8); }
.award__points { font-size: var(--text-4xl); font-weight: var(--weight-black); line-height: 1; }
.award__unit { font-size: var(--text-sm); color: var(--text-muted); text-transform: uppercase; letter-spacing: var(--tracking-wide); }

.ledger { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-8); }
.ledger__row { display: flex; justify-content: space-between; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm); }
.ledger__row dt { color: var(--text-secondary); }
.ledger__row dd { margin: 0; font-weight: var(--weight-semibold); }

/* --- notices -------------------------------------------------------------- */
.notice { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: var(--space-4); padding: var(--space-8) 0; }
.notice__title { font-size: var(--text-xl); font-weight: var(--weight-bold); }
.notice__body { color: var(--text-secondary); max-width: 32ch; }

/* --- sticky footer action ------------------------------------------------- */
.dock {
  position: sticky;
  bottom: 0;
  padding: var(--space-4) 0 max(var(--space-4), env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--surface-base) 70%, transparent);
}

/* The employee surface is phone-first; on a tablet or desktop it stays a
   single readable column rather than stretching to the viewport. */
@media (min-width: 40rem) {
  .shell__inner { max-width: 34rem; }
}

/* Sign-in is the one arena screen everyone opens, admins included, so it gets a
   real desktop treatment. Stacking banner, hero and form vertically overflowed a
   660px laptop viewport and pushed the submit button below the fold; side by
   side it fits and uses the horizontal space that was going to waste. */
@media (min-width: 48rem) and (min-height: 30rem) {
  .shell--centred .shell__inner {
    max-width: 64rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-12);
    align-items: center;
  }
  .shell--centred .banner { grid-column: 1; grid-row: 1; margin-bottom: var(--space-6); }
  .shell--centred .lede { grid-column: 1; grid-row: 2; margin-bottom: 0; }
  .shell--centred .step { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

  /* The hero is sized to its column, not the viewport: the vw-based clamp
     maxed out at 64px on any wide screen regardless of column width. */
  .shell--centred .lede__title { font-size: 3.25rem; }
  .shell--centred .lede__sub { font-size: var(--text-md); }
}
