:root {
  color-scheme: dark;
  --quiz-font-scale: 1.14;
  --bg: #07070c;
  --bg-soft: #11101a;
  --panel: rgba(14, 13, 24, 0.78);
  --panel-soft: rgba(255, 255, 255, 0.075);
  --text: #fff8ec;
  --muted: #c7bfd8;
  --dim: #9188a8;
  --line: rgba(255, 255, 255, 0.18);
  --accent: #ff3d8d;
  --accent-2: #19d8d2;
  --accent-3: #ffd84a;
  --danger: #ff776d;
  --success: #37e78e;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --glow-cyan: 0 0 34px rgba(25, 216, 210, 0.28);
  --glow-pink: 0 0 34px rgba(255, 61, 141, 0.24);
  --slide-pad-x: clamp(28px, 5.6vw, 86px);
  --slide-pad-y: clamp(28px, 5vh, 64px);
  --slide-pad-bottom: clamp(44px, 6vh, 74px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

html {
  background: var(--bg);
  font-size: calc(16px * var(--quiz-font-scale));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 42%, rgba(0, 0, 0, 0.44)),
    linear-gradient(112deg, rgba(255, 61, 141, 0.2), transparent 30%),
    linear-gradient(248deg, rgba(25, 216, 210, 0.18), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: geometricPrecision;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(106deg, transparent 0 13%, rgba(25, 216, 210, 0.13) 13.15% 13.65%, transparent 13.8% 100%),
    linear-gradient(72deg, transparent 0 24%, rgba(255, 216, 74, 0.13) 24.1% 24.55%, transparent 24.8% 100%),
    linear-gradient(256deg, transparent 0 18%, rgba(255, 61, 141, 0.12) 18.1% 18.55%, transparent 18.8% 100%),
    repeating-linear-gradient(90deg, transparent 0 84px, rgba(255, 255, 255, 0.045) 84px 85px);
  opacity: 0.88;
}

body::after {
  top: auto;
  height: 30vh;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.58)),
    repeating-linear-gradient(90deg, rgba(255, 216, 74, 0.12) 0 2px, transparent 2px 92px);
  clip-path: polygon(0 34%, 100% 0, 100% 100%, 0 100%);
  opacity: 0.48;
}

button,
summary {
  font: inherit;
}

button {
  letter-spacing: 0;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent-3);
  outline-offset: 4px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

[hidden] {
  display: none !important;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100%;
  isolation: isolate;
}

.slide {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  padding: var(--slide-pad-y) var(--slide-pad-x) var(--slide-pad-bottom);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 22px;
  isolation: isolate;
}

.slide::before {
  content: "";
  position: absolute;
  inset: clamp(10px, 1.8vmin, 24px);
  z-index: 0;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent, rgba(25, 216, 210, 0.58), transparent) top / 100% 2px no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 216, 74, 0.46), transparent) bottom / 100% 2px no-repeat;
  pointer-events: none;
}

.slide::after {
  content: "";
  position: absolute;
  left: var(--slide-pad-x);
  right: var(--slide-pad-x);
  bottom: calc(var(--slide-pad-bottom) - 20px);
  z-index: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent-3), var(--accent), transparent);
  opacity: 0.74;
  pointer-events: none;
}

.topline,
.bottomline {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topline > *,
.bottomline > * {
  min-width: 0;
}

.round-tag {
  display: block;
  max-width: min(78vw, 980px);
  overflow: hidden;
  color: var(--accent-3);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}

.stage {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: min(1240px, 100%);
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
}

.round-stage,
.question-stage,
.preflight-stage,
.start-stage,
.intermission-stage,
.final-stage {
  display: grid;
  align-content: center;
  gap: 28px;
  min-width: 0;
  min-height: 0;
}

.round-stage,
.preflight-stage,
.start-stage,
.intermission-stage,
.final-stage {
  justify-items: start;
}

.round-number,
.question-label,
.preflight-kicker,
.start-kicker,
.intermission-kicker,
.final-kicker {
  margin: 0;
  color: var(--accent-2);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: var(--glow-cyan);
}

.round-title,
.preflight-title,
.start-title,
.intermission-title,
.final-title {
  margin: 0;
  max-width: 1080px;
  font-size: 5.5rem;
  font-weight: 950;
  line-height: 0.94;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
  text-shadow:
    0 10px 38px rgba(0, 0, 0, 0.42),
    var(--glow-pink);
}

.round-count,
.preflight-copy,
.start-copy,
.intermission-copy,
.final-copy,
.preflight-subtitle,
.start-subtitle,
.intermission-subtitle,
.final-subtitle {
  margin: 0;
  max-width: 860px;
  color: var(--muted);
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.question-stage {
  gap: 30px;
}

.prompt {
  margin: 0;
  max-width: 1120px;
  font-weight: 950;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-shadow: 0 10px 42px rgba(0, 0, 0, 0.42);
  text-wrap: balance;
}

.prompt-emoji {
  max-width: 10ch;
  font-size: 6.4rem;
  line-height: 1.08;
  overflow-wrap: normal;
  word-break: keep-all;
}

.prompt-text {
  max-width: 14ch;
  font-size: 5rem;
  line-height: 1.02;
}

.prompt-quote {
  max-width: 18ch;
  font-size: 4.05rem;
  line-height: 1.08;
}

.prompt-audio {
  max-width: 14ch;
  font-size: 4.7rem;
  line-height: 1.02;
}

.answer {
  display: grid;
  gap: 10px;
  width: min(900px, 100%);
  padding: 26px 30px;
  border: 1px solid rgba(255, 216, 74, 0.34);
  border-left: 8px solid var(--accent-3);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 216, 74, 0.16), rgba(255, 61, 141, 0.08)),
    rgba(12, 10, 18, 0.8);
  box-shadow: var(--shadow);
  animation: answer-in 180ms ease-out both;
}

