/* Ambassador Quiz 2026 — projector-first presentation styles.
   Sizing leans on clamp() so one slide reads well on a laptop and a hall screen.

   Every colour lives in the tokens below. The surface/line/dot values are
   tinted with the ink colour rather than plain white, so swapping the palette
   doesn't leave invisible borders behind. */

:root {
  /* page */
  --bg: #f5f7fc;
  --bg-glow-a: #dbe4ff;
  --bg-glow-b: #d5efe9;

  /* raised panels — cards, chips, nav buttons */
  --surface: rgba(19, 26, 46, 0.035);
  --surface-line: rgba(19, 26, 46, 0.13);
  --surface-hover: rgba(19, 26, 46, 0.07);
  --surface-hover-line: rgba(19, 26, 46, 0.26);
  --shadow: 0 1px 2px rgba(19, 26, 46, 0.05), 0 8px 22px rgba(19, 26, 46, 0.06);
  --shadow-lift: 0 2px 4px rgba(19, 26, 46, 0.06), 0 14px 32px rgba(19, 26, 46, 0.1);

  /* text */
  --ink: #131a2e;
  --ink-dim: #5b6784;
  --ink-faint: rgba(91, 103, 132, 0.72);

  /* accent — deepened so it holds contrast against a light page */
  --accent: #9a5708;
  --accent-2: #cf3f6a;
  --accent-fill: #f0a52a;
  --accent-fill-hover: #ffb845;
  --accent-ink: #2a1d00;
  --answer-bg: rgba(240, 165, 42, 0.13);
  --answer-line: rgba(163, 93, 9, 0.34);

  /* difficulty */
  --easy: #15803d;
  --medium: #1d4ed8;
  --hard: #be185d;

  /* dots */
  --dot: rgba(19, 26, 46, 0.18);
  --dot-seen: rgba(19, 26, 46, 0.42);

  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

/* Author display rules (.tf uses flex) otherwise beat the UA style for [hidden]. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* Two soft colour pools stop the flat page from looking washed out when projected. */
body::before {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -1;
  background:
    radial-gradient(46% 46% at 18% 12%, var(--bg-glow-a) 0%, transparent 62%),
    radial-gradient(46% 46% at 84% 86%, var(--bg-glow-b) 0%, transparent 60%);
  opacity: 0.9;
}

/* ------------------------------------------------------------- screens --- */

.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
}

.screen.is-active { display: flex; }

#start.is-active,
#end.is-active {
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.start-inner {
  width: min(1000px, 92vw);
  padding: 4vh 0;
  text-align: center;
  animation: rise 0.5s var(--ease) both;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: clamp(0.75rem, 1.3vw, 0.95rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
}

.title {
  margin: 0;
  font-size: clamp(2.4rem, 6.4vw, 4.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.title span {
  background: linear-gradient(100deg, #d9820e, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 1rem auto 2.4rem;
  max-width: 52ch;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: var(--ink-dim);
  line-height: 1.6;
}

.muted { opacity: 0.75; }

/* --------------------------------------------------------- round cards --- */

.rounds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 2.2rem;
  text-align: left;
}

.loading {
  grid-column: 1 / -1;
  color: var(--ink-dim);
  text-align: center;
}

.round-card {
  position: relative;
  overflow: hidden;
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}

.round-card:hover,
.round-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--surface-hover-line);
  box-shadow: var(--shadow-lift);
  outline: none;
}

.round-card .rc-name {
  display: block;
  font-size: 1.22rem;
  font-weight: 700;
}

.round-card .rc-meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.87rem;
  color: var(--ink-dim);
}

/* Difficulty stripe down the left edge of each card. */
.round-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--medium);
}

.round-card[data-diff="Easy"]::before   { background: var(--easy); }
.round-card[data-diff="Medium"]::before { background: var(--medium); }
.round-card[data-diff="Hard"]::before   { background: var(--hard); }

/* A mixed round earns all three colours down its edge. */
.round-card[data-diff="Mixed"]::before {
  background: linear-gradient(to bottom, var(--easy), var(--medium), var(--hard));
}

.start-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  align-items: center;
  justify-content: center;
}

.check {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--ink-dim);
  font-size: 0.94rem;
  cursor: pointer;
}

.check input { accent-color: var(--accent-fill); width: 1rem; height: 1rem; }

.source {
  margin: 2.2rem auto 0;
  max-width: 64ch;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-faint);
}

