:root {
  color-scheme: light;
  --brand-purple: #5b3df6;
  --brand-purple-deep: #4324d8;
  --brand-teal: #14c8b8;
  --brand-teal-deep: #087f75;
  --brand-orange: #ff8a3d;
  --brand-yellow: #ffc83d;
  --brand-lavender: #ede9ff;
  --brand-bg: #f6f7fb;
  --surface: #ffffff;
  --text-primary: #16152f;
  --text-secondary: #66647d;
  --line: #e3e2ef;
  --danger: #c33d50;
  --card-radius: clamp(22px, 1.8vw, 32px);
  --card-shadow: 0 22px 60px rgba(57, 39, 133, 0.11);
  --page-space: clamp(20px, 2.2vw, 42px);
  --header-height: 78px;
  --timer-size: clamp(108px, 8vw, 142px);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html,
body { min-width: 1024px; min-height: 100%; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 8% 16%, rgba(91, 61, 246, 0.1) 0 7rem, transparent 7.1rem),
    radial-gradient(circle at 94% 13%, rgba(91, 61, 246, 0.07) 0 14rem, transparent 14.1rem),
    radial-gradient(circle at 76% 98%, rgba(20, 200, 184, 0.07) 0 12rem, transparent 12.1rem),
    linear-gradient(135deg, #fbfbff 0%, #f5f3ff 48%, #f8f9fd 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(2px);
}

body::before {
  left: -10rem;
  bottom: -18rem;
  width: 38rem;
  height: 38rem;
  border: 1px solid rgba(91, 61, 246, 0.08);
  box-shadow: 0 0 0 7rem rgba(91, 61, 246, 0.025), 0 0 0 14rem rgba(91, 61, 246, 0.018);
}

body::after {
  right: -7rem;
  top: 34%;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.75), rgba(91, 61, 246, 0.06));
}

button,
input { font: inherit; }