.answer-label {
  color: var(--accent-3);
  font-size: 0.95rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.answer-title {
  font-size: 2.6rem;
  font-weight: 950;
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.answer-artist {
  color: var(--muted);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.intro-playback {
  width: fit-content;
  max-width: 100%;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border: 1px solid rgba(25, 216, 210, 0.54);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 216, 210, 0.2), rgba(255, 216, 74, 0.11)),
    rgba(7, 7, 12, 0.72);
  color: var(--text);
  box-shadow: var(--glow-cyan);
  animation: playback-in 150ms ease-out both;
}

.intro-playback-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.intro-playback-icon span {
  width: 5px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 16px rgba(25, 216, 210, 0.52);
  animation: equalizer 720ms ease-in-out infinite;
}

.intro-playback-icon span:nth-child(2) {
  animation-delay: 90ms;
}

.intro-playback-icon span:nth-child(3) {
  animation-delay: 180ms;
}

.intro-playback-icon span:nth-child(4) {
  animation-delay: 270ms;
}

.intro-playback-text {
  font-size: 1.35rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.audio-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 54px;
}

.stage-button,
.control-button,
.start-button,
.preflight-button,
.primary-action {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.stage-button,
.start-button,
.preflight-button,
.primary-action {
  min-height: 54px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 950;
  letter-spacing: 0;
}

.stage-button:hover,
.control-button:hover,
.start-button:hover,
.preflight-button:hover,
.primary-action:hover {
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.18);
}

.stage-button:active,
.control-button:active,
.start-button:active,
.preflight-button:active,
.primary-action:active {
  transform: translateY(1px);
}

.primary,
.start-button,
.preflight-button,
.primary-action {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-3), #ff8d3d);
  color: #130d08;
  box-shadow: 0 12px 30px rgba(255, 216, 74, 0.2);
}