.source.is-warning { color: #a3410b; font-weight: 600; }

/* --------------------------------------------------------------- buttons - */

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.2s, border-color 0.2s,
              box-shadow 0.2s, opacity 0.2s;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  padding: 0.85rem 2rem;
  background: var(--accent-fill);
  color: var(--accent-ink);
  font-size: 1rem;
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-fill-hover);
  box-shadow: var(--shadow-lift);
}

.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.btn-lg {
  padding: 1.05rem 2.9rem;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  letter-spacing: 0.01em;
}

.btn-ghost {
  padding: 0.55rem 1.1rem;
  border-color: var(--surface-line);
  background: transparent;
  color: var(--ink-dim);
  font-size: 0.9rem;
}

.btn-ghost:hover { border-color: var(--surface-hover-line); color: var(--ink); }

.btn-nav {
  padding: 0.8rem 1.7rem;
  border-color: var(--surface-line);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.98rem;
}

.btn-nav:hover:not(:disabled) {
  border-color: var(--surface-hover-line);
  box-shadow: var(--shadow-lift);
}

.btn-nav:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

/* ---------------------------------------------------------- quiz chrome -- */

.progress {
  height: 4px;
  background: var(--surface);
  flex: none;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-fill), var(--accent-2));
  transition: width 0.4s var(--ease);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 3vw, 2.4rem);
  flex: none;
}

.bar-meta { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.bar-right { display: flex; gap: 0.7rem; align-items: center; }

.badge {
  padding: 0.38rem 0.9rem;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.badge-diff[data-diff="Easy"]   { color: var(--easy);   border-color: rgba(21, 128, 61, 0.42); }
.badge-diff[data-diff="Medium"] { color: var(--medium); border-color: rgba(29, 78, 216, 0.42); }
.badge-diff[data-diff="Hard"]   { color: var(--hard);   border-color: rgba(190, 24, 93, 0.42); }

.counter {
  font-variant-numeric: tabular-nums;
  font-size: 0.94rem;
  color: var(--ink-dim);
}

/* ----------------------------------------------------------- the slide --- */

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 1vh clamp(1.2rem, 5vw, 4rem);
  min-height: 0;
  overflow-y: auto;
}

.slide {
  width: min(1100px, 100%);
  text-align: center;
}

.slide.is-entering { animation: slideIn 0.4s var(--ease) both; }

.q-number {
  margin: 0 0 1.1rem;
  font-size: clamp(0.72rem, 1.2vw, 0.85rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}

.q-text {
  margin: 0 auto;
  max-width: 24ch;
  font-size: clamp(1.6rem, 4.1vw, 3.15rem);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.tf {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.tf-chip {
  padding: 0.6rem 2.2rem;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 600;
  color: var(--ink-dim);
}

.answer-zone { margin-top: clamp(2rem, 5vh, 3.4rem); }

.answer {
  max-width: 46ch;
  margin: 0 auto;
  padding: 1.7rem 2rem;
  border: 1px solid var(--answer-line);
  border-radius: var(--radius);
  background: var(--answer-bg);
  animation: rise 0.42s var(--ease) both;
}

.answer-label {
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}

.a-text {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.9rem);
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}

.a-ref,
.a-note {
  margin: 0.85rem 0 0;
  color: var(--ink-dim);
  line-height: 1.5;
}

.a-ref { font-size: clamp(0.85rem, 1.4vw, 1rem); font-style: italic; }
.a-note { font-size: clamp(0.82rem, 1.3vw, 0.95rem); }

.a-ref:empty,
.a-note:empty { display: none; }

/* --------------------------------------------------------------- footer -- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem clamp(1rem, 3vw, 2.4rem) 1.6rem;
  flex: none;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 60%;
}

.dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--dot);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.dot:hover { transform: scale(1.4); }
.dot.is-seen { background: var(--dot-seen); }
.dot.is-current { background: var(--accent-fill); transform: scale(1.55); }

.hint {
  position: fixed;
  bottom: 0.55rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.72rem;
  color: var(--ink-faint);
  pointer-events: none;
  white-space: nowrap;
}

kbd {
  padding: 1px 5px;
  border: 1px solid var(--surface-line);
  border-radius: 4px;
  background: #fff;
  font-family: inherit;
  font-size: 0.9em;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .dots { display: none; }
  .hint { display: none; }
  .nav { padding-bottom: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
