:root {
  --bg-0: #050816;
  --bg-1: #0b1224;
  --bg-2: #0f1932;
  --card: rgba(10, 18, 38, 0.78);
  --card-strong: rgba(13, 22, 46, 0.9);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f5f8ff;
  --muted: #b1bfd8;
  --accent: #7dd3fc;
  --accent-2: #facc15;
  --accent-3: #86efac;
  --danger: #fb7185;
  --warning: #fb923c;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.36);
  --radius: 28px;
  --radius-sm: 18px;
  --track: rgba(255, 255, 255, 0.08);
  --solidarity: #86efac;
  --cautious: #7dd3fc;
  --selfish: #fb7185;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 16%, rgba(122, 211, 252, 0.16), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(250, 204, 21, 0.12), transparent 23%),
    radial-gradient(circle at 50% 82%, rgba(134, 239, 172, 0.08), transparent 26%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 42%, var(--bg-2));
  overflow-x: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.03) 24%, transparent 46%),
    repeating-linear-gradient(90deg, transparent 0, transparent 124px, rgba(255,255,255,0.02) 125px, transparent 126px),
    repeating-linear-gradient(0deg, transparent 0, transparent 124px, rgba(255,255,255,0.015) 125px, transparent 126px);
  animation: gridFloat 16s linear infinite;
}

body::after {
  background:
    radial-gradient(circle at 20% 30%, rgba(125, 211, 252, 0.18), transparent 18%),
    radial-gradient(circle at 78% 26%, rgba(251, 146, 60, 0.12), transparent 16%),
    radial-gradient(circle at 62% 72%, rgba(134, 239, 172, 0.12), transparent 20%);
  filter: blur(32px);
  animation: auroraShift 10s ease-in-out infinite alternate;
}

main {
  position: relative;
  z-index: 1;
}

h1, h2, h3, p { margin-top: 0; }

.glass-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.cinematic-panel::after,
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.05) 18%, transparent 42%);
  transform: translateX(-100%);
  animation: sheen 12s linear infinite;
}

.glass-card::before { opacity: 0.3; }

.landing-shell,
.dashboard-shell,
.play-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.landing-shell { padding-top: 40px; }

.hero-panel,
.dashboard-hero {
  padding: 34px;
  margin-bottom: 22px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: center;
}

.hero-panel h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: 0.98;
  margin-bottom: 14px;
}

.hero-copy {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-orbit {
  min-height: 280px;
  position: relative;
  display: grid;
  place-items: center;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(0.2px);
  animation: floatUp 7s ease-in-out infinite alternate;
}

.orb-a {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle at 30% 30%, rgba(125, 211, 252, 0.85), rgba(125, 211, 252, 0.08));
}

.orb-b {
  width: 140px;
  height: 140px;
  top: 8%;
  left: 12%;
  background: radial-gradient(circle at 30% 30%, rgba(250, 204, 21, 0.8), rgba(250, 204, 21, 0.08));
  animation-duration: 9s;
}

.orb-c {
  width: 124px;
  height: 124px;
  right: 10%;
  bottom: 10%;
  background: radial-gradient(circle at 40% 40%, rgba(134, 239, 172, 0.7), rgba(134, 239, 172, 0.08));
  animation-duration: 8.5s;
}

.hero-stats,
.glass-subcard {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(8, 16, 34, 0.72);
  border: 1px solid rgba(255,255,255,0.09);
  display: grid;
  gap: 16px;
}

.hero-stats span,
.stat-card span,
.legend-card p,
.muted,
.timeline-item p,
.choice-card p,
.result-chip small,
.choice-footer,
.locked-banner,
.empty-state,
.headline-copy,
.helper-text {
  color: var(--muted);
}

.hero-stats strong,
.stat-card strong {
  display: block;
  font-size: 1.1rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 800;
}

.grid-two,
.grid-host-main,
.grid-play-main {
  display: grid;
  gap: 22px;
}

.grid-two,
.grid-host-main {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
}

.grid-play-main {
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
}

.form-card,
.info-strip,
.round-scene-card,
.sidebar-stack > .glass-card,
.team-table-card,
.scene-stage,
.dashboard-hero,
.ending-card {
  padding: 28px;
}

.dramatic-card {
  isolation: isolate;
}

.card-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  top: -80px;
  right: -80px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.36), transparent 70%);
  filter: blur(12px);
  z-index: 0;
}

.card-glow.warm {
  background: radial-gradient(circle, rgba(250, 204, 21, 0.28), transparent 70%);
}

.form-card > * { position: relative; z-index: 1; }

label {
  display: block;
  margin-bottom: 16px;
  font-weight: 700;
}

input, textarea, button {
  font: inherit;
}

input, textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}

input:focus, textarea:focus {
  border-color: rgba(125, 211, 252, 0.7);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.12);
}

button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 18px;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 28px rgba(0,0,0,0.24);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #a5f3fc);
  color: #07111d;
  font-weight: 900;
}

.primary-btn.alt {
  background: linear-gradient(135deg, var(--accent-2), #fde68a);
}

.secondary-btn {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.09);
}

.warning-btn {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.95), rgba(251, 191, 36, 0.95));
  color: #1c1104;
  font-weight: 900;
}

.pill-row,
.section-head,
.hero-actions,
.stats-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.section-head.spread {
  justify-content: space-between;
}

.compact-head { margin-bottom: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 0.92rem;
}

.pill.small { padding: 6px 10px; font-size: 0.76rem; }
.pill.positive { border-color: rgba(134,239,172,0.32); }
.pill.negative { border-color: rgba(251,113,133,0.35); }

