:root {
  color-scheme: light;
  --ink: #141b29;
  --muted: #5f6c7b;
  --paper: #fff7e8;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --line: rgba(255, 255, 255, 0.68);
  --blue: #2563eb;
  --blue-deep: #1742a0;
  --green: #12805c;
  --pink: #d9467d;
  --coral: #ff6b6b;
  --yellow: #f4b942;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(20, 27, 41, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 247, 232, 0.94), rgba(233, 248, 242, 0.94), rgba(234, 240, 255, 0.94), rgba(255, 236, 243, 0.94));
  background-size: 180% 180%;
  color: var(--ink);
  animation: background-drift 16s ease-in-out infinite;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  cursor: pointer;
  min-height: 46px;
  padding: 0 16px;
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover {
  border-color: rgba(37, 99, 235, 0.44);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0) scale(0.99);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 3px;
}

button.primary {
  width: 100%;
  border: 0;
  background: linear-gradient(90deg, var(--blue), #6d5df6, var(--pink));
  color: #fff;
  box-shadow: 0 18px 38px rgba(217, 70, 125, 0.22);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(95, 108, 123, 0.28);
  border-radius: 8px;
  min-height: 50px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus {
  border-color: var(--blue);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

label {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 7px;
}

.shell {
  width: min(940px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero {
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  padding: 28px 0;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.55rem, 9vw, 5.1rem);
  line-height: 0.96;
}

.policy-page h1 {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 8vw, 4rem);
  line-height: 1;
}

.policy-page h2 {
  margin: 20px 0 8px;
}

.policy-page p {
  color: #2f3a48;
  line-height: 1.6;
}

.lede {
  max-width: 650px;
  margin: 16px 0 0;
  color: #2f3a48;
  font-size: 1.08rem;
  line-height: 1.55;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--pink);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 520px;
  margin-top: 18px;
}

.trust-strip span,
.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(20, 27, 41, 0.08);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 9px 12px;
  text-align: center;
}

.status {
  color: var(--muted);
  white-space: nowrap;
}

.status.online {
  color: var(--green);
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.panel::before,
.prompt::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(37, 99, 235, 0.42), rgba(217, 70, 125, 0.34));
  pointer-events: none;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.tab.active {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(234, 240, 255, 0.82);
  color: var(--blue-deep);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.13);
}

.field {
  margin-bottom: 15px;
}

.policy-box {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 12px 28px rgba(20, 27, 41, 0.07);
  margin-bottom: 16px;
  padding: 14px;
}

.policy-box p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.45;
  margin: 8px 0 0;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
}

.check-row input {
  flex: 0 0 auto;
  min-height: 18px;
  width: 18px;
  margin-top: 2px;
}

.policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.policy-links a {
  color: var(--blue-deep);
  font-size: 0.86rem;
  font-weight: 900;
}

.room-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid rgba(95, 108, 123, 0.16);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.room-bar h2 {
  margin: 0;
  font-size: 1.7rem;
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(20, 27, 41, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  animation: card-pop 300ms cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
}

.player:hover {
  transform: translateY(-1px);
}

.player.current-player {
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(234, 240, 255, 0.76);
}

.player strong,
.player small {
  display: block;
}

.player small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  margin-top: 3px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.badge {
  border-radius: 999px;
  background: rgba(20, 27, 41, 0.08);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 950;
  padding: 4px 7px;
  text-transform: uppercase;
}

.badge.you {
  background: rgba(37, 99, 235, 0.14);
  color: var(--blue-deep);
}

.badge.host {
  background: rgba(244, 185, 66, 0.28);
  color: #7a4d00;
}

.badge.muted {
  color: var(--muted);
}

.mini-action {
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.stage {
  display: grid;
  gap: 14px;
}

.stage-section {
  display: grid;
  gap: 14px;
}

.prompt {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(244, 185, 66, 0.34);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--ink), #233251 56%, #472b55);
  color: #fff;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(20, 27, 41, 0.22);
  animation: prompt-lift 520ms cubic-bezier(0.18, 0.9, 0.22, 1) both;
}

.prompt h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--yellow);
}

.prompt p {
  margin: 0;
  font-size: clamp(1.34rem, 3.2vw, 1.8rem);
  line-height: 1.18;
  font-weight: 950;
}

.prompt-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: #060914;
  margin: 16px 0 0;
  animation: media-in 420ms ease 120ms both;
}

.youtube-media {
  border: 0;
  min-height: 200px;
}

.youtube-embed-page {
  min-height: 100vh;
  margin: 0;
  background: #060914;
}

.youtube-embed-player {
  display: block;
  width: 100%;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #060914;
}

.youtube-embed-error {
  margin: 0;
  padding: 18px;
  color: #fff;
  font-weight: 800;
}

.youtube-placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 18px;
}

.youtube-placeholder button {
  max-width: 360px;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.youtube-placeholder button small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.media-unavailable {
  margin-top: 14px !important;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem !important;
}

img.prompt-media {
  aspect-ratio: 3 / 2;
}

.prompt .blank-sentence {
  border: 1px solid rgba(244, 185, 66, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 14px;
  padding: 12px;
}

.blank-sentence strong {
  color: var(--yellow);
}

.answer-grid {
  display: grid;
  gap: 10px;
}

.lobby-note {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 10px 26px rgba(20, 27, 41, 0.07);
  padding: 14px;
}

.lobby-note strong,
.lobby-note small {
  display: block;
}

.lobby-note small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
  margin-top: 5px;
}

.answer-card {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  min-height: 74px;
  padding: 15px;
  box-shadow: 0 12px 30px rgba(20, 27, 41, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  animation: card-pop 340ms cubic-bezier(0.2, 0.9, 0.25, 1.1) both;
}

.answer-card:hover {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.answer-card > button {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  min-height: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-weight: 950;
}

.answer-card > button:hover {
  box-shadow: none;
  transform: none;
}

.answer-card > button[data-report],
.answer-card > button[data-hide] {
  width: auto;
  min-height: 34px;
  border: 1px solid rgba(95, 108, 123, 0.2);
  border-radius: 8px;
  margin-top: 10px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.answer-card.winner {
  border-color: rgba(18, 128, 92, 0.48);
  background: rgba(234, 248, 241, 0.9);
  box-shadow: 0 16px 34px rgba(18, 128, 92, 0.14);
}

.answer-card small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 850;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

[data-tone][aria-pressed="true"] {
  border-color: rgba(37, 99, 235, 0.56);
  background: rgba(234, 240, 255, 0.9);
  color: var(--blue-deep);
}

.error {
  min-height: 24px;
  color: var(--danger);
  font-weight: 900;
}

@keyframes background-drift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes prompt-lift {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes media-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 28px, 940px);
    padding-top: 18px;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 220px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 13vw, 4.4rem);
  }

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .room-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .room-actions {
    justify-content: stretch;
  }

  .room-actions button {
    flex: 1 1 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
