*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #09090b;
  --panel: #18181b;
  --panel-2: #27272a;
  --border: #3f3f46;
  --text: #fafafa;
  --muted: #a1a1aa;
  --sun: #f59e0b;
  --sun-soft: #fde68a;
  --moon: #60a5fa;
  --moon-soft: #bfdbfe;
}

body {
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 18%, rgba(245, 158, 11, 0.18), transparent 24rem),
    radial-gradient(circle at 82% 12%, rgba(96, 165, 250, 0.18), transparent 25rem),
    linear-gradient(145deg, #111827 0%, #09090b 48%, #020617 100%);
}

.back-bar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.5rem 0;
}

.back-link {
  color: var(--muted);
  display: inline-flex;
  font-size: 0.82rem;
  gap: 0.4rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.game-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.game-header {
  text-align: center;
  margin-bottom: 2rem;
}

.eyebrow {
  color: var(--moon-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.25rem, 7vw, 5rem);
  line-height: 1;
  margin-bottom: 0.85rem;
}

.intro {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.arena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.vote-card {
  min-height: 390px;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 2rem;
  position: relative;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.vote-card--sun {
  background: linear-gradient(150deg, rgba(245, 158, 11, 0.22), rgba(24, 24, 27, 0.96) 62%);
}

.vote-card--moon {
  background: linear-gradient(210deg, rgba(96, 165, 250, 0.22), rgba(24, 24, 27, 0.96) 62%);
}

.vote-card:hover:not(:disabled) {
  transform: translateY(-4px);
}

.vote-card--sun:hover:not(:disabled),
.vote-card--sun.selected {
  border-color: var(--sun);
  box-shadow: 0 22px 70px rgba(245, 158, 11, 0.2);
}

.vote-card--moon:hover:not(:disabled),
.vote-card--moon.selected {
  border-color: var(--moon);
  box-shadow: 0 22px 70px rgba(96, 165, 250, 0.2);
}

.vote-card:disabled {
  cursor: default;
}

body[data-voted="true"] .vote-card:not(.selected) {
  opacity: 0.55;
}

.orb {
  font-size: clamp(5rem, 14vw, 9rem);
  line-height: 1;
  margin-bottom: 1.2rem;
  filter: drop-shadow(0 20px 32px rgba(0, 0, 0, 0.32));
}

.orb--sun {
  animation: pulse-sun 3.2s ease-in-out infinite;
}

.orb--moon {
  animation: float-moon 4s ease-in-out infinite;
}

.choice-name {
  font-size: 1.55rem;
  font-weight: 800;
}

.choice-desc {
  color: var(--muted);
  line-height: 1.55;
  margin: 0.75rem auto 1.35rem;
  max-width: 310px;
}

.vote-action {
  align-self: center;
  border: 1px solid currentcolor;
  border-radius: 0.45rem;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.65rem 1rem;
}

.vote-card--sun .vote-action {
  color: var(--sun-soft);
}

.vote-card--moon .vote-action {
  color: var(--moon-soft);
}

.versus {
  align-self: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.results {
  background: rgba(24, 24, 27, 0.88);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-top: 1.25rem;
  padding: 1.25rem;
}

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

h2 {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

#status-text {
  color: var(--muted);
  font-size: 0.88rem;
}

.reset-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0.55rem 0.85rem;
}

.reset-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

.meter {
  background: var(--panel-2);
  border-radius: 999px;
  display: flex;
  height: 18px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.meter-fill--sun {
  background: linear-gradient(90deg, #f97316, var(--sun-soft));
}

.meter-fill--moon {
  background: linear-gradient(90deg, var(--moon-soft), #2563eb);
}

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

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
}

.stat-label,
.stat span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
}

.stat strong {
  font-size: 2rem;
  line-height: 1;
}

.stat--sun strong {
  color: var(--sun-soft);
}

.stat--moon strong {
  color: var(--moon-soft);
}

@keyframes pulse-sun {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes float-moon {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

@media (max-width: 760px) {
  .game-shell {
    padding-inline: 1rem;
  }

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

  .vote-card {
    min-height: 280px;
    padding: 1.5rem;
  }

  .versus {
    justify-self: center;
  }

  .results-header,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .results-header {
    flex-direction: column;
  }
}
