/* The pub's TV, in the Magic Whizz Kids look: designed for 1920x1080 viewed from across a room, with a portrait
   layout at the end. 1 --u = 1% of the 16:9 stage width (19.2px at 1080p), so it scales on any window. */
:root {
  --u0: min(1vw, 1.7778vh);
  --u0: min(1vw, 1.7778svh);
  --u: var(--u0);
  --stage-h: 56.25;
  --ink: #1d1747;
  --white: #ffffff;
  --yellow: #ffd23f;
  --green: #22c55e;
  --red: #ff4d6d;
  --blue: #4d7cff;
  --purple: #8b5cf6;
  /* the answer colours, the same as the buttons on the teams' phones */
  --c1: #e21b3c; --c2: #1368ce; --c3: #d89e00; --c4: #26890c; --c5: #864cbf; --c6: #0aa3a3;
  --font: "Arial Rounded MT Bold", "Nunito", "Varela Round", "Comic Sans MS", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #120d33;
  overflow: hidden;
  font-family: var(--font);
  color: var(--white);
  cursor: none;
}
body.pointer { cursor: default; }

.stage {
  position: absolute;
  inset: 0;
  margin: auto;
  width: calc(var(--u) * 100);
  height: calc(var(--u) * var(--stage-h));
  overflow: hidden;
  background: linear-gradient(135deg, #6a3df0 0%, #3b82f6 55%, #06b6d4 100%);
  transition: background 0.4s;
}
body[data-screen="intro"] .stage { background: linear-gradient(135deg, #ff7a18 0%, #ff4d6d 60%, #c026d3 100%); }
body[data-screen="feedback"][data-result="correct"] .stage { background: linear-gradient(135deg, #16a34a, #22c55e 60%, #84cc16); }
body[data-screen="feedback"][data-result="wrong"] .stage { background: linear-gradient(135deg, #f97316, #ef4444 70%, #be123c); }
body[data-screen="standings"] .stage, body[data-screen="final"] .stage { background: linear-gradient(135deg, #7c3aed, #db2777 60%, #f59e0b); }
body[data-screen="expired"] .stage { background: linear-gradient(135deg, #334155, #1e293b); }

#app, .screen { width: 100%; height: 100%; }
#app > .screen { --u: calc(var(--u0) * var(--fit, 1)); }

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 1.6);
  padding: calc(var(--u) * 2.5) calc(var(--u) * 3);
  text-align: center;
  text-shadow: 0 calc(var(--u) * 0.35) 0 rgba(0, 0, 0, 0.25);
}
.screen.enter { animation: screen-in 0.35s ease-out; }
@keyframes screen-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }
.heading { font-size: calc(var(--u) * 4.6); }
.hint { font-size: calc(var(--u) * 1.8); opacity: 0.9; }
.hint b { background: rgba(255, 255, 255, 0.25); padding: 0 calc(var(--u) * 0.8); border-radius: calc(var(--u) * 0.8); }

/* The bouncing title: each letter a beat after the one before (delays set by display.js). */
.title { font-size: calc(var(--u) * 7); letter-spacing: calc(var(--u) * 0.3); }
.title span { display: inline-block; animation: bounce 1.6s ease-in-out infinite; }
.title span:nth-child(odd) { color: var(--yellow); }
.title span:nth-child(3n) { color: #ff9ad5; }
.title .gap { width: calc(var(--u) * 2.5); }
@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(calc(var(--u) * -1.6)) rotate(-4deg); }
}
/* The venue's name: white, each letter swaying and hopping in turn. */
.venue-name { font-size: calc(var(--u) * 2.6); font-weight: 700; letter-spacing: calc(var(--u) * 0.12); }
.venue-name span { display: inline-block; animation: letter-dance 1.4s ease-in-out infinite; }
.venue-name .gap { width: calc(var(--u) * 0.9); animation: none; }
@keyframes letter-dance {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(calc(var(--u) * -0.7)) rotate(-10deg); }
  50% { transform: translateY(0) rotate(0); }
  75% { transform: translateY(calc(var(--u) * -0.4)) rotate(10deg); }
}
.pill {
  display: inline-flex; align-items: center; gap: calc(var(--u) * 0.6);
  font-size: calc(var(--u) * 2); background: rgba(255, 255, 255, 0.22);
  padding: calc(var(--u) * 0.5) calc(var(--u) * 1.8); border-radius: calc(var(--u) * 3);
}
.pill.score { background: var(--yellow); color: var(--ink); text-shadow: none; }

/* ---- sign in ---- */
.signin-btn {
  display: inline-block; background: var(--yellow); color: var(--ink); text-decoration: none; text-shadow: none;
  font-size: calc(var(--u) * 3); padding: calc(var(--u) * 1) calc(var(--u) * 4); border-radius: calc(var(--u) * 5);
  box-shadow: 0 calc(var(--u) * 0.6) 0 #c99a00;
}
/* Nobody signed in on this TV: the quiz's title over floating pictures, the six answer shapes, and a sign-in card
   (as on Magic Whizz Kids). "About the app" carries on below (the end of this file). */
body[data-screen="signin"] .stage { background: linear-gradient(135deg, #6a3df0 0%, #3b82f6 55%, #06b6d4 100%); }
.screen.signin > :not(.floaters) { position: relative; z-index: 1; }
.screen.signin .title { font-size: calc(var(--u) * 8); }
.signin-tag { font-size: calc(var(--u) * 2.4); font-weight: 700; }
.signin-shapes { display: flex; gap: calc(var(--u) * 1.2); }
.signin-shapes span {
  display: grid; place-items: center; width: calc(var(--u) * 5.2); height: calc(var(--u) * 5.2); border-radius: calc(var(--u) * 1.2);
  font-size: calc(var(--u) * 2.8); color: #fff; box-shadow: 0 calc(var(--u) * 0.45) 0 rgba(0, 0, 0, 0.3);
  animation: shape-hop 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * 0.18s);
}
.signin-shapes .c1, .about-buttons .c1 { background: var(--c1); } .signin-shapes .c2, .about-buttons .c2 { background: var(--c2); }
.signin-shapes .c3, .about-buttons .c3 { background: var(--c3); } .signin-shapes .c4, .about-buttons .c4 { background: var(--c4); }
.signin-shapes .c5, .about-buttons .c5 { background: var(--c5); } .signin-shapes .c6, .about-buttons .c6 { background: var(--c6); }
@keyframes shape-hop { 0%, 60%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(calc(var(--u) * -1.2)) rotate(-8deg); } }
.signin-card {
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 1.1); margin-top: calc(var(--u) * 0.8);
  width: min(100%, calc(var(--u) * 52)); padding: calc(var(--u) * 2) calc(var(--u) * 2.4); border-radius: calc(var(--u) * 2.4);
  background: rgba(19, 39, 122, 0.82); border: calc(var(--u) * 0.3) solid #ffd84a;
  box-shadow: 0 calc(var(--u) * 0.6) 0 rgba(10, 20, 80, 0.45);
  animation: card-pop 0.6s 0.4s cubic-bezier(.3, 1.6, .5, 1) both;
}
.signin-card .heading { font-size: calc(var(--u) * 3); color: #ffd84a; line-height: 1.15; }
.signin-card .hint { font-size: calc(var(--u) * 1.6); }
.signin-card .small-print { font-size: calc(var(--u) * 1.3); opacity: 0.85; }
@keyframes card-pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
html.portrait .screen.signin .title { font-size: calc(var(--u) * 9.5); }
html.portrait .signin-tag { font-size: calc(var(--u) * 3.6); }
html.portrait .signin-shapes span { width: calc(var(--u) * 10); height: calc(var(--u) * 10); font-size: calc(var(--u) * 5); }
html.portrait .signin-card { width: 88%; gap: calc(var(--u) * 2); padding: calc(var(--u) * 4); }
html.portrait .signin-card .heading { font-size: calc(var(--u) * 5.4); }
html.portrait .signin-card .hint { font-size: calc(var(--u) * 3.2); }
html.portrait .signin-card .small-print { font-size: calc(var(--u) * 2.6); }
html.portrait .signin-card .signin-btn { font-size: calc(var(--u) * 5); }

/* ---- the lobby: join the quiz ---- */
.attract { display: grid; grid-template-columns: 1fr 1.1fr; grid-template-rows: auto 1fr auto; gap: calc(var(--u) * 1.6) calc(var(--u) * 3); align-items: stretch; }
.attract .brand { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 0.4); }
.join-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 1);
  background: var(--white); color: var(--ink); text-shadow: none; border-radius: calc(var(--u) * 2.5); padding: calc(var(--u) * 1.8);
  box-shadow: 0 calc(var(--u) * 0.9) 0 rgba(0, 0, 0, 0.25);
}
.join-card h2 { font-size: calc(var(--u) * 3.2); }
.join-card .phone-icon { display: inline-block; animation: phone-wiggle 2.4s ease-in-out infinite; }
.join-card .qr { width: calc(var(--u) * 20); height: calc(var(--u) * 20); image-rendering: pixelated; }
.join-card .url { font-size: calc(var(--u) * 1.3); opacity: 0.7; word-break: break-all; }
.join-card .steps { font-size: calc(var(--u) * 1.6); color: #4b4673; }
@keyframes phone-wiggle {
  0%, 60%, 100% { transform: rotate(0); }
  70% { transform: rotate(-14deg); }
  80% { transform: rotate(12deg); }
  90% { transform: rotate(-6deg); }
}
.teams-card { display: flex; flex-direction: column; gap: calc(var(--u) * 1.2); background: rgba(255, 255, 255, 0.15); border-radius: calc(var(--u) * 2.5); padding: calc(var(--u) * 1.8); min-height: 0; }
.teams-card h2 { font-size: calc(var(--u) * 3); display: flex; justify-content: space-between; align-items: baseline; }
.teams-card h2 small { font-size: calc(var(--u) * 1.6); opacity: 0.85; }
.team-chips { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 0.8); align-content: flex-start; overflow: hidden; }
.chip {
  font-size: calc(var(--u) * 1.9); padding: calc(var(--u) * 0.5) calc(var(--u) * 1.4); border-radius: calc(var(--u) * 3);
  background: var(--white); color: var(--ink); text-shadow: none; box-shadow: 0 calc(var(--u) * 0.35) 0 rgba(0, 0, 0, 0.2);
  animation: pop-in 0.4s cubic-bezier(.2, 1.6, .4, 1) both;
}
.chip.away { opacity: 0.45; }
.chip.done { background: var(--yellow); }
.empty-teams { font-size: calc(var(--u) * 2.2); opacity: 0.9; margin: auto; }
.lobby-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: calc(var(--u) * 2); }
.lobby-status {
  font-size: calc(var(--u) * 2.4); background: var(--yellow); color: var(--ink); text-shadow: none;
  padding: calc(var(--u) * 0.8) calc(var(--u) * 2.5); border-radius: calc(var(--u) * 5); box-shadow: 0 calc(var(--u) * 0.5) 0 #c99a00;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.host-card {
  display: flex; align-items: center; gap: calc(var(--u) * 1); font-size: calc(var(--u) * 1.2); text-align: left;
  background: var(--white); color: var(--ink); text-shadow: none; border-radius: calc(var(--u) * 1.6); padding: calc(var(--u) * 0.7) calc(var(--u) * 1.4) calc(var(--u) * 0.7) calc(var(--u) * 0.7);
  box-shadow: 0 calc(var(--u) * 0.5) 0 rgba(0, 0, 0, 0.25);
}
.host-card img { width: calc(var(--u) * 6); height: calc(var(--u) * 6); }
.host-card b { display: block; font-size: calc(var(--u) * 1.6); }
.corner { position: absolute; bottom: calc(var(--u) * 0.8); font-size: calc(var(--u) * 1.1); opacity: 0.85; }
.corner.left { left: calc(var(--u) * 1.5); }
.corner.right { right: calc(var(--u) * 1.5); }
.corner a { color: var(--white); }
.tv-signout { cursor: pointer; font: inherit; font-size: calc(var(--u) * 1.1); background: rgba(255, 255, 255, 0.2); color: var(--white); border: 0; border-radius: calc(var(--u) * 3); padding: calc(var(--u) * 0.25) calc(var(--u) * 1); }
.tv-signout.armed { background: var(--red); }
.trial-note {
  position: absolute; top: calc(var(--u) * 1.2); right: calc(var(--u) * 1.5); font-size: calc(var(--u) * 1.4); text-shadow: none;
  background: var(--white); color: #15803d; border-radius: calc(var(--u) * 3); padding: calc(var(--u) * 0.4) calc(var(--u) * 1.4);
}
.trial-note.warn { color: #b91c1c; }

/* ---- round intro ---- */
.intro .round-no { font-size: calc(var(--u) * 3.4); letter-spacing: 0.2em; text-transform: uppercase; animation: slide-down 0.6s ease-out both; }
.intro .round-emoji { font-size: calc(var(--u) * 12); line-height: 1; animation: pop-in 0.7s 0.2s cubic-bezier(.2, 1.6, .4, 1) both; }
.intro .title { animation: pop-in 0.7s 0.35s cubic-bezier(.2, 1.6, .4, 1) both; }
.intro .hint { animation: screen-in 0.6s 0.9s both; }

/* ---- question ---- */
.topbar { position: absolute; top: calc(var(--u) * 1.6); left: calc(var(--u) * 2.5); right: calc(var(--u) * 2.5); display: flex; justify-content: space-between; gap: calc(var(--u) * 1); }
.question, .feedback, .memorise { justify-content: flex-start; padding-top: calc(var(--u) * 7); }
/* The question pops in, swirls once and settles, in lime-to-pink gradient text. */
.prompt {
  font-size: calc(var(--u) * 4.6); line-height: 1.15; max-width: 92%;
  background: linear-gradient(135deg, #c6ff00, #ffea00 45%, #ff4081);
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
  filter: drop-shadow(0 calc(var(--u) * 0.35) 0 rgba(0, 0, 0, 0.35));
  opacity: 0;
  animation: prompt-pop 0.25s cubic-bezier(.34, 1.56, .64, 1) forwards, prompt-settle 0.3s ease-out 0.25s forwards;
}
.prompt.p-long { font-size: calc(var(--u) * 3.6); }
.prompt.p-xlong { font-size: calc(var(--u) * 3); }
.prompt img.ico, .prompt img.flag { height: 1.2em; vertical-align: middle; }
@keyframes prompt-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1.1); } }
@keyframes prompt-settle { from { opacity: 1; transform: scale(1.1); } to { opacity: 1; transform: scale(1); } }
.q-picture { display: flex; justify-content: center; }
.v-icons { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: calc(var(--u) * 2); }
.v-icons span { animation: pop-in 0.45s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--i) * 0.12s); }
.v-icons img.ico { width: calc(var(--u) * 9); height: calc(var(--u) * 9); }
.v-icons img.flag { height: calc(var(--u) * 9); border-radius: calc(var(--u) * 0.4); box-shadow: 0 calc(var(--u) * 0.3) 0 rgba(0, 0, 0, 0.25); }
.v-icons.big img.ico { width: calc(var(--u) * 11); height: calc(var(--u) * 11); }
.v-icons.big img.flag { height: calc(var(--u) * 13); }
/* A venue's own picture (My quizzes): as big as fits above the answers, never cropped. */
.v-image { display: block; max-width: 70%; max-height: calc(var(--u) * 22); object-fit: contain; border-radius: calc(var(--u) * 0.8);
  box-shadow: 0 calc(var(--u) * 0.4) 0 rgba(0, 0, 0, 0.25); animation: pop-in 0.45s cubic-bezier(.2, 1.6, .4, 1) both; }
