/* EQC Activities Hub: shared game-show look.
   Every page links this file so it all matches the home page. */
@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Bungee&display=swap");

:root {
  --stage: #2A1A5E;
  --stage-deep: #1E1247;
  --ink: #1B1035;
  --bulb: #FFD23F;
  --paper: #FFF8E7;

  --tomato: #FF5A4E;
  --teal: #12C2A8;
  --sky: #3FA9F5;
  --pink: #FF4FA3;
  --lime: #9BE15D;
  --orange: #FF9F1C;

  --tile-radius: 28px;
  --press: 8px;
  --display: "Bungee", "Baloo 2", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--stage-deep); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--paper);
  background:
    radial-gradient(140% 900px at 50% 0%, #3B2780 0%, var(--stage) 55%, var(--stage-deep) 100%) no-repeat,
    var(--stage-deep);
}

h1, h2, h3, p { overflow-wrap: anywhere; }
a { color: var(--bulb); }
button { font: inherit; }

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 48px) 64px;
}
.page.narrow { max-width: 640px; padding-top: 22px; }
.center { text-align: center; }
.muted { color: rgba(255, 248, 231, .75); }
[hidden] { display: none !important; }

/* ── Marquee sign ──────────────────────────────────────────── */
.marquee {
  --band: 26px;
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto clamp(36px, 5vw, 64px);
  padding: calc(var(--band) + 18px) calc(var(--band) + clamp(20px, 4vw, 56px));
  text-align: center;
  background: var(--tomato);
  border: 5px solid var(--ink);
  border-radius: 36px;
  box-shadow: 0 10px 0 var(--ink);
}
.marquee::before,
.marquee::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 30px;
  padding: var(--band);
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.marquee::before {
  background: radial-gradient(circle at center, var(--bulb) 0 6.5px, #FFF3C2 7px 7.5px, transparent 8px) 0 0 / 34px 34px;
  animation: blink 1.1s steps(1) infinite;
}
.marquee::after {
  background: radial-gradient(circle at center, var(--bulb) 0 6.5px, #FFF3C2 7px 7.5px, transparent 8px) 17px 17px / 34px 34px;
  animation: blink 1.1s steps(1) infinite reverse;
}
@keyframes blink {
  0%   { opacity: 1; filter: drop-shadow(0 0 6px rgba(255, 210, 63, .9)); }
  50%  { opacity: .25; filter: none; }
}
.marquee h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 6.2vw, 4.75rem);
  line-height: 1;
  letter-spacing: .01em;
  color: var(--paper);
  text-shadow: 0 5px 0 var(--ink);
}
.marquee p {
  margin: 14px 0 0;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 700;
  color: var(--ink);
}
/* A smaller sign for phone pages */
.marquee.mini { --band: 16px; margin-bottom: 26px; border-radius: 26px; }
.marquee.mini::before, .marquee.mini::after { border-radius: 20px; background-size: 22px 22px; }
.marquee.mini::after { background-position: 11px 11px; }
.marquee.mini h1 { font-size: clamp(1.6rem, 7vw, 2.4rem); text-shadow: 0 3px 0 var(--ink); }
.marquee.mini p { font-size: 1.05rem; margin-top: 6px; }

/* ── Section headings ─────────────────────────────────────── */
.group + .group { margin-top: clamp(40px, 5vw, 64px); }
.group h2, .label-pill {
  display: inline-block;
  margin: 0 0 20px;
  padding: 2px 18px 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  background: var(--bulb);
  border: 4px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--ink);
  transform: rotate(-1.5deg);
}

/* ── Tiles ─────────────────────────────────────────────────── */
.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(18px, 2.4vw, 28px);
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-height: 240px;
  padding: 24px 26px 26px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  background: var(--c, var(--sky));
  border: 4px solid var(--ink);
  border-radius: var(--tile-radius);
  box-shadow: 0 var(--press) 0 var(--ink);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { transform: translateY(-3px) rotate(-.6deg); box-shadow: 0 calc(var(--press) + 3px) 0 var(--ink); }
.tile:active { transform: translateY(var(--press)); box-shadow: 0 0 0 var(--ink); }
.tile:focus-visible { outline: 5px solid var(--bulb); outline-offset: 5px; }
.tile .emoji { font-size: clamp(3.5rem, 5vw, 4.5rem); line-height: 1; margin-bottom: auto; padding-bottom: 18px; }
.tile h3 { margin: 0; font-size: clamp(1.6rem, 2.3vw, 1.95rem); font-weight: 800; line-height: 1.1; }
.tile p { margin: 0; font-size: 1.1rem; font-weight: 500; max-width: 34ch; }
.tile .external {
  position: absolute; top: 18px; right: 18px;
  padding: 1px 12px 0; font-size: .95rem; font-weight: 700;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 999px;
}

