/*
 * Top of the Class: shared look for the quiz and the board game.
 *
 * Loaded by both pages after their own stylesheet. One product, two modes:
 * Queezy layout and purple actions throughout, with the printed game's
 * chalkboard and gold for every headline panel, and the same counters.
 */

:root {
  --gold: #e2a93b;
  --gold-soft: #f3d489;
  --gold-deep: #b98d33;
  --chalk: #27262c;
  --chalk-deep: #1b1a1f;
}

/* Soft colour wash behind every screen. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 420px at 12% -8%, rgba(144, 135, 229, 0.28), transparent 70%),
    radial-gradient(560px 380px at 96% 4%, rgba(226, 169, 59, 0.16), transparent 70%);
}

/* ------------------------------------------------------------------ */
/* Top bar                                                             */
/* ------------------------------------------------------------------ */

.tc-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 12px 24px 0;
}
.tc-brand {
  flex: none;
  display: block;
  line-height: 0;
}
.tc-brand img {
  height: 44px;
  width: auto;
}
.tc-grow {
  flex: 1;
  min-width: 0;
}
.tc-links {
  display: flex;
  gap: 2px;
  margin-left: 14px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 18px rgba(12, 9, 42, 0.06);
}
.tc-links a {
  padding: 9px 16px;
  border-radius: 999px;
  color: #5d5a73;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.tc-links a:hover {
  color: var(--primary);
}
.tc-links a[aria-current="page"] {
  background: var(--chalk);
  color: var(--gold-soft);
  box-shadow: inset 0 0 0 1.5px var(--gold-deep);
}
.tc-links a:focus-visible,
.tc-iconbtn:focus-visible {
  outline: 3px solid rgba(106, 90, 224, 0.45);
  outline-offset: 2px;
}

.tc-iconbtn {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(12, 9, 42, 0.06);
}
.tc-iconbtn svg {
  width: 20px;
  height: 20px;
}
.tc-iconbtn:hover {
  background: var(--lavender);
}

@media (max-width: 1180px) {
  .tc-top {
    padding: 10px 16px 0;
  }
  .tc-links a {
    padding: 8px 12px;
  }
}
@media (max-width: 860px) {
  .tc-top {
    padding: 8px 12px 0;
    gap: 8px;
  }
  .tc-brand img {
    height: 34px;
  }
  /* Phones use the bottom tab bar on the quiz; the board keeps the logo home link. */
  .tc-links {
    display: none;
  }
}

/* ------------------------------------------------------------------ */
/* Chalkboard panel: the printed game's black and gold                  */
/* ------------------------------------------------------------------ */

.tc-chalk,
.hero,
.result-banner {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(1.5px 1.5px at 18% 24%, rgba(243, 212, 137, 0.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 82% 16%, rgba(243, 212, 137, 0.8), transparent 60%),
    radial-gradient(2px 2px at 66% 78%, rgba(243, 212, 137, 0.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 30% 86%, rgba(243, 212, 137, 0.6), transparent 60%),
    radial-gradient(2px 2px at 92% 58%, rgba(243, 212, 137, 0.75), transparent 60%),
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.08), transparent 60%),
    var(--chalk);
  box-shadow:
    inset 0 0 0 2px var(--gold-deep),
    inset 0 0 0 6px var(--chalk-deep),
    inset 0 0 0 7px rgba(226, 169, 59, 0.4),
    0 18px 40px rgba(12, 9, 42, 0.16);
}
/* The Queezy bubbles do not belong on a chalkboard. */
.hero::before,
.hero::after {
  display: none;
}
.hero .eyebrow,
.result-banner .eyebrow {
  color: var(--gold-soft) !important;
}
.hero .logo-chip {
  background: transparent;
  padding: 0;
}
.hero .logo-chip img {
  width: 200px;
}

.pill.on-purple,
.tc-chalk .pill {
  background: rgba(226, 169, 59, 0.16);
  color: var(--gold-soft);
  box-shadow: inset 0 0 0 1px rgba(226, 169, 59, 0.45);
}

.hero .progress {
  background: rgba(255, 255, 255, 0.16);
}
.hero .progress span {
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
}

/* Subject sticker from the printed subject die. */
.tc-sticker {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------------ */
/* Counters                                                            */
/* ------------------------------------------------------------------ */

.tc-pawn {
  display: block;
  width: 26px;
  height: auto;
  flex: none;
  overflow: visible;
}
.tc-pawn__shadow {
  fill: rgba(0, 0, 0, 0.38);
}
.tc-pawn__body {
  fill: var(--tok);
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linejoin: round;
  paint-order: stroke;
}
.tc-pawn__shade {
  fill: rgba(0, 0, 0, 0.2);
}
.tc-pawn__shine {
  fill: rgba(255, 255, 255, 0.7);
}

/* A counter standing on a gold disc: the player's avatar everywhere. */
.tc-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding-top: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold) 70%);
  box-shadow: 0 0 0 2px var(--chalk-deep), 0 0 0 4px var(--gold-deep);
}
.tc-avatar .tc-pawn {
  width: 52%;
}
.tc-avatar--large {
  width: 64px;
  height: 64px;
}

/* ------------------------------------------------------------------ */
/* Quiz alignment: same answer rows and tab bar as the board game       */
/* ------------------------------------------------------------------ */

.option {
  gap: 14px;
  padding: 10px 16px;
  font-size: 17px;
}
.option .key {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--primary);
  font-size: 15px;
}
.option:hover {
  border-color: var(--primary);
}
.option[aria-pressed="true"] {
  background: #f4f2ff;
}

.leader-row .rank.gold {
  background: var(--gold);
  color: var(--chalk-deep);
}

.nav {
  grid-template-columns: repeat(5, 1fr);
}
.nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
@media (min-width: 861px) {
  /* The top bar carries navigation on wider screens. */
  .nav {
    display: none;
  }
  #app.has-top {
    padding-top: 16px;
    padding-bottom: 40px;
  }
}

#app .tc-top {
  padding: 0 0 16px;
}

.question-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.question-head h2 {
  font-size: 21px;
  line-height: 1.3;
}

/* The real board on the home screen. */
.board-teaser {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}
.board-teaser img {
  flex: none;
  width: 112px;
  height: 112px;
  border-radius: 12px;
  box-shadow: 0 2px 0 #7a5a17, 0 10px 20px rgba(12, 9, 42, 0.22);
  transition: transform 0.18s ease;
}
.board-teaser:hover img {
  transform: rotate(-3deg) scale(1.04);
}

/* Inline icons need a size or they fill their container. */
.btn svg,
.link svg {
  flex: none;
  width: 20px;
  height: 20px;
}
.pill svg,
.timer svg {
  flex: none;
  width: 15px;
  height: 15px;
}

/* Fade only. A transform here (even an identity one left by the animation)
   would trap the fixed tab bar inside the section instead of the viewport. */
.fade-in {
  animation: tc-fade 0.22s ease;
}
@keyframes tc-fade {
  from {
    opacity: 0;
  }
}

/* Nameplate at the top of sign in, sign up and setup sheets. */
.tc-masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 18px;
  border-radius: 24px;
}
.tc-masthead img {
  width: 200px;
  max-width: 70%;
}
.tc-masthead span {
  color: var(--gold-soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.sheet.stack > button.link {
  justify-self: center;
  align-self: center;
}