/* The six answers: white cards like Magic Whizz Kids, each with its phone button's colour and shape. */
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--u) * 1.2) calc(var(--u) * 1.6); width: 94%; }
.choice {
  position: relative; display: flex; align-items: center; gap: calc(var(--u) * 1.4); text-align: left;
  padding: calc(var(--u) * 0.8) calc(var(--u) * 1.6) calc(var(--u) * 0.8) calc(var(--u) * 0.8); border-radius: calc(var(--u) * 2.2);
  background: var(--white); color: var(--ink); text-shadow: none; font-size: calc(var(--u) * 2.5);
  box-shadow: 0 calc(var(--u) * 0.5) 0 rgba(0, 0, 0, 0.25);
  animation: pop-in 0.4s cubic-bezier(.2, 1.6, .4, 1) both;
  outline: calc(var(--u) * 0.5) solid transparent;
}
.choice:nth-child(2) { animation-delay: 0.06s; }
.choice:nth-child(3) { animation-delay: 0.12s; }
.choice:nth-child(4) { animation-delay: 0.18s; }
.choice:nth-child(5) { animation-delay: 0.24s; }
.choice:nth-child(6) { animation-delay: 0.3s; }
.choice .shape {
  flex: none; width: calc(var(--u) * 5.5); height: calc(var(--u) * 5.5); border-radius: 50%; display: grid; place-items: center;
  font-size: calc(var(--u) * 2.8); color: var(--white);
}
.choice.c1 .shape { background: var(--c1); } .choice.c2 .shape { background: var(--c2); }
.choice.c3 .shape { background: var(--c3); } .choice.c4 .shape { background: var(--c4); }
.choice.c5 .shape { background: var(--c5); } .choice.c6 .shape { background: var(--c6); }
.choice .shape + span { min-width: 0; overflow-wrap: anywhere; }
.choice img.ico { height: calc(var(--u) * 5.5); }
.choice img.flag { height: calc(var(--u) * 5); border-radius: calc(var(--u) * 0.3); }
.choices.reveal .choice:not(.right) { opacity: 0.35; filter: grayscale(0.8); }
.choices.reveal .choice.right { outline-color: var(--yellow); transform: scale(1.04); }
.choices.reveal .choice.right::after { content: '✓'; position: absolute; right: calc(var(--u) * 1.5); font-size: calc(var(--u) * 4); color: #15803d; }
.answer-status { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 0.8); width: 92%; }
.answered { font-size: calc(var(--u) * 2.4); }
.answered b { font-size: 1.4em; color: var(--yellow); }
.answer-status .team-chips { justify-content: center; max-height: calc(var(--u) * 6.5); }
.answer-status .chip { font-size: calc(var(--u) * 1.3); padding: calc(var(--u) * 0.3) calc(var(--u) * 0.9); animation: none; }
.timer { display: flex; align-items: center; gap: calc(var(--u) * 2); width: 80%; margin-top: auto; }
.timer-track { flex: 1; height: calc(var(--u) * 2.6); background: rgba(0, 0, 0, 0.25); border-radius: calc(var(--u) * 2); overflow: hidden; }
.timer-bar { height: 100%; width: 100%; background: var(--yellow); border-radius: inherit; transform-origin: left center; transform: scaleX(0); }
.timer-bar.urgent { background: var(--red); }
.timer-secs { font-size: calc(var(--u) * 4); width: calc(var(--u) * 5); }
.timer-secs.urgent { color: #ffe1e6; animation: pulse 0.5s ease-in-out infinite; }
.paused-banner {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 1);
  background: rgba(29, 23, 71, 0.82); z-index: 5; font-size: calc(var(--u) * 7); color: var(--yellow);
}
.paused-banner small { font-size: calc(var(--u) * 2.2); color: var(--white); }

