:root {
  color-scheme: dark;
  --bg: #030303;
  --surface: rgba(10, 10, 11, 0.84);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f5f5f0;
  --muted: #a6a6a0;
  --dim: #6d6d68;
  --signal: #e9ff70;
  --good: #67ff93;
  --bad: #ff5c7a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(115deg, rgba(233, 255, 112, 0.08), transparent 28rem),
    linear-gradient(245deg, rgba(255, 255, 255, 0.06), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}

.game-page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 0 64px;
}

.game-page::after {
  position: fixed;
  right: max(24px, 8vw);
  bottom: 52px;
  width: min(34vw, 420px);
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.intro {
  display: grid;
  justify-items: center;
  padding: 32px 0 42px;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 42px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
}

.brand-mark {
  width: 17px;
  height: 17px;
  border: 2px solid var(--text);
  border-radius: 50%;
  box-shadow: inset 6px 0 0 var(--signal);
}

h1, h2 {
  margin: 0;
  font-weight: 880;
  line-height: 0.86;
  letter-spacing: 0;
}

h1 { font-size: clamp(54px, 11vw, 132px); }
h2 { font-size: clamp(42px, 7vw, 86px); }

.lede {
  max-width: 720px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.22;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 70%),
    var(--surface);
  padding: clamp(20px, 4vw, 34px);
}

.setup-form, .players-list, .game-panel, .leaderboard-panel {
  display: grid;
  gap: 18px;
}

.field-row, .players-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label { display: grid; gap: 8px; }

label span, .tools-kicker, .game-topline, .conversation-meta {
  color: var(--signal);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 14px;
}

input:focus { border-color: rgba(233, 255, 112, 0.58); }

.status {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  padding: 0 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 780;
  white-space: nowrap;
}

.button-light {
  border: 1px solid #eff2d6;
  background: #f5f7e9;
  color: #11120e;
}

.button:disabled, .option-button:disabled {
  cursor: default;
  opacity: 0.82;
}

.game-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.conversation-card, .answer-panel, .result-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.conversation-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.conversation-log {
  display: grid;
  gap: 12px;
  padding: clamp(16px, 3vw, 24px);
}

.message {
  display: grid;
  max-width: 84%;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  padding: 13px 15px;
}

.message:nth-child(even) {
  justify-self: end;
  background: rgba(233, 255, 112, 0.08);
}

.message strong {
  color: var(--signal);
  font-size: 12px;
  text-transform: uppercase;
}

.message p {
  margin: 0;
  color: var(--text);
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 760;
  line-height: 1.18;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.answer-panel {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 24px);
}

.tools-kicker { margin: 0; }

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-button {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  cursor: pointer;
  padding: 18px;
  font: inherit;
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 820;
  line-height: 1.08;
  text-align: left;
  overflow-wrap: anywhere;
  hyphens: auto;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.option-button:hover {
  transform: translateY(-2px);
  border-color: rgba(233, 255, 112, 0.52);
  background: rgba(233, 255, 112, 0.08);
}

.option-button.correct {
  border-color: rgba(103, 255, 147, 0.7);
  background: rgba(103, 255, 147, 0.18);
  color: var(--good);
}

.option-button.wrong {
  border-color: rgba(255, 92, 122, 0.62);
  background: rgba(255, 92, 122, 0.12);
  color: var(--bad);
}

.result-card {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 24px);
}

.result-card p:last-of-type {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.35;
}

.leaderboard {
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 16px;
}

.leaderboard-row strong {
  overflow-wrap: anywhere;
  font-size: 20px;
}

.leaderboard-row span:first-child,
.leaderboard-row span:last-child {
  color: var(--signal);
  font-weight: 860;
}

.leaderboard-row.winner {
  border-color: rgba(233, 255, 112, 0.68);
  box-shadow: 0 0 24px rgba(233, 255, 112, 0.12);
}

@media (max-width: 720px) {
  .game-page {
    width: min(100% - 24px, 1120px);
    padding-bottom: 40px;
  }

  .field-row, .players-list, .options-grid {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 100%;
  }

  .conversation-meta, .game-topline {
    flex-direction: column;
    gap: 6px;
  }
}