button { touch-action: manipulation; }

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 12px 16px;
  color: #fff;
  background: var(--brand-purple-deep);
  border-radius: 12px;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.app-bar {
  position: relative;
  z-index: 20;
  min-height: var(--header-height);
  padding: 12px clamp(28px, 4vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(222, 219, 234, 0.78);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand-identity,
.app-actions,
.connection-status,
.sound-control,
.button,
.summary-card,
.question-badges,
.question-corner,
.participant-pill,
.leaderboard-heading,
.leaderboard-heading h2,
.leaderboard-row,
.podium-card,
.text-answer-prompt { display: flex; align-items: center; }

.brand-identity { gap: clamp(18px, 1.5vw, 28px); }

.brand-logo {
  display: block;
  width: clamp(126px, 9vw, 164px);
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

.brand-divider { width: 1px; height: 32px; background: var(--line); }

.product-label {
  color: #46435d;
  font-size: clamp(15px, 1vw, 18px);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.app-actions { justify-content: flex-end; gap: 12px; }

.connection-status {
  min-height: 50px;
  padding: 7px 12px;
  gap: 8px;
  color: var(--brand-teal-deep);
  background: rgba(224, 250, 247, 0.92);
  border: 1px solid rgba(20, 200, 184, 0.22);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-teal);
  box-shadow: 0 0 0 4px rgba(20, 200, 184, 0.13);
}

.connection-status[data-state="pending"] { color: #7a5d13; background: #fff6d8; border-color: rgba(255, 200, 61, 0.38); }
.connection-status[data-state="pending"] .connection-dot { background: var(--brand-yellow); box-shadow: 0 0 0 4px rgba(255, 200, 61, 0.16); }

.sound-control {
  position: relative;
  min-height: 50px;
  padding: 5px 8px 5px 12px;
  gap: 8px;
  color: #46435d;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.sound-control:hover { border-color: rgba(91, 61, 246, 0.34); }

.sound-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sound-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  background: #cbc9d8;
  border-radius: 999px;
  transition: background 160ms ease;
}

.sound-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(22, 21, 47, 0.2);
  transition: transform 160ms ease;
}

.sound-control input:checked + .sound-switch { background: var(--brand-purple); }
.sound-control input:checked + .sound-switch::after { transform: translateX(18px); }
.sound-control input:focus-visible + .sound-switch { outline: 3px solid rgba(91, 61, 246, 0.28); outline-offset: 2px; }

main {
  position: relative;
  z-index: 1;
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: var(--page-space);
}

h1,
h2,
p { overflow-wrap: anywhere; }

h1,
h2,
p { margin-top: 0; }

.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(222, 219, 234, 0.84);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.start-screen {
  min-height: calc(100dvh - var(--header-height) - (var(--page-space) * 2));
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, 0.72fr);
  align-items: center;
  gap: clamp(48px, 6vw, 116px);
}

.start-visual {
  min-width: 0;
  min-height: min(740px, calc(100dvh - var(--header-height) - (var(--page-space) * 2)));
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.start-copy { max-width: 820px; }

.start-copy h1 {
  position: relative;
  display: inline-block;
  margin: 0;
  font-size: clamp(54px, 5vw, 90px);
  line-height: 1.06;
  letter-spacing: -0.055em;
}

.start-copy h1::after {
  content: "";
  position: absolute;
  right: -0.2em;
  bottom: -0.08em;
  width: 2.15em;
  height: 0.18em;
  border-top: 0.06em solid var(--brand-purple);
  border-radius: 50%;
  transform: rotate(-4deg);
}

.start-copy > p {
  max-width: 700px;
  margin: clamp(22px, 2.2vw, 34px) 0 0;
  color: var(--text-secondary);
  font-size: clamp(18px, 1.4vw, 24px);
  line-height: 1.7;
}

.audience-scene {
  position: relative;
  width: min(620px, 84%);
  height: clamp(210px, 23vh, 292px);
  margin: clamp(26px, 4vh, 54px) 0 0 clamp(10px, 4vw, 76px);
}

.scene-screen {
  position: absolute;
  left: 11%;
  top: 0;
  width: 60%;
  height: 63%;
  display: grid;
  place-items: center;
  border: clamp(8px, 0.8vw, 14px) solid rgba(118, 92, 255, 0.34);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 40px rgba(74, 52, 172, 0.16), inset 0 0 0 2px rgba(91, 61, 246, 0.1);
  transform: perspective(700px) rotateY(5deg);
}

.scene-screen::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -22%;
  width: 36%;
  height: 20%;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, #d8d1ff, #eeeaff);
  transform: translateX(-50%);
}

.scene-screen img { width: 53%; height: 56%; object-fit: contain; }

.screen-spark {
  position: absolute;
  width: 7px;
  height: 26px;
  border-radius: 99px;
  background: var(--brand-orange);
}

.screen-spark-one { right: -8%; top: 26%; transform: rotate(18deg); }
.screen-spark-two { right: -13%; top: 43%; height: 18px; transform: rotate(62deg); }

.speech-bubble {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(57, 39, 133, 0.15);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: inherit;
  transform: rotate(45deg);
}

.speech-bubble-teal {
  left: 0;
  top: 34%;
  width: 92px;
  height: 60px;
  gap: 7px;
  border-radius: 18px;
  background: linear-gradient(145deg, #22d8ca, #08b7aa);
}

.speech-bubble-teal i {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
}

.speech-bubble-orange {
  right: 3%;
  top: 19%;
  width: 70px;
  height: 60px;
  color: #fff;
  border-radius: 20px;
  background: linear-gradient(145deg, #ff9c59, #ff7a28);
}

.speech-bubble-orange svg { position: relative; z-index: 1; width: 30px; height: 30px; stroke-width: 3; }

.audience-row {
  position: absolute;
  left: 7%;
  right: 5%;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 34px);
}

.audience-person {
  position: relative;
  display: block;
  width: clamp(66px, 6vw, 92px);
  height: clamp(70px, 6.5vw, 98px);
  border-radius: 45% 45% 16px 16px;
  box-shadow: 0 14px 28px rgba(57, 39, 133, 0.14);
}

.audience-person::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -34%;
  width: 65%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: inherit;
  transform: translateX(-50%);
  box-shadow: 0 8px 20px rgba(57, 39, 133, 0.13);
}

.audience-purple { background: linear-gradient(145deg, #8067ff, #4c2ae3); }
.audience-teal { height: clamp(78px, 7.4vw, 108px); background: linear-gradient(145deg, #38ddd0, #0ab8aa); }
.audience-orange { background: linear-gradient(145deg, #ffa45e, #ff7f2f); }
.audience-lavender { width: clamp(52px, 5vw, 76px); height: clamp(58px, 5.6vw, 84px); background: linear-gradient(145deg, #ded8ff, #afa2ff); }

.start-form {
  width: min(100%, 600px);
  justify-self: end;
  padding: clamp(32px, 3vw, 54px);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 28px 80px rgba(62, 41, 155, 0.14);
}

.field { display: grid; gap: 14px; }

label {
  color: var(--text-primary);
  font-size: clamp(18px, 1.3vw, 22px);
  font-weight: 850;
}

.code-input-shell {
  position: relative;
  min-height: clamp(66px, 5.2vw, 82px);
  border-radius: 16px;
}

.code-slots {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(7px, 0.7vw, 12px);
}

.code-slots span {
  display: grid;
  place-items: center;
  color: #8a879b;
  border: 2px solid #d8d6e3;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 -3px 0 rgba(39, 28, 88, 0.025);
  font-size: clamp(27px, 2.1vw, 36px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.code-slots span.filled { color: var(--brand-purple); border-color: rgba(91, 61, 246, 0.42); background: #fbfaff; }
.code-input-shell:focus-within .code-slots span.next { border-color: var(--brand-purple); box-shadow: 0 0 0 4px rgba(91, 61, 246, 0.1); transform: translateY(-2px); }

#room-code {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  color: transparent;
  caret-color: transparent;
  border: 0;
  border-radius: 16px;
  background: transparent;
  outline: none;
  opacity: 0.02;
  cursor: text;
}

.field-help {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: clamp(13px, 0.92vw, 16px);
  line-height: 1.6;
}

.button {
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: 0.55; }

.button-primary {
  width: 100%;
  min-height: clamp(58px, 4.6vw, 72px);
  color: #fff;
  background: linear-gradient(135deg, #6547ff 0%, #4b27ee 100%);
  box-shadow: 0 16px 28px rgba(91, 61, 246, 0.24);
  font-size: clamp(17px, 1.2vw, 21px);
}

.button-primary:hover:not(:disabled) { box-shadow: 0 20px 36px rgba(91, 61, 246, 0.3); }
.button-primary .button-icon { width: 24px; height: 24px; stroke-width: 2.4; }

.button-quiet {
  color: var(--brand-purple-deep);
  border-color: rgba(91, 61, 246, 0.35);
  background: rgba(255, 255, 255, 0.86);
  text-decoration: none;
}

.button-quiet:hover { background: var(--brand-lavender); }
.button-quiet .button-icon { width: 19px; height: 19px; }

input:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(91, 61, 246, 0.3);
  outline-offset: 3px;
}

.field-error {
  min-height: 24px;
  margin: 10px 0 -8px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
}

.display-screen { display: grid; gap: clamp(14px, 1.2vw, 22px); }

.session-summary {
  display: grid;
  grid-template-columns: 1.12fr repeat(3, minmax(0, 1fr));
  gap: clamp(9px, 0.9vw, 16px);
}

.summary-card {
  min-width: 0;
  min-height: clamp(82px, 6.7vw, 108px);
  justify-content: space-between;
  gap: 14px;
  padding: clamp(13px, 1.25vw, 20px) clamp(16px, 1.6vw, 26px);
  border: 1px solid rgba(225, 223, 237, 0.85);
  border-radius: clamp(16px, 1.25vw, 22px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(57, 39, 133, 0.07);
}

.summary-card > div { min-width: 0; }
.summary-label { margin: 0 0 4px; color: var(--text-secondary); font-size: clamp(14px, 0.9vw, 16px); font-weight: 750; }
.summary-code,
.summary-value { margin: 0; font-variant-numeric: tabular-nums; font-weight: 900; line-height: 1.05; }
.summary-code { color: var(--brand-purple); font-size: clamp(27px, 2.2vw, 38px); letter-spacing: 0.12em; white-space: nowrap; }
.summary-value { font-size: clamp(24px, 2vw, 34px); }
.summary-value small { margin-left: 5px; font-size: 0.55em; font-weight: 800; }

.summary-icon {
  flex: 0 0 auto;
  width: clamp(42px, 3.3vw, 54px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 15px;
}

.summary-icon svg { width: 55%; height: 55%; stroke-width: 2.4; }
.summary-icon-purple { color: var(--brand-purple); background: var(--brand-lavender); }
.summary-icon-orange { color: #dc6422; background: #fff0e6; }
.summary-icon-teal { color: var(--brand-teal-deep); background: #def9f5; }

.status-pill,
.response-progress,
.question-type {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 30px;
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: clamp(14px, 0.88vw, 16px);
  font-weight: 850;
  white-space: nowrap;
}

.status-pill { color: var(--brand-teal-deep); background: #dcf9f5; }
.status-pill::before { content: ""; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--brand-teal); }
.status-pill[data-status="waiting"] { color: var(--brand-purple-deep); background: var(--brand-lavender); }
.status-pill[data-status="waiting"]::before { background: var(--brand-purple); }
.status-pill[data-status="closed"] { color: #a5501f; background: #fff0e6; }
.status-pill[data-status="closed"]::before { background: var(--brand-orange); }
.status-pill[data-status="ended"] { color: #72540b; background: #fff5cf; }
.status-pill[data-status="ended"]::before { background: var(--brand-yellow); }

.stage {
  height: calc(100dvh - var(--header-height) - (var(--page-space) * 2) - clamp(82px, 6.7vw, 108px) - clamp(14px, 1.2vw, 22px));
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(24px, 2.35vw, 46px);
  background:
    radial-gradient(circle at 96% 8%, rgba(91, 61, 246, 0.08) 0 9rem, transparent 9.1rem),
    radial-gradient(circle at 5% 96%, rgba(20, 200, 184, 0.05) 0 11rem, transparent 11.1rem),
    rgba(255, 255, 255, 0.96);
}

body[data-screen="waiting"] .stage {
  border-color: rgba(91, 61, 246, 0.1);
  background:
    radial-gradient(circle at -3% -8%, rgba(91, 61, 246, 0.1) 0 10rem, transparent 10.1rem),
    radial-gradient(circle at 103% 5%, rgba(91, 61, 246, 0.08) 0 12rem, transparent 12.1rem),
    radial-gradient(circle at 2% 108%, rgba(20, 200, 184, 0.08) 0 14rem, transparent 14.1rem),
    radial-gradient(circle at 94% 110%, rgba(91, 61, 246, 0.09) 0 18rem, transparent 18.1rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 247, 255, 0.96));
  box-shadow: 0 24px 70px rgba(57, 39, 133, 0.1);
}

#stage-content { flex: 1; min-height: 0; }

.lobby-stage {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
}

.lobby-glow {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(68vw, 1060px);
  aspect-ratio: 2.2;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(91, 61, 246, 0.14) 0%, rgba(91, 61, 246, 0.05) 40%, transparent 72%);
  filter: blur(18px);
  transform: translate(-50%, -50%);
  animation: lobby-breathe 4.8s ease-in-out infinite;
}

.lobby-content {
  position: relative;
  z-index: 2;
  width: min(1060px, 96%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lobby-title {
  margin: 0 auto clamp(24px, 3vh, 42px);
  max-width: min(1080px, 94%);
  color: var(--text-primary);
  font-size: clamp(38px, 3.7vw, 66px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lobby-join-options {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(270px, 1fr);
  align-items: stretch;
  gap: clamp(16px, 1.6vw, 26px);
}

.lobby-join-card {
  min-width: 0;
  min-height: clamp(250px, 27vh, 302px);
  padding: clamp(22px, 1.6vw, 28px);
  border: 1px solid rgba(91, 61, 246, 0.08);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 24px 65px rgba(57, 39, 133, 0.1);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
}

.lobby-join-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.lobby-join-heading h3 { margin: 0; color: #46435d; font-size: clamp(18px, 1.25vw, 22px); }
.lobby-join-heading p { margin: 3px 0 0; color: var(--text-secondary); font-size: clamp(13px, 0.95vw, 17px); }

.lobby-join-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--brand-purple);
  border-radius: 16px;
  background: var(--brand-lavender);
}

.lobby-join-icon svg { width: 30px; height: 30px; }
.lobby-join-card-scan .lobby-join-icon { width: 48px; height: 48px; border-radius: 13px; }
.lobby-join-card-scan .lobby-join-icon svg { width: 27px; height: 27px; }

.lobby-qr-image-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding-top: 12px;
}

.lobby-qr-image { display: block; width: min(100%, 210px); max-height: 200px; object-fit: contain; }
.lobby-qr-placeholder { max-width: 220px; margin: 0; color: var(--text-secondary); font-size: 15px; line-height: 1.5; }

.lobby-join-card-code .lobby-code-shell {
  margin: auto 0;
}

.lobby-code-shell {
  width: 100%;
}

.lobby-code-digits {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(8px, 0.8vw, 14px);
  white-space: nowrap;
}

.lobby-code-digit {
  height: clamp(78px, 11vh, 106px);
  display: grid;
  place-items: center;
  color: var(--brand-purple);
  border: 1px solid rgba(91, 61, 246, 0.09);
  border-radius: clamp(16px, 1.2vw, 22px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(91, 61, 246, 0.075)),
    rgba(237, 233, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 24px rgba(91, 61, 246, 0.06);
  font-size: clamp(54px, 4.4vw, 82px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 8px 30px rgba(91, 61, 246, 0.13);
}

.participant-pill {
  width: max-content;
  min-height: 50px;
  margin: clamp(16px, 2vh, 26px) auto 0;
  padding: 10px 20px;
  gap: 11px;
  color: var(--brand-teal-deep);
  border: 1px solid rgba(20, 200, 184, 0.24);
  border-radius: 999px;
  background: rgba(220, 249, 245, 0.9);
  box-shadow: 0 10px 26px rgba(20, 200, 184, 0.09);
  font-size: clamp(17px, 1.25vw, 22px);
  font-weight: 750;
}

.participant-pill svg { width: 24px; height: 24px; }
.participant-pill strong { font-size: 1.25em; }

.stage-lead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: clamp(12px, 1.7vh, 22px) 0 0;
  color: var(--text-secondary);
  font-size: clamp(16px, 1.15vw, 20px);
}

.lobby-decoration {
  position: absolute;
  z-index: 1;
  width: clamp(18px, 1.8vw, 32px);
  height: clamp(38px, 3.8vw, 66px);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.92;
  box-shadow: 0 12px 24px rgba(57, 39, 133, 0.09);
}

.lobby-decoration-purple {
  left: 12%;
  bottom: 21%;
  background: linear-gradient(160deg, #8169ff, var(--brand-purple));
  transform: rotate(-42deg);
}

.lobby-decoration-teal {
  left: 5%;
  top: 23%;
  width: clamp(64px, 6vw, 108px);
  height: clamp(24px, 2.5vw, 44px);
  background: linear-gradient(135deg, #74eadf, var(--brand-teal));
  transform: rotate(-23deg);
}

.lobby-decoration-orange {
  left: 20%;
  bottom: 12%;
  width: clamp(14px, 1.25vw, 22px);
  height: clamp(34px, 3vw, 52px);
  background: linear-gradient(160deg, #ffab6f, var(--brand-orange));
  transform: rotate(-36deg);
}

.lobby-decoration-yellow {
  right: 14%;
  bottom: 25%;
  width: clamp(16px, 1.45vw, 26px);
  height: clamp(40px, 3.3vw, 58px);
  background: linear-gradient(160deg, #ffdc69, var(--brand-yellow));
  transform: rotate(34deg);
}

.lobby-decoration-blue {
  right: 6%;
  bottom: 18%;
  width: clamp(20px, 1.9vw, 34px);
  height: clamp(42px, 4vw, 70px);
  background: linear-gradient(160deg, #765dff, #3e20d7);
  transform: rotate(-42deg);
}

.waiting-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-orange);
  box-shadow: 0 0 0 5px rgba(255, 138, 61, 0.12);
  animation: waiting-pulse 2.2s ease-in-out infinite;
}

.question-stage { position: relative; height: 100%; min-height: 0; }
.question-meta { min-height: 34px; }
.question-badges { flex-wrap: wrap; gap: 10px; }
.question-type { color: var(--brand-purple-deep); background: var(--brand-lavender); }
.question-type.reveal { color: var(--brand-teal-deep); background: #def9f5; }
.response-progress { color: var(--brand-teal-deep); background: #def9f5; }

.question-corner {
  position: absolute;
  right: 0;
  top: 0;
  justify-content: flex-end;
  gap: clamp(12px, 1.4vw, 22px);
}

.question-position { color: var(--text-secondary); font-size: clamp(14px, 1vw, 17px); font-weight: 750; white-space: nowrap; }

.countdown {
  --timer-angle: 360deg;
  position: relative;
  flex: 0 0 auto;
  width: var(--timer-size);
  height: var(--timer-size);
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: conic-gradient(var(--brand-teal) 0 var(--timer-angle), rgba(91, 61, 246, 0.13) var(--timer-angle) 360deg);
  box-shadow: 0 18px 38px rgba(91, 61, 246, 0.2);
  transition: background 240ms linear, transform 180ms ease;
}

.countdown::before {
  content: "";
  position: absolute;
  inset: clamp(8px, 0.75vw, 12px);
  border-radius: 50%;
  background: linear-gradient(145deg, #704fff 0%, #4a27e7 100%);
  box-shadow: inset 0 8px 20px rgba(255, 255, 255, 0.12);
}

.countdown-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-direction: column;
}

.countdown span { font-size: clamp(42px, 3.6vw, 62px); font-variant-numeric: tabular-nums; font-weight: 950; line-height: 1; }
.countdown.three-digits span { font-size: clamp(34px, 2.9vw, 50px); }
.countdown small { font-size: clamp(12px, 0.85vw, 15px); font-weight: 850; line-height: 1; }
.countdown.urgent { background: conic-gradient(var(--brand-orange) 0 var(--timer-angle), rgba(255, 138, 61, 0.14) var(--timer-angle) 360deg); transform: scale(1.025); }
.countdown.urgent::before { background: linear-gradient(145deg, #ff9650, #ef6f24); }

.question-heading {
  min-height: var(--timer-size);
  max-width: 100%;
  margin: clamp(10px, 1.2vh, 18px) 0 clamp(18px, 2.2vh, 32px);
  padding-right: calc(var(--timer-size) + clamp(118px, 9vw, 170px));
  display: flex;
  align-items: center;
  font-size: clamp(34px, 3.35vw, 62px);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.question-figure {
  margin: 0 0 clamp(12px, 1.4vh, 20px);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.question-figure img {
  display: block;
  max-width: min(100%, 64ch);
  max-height: min(30vh, 320px);
  object-fit: contain;
  background: var(--brand-bg);
  border: 2px solid #e2e0ee;
  border-radius: clamp(14px, 1.2vw, 22px);
}

.answer-breakdown .question-figure img { max-height: min(22vh, 210px); }

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.1vw, 20px);
}

.answer-card {
  position: relative;
  min-height: clamp(102px, 13vh, 166px);
  padding: clamp(16px, 1.55vw, 28px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(13px, 1.25vw, 22px);
  overflow: hidden;
  border: 2px solid #e2e0ee;
  border-radius: clamp(17px, 1.35vw, 24px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(57, 39, 133, 0.055);
}

.answer-card::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -58px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(91, 61, 246, 0.035);
  box-shadow: 0 0 0 20px rgba(91, 61, 246, 0.018);
}

.answer-letter {
  position: relative;
  z-index: 1;
  width: clamp(52px, 4.1vw, 70px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: clamp(14px, 1vw, 18px);
  background: linear-gradient(145deg, #714fff, #4b25eb);
  box-shadow: 0 9px 20px rgba(91, 61, 246, 0.23);
  font-size: clamp(24px, 2vw, 34px);
  font-weight: 950;
}

.answer-card:nth-child(2) .answer-letter { color: #063e39; background: linear-gradient(145deg, #36ddcf, #0fbeaf); box-shadow: 0 9px 20px rgba(20, 200, 184, 0.2); }
.answer-card:nth-child(3) .answer-letter { color: #5a2605; background: linear-gradient(145deg, #ffae73, #ff8434); box-shadow: 0 9px 20px rgba(255, 138, 61, 0.2); }
.answer-card:nth-child(4) .answer-letter { color: #604600; background: linear-gradient(145deg, #ffd96d, #ffc12b); box-shadow: 0 9px 20px rgba(255, 200, 61, 0.2); }

.answer-text {
  position: relative;
  z-index: 1;
  min-width: 0;
  font-size: clamp(20px, 1.75vw, 31px);
  font-weight: 850;
  line-height: 1.35;
}

.many-options .answer-card { min-height: clamp(76px, 8.6vh, 112px); }
.many-options .answer-letter { width: clamp(44px, 3vw, 58px); font-size: clamp(20px, 1.5vw, 27px); }
.many-options .answer-text { font-size: clamp(18px, 1.35vw, 24px); }
.dense-options { gap: clamp(9px, 0.8vw, 14px); }
.dense-options .answer-card { min-height: clamp(52px, 6vh, 76px); padding-top: 9px; padding-bottom: 9px; }
.dense-options .answer-letter { width: clamp(38px, 2.6vw, 50px); }
.dense-options .answer-text { font-size: clamp(17px, 1.15vw, 21px); }

.ordering-grid { grid-template-columns: 1fr; }
.ordering-grid .answer-card { min-height: clamp(64px, 7.8vh, 96px); }

.stage.ordering-stage-active { padding-block: clamp(18px, 2vh, 28px); }

.ordering-stage-adaptive {
  --timer-size: clamp(88px, 10vh, 112px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.ordering-stage-adaptive .question-heading {
  min-height: var(--timer-size);
  margin: clamp(6px, 1vh, 12px) 0 clamp(10px, 1.3vh, 18px);
  font-size: clamp(28px, 3vw, 52px);
}

.ordering-stage-adaptive .ordering-grid {
  min-height: 0;
  height: 100%;
  grid-template-rows: repeat(var(--option-count), minmax(0, 1fr));
  gap: clamp(6px, 0.8vh, 12px);
}

.ordering-stage-adaptive .answer-card {
  min-height: 0;
  height: 100%;
  padding: clamp(5px, 0.8vh, 12px) clamp(14px, 1.4vw, 24px);
}

.ordering-stage-adaptive .answer-letter {
  width: clamp(32px, 4.8vh, 50px);
  border-radius: clamp(10px, 1.4vh, 15px);
  font-size: clamp(18px, 2.8vh, 27px);
}

.ordering-stage-adaptive .answer-text { font-size: clamp(16px, 2.3vh, 25px); }

.ordering-stage-adaptive .dense-options .answer-card { padding-block: 2px; }
.ordering-stage-adaptive .dense-options .answer-letter { width: clamp(26px, 3.2vh, 34px); font-size: clamp(16px, 2vh, 21px); }

.text-answer-prompt,
.reference-answer-panel {
  min-height: clamp(150px, 21vh, 238px);
  padding: clamp(24px, 2.6vw, 48px);
  justify-content: center;
  gap: 16px;
  color: var(--brand-purple-deep);
  border: 2px solid rgba(91, 61, 246, 0.14);
  border-radius: clamp(18px, 1.4vw, 24px);
  background: linear-gradient(135deg, rgba(237, 233, 255, 0.95), rgba(246, 244, 255, 0.88));
  font-size: clamp(22px, 2.2vw, 36px);
  font-weight: 850;
  line-height: 1.45;
  text-align: center;
}

.prompt-mark,
.reference-answer-icon {
  flex: 0 0 auto;
  width: clamp(48px, 4vw, 66px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 18px;
  background: var(--brand-purple);
}

.prompt-mark svg,
.reference-answer-icon svg { width: 54%; height: 54%; stroke-width: 2.7; }

.results-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.72fr);
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(22px, 2.2vw, 40px);
  align-items: stretch;
}

.answer-breakdown { min-width: 0; }

.result-question {
  min-height: auto;
  margin: clamp(14px, 1.5vh, 22px) 0 clamp(18px, 2vh, 28px);
  padding: 0;
  font-size: clamp(28px, 2.7vw, 50px);
}

.result-grid { grid-template-columns: 1fr; gap: clamp(9px, 0.8vw, 14px); }
.result-grid .answer-card { min-height: clamp(64px, 7.7vh, 96px); padding-top: 12px; padding-bottom: 12px; }
.result-grid .answer-letter { width: clamp(42px, 3vw, 56px); font-size: clamp(19px, 1.5vw, 26px); }
.result-grid .answer-text { font-size: clamp(18px, 1.35vw, 24px); }
.answer-card.correct { border-color: rgba(20, 200, 184, 0.6); background: #effcfa; }
.correct .answer-letter { color: #063e39; background: var(--brand-teal); box-shadow: 0 9px 20px rgba(20, 200, 184, 0.2); }
.correct-mark { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; color: #fff; border-radius: 50%; background: var(--brand-teal); }
.correct-mark svg { width: 18px; height: 18px; stroke-width: 3; }
.answer-count { position: relative; z-index: 1; min-width: 66px; color: var(--text-primary); text-align: right; font-size: clamp(20px, 1.8vw, 30px); font-variant-numeric: tabular-nums; font-weight: 950; }
.answer-count small { margin-left: 3px; color: var(--text-secondary); font-size: 0.5em; font-weight: 800; }
.answer-bar { position: absolute; z-index: 2; inset: auto 0 0; height: 6px; background: var(--brand-purple); transform-origin: left center; transition: transform 300ms ease; }
.correct .answer-bar { background: var(--brand-teal); }

.reference-answer-panel {
  position: relative;
  display: grid;
  place-content: center;
  gap: 8px;
}

.reference-answer-panel p { margin: 0; }
.reference-answer-panel .summary-label { color: var(--brand-teal-deep); font-size: clamp(14px, 1vw, 17px); }
.reference-answer-panel > p:nth-of-type(2) { color: var(--text-primary); font-size: clamp(26px, 2.5vw, 44px); }
.reference-answer-icon { margin: 0 auto 6px; background: var(--brand-teal); }
.result-totals { margin-top: 16px; color: var(--text-secondary); font-size: clamp(16px, 1.2vw, 21px); }
.result-totals strong { color: var(--brand-teal-deep); font-variant-numeric: tabular-nums; }
.result-totals span { padding: 0 8px; }

.panel-inset,
.final-leaderboard {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: clamp(18px, 1.5vw, 26px);
  background: rgba(249, 249, 253, 0.88);
}

.panel-inset {
  min-height: 0;
  padding: clamp(20px, 1.8vw, 30px);
  overflow: hidden;
}

.leaderboard.panel-inset { display: flex; flex-direction: column; }

.leaderboard-heading { justify-content: space-between; gap: 20px; }
.leaderboard-heading h2 { gap: 10px; margin: 0; font-size: clamp(22px, 1.65vw, 30px); }
.leaderboard-heading > span { color: var(--text-secondary); font-size: clamp(13px, 0.9vw, 16px); font-weight: 700; }
.heading-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--brand-purple); border-radius: 10px; background: var(--brand-lavender); }
.heading-icon svg { width: 21px; height: 21px; stroke-width: 2.4; }
.leaderboard-list,
.final-ranking-list { display: grid; gap: 8px; }
.leaderboard-list { flex: 1; min-height: 0; margin-top: 18px; overflow: auto; padding-right: 3px; }

.leaderboard-row {
  min-height: 52px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 34px 38px minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid rgba(227, 226, 239, 0.78);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.95);
}

.leaderboard-row.compact { min-height: 50px; }
.rank { color: var(--brand-purple); font-variant-numeric: tabular-nums; font-weight: 950; text-align: center; }
.rank.first { padding: 4px 0; color: #6a4c00; background: var(--brand-yellow); border-radius: 9px; }
.participant-avatar { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; border-radius: 50%; font-size: 14px; font-weight: 900; }
.avatar-tone-0 { background: linear-gradient(145deg, #7559ff, #4b2bdd); }
.avatar-tone-1 { background: linear-gradient(145deg, #31d9cb, #0a9f94); }
.avatar-tone-2 { background: linear-gradient(145deg, #ffab70, #ee7223); }
.avatar-tone-3 { background: linear-gradient(145deg, #ffd96c, #dba51b); }
.person-name { min-width: 0; overflow: hidden; font-size: clamp(15px, 1vw, 17px); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.person-score { color: var(--brand-purple-deep); font-size: clamp(15px, 1.05vw, 18px); font-variant-numeric: tabular-nums; font-weight: 900; white-space: nowrap; }
.person-score small { margin-left: 2px; color: var(--text-secondary); font-size: 0.7em; }
.empty-state { margin: 0; padding: 48px 0; color: var(--text-secondary); text-align: center; line-height: 1.5; }

.final-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.83fr) minmax(620px, 1.35fr);
  gap: clamp(28px, 3vw, 58px);
  align-items: stretch;
}

.celebration-hero {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  justify-content: flex-start;
  flex-direction: column;
}

.celebration-kicker {
  margin: 0 0 10px;
  color: var(--brand-purple);
  font-size: clamp(13px, 0.95vw, 17px);
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.celebration-hero h2 {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: clamp(42px, 3.7vw, 70px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.celebration-copy { position: relative; z-index: 2; margin: 14px 0 0; color: var(--text-secondary); font-size: clamp(18px, 1.35vw, 24px); }

.celebration-art {
  position: relative;
  flex: 1;
  min-height: 220px;
  margin-top: 6px;
}

.celebration-art img {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 24px rgba(57, 39, 133, 0.16));
}

.trophy-halo {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 4%;
  width: clamp(92px, 7vw, 130px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #d99b00;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 225, 132, 0.96), rgba(255, 200, 61, 0.12) 62%, transparent 63%);
  transform: translateX(-50%);
}

.trophy-halo svg { width: 67%; height: 67%; stroke-width: 3; }

.confetti { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.confetti i { position: absolute; width: 9px; height: 26px; border-radius: 4px; background: var(--brand-purple); transform: rotate(24deg); animation: confetti-in 800ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.confetti i:nth-child(1) { left: 4%; top: 13%; background: var(--brand-teal); transform: rotate(-20deg); }
.confetti i:nth-child(2) { left: 17%; top: 39%; background: var(--brand-orange); transform: rotate(46deg); animation-delay: 60ms; }
.confetti i:nth-child(3) { left: 38%; top: 7%; width: 16px; height: 16px; background: var(--brand-yellow); transform: rotate(38deg); animation-delay: 100ms; }
.confetti i:nth-child(4) { right: 7%; top: 18%; background: var(--brand-orange); transform: rotate(70deg); animation-delay: 140ms; }
.confetti i:nth-child(5) { right: 18%; top: 42%; background: var(--brand-teal); transform: rotate(-34deg); animation-delay: 40ms; }
.confetti i:nth-child(6) { left: 8%; top: 65%; background: var(--brand-yellow); transform: rotate(58deg); animation-delay: 170ms; }
.confetti i:nth-child(7) { right: 4%; top: 69%; background: var(--brand-purple); transform: rotate(16deg); animation-delay: 110ms; }
.confetti i:nth-child(8) { left: 30%; top: 55%; width: 14px; height: 14px; background: var(--brand-teal); transform: rotate(48deg); animation-delay: 210ms; }
.confetti i:nth-child(9) { right: 31%; top: 58%; background: var(--brand-orange); transform: rotate(-26deg); animation-delay: 80ms; }
.confetti i:nth-child(10) { left: 47%; top: 31%; background: var(--brand-purple); transform: rotate(65deg); animation-delay: 130ms; }
.confetti i:nth-child(11) { left: 17%; top: 79%; background: var(--brand-orange); transform: rotate(18deg); animation-delay: 200ms; }
.confetti i:nth-child(12) { right: 16%; top: 84%; background: var(--brand-yellow); transform: rotate(-48deg); animation-delay: 230ms; }

.final-leaderboard {
  min-height: 0;
  padding: clamp(20px, 1.7vw, 30px);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.89);
  box-shadow: 0 16px 42px rgba(57, 39, 133, 0.07);
}

.podium {
  min-height: clamp(158px, 19vh, 220px);
  margin-top: clamp(13px, 1.7vh, 22px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: clamp(10px, 1vw, 16px);
}

.podium-card {
  position: relative;
  min-width: 0;
  height: 88%;
  padding: clamp(12px, 1vw, 17px) 10px;
  justify-content: flex-end;
  flex-direction: column;
  border: 1px solid rgba(227, 226, 239, 0.9);
  border-radius: 20px 20px 14px 14px;
  background: linear-gradient(180deg, #f4f2ff, #fbfaff);
}

.podium-card > * { flex-shrink: 0; }

.podium-card[data-rank="1"] { grid-column: 2; grid-row: 1; height: 100%; border-color: rgba(255, 200, 61, 0.42); background: linear-gradient(180deg, #fff5ce, #fffaf0); }
.podium-card[data-rank="2"] { grid-column: 1; grid-row: 1; background: linear-gradient(180deg, #eef1f8, #fafbfe); }
.podium-card[data-rank="3"] { grid-column: 3; grid-row: 1; background: linear-gradient(180deg, #fff0e5, #fff9f5); }
.podium-avatar { width: clamp(50px, 4vw, 66px); aspect-ratio: 1; display: grid; place-items: center; color: #fff; border: 5px solid #fff; border-radius: 50%; box-shadow: 0 8px 18px rgba(57, 39, 133, 0.14); font-size: clamp(18px, 1.4vw, 24px); font-weight: 950; }
.podium-card[data-rank="1"] .podium-avatar { width: clamp(58px, 4.8vw, 78px); border-color: #fff4c2; }
.podium-medal { position: absolute; top: 43%; left: 50%; width: 32px; height: 32px; display: grid; place-items: center; color: #fff; border: 3px solid #fff; border-radius: 50%; background: #8e9ab5; font-size: 14px; font-weight: 950; transform: translate(-50%, -50%); }
.podium-card[data-rank="1"] .podium-medal { top: 46%; color: #694d00; background: var(--brand-yellow); }
.podium-card[data-rank="3"] .podium-medal { background: #d88451; }
.podium-card strong { max-width: 100%; margin-top: clamp(10px, 1.1vh, 16px); overflow: hidden; font-size: clamp(15px, 1vw, 18px); line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.podium-card b { margin-top: 4px; color: var(--brand-purple-deep); font-size: clamp(18px, 1.4vw, 24px); font-variant-numeric: tabular-nums; }
.podium-card b small { margin-left: 2px; color: var(--text-secondary); font-size: 0.6em; }
.podium-crown { position: absolute; left: 50%; top: -21px; width: 42px; height: 42px; display: grid; place-items: center; color: #e0a000; transform: translateX(-50%); }
.podium-crown svg { width: 100%; height: 100%; stroke-width: 3; }

.ranking-table {
  min-height: 0;
  margin-top: clamp(12px, 1.5vh, 20px);
  display: flex;
  flex: 1;
  flex-direction: column;
}

.ranking-table-head {
  padding: 0 13px 8px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 750;
}

.ranking-table-head span:last-child { text-align: right; }
.final-ranking-list { min-height: 0; overflow: auto; }
.final-ranking-list .leaderboard-row { grid-template-columns: 34px 34px minmax(0, 1fr) auto; min-height: 46px; padding-top: 5px; padding-bottom: 5px; }
.final-ranking-list .participant-avatar { width: 32px; height: 32px; font-size: 13px; }

[hidden] { display: none !important; }

@keyframes lobby-breathe {
  0%, 100% { opacity: 0.68; transform: translate(-50%, -50%) scale(0.94); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
}

@keyframes waiting-pulse {
  0%, 100% { opacity: 0.56; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes confetti-in {
  from { opacity: 0; translate: 0 -26px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes metric-pop {
  0% { opacity: 0.45; transform: scale(0.82); }
  70% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.metric-pop { display: inline-block; animation: metric-pop 300ms ease-out; }

@media (max-width: 1240px) {
  :root { --timer-size: clamp(100px, 8vw, 118px); }
  .start-screen { grid-template-columns: minmax(0, 1fr) minmax(410px, 0.74fr); gap: 44px; }
  .start-copy h1 { font-size: clamp(52px, 5.2vw, 68px); }
  .audience-scene { width: 88%; margin-left: 20px; }
  .summary-card { padding-left: 16px; padding-right: 16px; }
  .final-layout { grid-template-columns: minmax(320px, 0.76fr) minmax(560px, 1.34fr); gap: 28px; }
}

@media (max-height: 820px) and (min-width: 900px) {
  :root { --header-height: 68px; --page-space: 16px; --timer-size: 104px; }
  .app-bar { padding-top: 8px; padding-bottom: 8px; }
  .brand-logo { height: 42px; }
  .start-visual { min-height: calc(100dvh - var(--header-height) - (var(--page-space) * 2)); }
  .start-copy h1 { font-size: clamp(48px, 4.6vw, 62px); }
  .start-copy > p { margin-top: 18px; font-size: clamp(17px, 1.3vw, 20px); }
  .audience-scene { height: 190px; margin-top: 22px; }
  .speech-bubble-teal { width: 74px; height: 48px; }
  .speech-bubble-orange { width: 58px; height: 49px; }
  .start-form { padding: 30px; }
  .field { gap: 10px; }
  .code-input-shell { min-height: 62px; }
  .button-primary { min-height: 56px; }
  .summary-card { min-height: 78px; padding-top: 10px; padding-bottom: 10px; }
  .stage { height: calc(100dvh - var(--header-height) - (var(--page-space) * 2) - 78px - clamp(14px, 1.2vw, 22px)); min-height: 0; padding: 24px 28px; }
  .lobby-title { margin-bottom: 20px; font-size: clamp(32px, 3.2vw, 48px); }
  .lobby-join-card { min-height: 246px; padding: 20px; }
  .lobby-code-digit { height: clamp(70px, 11vh, 90px); font-size: clamp(48px, 4vw, 68px); }
  .lobby-qr-image { max-height: 164px; }
  .participant-pill { min-height: 44px; margin-top: 18px; padding-top: 7px; padding-bottom: 7px; }
  .stage-lead { margin-top: 16px; }
  .question-heading { margin-top: 8px; margin-bottom: 18px; font-size: clamp(32px, 3vw, 46px); }
  .answer-card { min-height: clamp(92px, 12vh, 112px); }
  .answer-letter { width: clamp(48px, 3.7vw, 58px); }
  .results-layout { gap: 24px; }
  .result-question { margin: 12px 0 16px; min-height: auto; padding: 0; font-size: clamp(27px, 2.5vw, 38px); }
  .result-grid .answer-card { min-height: 62px; }
  .leaderboard-list { margin-top: 12px; }
  .final-layout { gap: 26px; }
  .celebration-kicker { margin-bottom: 6px; }
  .celebration-hero h2 { font-size: clamp(40px, 3.4vw, 52px); }
  .celebration-copy { margin-top: 8px; }
  .celebration-art { min-height: 190px; }
  .final-leaderboard { padding: 18px 20px; }
  .podium { min-height: 154px; margin-top: 12px; }
  .podium-card { padding-top: 10px; padding-bottom: 10px; }
  .podium-avatar { width: 50px; }
  .podium-card[data-rank="1"] .podium-avatar { width: 60px; }
  .podium-card strong { margin-top: 10px; }
  .ranking-table { margin-top: 10px; }
}

@media (max-width: 900px) {
  html,
  body { min-width: 320px; }
  :root { --header-height: 66px; --page-space: 16px; }
  .app-bar { padding: 9px 16px; }
  .brand-logo { width: 116px; height: 40px; }
  .brand-divider,
  .product-label,
  .connection-status,
  .display-creator-link { display: none; }
  .sound-control { padding: 8px; }
  .sound-control-label { display: none; }
  .button-quiet { padding: 8px 12px; font-size: 13px; }
  .start-screen { min-height: auto; grid-template-columns: 1fr; gap: 32px; padding: 36px 0 64px; }
  .start-visual { min-height: auto; }
  .start-copy h1 { font-size: clamp(44px, 10vw, 66px); }
  .audience-scene { width: min(560px, 92%); height: 230px; margin: 36px auto 0; }
  .start-form { width: 100%; justify-self: stretch; }
  .display-screen { gap: 14px; }
  .session-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage { height: auto; min-height: auto; padding: 24px 18px; }
  .lobby-join-options { grid-template-columns: 1fr; max-width: 650px; }
  .lobby-join-card { min-height: 220px; }
  .lobby-join-card-scan { min-height: 275px; }
  .lobby-qr-image { max-height: 190px; }
  #stage-content,
  .lobby-stage,
  .question-stage,
  .results-layout,
  .final-layout { min-height: 520px; }
  .question-corner { position: static; margin-top: 18px; justify-content: space-between; }
  .question-heading { min-height: auto; padding-right: 0; margin: 24px 0; }
  .stage.ordering-stage-active { padding-block: 24px; }
  .ordering-stage-adaptive { display: block; min-height: 0; }
  .ordering-stage-adaptive .question-heading { min-height: auto; margin: 24px 0; }
  .ordering-stage-adaptive .ordering-grid { height: auto; grid-template-rows: none; }
  .ordering-stage-adaptive .answer-card { min-height: 64px; }
  .answer-grid { grid-template-columns: 1fr; }
  .results-layout,
  .final-layout { grid-template-columns: 1fr; }
  .leaderboard-list { max-height: 440px; }
  .celebration-hero { min-height: 580px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