/* ---- memorise (Memory Flash) ---- */
.memorise .heading { margin-top: calc(var(--u) * 2); }
.memorise-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--u) * 3); max-width: 80%; }
.memorise-grid span { animation: pop-in 0.45s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--i) * 0.15s); }
.memorise-grid img.ico { width: calc(var(--u) * 11); height: calc(var(--u) * 11); }

/* ---- feedback ---- */
.big-word { font-size: calc(var(--u) * 6); animation: pop-in 0.45s cubic-bezier(.2, 1.6, .4, 1) both; }
.feedback .choices { width: 90%; }
.feedback .choice { font-size: calc(var(--u) * 2.1); }
.feedback .choice .shape { width: calc(var(--u) * 4.4); height: calc(var(--u) * 4.4); font-size: calc(var(--u) * 2.2); }
.fastest { display: flex; flex-direction: column; gap: calc(var(--u) * 0.8); width: min(100%, calc(var(--u) * 50)); }
.fastest-title { font-size: calc(var(--u) * 2.2); opacity: 0.9; }
.fast-row {
  display: grid; grid-template-columns: calc(var(--u) * 4) 1fr auto auto; align-items: center; gap: calc(var(--u) * 1.5);
  background: var(--white); color: var(--ink); text-shadow: none; border-radius: calc(var(--u) * 2);
  padding: calc(var(--u) * 0.5) calc(var(--u) * 1.6); font-size: calc(var(--u) * 2.4); text-align: left;
  animation: pop-in 0.4s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--i) * 0.1s);
}
.fast-row .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fast-row .time { opacity: 0.7; }
.fast-row .points { font-weight: bold; color: #15803d; }
.explain { font-size: calc(var(--u) * 2.2); max-width: 80%; }
.explain img.ico, .explain img.flag { height: 1.4em; vertical-align: middle; }

/* ---- standings and final scores ---- */
.board { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(var(--rows), auto); gap: calc(var(--u) * 0.6) calc(var(--u) * 1.2); width: min(100%, calc(var(--u) * 90)); }
.board.one-col { grid-template-columns: 1fr; width: min(100%, calc(var(--u) * 60)); }
.row {
  display: grid; grid-template-columns: calc(var(--u) * 3.5) calc(var(--u) * 3) 1fr auto auto; align-items: center; gap: calc(var(--u) * 1.2);
  background: rgba(255, 255, 255, 0.15); border-radius: calc(var(--u) * 2);
  padding: calc(var(--u) * 0.5) calc(var(--u) * 1.6); font-size: calc(var(--u) * 2.2);
  animation: pop-in 0.4s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--i) * 0.08s);
}
.board.one-col .row { font-size: calc(var(--u) * 2.8); padding: calc(var(--u) * 0.8) calc(var(--u) * 2); }
.row.top { background: var(--yellow); color: var(--ink); text-shadow: none; }
.row .rank { font-weight: bold; }
.row .move { font-size: 0.7em; }
.row .move.up { color: #86efac; } .row .move.down { color: #fecdd3; } .row .move.same { opacity: 0.6; }
.row.top .move.up { color: #15803d; } .row.top .move.down { color: #b91c1c; }
.row .name { text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .round { font-size: 0.7em; opacity: 0.85; }
.row .total { font-weight: bold; min-width: calc(var(--u) * 5); text-align: right; }
.more-teams { font-size: calc(var(--u) * 1.8); opacity: 0.9; }
/* The final podium: the animal stage (podium.js, shared with Magic Whizz Kids, 680 x 470). Each team's name and
   points sit on the front of its block, under "1st", "2nd" or "3rd", sized in cqw (1% of the stage's width). */
.animal-podium {
  position: relative; flex: none; width: min(100%, calc(var(--u) * 58));
  container-type: inline-size; border-radius: calc(var(--u) * 1.2); overflow: hidden;
  box-shadow: 0 calc(var(--u) * 0.6) calc(var(--u) * 2) rgba(0, 0, 0, 0.25);
  background: linear-gradient(#fff8e6, #f6f5f0); /* the light stage the artwork was drawn for */
  animation: pop-in 0.6s cubic-bezier(.2,1.4,.4,1) both;
}
.final:has(.board) .animal-podium { width: min(100%, calc(var(--u) * 42)); }
.animal-podium-art { display: block; width: 100%; height: auto; text-shadow: none; }
.podium-label {
  position: absolute; width: calc(140 / 680 * 100%); padding: 0.6cqw 0.5cqw; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0.3cqw;
  overflow: hidden; color: var(--ink); text-shadow: none; line-height: 1.1;
  animation: pop-in 0.5s cubic-bezier(.2,1.6,.4,1) both; animation-delay: calc(0.4s + var(--i) * 0.25s);
}
/* The fronts of the blocks: 2nd x 95-235, y 300-400; 1st x 265-405, y 260-400; 3rd x 435-575, y 330-400. */
.podium-label.p2 { left: calc(95 / 680 * 100%); top: calc(330 / 470 * 100%); height: calc(70 / 470 * 100%); }
.podium-label.p1 { left: calc(265 / 680 * 100%); top: calc(292 / 470 * 100%); height: calc(108 / 470 * 100%); }
.podium-label.p3 { left: calc(435 / 680 * 100%); top: calc(356 / 470 * 100%); height: calc(44 / 470 * 100%); padding-top: 0.2cqw; gap: 0; }
.podium-name {
  max-width: 100%; font-size: 3.2cqw; overflow-wrap: anywhere; text-align: center;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
/* Team names are often long: 3 lines on 1st, 2 on 2nd, and one line cut short on 3rd (the shortest block). */
.podium-label.p1 .podium-name { font-size: 3.4cqw; -webkit-line-clamp: 3; }
.podium-label.p2 .podium-name { font-size: 2.7cqw; }
.podium-label.p3 .podium-name { display: block; font-size: 2.6cqw; white-space: nowrap; text-overflow: ellipsis; }
.podium-points { font-size: 2.8cqw; font-weight: bold; white-space: nowrap; }
.podium-label.p2 .podium-points, .podium-label.p3 .podium-points { font-size: 2.4cqw; }
.podium-points small { font-size: 0.8em; font-weight: normal; opacity: 0.85; }
html.portrait .animal-podium, html.portrait .final:has(.board) .animal-podium { width: 100%; }


/* ---- expired ---- */
.expired .lock { font-size: calc(var(--u) * 10); }

/* ---- bits on every screen ---- */
.offline, .sound-note {
  position: absolute; z-index: 20; font-size: calc(var(--u) * 1.4); padding: calc(var(--u) * 0.4) calc(var(--u) * 1.2);
  border-radius: calc(var(--u) * 3); background: rgba(0, 0, 0, 0.45);
}
.offline { top: calc(var(--u) * 1); left: 50%; transform: translateX(-50%); background: var(--red); }
.sound-note { top: calc(var(--u) * 1.2); left: calc(var(--u) * 1.5); cursor: pointer; }

/* During a round: the join code in the bottom-right corner, so teams can join (or rejoin) mid-quiz. */
.join-corner {
  position: absolute; right: calc(var(--u) * 1.5); bottom: calc(var(--u) * 1.2); z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 0.4);
  padding: calc(var(--u) * 0.6); border-radius: calc(var(--u) * 1.2);
  background: var(--white); color: var(--ink); text-shadow: none;
  box-shadow: 0 calc(var(--u) * 0.4) calc(var(--u) * 1.2) rgba(0, 0, 0, 0.3); pointer-events: none;
}
.join-corner img { display: block; width: calc(var(--u) * 8); height: calc(var(--u) * 8); }
.join-corner-text { text-align: center; line-height: 1.15; }
.join-corner-text b { display: block; font-size: calc(var(--u) * 1.4); white-space: nowrap; }
.join-corner-text small { display: block; font-size: calc(var(--u) * 1); opacity: 0.75; white-space: nowrap; }
/* The timer is centred: narrow it so its right end (and the seconds) stay clear of the code. */
body[data-join="1"] .timer { width: min(80%, calc(100% - var(--u) * 26)); }

/* The TV's keyboard: Backspace presses left to end the round (bottom left), and "Press OK again for a new quiz". */
.quit-badge {
  position: absolute; left: calc(var(--u) * 1.5); bottom: calc(var(--u) * 1.2); z-index: 6;
  max-width: calc(var(--u) * 22); padding: calc(var(--u) * 0.8) calc(var(--u) * 1.2); border-radius: calc(var(--u) * 1.2);
  background: var(--red); font-size: calc(var(--u) * 1.8); line-height: 1.25; text-align: center;
  animation: quit-pulse 0.6s ease-in-out infinite alternate; pointer-events: none;
}
.quit-badge b { background: rgba(255, 255, 255, 0.25); padding: 0 calc(var(--u) * 0.5); border-radius: calc(var(--u) * 0.6); }
.quit-badge small { display: block; font-size: 0.8em; opacity: 0.9; }
@keyframes quit-pulse { to { transform: scale(1.05); } }
.kb-note {
  position: absolute; left: 50%; bottom: calc(var(--u) * 1.5); transform: translateX(-50%); z-index: 7;
  padding: calc(var(--u) * 0.7) calc(var(--u) * 2); border-radius: calc(var(--u) * 2);
  background: var(--white); color: var(--ink); text-shadow: none; font-size: calc(var(--u) * 2.2); font-weight: bold;
  box-shadow: 0 calc(var(--u) * 0.4) calc(var(--u) * 1.2) rgba(0, 0, 0, 0.3); pointer-events: none;
  animation: pop-in 0.3s cubic-bezier(.2,1.6,.4,1) both;
}

/* ---- portrait ---- */
html.portrait { --stage-h: 177.78; --u0: min(1vw, 0.5625vh); --u0: min(1vw, 0.5625svh); }
html.portrait .attract { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto; }
html.portrait .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.portrait .v-image { max-width: 90%; max-height: calc(var(--u) * 45); }
html.portrait .board { grid-template-columns: 1fr; grid-auto-flow: row; }
/* Portrait: a bigger join code (easy to scan across the room), and the screen's content stops above it. */
html.portrait .join-corner img { width: calc(var(--u) * 13); height: calc(var(--u) * 13); }
html.portrait .join-corner-text b { font-size: calc(var(--u) * 2.2); }
html.portrait .join-corner-text small { font-size: calc(var(--u) * 1.6); }
html.portrait body[data-join="1"] .timer { width: 80%; }
html.portrait body[data-join="1"] #app > .screen { padding-bottom: calc(var(--u) * 22); }
html.portrait .quit-badge { font-size: calc(var(--u) * 2.6); max-width: calc(var(--u) * 30); }
html.portrait .kb-note { font-size: calc(var(--u) * 3); bottom: calc(var(--u) * 24); }

@keyframes pop-in { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: none; } }
@keyframes slide-down { from { opacity: 0; transform: translateY(calc(var(--u) * -3)); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(calc(var(--u) * 10)); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; }
}

/* ---- decorations, as in Magic Whizz Kids ---- */
.screen > * { position: relative; z-index: 1; }
.screen > .floaters, .screen > .confetti, .screen > .fireworks, .screen > .balloons, .screen > .emoji-rain { position: absolute; z-index: 0; }
.screen > .corner, .screen > .topbar, .screen > .trial-note, .screen > .paused-banner { position: absolute; }
.screen > .paused-banner { z-index: 5; }

/* Numbers, question marks and pictures floating up the screen. */
.floaters { inset: 0; pointer-events: none; overflow: hidden; }
.floaters span { position: absolute; bottom: -15%; opacity: 0.55; animation: float-up linear infinite; }
.floaters .float-ico { opacity: 0.7; }
.floaters .float-ico img { display: block; width: 1em; height: 1em; }
.floaters.faint span { opacity: 0.2; }
@keyframes float-up {
  from { transform: translateY(0) rotate(0); }
  to   { transform: translateY(calc(var(--u) * var(--stage-h) * -1.33)) rotate(360deg); }
}

/* Dots bursting out from the question as it settles. */
.prompt-wrap { position: relative; max-width: 92%; }
.prompt-wrap .prompt { max-width: none; }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst i {
  position: absolute; top: 50%; left: 50%;
  width: calc(var(--u) * 1.6); height: calc(var(--u) * 1.6); margin: calc(var(--u) * -0.8);
  border-radius: 50%; opacity: 0; animation: dot-burst 0.45s ease-out 0.55s forwards;
}
@keyframes dot-burst {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.4); }
  60%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.9); }
}

