:root {
  --bg: #f6f8ff;
  --panel: #ffffff;
  --text: #111a3a;
  --muted: #5f6f89;
  --line: #e3e9f5;
  --brand: #db2777;
  --brand-2: #7c3aed;
  --blue: #2563eb;
  --green: #16a34a;
  --orange: #f59e0b;
  --shadow: 0 20px 60px rgba(36, 48, 94, 0.12);
  --soft-shadow: 0 12px 32px rgba(36, 48, 94, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 84% 4%, rgba(219, 39, 119, 0.12), transparent 30%),
    linear-gradient(180deg, #fff 0%, var(--bg) 48%, #f7fbff 100%);
  overflow-x: hidden;
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.top-nav {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(227, 233, 245, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand span span { color: var(--brand); }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 10px 22px rgba(219, 39, 119, 0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 700;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.8;
}

.nav-links a:hover { color: var(--brand); opacity: 1; }

.app {
  display: grid;
  gap: 20px;
}

.hero, .panel, .question-card, .join-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  min-height: 330px;
  padding: 48px clamp(24px, 5vw, 72px);
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 52%, #fff0f7 100%);
}

.hero h1 {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 0.98;
}

.hero p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.join-box {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 60px rgba(37, 99, 235, 0.15);
}

.join-url {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--blue);
  background: #fff;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.stat span { color: var(--muted); font-size: 13px; font-weight: 700; }

.question-card, .join-card, .panel { padding: 26px; }
.question-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
}

.status-pill {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: #eff6ff;
  font-size: 13px;
  font-weight: 800;
}

.status-pill.open {
  color: var(--green);
  background: #ecfdf3;
}

.options {
  display: grid;
  gap: 12px;
}

.option, .answer-button {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  color: var(--text);
  background: #fff;
  text-align: left;
  font: inherit;
  font-weight: 800;
}

.answer-button {
  cursor: pointer;
  box-shadow: var(--soft-shadow);
}

.answer-button:hover { border-color: var(--brand); }
.answer-button.selected {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.option {
  display: grid;
  gap: 9px;
}

.bar-wrap {
  height: 16px;
  border-radius: 999px;
  background: #eef2ff;
  overflow: hidden;
}

.bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--blue), var(--brand-2));
  transition: width 240ms ease;
}

.option.correct .bar { background: linear-gradient(135deg, var(--green), #22c55e); }
.option.correct { border-color: rgba(22, 163, 74, 0.45); }
.option-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.option-top span:last-child {
  flex: 0 0 auto;
  color: var(--muted);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button.secondary, .button-link.secondary {
  color: var(--blue);
  background: #eff6ff;
}

button.neutral {
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 18px 0;
}

input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.helper {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  color: var(--muted);
}

.footer-copy { margin: 0; line-height: 1.55; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.site-footer a { color: var(--brand); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.social-icon {
  width: 21px;
  height: 21px;
  display: inline-flex;
}
.social-icon svg { width: 100%; height: 100%; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .page-shell { width: min(100vw - 20px, 100%); padding-top: 12px; }
  .top-nav {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
  }
  .brand { gap: 8px; font-size: 15px; white-space: nowrap; }
  .brand-mark { width: 30px; height: 30px; border-radius: 10px; }
  .nav-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    gap: 4px;
    font-size: clamp(11px, 3vw, 13px);
  }
  .nav-links a {
    min-width: 0;
    white-space: nowrap;
    text-align: center;
    padding: 5px 2px;
  }
  .hero, .panel, .question-card, .join-card { border-radius: 20px; }
  .hero, .question-card, .join-card, .panel { padding: 22px; }
  .hero h1 { font-size: 38px; }
  .hero p { font-size: 15px; }
  .stats, .name-row { grid-template-columns: 1fr; }
  .question-head, .site-footer { flex-direction: column; align-items: stretch; }
  .footer-links { justify-content: flex-start; }
}
