/* Bricolage Grotesque, bundled (same font as HypeQuiz): no request to Google. */
@font-face {
  font-family: "Bricolage Grotesque Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* HypeQuiz theme (teamquiz/src/theme.css): Hype Up's four colours, warm yellow dominant. */
:root {
  --accent: #f9c74f;   /* yellow: logo, buttons, current person */
  --work: #2ec4c2;     /* teal */
  --fun: #e84393;      /* pink */
  --violet: #8e3cb8;
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #1b1b1b;
  --ink-muted: #595959;
  --light-grey: #e6e6e6;
  --line: #1b1b1b;
  --ok: #23803a;
  --warn: #d98a00;
  --danger: #c62828;
  --radius: 14px;
  --border: 3px solid var(--line);
  --shadow: 3px 3px 0 var(--line);
  --shadow-lg: 5px 5px 0 var(--line);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque Variable", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.hidden { display: none !important; }

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 0.5rem;
}

button {
  font: inherit;
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--ink);
  padding: 0.55rem 1.1rem;
  box-shadow: var(--shadow);
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
}
button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
button.secondary { background: var(--surface); }
button.big { font-size: 1.25rem; padding: 0.8rem 1.6rem; }
button.small-button { font-size: 0.9rem; padding: 0.3rem 0.8rem; box-shadow: 2px 2px 0 var(--line); }

/* Top bar & logo (same as HypeQuiz's "Hype [Quiz]") */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.25rem; }
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
}
.logo-in {
  background: var(--accent);
  border: var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.08em 0.3em 0.12em;
  transform: rotate(-3deg);
}

.screen { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 1rem 1rem 2rem; }

/* Setup */
.panel {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2vh;
}
.panel.center { text-align: center; align-items: center; margin-top: 12vh; }
label { font-weight: 600; }
textarea, select {
  font: inherit;
  font-size: max(1em, 1rem);
  border: var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: var(--surface);
  color: var(--ink);
}
textarea { resize: vertical; font-size: 1.15rem; line-height: 1.4; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.checkbox { display: flex; gap: 0.5rem; align-items: center; font-weight: 500; }
.checkbox input { width: 1.2rem; height: 1.2rem; accent-color: var(--ink); }
.error { color: var(--danger); margin: 0; font-weight: 600; }

/* People strip */
.people { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; padding: 0; margin: 0 0 1.5rem; }
.people li {
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0.15rem 0.75rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.people li.done { background: var(--light-grey); color: var(--ink-muted); text-decoration: line-through; }
.people li.current { background: var(--accent); box-shadow: 2px 2px 0 var(--line); transform: rotate(-2deg); }

.who { text-align: center; }
#who {
  display: inline-block;
  background: var(--accent);
  border: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0 0.25em 0.05em;
  transform: rotate(-2deg);
}
.prompt { font-size: 1.2rem; color: var(--ink-muted); margin: 0.5rem 0 1.5rem; }

/* Cards */
.choices { display: flex; gap: clamp(1rem, 4vw, 3rem); flex-wrap: wrap; justify-content: center; }
.card {
  position: relative;
  width: clamp(220px, 26vw, 300px);
  aspect-ratio: 5 / 7;
  border: var(--border);
  border-radius: 20px;
  box-shadow: 6px 6px 0 var(--line);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  background: var(--surface);
  color: var(--ink);
}
.card.work.back { background: var(--work); }
.card.fun.back { background: var(--fun); }
.card.back::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 3px dashed var(--line);
  border-radius: 12px;
  opacity: 0.25;
  pointer-events: none;
}
.card .kind { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.1; letter-spacing: -0.01em; }
.card .mark { font-size: clamp(3rem, 6vw, 5rem); }
.choices .card:hover { transform: translate(-3px, -6px) rotate(-2deg); box-shadow: 9px 12px 0 var(--line); }
.choices .card.fun:hover { transform: translate(-3px, -6px) rotate(2deg); }

/* Flip */
.stage { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.flip { perspective: 1600px; }
.flip .card { width: clamp(300px, 46vw, 620px); aspect-ratio: 7 / 5; }
.flip-inner { position: relative; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(0.3, 1.4, 0.5, 1); }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.rear { position: absolute; inset: 0; transform: rotateY(180deg); }
.face.rear .kind {
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  font-size: 1rem;
  padding: 0.1rem 0.7rem;
  border: 2px solid var(--line);
  border-radius: 999px;
}
.face.rear.work .kind { background: var(--work); }
.face.rear.fun .kind { background: var(--fun); }
.face.rear.work { box-shadow: 8px 8px 0 var(--work), 8px 8px 0 3px var(--line); }
.face.rear.fun { box-shadow: 8px 8px 0 var(--fun), 8px 8px 0 3px var(--line); }
#question { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; font-size: clamp(1.6rem, 3.2vw, 2.8rem); line-height: 1.15; margin: 0; padding: 1.5rem 1rem 0.5rem; }
.flip.enter { animation: deal 0.45s ease-out; }
@keyframes deal {
  from { transform: translateY(40px) scale(0.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Timer */
.timer { position: relative; width: 120px; height: 120px; cursor: pointer; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 10; }
.timer .track { stroke: var(--light-grey); }
.timer .ring { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 276.46; transition: stroke-dashoffset 0.25s linear, stroke 0.3s; }
.timer.warn .ring { stroke: var(--warn); }
.timer.over .ring { stroke: var(--danger); }
#time { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 2rem; font-variant-numeric: tabular-nums; }
.timer.paused #time::after { content: "paused"; position: absolute; bottom: 22px; font-family: var(--font); font-weight: 600; font-size: 0.7rem; color: var(--ink-muted); }
.timer.warn #time { animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
.timesup { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; color: var(--danger); margin: -0.5rem 0 0; animation: wobble 0.6s; }
@keyframes wobble { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

.actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.hint { text-align: center; color: var(--ink-muted); font-size: 0.8rem; margin: 0 0 0.75rem; }

@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition-duration: 0.01s; }
  .flip.enter, .timer.warn #time { animation: none; }
}