/* Confetti. */
.confetti { inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -5%; width: calc(var(--u) * 1.2); height: calc(var(--u) * 2);
  border-radius: calc(var(--u) * 0.3); animation: fall ease-in forwards;
}
@keyframes fall {
  to { transform: translate(var(--drift), calc(var(--u) * var(--stage-h) * 1.1)) rotate(var(--spin)); opacity: 0.8; }
}

/* Fireworks, balloons and a shower of emoji: the other celebrations for a right answer. */
.fireworks, .balloons, .emoji-rain { inset: 0; pointer-events: none; overflow: hidden; }
.firework { position: absolute; }
.firework i {
  position: absolute; width: calc(var(--u) * 1.1); height: calc(var(--u) * 1.1); margin: calc(var(--u) * -0.55);
  border-radius: 50%; background: var(--c); box-shadow: 0 0 calc(var(--u) * 1) var(--c);
  opacity: 0; animation: spark 1s ease-out forwards;
}
@keyframes spark {
  0%   { opacity: 1; transform: translate(0, 0) scale(1.2); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + var(--u) * 3)) scale(0.4); }
}
.balloons span { position: absolute; bottom: -15%; font-size: calc(var(--u) * 7); animation: balloon-up ease-in forwards; }
@keyframes balloon-up {
  0%   { transform: translate(0, 0) rotate(-6deg); }
  50%  { transform: translate(calc(var(--u) * 2), calc(var(--u) * var(--stage-h) * -0.6)) rotate(6deg); }
  100% { transform: translate(calc(var(--u) * -1), calc(var(--u) * var(--stage-h) * -1.3)) rotate(-6deg); }
}
.emoji-rain span { position: absolute; top: -10%; font-size: calc(var(--u) * 4.5); animation: emoji-fall ease-in forwards; }
@keyframes emoji-fall { to { transform: translateY(calc(var(--u) * var(--stage-h) * 1.2)) rotate(var(--spin)); } }