.t-tomato { --c: var(--tomato); }
.t-teal   { --c: var(--teal); }
.t-sky    { --c: var(--sky); }
.t-pink   { --c: var(--pink); }
.t-lime   { --c: var(--lime); }
.t-orange { --c: var(--orange); }
.t-bulb   { --c: var(--bulb); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  --c: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 20px 6px;
  font-family: "Baloo 2", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
  text-decoration: none;
  background: var(--c);
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--ink);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, filter .1s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(6px); box-shadow: 0 0 0 var(--ink); }
.btn:focus-visible { outline: 4px solid var(--bulb); outline-offset: 3px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 0 6px 0 var(--ink); }
.btn-bulb   { --c: var(--bulb); }
.btn-teal   { --c: var(--teal); }
.btn-tomato { --c: var(--tomato); }
.btn-sky    { --c: var(--sky); }
.btn-pink   { --c: var(--pink); }
.btn-lime   { --c: var(--lime); }
.btn-ghost  { --c: transparent; color: var(--paper); border-color: var(--paper); box-shadow: none; }
.btn-ghost:hover { box-shadow: none; background: rgba(255, 248, 231, .12); }
.btn-big { min-height: 64px; font-size: 1.4rem; padding: 10px 28px 8px; border-radius: 20px; }
.btn-block { width: 100%; }
.btn-round { width: 52px; min-height: 52px; padding: 0; border-radius: 50%; font-size: 1.4rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row.spread { justify-content: space-between; }

/* ── Cards, pills, fields ─────────────────────────────────── */
.card {
  position: relative;
  padding: 20px 22px;
  color: var(--ink);
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 7px 0 var(--ink);
}
.card h2, .card h3 { margin: 0 0 8px; line-height: 1.15; }
.card + .card { margin-top: 22px; }
.card .muted, .modal .muted { color: rgba(27, 16, 53, .65); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 12px 0;
  font-size: .95rem;
  font-weight: 800;
  color: var(--ink);
  background: var(--c, var(--bulb));
  border: 3px solid var(--ink);
  border-radius: 999px;
  white-space: nowrap;
}
button.pill { cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.field { display: block; margin: 0 0 16px; }
.field > span { display: block; margin-bottom: 6px; font-weight: 800; font-size: 1.05rem; }
.field input, .field select, .field textarea, .input {
  width: 100%;
  padding: 12px 14px 10px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 14px;
  outline: none;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { box-shadow: 0 0 0 4px var(--bulb); }
.field .count { float: right; font-weight: 700; font-size: .9rem; opacity: .7; }
.error-box {
  margin: 12px 0;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--ink);
  background: #FFD1CC;
  border: 3px solid var(--ink);
  border-radius: 14px;
}

/* ── Modal and bottom sheet ───────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(14, 8, 36, .78);
  backdrop-filter: blur(3px);
  animation: fade-in .18s ease both;
}
.modal {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 28px 26px 26px;
  color: var(--ink);
  background: var(--paper);
  border: 5px solid var(--ink);
  border-radius: 28px;
  box-shadow: 0 10px 0 var(--ink);
  animation: pop-in .28s cubic-bezier(.2, 1.4, .4, 1) both;
}
.modal.wide { width: min(100%, 1100px); }
.modal-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  background: var(--bulb);
  border: 3px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
}
.sheet-backdrop { place-items: end center; padding: 0; }
.sheet {
  width: min(100%, 560px);
  max-height: 80vh;
  overflow: auto;
  padding: 18px 14px 22px;
  color: var(--ink);
  background: var(--paper);
  border: 5px solid var(--ink);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  animation: rise .25s ease both;
}

/* QR block used in every join pop-up */
.qr-box { display: grid; justify-items: center; gap: 10px; text-align: center; }
.qr-box .qr { width: min(70vw, 300px); padding: 12px; background: #fff; border: 4px solid var(--ink); border-radius: 18px; }
.qr-box .qr svg { display: block; width: 100%; height: auto; }
.qr-box .link { font-weight: 800; font-size: 1.15rem; word-break: break-all; }
.qr-box .code { font-family: var(--display); font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: .14em; line-height: 1; }

/* PIN pad */
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 14px 0 18px; }
.pin-dots span { width: 22px; height: 22px; border: 4px solid var(--ink); border-radius: 50%; }
.pin-dots span.on { background: var(--ink); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pin-pad button { min-height: 60px; font-size: 1.6rem; }

/* ── Toasts ────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 80;
  display: grid;
  gap: 10px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 24px);
}
.toast {
  padding: 10px 18px 8px;
  font-weight: 800;
  color: var(--ink);
  background: var(--bulb);
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--ink);
  animation: pop-in .25s ease both;
}
.toast.good { background: var(--lime); }
.toast.bad { background: var(--tomato); }
.toast.info { background: var(--sky); }

/* ── Answer colours and shapes (Trivia) ───────────────────── */
.shape-tri { --c: var(--tomato); }
.shape-dia { --c: var(--sky); }
.shape-cir { --c: var(--bulb); }
.shape-sq  { --c: var(--teal); }
.shape-icon { display: inline-block; width: 1.4em; height: 1.4em; background: var(--ink); flex: none; }
.shape-tri .shape-icon { clip-path: polygon(50% 4%, 96% 92%, 4% 92%); }
.shape-dia .shape-icon { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.shape-cir .shape-icon { border-radius: 50%; }
.shape-sq  .shape-icon { border-radius: 4px; }

/* ── Toolbar on the home page ─────────────────────────────── */
.toolbar { display: flex; justify-content: flex-end; gap: 10px; margin: -18px 0 18px; }

/* ── Motion ────────────────────────────────────────────────── */
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.7); } }
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 25% { rotate: -3deg; } 75% { rotate: 3deg; } }
@keyframes flip { 0% { transform: rotateY(0); } 50% { transform: rotateY(90deg); } 100% { transform: rotateY(0); } }
@keyframes shake { 0%, 100% { translate: 0; } 20%, 60% { translate: -10px; } 40%, 80% { translate: 10px; } }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.pop-in { animation: pop-in .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.wiggle { animation: wiggle .5s ease .35s 2; }
.shake { animation: shake .45s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition: none !important;
  }
  .marquee::before, .marquee::after { animation: none !important; }
  .tile, .tile:hover, .tile:active { transform: none; }
}
