@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Space+Grotesk:wght@400;600;700&display=swap");

:root {
  --bg-paper: #fefdf6;
  --ink: #121212;
  --teal: #0f766e;
  --gold: #e7a817;
  --tomato: #cf4e35;
  --slate: #2d3748;
  --card: #fffdf2;
  --soft-shadow: 0 14px 35px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(15, 118, 110, 0.16), transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(231, 168, 23, 0.2), transparent 36%),
    linear-gradient(135deg, #fffef8, #f7f4e8);
}

.shell {
  width: min(1200px, 94vw);
  margin: 0 auto;
  padding: 1.4rem 0 2.2rem;
}

.screen-page .shell {
  width: min(1800px, 98vw);
  min-height: 100vh;
  padding: 0.7rem 0 0.9rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.title {
  font-size: clamp(2rem, 4.3vw, 4rem);
}

.badge {
  font-weight: 700;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  background: #ffffffb8;
  border: 2px solid #ffffff;
}

.layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1rem;
}

.screen-page .layout {
  min-height: calc(100vh - 130px);
  grid-template-columns: 1.95fr 0.7fr;
}

.card {
  background: var(--card);
  border: 2px solid #f3efe0;
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
  padding: 1rem;
}

.screen-page .layout > .card,
.screen-page .layout > aside.card {
  height: 100%;
}

.prompt {
  font-size: clamp(1.3rem, 2.4vw, 2.1rem);
  line-height: 1.2;
  margin-bottom: 0.8rem;
}

.screen-page .prompt {
  font-size: clamp(2.6rem, 5.2vw, 4.8rem);
  line-height: 1.02;
  margin-bottom: 1rem;
}

.screen-page #questionMeta,
.screen-page #answerCount {
  font-size: clamp(1.2rem, 1.6vw, 1.9rem);
}

.screen-page #choices .choice {
  font-size: clamp(1.4rem, 1.9vw, 2.1rem);
  padding: 1.2rem;
}

.choice-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice {
  border: 2px solid #d8d2be;
  border-radius: 12px;
  padding: 0.9rem;
  font-weight: 600;
  background: #fff;
}

.choice.selected {
  border-color: var(--gold);
  background: #fff3c8;
}

.choice.correct {
  border-color: var(--teal);
  background: #dbf2ef;
}

.choice.wrong {
  border-color: var(--tomato);
  background: #fbe1dc;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

button {
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 0.7rem 1.1rem;
  transition: filter 0.18s ease;
}

button:hover {
  filter: brightness(1.04);
}

.choice,
.choice:hover,
.choice:active {
  transform: none;
  filter: none;
  transition: none;
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}

.btn-gold {
  background: var(--gold);
  color: #1f1300;
}

.btn-slate {
  background: var(--slate);
  color: #fff;
}

.btn-tomato {
  background: var(--tomato);
  color: #fff;
}

.player-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.player-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #5a5340;
  padding: 0 0.2rem;
}

.player-list-header span:nth-child(2),
.player-list-header span:nth-child(3) {
  text-align: right;
}

.screen-page .player-list {
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.player-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #ece6d4;
  padding: 0.6rem 0.7rem;
}

.player-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-current,
.player-total {
  text-align: right;
  font-weight: 700;
}

.player-total {
  color: #635634;
}

.screen-side {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.screen-board {
  display: grid;
  gap: 0.6rem;
}

.qr-wrap {
  display: grid;
  place-items: center;
  gap: 0.5rem;
}

.qr-wrap img {
  width: min(320px, 100%);
  border-radius: 16px;
  border: 8px solid #fff;
  box-shadow: var(--soft-shadow);
}

body.round-active .screen-side > hr {
  display: none;
}

body.round-active .screen-join {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 170px;
  padding: 0.55rem;
  border-radius: 12px;
  background: #fffef8;
  border: 2px solid #ece6d4;
  box-shadow: var(--soft-shadow);
  z-index: 10;
}

body.round-active .screen-join h2 {
  font-size: 1.2rem;
  text-align: center;
}

body.round-active .screen-join .qr-wrap {
  gap: 0.3rem;
}

body.round-active .screen-join .qr-wrap img {
  width: 124px;
  border-width: 4px;
  border-radius: 10px;
}

body.round-active .screen-join #joinUrl {
  display: none;
}

.subtle {
  margin: 0;
  color: #4a4a4a;
}

.join-shell {
  width: min(580px, 94vw);
  margin: 0 auto;
  padding: 1.5rem 0;
}

.pulse-in {
  animation: pulseIn 420ms ease;
}

@keyframes pulseIn {
  from {
    transform: scale(0.97);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .screen-page .layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  body.round-active .screen-join {
    position: static;
    width: auto;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  body.round-active .screen-join #joinUrl {
    display: block;
  }

  body.round-active .screen-side > hr {
    display: block;
  }
}