@media (prefers-reduced-motion: reduce) {
  .floaters, .burst, .fireworks, .balloons, .emoji-rain { display: none; }
}

/* Team avatars: a small animal before each team name. */
.avatar { width: 1.3em; height: 1.3em; vertical-align: -0.3em; margin-right: 0.35em; flex: none; }

/* ---- a team's phone watching the TV (?view=1) ---- */
body.view .tv-signout { display: none; }
.view-back {
  position: fixed; z-index: 30; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 10px 16px;
  border-radius: 999px; background: var(--white); color: var(--ink); text-shadow: none; font-weight: bold; font-size: 16px;
  text-decoration: none; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* ---------- About the app: the web page below the sign-in screen (index.html #about) ----------
   As on Magic Whizz Kids. Only while nobody is signed in, and not on a phone watching the TV. The body scrolls; the
   stage stays the first screenful (the hero) and the page starts just below it, so a TV that never scrolls looks
   exactly as before. Ordinary web sizes (rem), not the TV's --u. */
.about { display: none; }
body.has-about[data-screen="signin"] { position: relative; overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; cursor: auto; }
body.has-about[data-screen="signin"] .about {
  display: block; position: absolute; top: 100%; left: 0; right: 0; text-shadow: none;
  cursor: auto; color: var(--ink); font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem); line-height: 1.5;
}
.about a { color: inherit; }
/* "Find out more": a bouncing pill on the bottom edge of the hero, for browsers with a mouse or a touch screen. */
.about-cue {
  position: absolute; top: -1.3rem; right: 4%; z-index: 5; display: none;
  padding: 0.45em 1.3em; border-radius: 999px; background: #fff; color: var(--ink) !important; text-decoration: none;
  font-weight: 900; font-size: clamp(0.95rem, 0.8rem + 0.4vw, 1.2rem); white-space: nowrap;
  box-shadow: 0 0.3rem 0 #b8901a, 0 0 1.2rem rgba(255, 233, 74, 0.7);
  animation: about-cue 1.6s ease-in-out infinite;
}
@media (hover: hover), (pointer: coarse) { .about-cue { display: block; } }
@keyframes about-cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.4rem); } }
.about-rainbow { height: 0.6rem; background: linear-gradient(90deg, #ff3d7f, #ff9f1c, #ffe94a, #3ddc84, #2ec4ff, #8b5cf6); }

/* The bands: each its own bright gradient, with a scalloped bottom edge that bites into the next band. */
.about-band {
  --scallop: 2.4rem;
  position: relative; text-align: center; padding: 4rem 1.25rem calc(4rem + var(--scallop) / 2);
  display: flex; flex-direction: column; align-items: center; gap: 1.6rem;
}
.about-band::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: calc(var(--scallop) / -2 + 1px); height: calc(var(--scallop) / 2); z-index: 3;
  background: radial-gradient(circle calc(var(--scallop) / 2) at 50% 0, var(--edge) 96%, transparent 100%)
    0 0 / var(--scallop) calc(var(--scallop) / 2) repeat-x;
  pointer-events: none;
}
.band-how { --edge: #ff4f8a; background: linear-gradient(160deg, #ff9f1c 0%, #ff4f8a 70%); }
.band-inside { --edge: #4f6ef7; background: linear-gradient(160deg, #8b5cf6 0%, #4f6ef7 60%, #4f6ef7 100%); }
.band-why { --edge: #10b981; background: linear-gradient(160deg, #2ec4ff 0%, #10b981 70%); }
.band-prices { --edge: #ffb627; background: linear-gradient(160deg, #ffe94a 0%, #ffb627 70%); }
.about-band > * { position: relative; z-index: 2; max-width: 72rem; }

.about-title {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.6rem); line-height: 1.1; font-weight: 900; color: #ffe94a;
  text-shadow: 0 0.06em 0 var(--ink), 0.04em 0.04em 0 var(--ink), -0.04em 0.04em 0 var(--ink), 0.04em -0.03em 0 var(--ink),
    -0.04em -0.03em 0 var(--ink), 0 0.14em 0 rgba(29, 23, 71, 0.35);
  animation: about-title-dance 4s ease-in-out infinite;
}
@keyframes about-title-dance { 0%, 100% { transform: rotate(-1.5deg) scale(1); } 50% { transform: rotate(1.5deg) scale(1.04); } }
.band-prices .about-title { color: #fff; }
.about-lead { max-width: 46rem; color: #fff; font-size: 1.15em; text-shadow: 0 0.08em 0 rgba(29, 23, 71, 0.35); }
.band-prices .about-lead, .band-prices .about-small { color: var(--ink); text-shadow: none; }
.about-small { color: #fff; font-size: 0.9em; }

/* Chunky white cards with a coloured stripe on top, a little tilt, and a boing on hover. */
.about-cards { display: grid; gap: 1.4rem; width: 100%; }
.about-cards.four { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.about-cards.three { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.about-card {
  --c: #4d7cff;
  background: #fff; border-radius: 1.6rem; padding: 1.4rem 1.2rem 1.5rem; border-top: 0.6rem solid var(--c);
  box-shadow: 0 0.45rem 0 rgba(29, 23, 71, 0.22), 0 1rem 2rem rgba(29, 23, 71, 0.18);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem; transform: rotate(-1.2deg);
}
.about-card:nth-child(even) { transform: rotate(1.2deg); }
.about-card:hover { animation: about-boing 0.6s cubic-bezier(.3, 1.6, .5, 1); }
.about-card h3 { font-size: 1.35em; line-height: 1.2; }
.about-card p { font-size: 0.95em; }
.about-card-pic {
  width: 6.5rem; height: 6.5rem; object-fit: contain; padding: 0.8rem; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 28%, #fff); animation: about-bob 3s ease-in-out infinite;
}
.about-card:nth-child(2n) .about-card-pic { animation-delay: -1s; }
.about-card:nth-child(3n) .about-card-pic { animation-delay: -2s; }
.c-pink { --c: #ff4f8a; } .c-blue { --c: #4d7cff; } .c-green { --c: #22c55e; } .c-teal { --c: #14b8a6; }
.c-orange { --c: #ff9f1c; } .c-yellow { --c: #ffd23f; } .c-purple { --c: #8b5cf6; }
@keyframes about-boing { 0% { scale: 1; } 30% { scale: 1.06 0.94; } 55% { scale: 0.97 1.04; } 100% { scale: 1; } }
@keyframes about-bob { 50% { transform: translateY(-6%); } }

/* How it works: 1–2–3 as big keypad buttons, then the six answer buttons the teams tap. */
.about-steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.4rem; width: 100%; }
.about-step { background: rgba(255, 255, 255, 0.95); border-radius: 1.6rem; padding: 2.6rem 1.2rem 1.4rem; position: relative; margin-top: 2rem;
  box-shadow: 0 0.45rem 0 rgba(29, 23, 71, 0.22); }
.about-step h3 { font-size: 1.3em; margin-bottom: 0.3rem; }
.step-key {
  position: absolute; top: -2rem; left: 50%; translate: -50% 0; width: 4rem; height: 4rem; border-radius: 1.1rem;
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 900; color: #fff;
  box-shadow: 0 0.35rem 0 rgba(29, 23, 71, 0.4); text-shadow: 0 0.1rem 0 rgba(0, 0, 0, 0.3);
  animation: about-bob 2.4s ease-in-out infinite;
}
.k1 { background: #22c55e; } .k2 { background: #4d7cff; animation-delay: -0.8s; } .k3 { background: #8b5cf6; animation-delay: -1.6s; }
.about-buttons { display: grid; grid-template-columns: repeat(3, 4.2rem); gap: 0.7rem; padding: 1rem; border-radius: 1.4rem;
  background: rgba(29, 23, 71, 0.85); box-shadow: 0 0.45rem 0 rgba(29, 23, 71, 0.3); }
.about-buttons span { display: grid; place-items: center; height: 4.2rem; border-radius: 0.9rem; color: #fff; font-size: 1.8rem;
  box-shadow: 0 0.3rem 0 rgba(0, 0, 0, 0.35); animation: about-bob 2.6s ease-in-out infinite; }
.about-buttons span:nth-child(2n) { animation-delay: -0.9s; }
.about-buttons span:nth-child(3n) { animation-delay: -1.7s; }

/* Prices: colourful tickets. */
.about-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.4rem; width: 100%; max-width: 52rem; }
.ticket {
  --c: #4d7cff;
  position: relative; background: #fff; border-radius: 1.4rem; padding: 1.6rem 1rem 1.3rem; border: 0.3rem dashed var(--c);
  box-shadow: 0 0.45rem 0 rgba(29, 23, 71, 0.22); transform: rotate(-1.5deg);
}
.ticket:nth-child(even) { transform: rotate(1.5deg); }
.ticket:hover { animation: about-boing 0.6s cubic-bezier(.3, 1.6, .5, 1); }
.ticket h3 { font-size: 1.25em; color: var(--c); }
.ticket-price { font-size: 2.6em; font-weight: 900; line-height: 1.1; }
.t-green { --c: #16a34a; } .t-blue { --c: #2563eb; } .t-pink { --c: #db2777; }
.ticket.best { border-style: solid; box-shadow: 0 0.45rem 0 rgba(29, 23, 71, 0.22), 0 0 0 0.35rem #fff, 0 0 1.6rem rgba(219, 39, 119, 0.6); }
.ticket-badge {
  position: absolute; top: -1rem; left: 50%; translate: -50% 0; white-space: nowrap;
  background: #db2777; color: #fff; font-weight: 900; font-size: 0.85em; padding: 0.2em 0.9em; border-radius: 999px;
}
.about-btn {
  display: inline-block; font-weight: 900; font-size: 1.3em; text-decoration: none; padding: 0.7em 2em; border-radius: 999px;
  background: #db2777; color: #fff !important; box-shadow: 0 0.35rem 0 #9d174d; border: 0.2rem solid #fff;
}
.about-btn:active { translate: 0 0.25rem; box-shadow: none; }

.about-footer { background: var(--ink); color: #fff; text-align: center; padding: 2.6rem 1rem 2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.about-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.6rem; }
.about-footer a { color: #ffe94a; }

/* Floating pictures in the bands' corners. */
.about-deco { position: absolute !important; z-index: 1 !important; pointer-events: none; height: auto; }
.sp-bob { animation: about-bob 3s ease-in-out infinite; }
.sp-twinkle { animation: about-twinkle 2.2s ease-in-out infinite; }
.sp-hover { animation: about-hover 2.4s ease-in-out infinite; }
.sp-float { animation: about-float 6s ease-in-out infinite; }
@keyframes about-twinkle { 50% { transform: scale(0.72) rotate(18deg); opacity: 0.75; } }
@keyframes about-hover { 50% { transform: translateY(-8%) rotate(4deg); } }
@keyframes about-float { 25% { transform: translate(5%, -10%) rotate(5deg); } 75% { transform: translate(-5%, -4%) rotate(-5deg); } }
.deco-a { width: 4rem; top: 1.5rem; left: 6%; }
.deco-b { width: 6.5rem; top: 2rem; right: 5%; }
.deco-c { width: 3.5rem; top: 2rem; left: 8%; }
.deco-d { width: 5.5rem; top: 2rem; right: 6%; }
.deco-e { width: 5.5rem; top: 2rem; left: 5%; }
.deco-f { width: 5rem; top: 2.5rem; right: 6%; }
.deco-g { width: 5rem; top: 1.5rem; left: 5%; }
.deco-h { width: 4rem; top: 2rem; right: 8%; }
@media (max-width: 700px) {
  .about-cue { top: 1.1rem; }
  .about-deco { opacity: 0.5; width: 3.5rem; }
  .about-band { padding-top: 3.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .about *, .about-cue, .signin-shapes span, .signin-card { animation: none !important; }
  body.has-about[data-screen="signin"] { scroll-behavior: auto; }
}
/* The hero fills the whole window behind the 16:9 stage (no dark bars on a laptop or phone). */
body.has-about[data-screen="signin"] { background: linear-gradient(135deg, #6a3df0 0%, #3b82f6 55%, #06b6d4 100%) fixed; }
/* ● is drawn small in most fonts: a little bigger, to match the other shapes. */
.about-buttons .c3 { font-size: 3rem; line-height: 1; padding-bottom: 0.5rem; }
.signin-shapes span.c3 { font-size: calc(var(--u) * 4.6); line-height: 1; padding-bottom: calc(var(--u) * 0.9); }
html.portrait .signin-shapes span.c3 { font-size: calc(var(--u) * 8.5); }

/* The scores after a round: how to move on without the host (the TV's keyboard, or tap). */
.standings-keys { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: calc(var(--u) * 1.2); position: relative; z-index: 1; }
.offer-btn {
  display: inline-flex; align-items: center; gap: calc(var(--u) * 0.8); cursor: pointer; font: inherit; font-weight: 700;
  font-size: calc(var(--u) * 1.8); color: var(--ink); background: #fff; border: 0; border-radius: calc(var(--u) * 3);
  padding: calc(var(--u) * 0.6) calc(var(--u) * 1.8); box-shadow: 0 calc(var(--u) * 0.4) 0 rgba(0, 0, 0, 0.25);
}
.offer-btn.go { background: var(--yellow); }
.offer-btn .key { background: var(--ink); color: #fff; border-radius: calc(var(--u) * 0.6); padding: 0 calc(var(--u) * 0.7); font-size: 0.85em; }
.offer-note { font-size: calc(var(--u) * 1.6); opacity: 0.9; }
.offer-note b { background: rgba(255, 255, 255, 0.25); padding: 0 calc(var(--u) * 0.6); border-radius: calc(var(--u) * 0.6); }
body.view .standings-keys { display: none; } /* a phone watching the TV can't press the TV's keys */

/* "See it on the big screen": real TV screens in a coverflow carousel (about-carousel.js), as on the driving school
   site, with TV frames in place of its phones. */
.band-screens { --edge: #1d4ed8; background: linear-gradient(160deg, #22d3ee 0%, #3b82f6 55%, #1d4ed8 100%); }
.band-screens > .app-carousel { width: 100%; max-width: 80rem; }
.deco-i { width: 4rem; top: 1.8rem; left: 6%; }
.deco-j { width: 5rem; top: 2rem; right: 6%; }
.app-carousel {
  --ac-w: min(42rem, 62vw);                /* the TV in front */
  --ac-h: calc(var(--ac-w) * 9 / 16 + 1.6rem); /* the stage: the TV and its stand */
  --ac-step: 58%;                          /* how far the neighbours sit from the middle */
  --ac-angle: 38deg;                       /* how much they turn away */
  position: relative; min-width: 0; outline: none; overflow: hidden; padding: 1.2rem 0 0.2rem;
}
.app-carousel:focus-visible { box-shadow: 0 0 0 0.25rem rgba(255, 233, 74, 0.8); border-radius: 1.4rem; }
.ac-stage { position: relative; height: var(--ac-h); perspective: 1600px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ac-slide {
  --offset: 0; margin: 0; position: absolute; top: 0; left: 50%; width: var(--ac-w); margin-left: calc(var(--ac-w) / -2);
  transform: translateX(calc(var(--offset) * var(--ac-step))) rotateY(calc(var(--offset) * -1 * var(--ac-angle))) scale(0.78);
  transition: transform 0.6s cubic-bezier(0.22, 0.8, 0.3, 1), opacity 0.6s, filter 0.6s;
  opacity: 0; visibility: hidden; cursor: pointer; z-index: 1;
}
/* A TV: a dark bezel, and a little stand under it. */
.tv-mock {
  position: relative; padding: 0.55rem; border-radius: 1rem; background: #1d1747;
  box-shadow: 0 0.9rem 2rem rgba(29, 23, 71, 0.35);
}
.tv-mock::after {
  content: ''; position: absolute; left: 50%; bottom: -1.1rem; transform: translateX(-50%);
  width: 22%; height: 1.1rem; border-radius: 0 0 0.6rem 0.6rem; background: #1d1747;
}
.tv-mock img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 0.5rem; pointer-events: none; }
.ac-slide[data-abs="0"] { opacity: 1; visibility: visible; z-index: 5; cursor: default; transform: translateX(0) rotateY(0) scale(1); }
.ac-slide[data-abs="0"] .tv-mock { box-shadow: 0 1.2rem 3rem rgba(29, 23, 71, 0.45); }
.ac-slide[data-abs="1"] { opacity: 0.92; visibility: visible; z-index: 4; filter: brightness(0.9); }
.ac-slide[data-abs="2"] {
  opacity: 0.5; visibility: visible; z-index: 3; filter: brightness(0.85);
  transform: translateX(calc(var(--offset) * var(--ac-step) * 0.88)) rotateY(calc(var(--offset) * -0.5 * var(--ac-angle))) scale(0.6);
}
.ac-caption {
  text-align: center; font-weight: 900; color: #fff; font-size: 1.2em; min-height: 1.6em; margin: 1.6rem 0 0.8rem;
  text-shadow: 0 0.08em 0 rgba(29, 23, 71, 0.4);
}
.ac-controls { display: flex; align-items: center; justify-content: center; gap: 0.9rem; }
.ac-arrow {
  width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 0; background: #fff; color: var(--ink);
  font: inherit; font-size: 1.7rem; font-weight: 900; line-height: 1; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 0.25rem 0 rgba(29, 23, 71, 0.3); transition: background 0.2s, transform 0.2s;
}
.ac-arrow:hover { background: #ffe94a; transform: translateY(-2px); }
.ac-dots { display: flex; gap: 0.5rem; }
.ac-dots button {
  width: 0.65rem; height: 0.65rem; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.5);
  cursor: pointer; transition: width 0.3s, background 0.3s;
}
.ac-dots button[aria-current="true"] { width: 1.6rem; background: #ffe94a; }
@media (max-width: 700px) {
  .app-carousel { --ac-w: 78vw; --ac-step: 46%; --ac-angle: 30deg; }
  .ac-caption { font-size: 1.05em; padding: 0 0.5rem; }
}

/* A team's phone watching the TV, held upright: the TV fills the whole phone (no dark bars), with bigger writing
   (fitScreen shrinks it again if a screen doesn't fit), the content in the middle, and room at the bottom for
   "Back to my buttons". Staff-only bits (host code, sign out, terms) are hidden. Held sideways: the TV as it is. */
html.portrait body.view { --u0: 1.6vw; --u: var(--u0); background: linear-gradient(135deg, #6a3df0 0%, #3b82f6 55%, #06b6d4 100%); }
html.portrait body.view .stage { width: 100vw; height: 100vh; height: 100svh; }
html.portrait body.view #app > .screen { padding-top: calc(var(--u) * 4); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
html.portrait body.view .timer { margin-top: calc(var(--u) * 3); width: 92%; }
html.portrait body.view .attract { grid-template-rows: auto auto auto auto; align-content: center; }
body.view .host-card, body.view .corner, body.view .join-card .url, body.view .lobby-foot .host-card { display: none; }
body.view .sound-note {
  top: auto; left: 10px; bottom: calc(18px + env(safe-area-inset-bottom)); font-size: 14px; padding: 8px 12px;
}
/* The round and question labels one above the other (shortened with … if need be), and the question and its
   answers in the middle of the phone, below them. */
html.portrait body.view .question, html.portrait body.view .feedback, html.portrait body.view .memorise {
  justify-content: center; padding-top: calc(var(--u) * 17);
}
html.portrait body.view .topbar { top: calc(var(--u) * 3); flex-direction: column; align-items: center; gap: calc(var(--u) * 1.2); }
html.portrait body.view .topbar .pill {
  display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: calc(var(--u) * 3);
}
html.portrait body.view .topbar .pill:empty { display: none; }
@media (max-width: 380px) {
  body.view .sound-note { font-size: 13px; padding: 7px 10px; left: 8px; }
  body.view .view-back { font-size: 14px; padding: 9px 13px; right: 8px; }
}