.primary:hover,
.start-button:hover,
.preflight-button:hover,
.primary-action:hover {
  background: linear-gradient(135deg, #ffe371, #ff9e55);
}

.status {
  min-height: 1.35em;
  max-width: min(72vw, 840px);
  overflow: hidden;
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status:empty {
  visibility: hidden;
}

.slide[data-slide-type="preflight"],
.slide.preflight,
.slide.preflight-screen,
.slide.start-screen,
.slide[data-slide-type="start"] {
  grid-template-rows: minmax(0, 1fr);
}

.slide[data-slide-type="preflight"] .stage,
.slide.preflight .stage,
.slide.preflight-screen .stage,
.slide.start-screen .stage,
.slide[data-slide-type="start"] .stage,
.preflight-stage,
.start-stage {
  width: min(980px, 100%);
}

.preflight-status,
.audio-status,
.check-status,
.start-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(25, 216, 210, 0.32);
  border-radius: 8px;
  background: rgba(25, 216, 210, 0.1);
  color: var(--accent-2);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.preflight-status.is-ready,
.preflight-status.is-ok,
.audio-status.is-ready,
.check-status.is-ready,
.status-ready,
.status-ok {
  border-color: rgba(55, 231, 142, 0.38);
  background: rgba(55, 231, 142, 0.1);
  color: var(--success);
}

.preflight-status.is-error,
.preflight-status.is-failed,
.audio-status.is-error,
.check-status.is-error,
.status-error,
.status-failed {
  border-color: rgba(255, 119, 109, 0.46);
  background: rgba(255, 119, 109, 0.11);
  color: var(--danger);
}

.preflight-list,
.audio-check-list,
.check-list {
  width: min(760px, 100%);
  max-height: 34vh;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.preflight-errors {
  width: min(860px, 100%);
  max-height: 34vh;
  padding: 18px 20px;
  overflow: auto;
  border: 1px solid rgba(255, 119, 109, 0.44);
  border-radius: 8px;
  background: rgba(255, 119, 109, 0.11);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.42;
}

.preflight-errors p {
  margin: 0 0 10px;
  color: var(--danger);
  font-weight: 900;
}

.preflight-errors ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.2em;
}

.slide[data-slide-type="intermission"] .stage,
.slide.intermission .stage,
.slide.intermission-screen .stage,
.slide[data-slide-type="final"] .stage,
.slide.final .stage,
.slide.final-screen .stage,
.intermission-stage,
.final-stage {
  width: min(1080px, 100%);
}

.intermission-title,
.final-title {
  color: var(--text);
}

.final-kicker {
  color: var(--accent-3);
  text-shadow: 0 0 30px rgba(255, 216, 74, 0.28);
}

.controls {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 30;
  max-width: calc(100vw - 24px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(6, 6, 12, 0.5);
  box-shadow: var(--shadow);
  opacity: 0.18;
  transform: translate(-50%, calc(100% - 16px));
  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 180ms ease,
    background 180ms ease;
  backdrop-filter: blur(14px);
}

.controls:hover,
.controls:focus-within,
.controls.is-visible,
.controls--visible {
  background: rgba(6, 6, 12, 0.84);
  opacity: 1;
  transform: translateX(-50%);
}

.controls.is-hidden,
.controls.hidden,
.controls--hidden,
.controls.is-public-hidden,
.controls[aria-hidden="true"],
.controls[data-hidden="true"],
.controls[hidden],
.app.controls-hidden .controls,
.app.is-controls-hidden .controls,
.app.hidden-controls .controls,
.app.is-public .controls,
.app.app--public .controls,
body.controls-hidden .controls,
body.is-controls-hidden .controls,
body.hidden-controls .controls,
body.public-mode .controls,
body.is-public .controls {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 20px));
}

.control-button {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.25rem;
  font-weight: 950;
}

.control-button.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-2), #78ffe5);
  color: #051312;
}

.help-button,
.help-toggle,
.help-trigger,
button[data-action="toggle-help"],
button[popovertarget="help-overlay"]:not(.help-close) {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 50;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(7, 7, 12, 0.6);
  color: var(--text);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 950;
  line-height: 1;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
  backdrop-filter: blur(12px);
}

.help-button:hover,
.help-toggle:hover,
.help-trigger:hover,
button[data-action="toggle-help"]:hover,
button[popovertarget="help-overlay"]:not(.help-close):hover {
  border-color: rgba(255, 216, 74, 0.62);
  background: rgba(255, 216, 74, 0.16);
  color: var(--accent-3);
}

.help-button:active,
.help-toggle:active,
.help-trigger:active,
button[data-action="toggle-help"]:active,
button[popovertarget="help-overlay"]:not(.help-close):active {
  transform: translateY(1px);
}

.help-overlay,
.keyboard-help,
.help-popover,
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  margin: 0;
  padding: 80px var(--slide-pad-x) 24px;
  display: grid;
  place-items: start end;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
  backdrop-filter: blur(5px);
}

.help-overlay[popover]:not(:popover-open) {
  display: none;
}

.help-overlay.is-open,
.help-overlay.is-visible,
.help-overlay[open],
.keyboard-help.is-open,
.help-popover.is-open,
.help-modal.is-open,
.help-widget[open] .help-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.help-overlay:popover-open {
  display: grid;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.help-overlay.is-hidden,
.help-overlay.hidden,
.help-overlay[aria-hidden="true"],
.keyboard-help.is-hidden,
.help-popover.is-hidden,
.help-modal.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.help-overlay::backdrop {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
}

.help-card,
.help-panel,
.help-content,
.keyboard-help-panel {
  width: min(520px, calc(100vw - 40px));
  max-height: min(70vh, 620px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(25, 216, 210, 0.14), rgba(255, 61, 141, 0.1)),
    rgba(8, 8, 15, 0.94);
  box-shadow: var(--shadow);
  animation: panel-in 170ms ease-out both;
}

.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.help-title {
  margin: 0;
  color: var(--accent-3);
  font-size: 1.35rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.help-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
}

.help-list,
.shortcut-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.font-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 216, 74, 0.26);
  border-radius: 8px;
  background: rgba(255, 216, 74, 0.08);
}

