* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(160deg, #1b1440 0%, #2a1a5e 55%, #40207a 100%);
  background-attachment: fixed;
  color: #fff;
  min-height: 100vh;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px; }
.wrap.wide { max-width: 900px; }
h1 { font-size: 1.7rem; margin-bottom: 4px; }
.sub { opacity: 0.75; font-size: 0.95rem; margin-bottom: 24px; }
.btn {
  display: block; width: 100%; padding: 14px; margin: 8px 0;
  background: #ffd93d; color: #1a1a1a; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0,0,0,0.25); transition: transform 0.08s;
}
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.secondary { background: transparent; border: 2px solid #ffd93d; color: #ffd93d; box-shadow: none; }
.btn.danger { background: #ff5b6e; color: #fff; }
.btn.small { width: auto; padding: 8px 14px; font-size: 0.85rem; display: inline-block; }
input[type=text] {
  width: 100%; padding: 12px; border-radius: 10px; border: none;
  font-size: 1rem; margin: 6px 0 14px;
}
.panel { background: rgba(255,255,255,0.08); border-radius: 14px; padding: 16px; margin: 14px 0; backdrop-filter: blur(4px); }
.center { text-align: center; }
.status { font-size: 0.85rem; opacity: 0.75; margin-bottom: 10px; }
a.link { color: #ffd93d; }
.qr-box { background: #fff; padding: 16px; border-radius: 12px; display: inline-block; margin: 12px 0; }

/* category chips (host setup) */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 2px solid rgba(255,255,255,0.3);
  background: transparent; color: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.chip.on { background: #ffd93d; border-color: #ffd93d; color: #1a1a1a; }

/* timer ring */
.timer { font-size: 2rem; font-weight: 800; color: #ffd93d; margin: 6px 0; }
.timer.urgent { color: #ff5b6e; }

/* big question display (host) */
.question-big { font-size: clamp(1.4rem, 4.5vw, 2.4rem); font-weight: 700; line-height: 1.3; margin: 12px 0; }
.choice-grid-host { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.choice-host {
  border-radius: 12px; padding: 14px 12px; font-size: clamp(0.9rem, 2.5vw, 1.2rem); font-weight: 600;
  text-align: left; min-height: 56px;
}
.choice-host.dim { opacity: 0.25; }
.choice-host.correct { background: #2ec27e !important; color: #fff; opacity: 1; }
.choice-host .tag {
  display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,0.35);
  align-items: center; justify-content: center; margin-right: 8px; font-size: 0.85rem;
}

/* player answer buttons */
.choice-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 14px; margin: 8px 0; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 600; color: #fff; cursor: pointer;
  text-align: left; transition: transform 0.08s;
}
.choice-btn:active { transform: scale(0.98); }
.choice-btn:disabled { cursor: not-allowed; }
.choice-btn .tag {
  display: inline-flex; flex: none; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,0.35);
  align-items: center; justify-content: center; font-size: 0.9rem;
}
.choice-btn.picked { outline: 3px solid #fff; }
.choice-btn.correct { background: #2ec27e !important; }
.choice-btn.wrong { background: #ff5b6e !important; opacity: 0.8; }
.c-red { background: #e6394f; } .c-blue { background: #3567d6; } .c-yellow { background: #d19a10; } .c-green { background: #1f9d5b; }

/* scoreboard */
.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.score-card { background: rgba(0,0,0,0.3); border-radius: 10px; padding: 10px; text-align: center; }
.score-card .name { font-weight: 700; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-card .pts { font-size: 1.3rem; font-weight: 800; color: #ffd93d; }
.score-card.answered { outline: 2px solid rgba(255,255,255,0.6); }
.score-card.gained { outline: 2px solid #2ec27e; }
.score-card.gained .pts { color: #2ec27e; }

.log { font-size: 0.8rem; opacity: 0.7; max-height: 80px; overflow-y: auto; }
.big-num { font-size: 1.5rem; font-weight: 800; text-align: center; margin: 8px 0; }
.podium { font-size: 1.2rem; line-height: 1.9; text-align: center; }
.medal { font-size: 1.6rem; }