.steps-list,
.compact,
.check-list {
  padding-left: 22px;
}

.steps-list li,
.compact li { margin-bottom: 10px; }

.info-strip {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  gap: 22px;
  margin-top: 22px;
}

.legend-grid,
.reveal-grid,
.choice-grid {
  display: grid;
  gap: 14px;
}

.legend-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.compact-grid { margin-top: 18px; }
.reveal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }

.legend-card,
.result-chip,
.meter-card,
.timeline-item,
.leader-row,
.team-insight-card,
.choice-card,
.locked-banner,
.waiting-box,
.narrator-block,
.hero-stats,
.glass-subcard {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 16px;
}

.legend-card span,
.choice-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  margin-bottom: 12px;
  font-size: 1.3rem;
}

.dashboard-hero,
.play-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.large-grid .stat-card { min-width: 132px; }
.stat-card {
  min-width: 110px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.pulseable {
  animation: subtlePulse 2.8s ease-in-out infinite;
}

.round-scene-card,
.scene-stage {
  min-height: 600px;
}

.narrator-block {
  margin: 18px 0;
  background: linear-gradient(135deg, rgba(125,211,252,0.12), rgba(250,204,21,0.08));
}

.narrator-block.spotlight {
  box-shadow: inset 0 0 0 1px rgba(125,211,252,0.16), 0 18px 35px rgba(0,0,0,0.22);
}

.narrator-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

.story-grid.two-up { margin-bottom: 10px; }

.choice-card {
  position: relative;
  display: grid;
  gap: 14px;
  text-align: left;
  border-radius: 24px;
  padding: 18px;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

button.choice-card {
  background: rgba(255,255,255,0.045);
}

.choice-card:hover:not(:disabled) {
  border-color: rgba(125,211,252,0.4);
  transform: translateY(-3px);
}

.choice-card.selected {
  border-color: rgba(125,211,252,0.75);
  box-shadow: 0 0 0 2px rgba(125,211,252,0.16), 0 18px 30px rgba(0,0,0,0.24);
}

.choice-card.disabled {
  opacity: 0.88;
}

.choice-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.intent-tag {
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.intent-tag.solidarity { color: var(--solidarity); }
.intent-tag.cautious { color: var(--cautious); }
.intent-tag.selfish { color: var(--selfish); }

.waiting-box,
.locked-banner {
  margin-top: 18px;
}

.locked-banner {
  background: rgba(250, 204, 21, 0.08);
}

.result-panel {
  margin-top: 18px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.result-chip {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 4px;
}

.team-insight-card {
  margin-top: 18px;
  background: linear-gradient(135deg, rgba(134,239,172,0.08), rgba(125,211,252,0.08));
}

.meters-panel,
.timeline-list,
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meter-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--track);
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.8s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 18px rgba(255,255,255,0.18);
}

.timeline-item,
.leader-row {
  display: grid;
  gap: 6px;
}

.timeline-item.mini-item { padding: 14px; }

.leader-row {
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
}

.leader-row.active {
  border-color: rgba(125,211,252,0.48);
  background: rgba(125,211,252,0.09);
}

.table-wrap { overflow-x: auto; }

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

th { color: var(--muted); }

.timer-badge {
  min-width: 104px;
  text-align: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 1.05rem;
  font-weight: 900;
}

.timer-badge.dramatic {
  animation: dramaticPulse 1.2s ease-in-out infinite;
}

.bottom-gap { margin-bottom: 8px; }

.reveal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 22, 0.62);
  backdrop-filter: blur(8px);
  z-index: 40;
}

.reveal-overlay.hidden { display: none; }
.reveal-overlay.visible .reveal-box { animation: revealPop 0.6s cubic-bezier(.18,.85,.28,1.16); }

.reveal-box {
  width: min(92vw, 560px);
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(125,211,252,0.22), rgba(15,25,50,0.98));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: var(--shadow);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 14px 16px;
  min-width: 260px;
  max-width: min(520px, calc(100vw - 28px));
  border-radius: 18px;
  background: rgba(8, 16, 34, 0.96);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 45;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error { border-color: rgba(251,113,133,0.36); }

.hidden { display: none !important; }

@keyframes gridFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}

@keyframes auroraShift {
  from { transform: translate3d(-1%, 0, 0) scale(1); }
  to { transform: translate3d(1%, -1%, 0) scale(1.06); }
}

@keyframes sheen {
  0% { transform: translateX(-120%); }
  10% { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

@keyframes floatUp {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-18px) scale(1.04); }
}

@keyframes dramaticPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(250,204,21,0); }
  50% { transform: scale(1.05); box-shadow: 0 0 24px rgba(250,204,21,0.2); }
}

@keyframes subtlePulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes revealPop {
  0% { transform: scale(0.88); opacity: 0; }
  70% { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 1120px) {
  .hero-panel,
  .grid-two,
  .grid-host-main,
  .grid-play-main,
  .info-strip,
  .story-grid,
  .legend-grid,
  .choice-grid,
  .reveal-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero,
  .play-hero {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .landing-shell,
  .dashboard-shell,
  .play-shell {
    width: min(calc(100% - 18px), 100%);
    padding-top: 20px;
  }

  .hero-panel,
  .dashboard-hero,
  .round-scene-card,
  .scene-stage,
  .sidebar-stack > .glass-card,
  .team-table-card,
  .info-strip,
  .form-card {
    padding: 22px;
  }

  .hero-panel h1 {
    font-size: 2.5rem;
  }

  .leader-row,
  .story-grid,
  .hero-actions,
  .stats-grid,
  .section-head.spread {
    grid-template-columns: 1fr;
  }
}