.font-controls-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.font-controls-title {
  color: var(--accent-3);
  font-size: 0.95rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.font-controls-value {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
}

.font-controls-buttons {
  display: flex;
  gap: 8px;
}

.font-button {
  min-width: 52px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 950;
  letter-spacing: 0;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.font-button:hover {
  border-color: rgba(255, 216, 74, 0.62);
  background: rgba(255, 216, 74, 0.16);
}

.font-button:active {
  transform: translateY(1px);
}

.help-row,
.shortcut-row {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.help-row dt,
.help-row dd,
.shortcut-row dt,
.shortcut-row dd {
  margin: 0;
  min-width: 0;
}

.help-row dt,
.shortcut-row dt {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.help-row dd,
.shortcut-row dd {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

kbd,
.help-key,
.shortcut-key {
  min-width: 34px;
  min-height: 32px;
  padding: 5px 10px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-color: rgba(255, 255, 255, 0.38);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.22);
}

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

@keyframes answer-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes playback-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes equalizer {
  0%,
  100% {
    height: 10px;
    opacity: 0.7;
  }

  50% {
    height: 30px;
    opacity: 1;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@supports selector(:has(*)) {
  .question-stage:has(.answer) {
    gap: 18px;
  }

  .question-stage:has(.answer) .prompt-text,
  .question-stage:has(.answer) .prompt-audio {
    font-size: 4.45rem;
  }

  .question-stage:has(.answer) .prompt-quote {
    font-size: 3.55rem;
  }

  .question-stage:has(.answer) .prompt-emoji {
    font-size: 5.7rem;
  }
}

@media (max-height: 820px) {
  :root {
    --slide-pad-y: 34px;
    --slide-pad-bottom: 54px;
  }

  .slide {
    gap: 16px;
  }

  .round-stage,
  .question-stage,
  .preflight-stage,
  .start-stage,
  .intermission-stage,
  .final-stage {
    gap: 20px;
  }

  .round-title,
  .preflight-title,
  .start-title,
  .intermission-title,
  .final-title {
    font-size: 4.6rem;
  }

  .prompt-emoji {
    font-size: 5.2rem;
  }

  .prompt-text,
  .prompt-audio {
    font-size: 4rem;
  }

  .prompt-quote {
    font-size: 3.2rem;
  }

  .answer {
    padding: 20px 24px;
  }

  .answer-title {
    font-size: 2.25rem;
  }
}

@media (max-height: 680px) {
  :root {
    --slide-pad-y: 24px;
    --slide-pad-bottom: 42px;
  }

  .topline,
  .bottomline {
    font-size: 0.82rem;
  }

  .round-title,
  .preflight-title,
  .start-title,
  .intermission-title,
  .final-title {
    font-size: 3.6rem;
  }

  .prompt-emoji {
    font-size: 4.4rem;
  }

  .prompt-text,
  .prompt-audio {
    font-size: 3.35rem;
  }

  .prompt-quote {
    font-size: 2.65rem;
  }

  .answer-title {
    font-size: 1.95rem;
  }

  .answer-artist,
  .intro-playback-text,
  .round-count,
  .preflight-copy,
  .start-copy,
  .intermission-copy,
  .final-copy,
  .preflight-subtitle,
  .start-subtitle,
  .intermission-subtitle,
  .final-subtitle {
    font-size: 1.05rem;
  }
}

@media (max-width: 900px) {
  :root {
    --slide-pad-x: 28px;
    --slide-pad-y: 44px;
    --slide-pad-bottom: 62px;
  }

  .slide {
    gap: 16px;
  }

  .topline,
  .bottomline {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    font-size: 0.86rem;
  }

  .round-tag {
    white-space: normal;
  }

  .round-title,
  .preflight-title,
  .start-title,
  .intermission-title,
  .final-title {
    font-size: 3.35rem;
  }

  .prompt-emoji {
    font-size: 4.35rem;
  }

  .prompt-text,
  .prompt-audio {
    font-size: 3.35rem;
  }

  .prompt-quote {
    font-size: 2.7rem;
  }

  .answer {
    padding: 20px;
  }

  .answer-title {
    font-size: 2rem;
  }

  .controls {
    gap: 6px;
    padding: 6px;
  }

  .control-button {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .help-button,
  .help-toggle,
  .help-trigger,
  button[data-action="toggle-help"],
  button[popovertarget="help-overlay"]:not(.help-close) {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 40px;
    height: 40px;
  }

  .help-overlay,
  .keyboard-help,
  .help-popover,
  .help-modal {
    padding: 66px 16px 16px;
    place-items: start center;
  }

  .help-card,
  .help-panel,
  .help-content,
  .keyboard-help-panel {
    padding: 20px;
  }

  .help-row,
  .shortcut-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .font-controls {
    grid-template-columns: 1fr;
  }

  .font-controls-buttons {
    width: 100%;
  }

  .font-button {
    flex: 1 1 0;
  }
}

@media (max-width: 700px), (max-height: 620px) {
  .bottomline {
    display: none;
  }

  .controls:not(:hover):not(:focus-within) {
    opacity: 0.1;
  }
}

@media (hover: none) {
  .controls {
    opacity: 0.34;
  }
}

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