:root {
  color-scheme: light dark;
  --bg: #f4f2ec;
  --bg-accent: #d9e6df;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #10161d;
  --muted: #5f6b78;
  --border: rgba(16, 22, 29, 0.12);
  --shadow: 0 24px 80px rgba(31, 44, 59, 0.14);
  --accent: #2f7d6f;
  --accent-strong: #215b51;
  --accent-soft: #d9f0ea;
  --danger: #bd5b3b;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 125, 111, 0.2), transparent 30%),
    radial-gradient(circle at top right, rgba(189, 91, 59, 0.14), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, #f8f6f1 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(16, 22, 29, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 22, 29, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 92%);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero-card,
.poll-card,
.info-card,
.result-card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 24px;
  padding: 28px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 125, 111, 0.18), transparent 68%);
  pointer-events: none;
}

.hero-copy,
.status-panel {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-strong);
}

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

h1 {
  margin-bottom: 14px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
  max-width: 10ch;
}

.lede {
  max-width: 56ch;
  margin-bottom: 24px;
  font-size: 1.03rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.discord-button,
.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease,
    color 160ms ease, border-color 160ms ease;
}

.discord-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  font-weight: 700;
  box-shadow: 0 16px 28px rgba(47, 125, 111, 0.2);
}

.discord-button {
  background: var(--accent);
  color: #fff;
}

.discord-button:hover,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.discord-button:hover {
  background: var(--accent-strong);
}

.primary-button {
  background: var(--text);
  color: #fff;
}

.primary-button:disabled {
  cursor: not-allowed;
  transform: none;
  background: rgba(16, 22, 29, 0.3);
  box-shadow: none;
}

.ghost-button {
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
}

.discord-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.discord-icon svg {
  width: 100%;
  height: 100%;
}

.helper-text {
  margin-bottom: 0;
  max-width: 56ch;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--muted);
}

.helper-text a {
  color: var(--accent-strong);
  font-weight: 700;
}

.status-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
  border-radius: calc(var(--radius-xl) - 6px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(217, 230, 223, 0.54));
  border: 1px solid rgba(33, 91, 81, 0.14);
}

.status-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(189, 91, 59, 0.14);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(16, 22, 29, 0.08);
}

.avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-name {
  margin-bottom: 2px;
  font-weight: 800;
}

.user-meta {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.callout {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(16, 22, 29, 0.05);
  color: var(--text);
}

.callout p {
  margin-bottom: 0;
  line-height: 1.6;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  margin-top: 24px;
}

.poll-card,
.info-card,
.result-card {
  border-radius: var(--radius-xl);
}

.poll-card {
  padding: 28px;
}

.section-heading h2,
.section-heading h3 {
  margin-bottom: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  letter-spacing: -0.04em;
}

.section-heading h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.compact {
  margin-bottom: 14px;
}

.vote-form {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

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

.vote-option {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(16, 22, 29, 0.12);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease,
    box-shadow 160ms ease;
}

.vote-option:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 125, 111, 0.34);
  box-shadow: 0 14px 26px rgba(31, 44, 59, 0.08);
}

.vote-option input {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.vote-option strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.vote-option small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.vote-option:has(input:checked) {
  border-color: rgba(47, 125, 111, 0.55);
  background: linear-gradient(180deg, rgba(217, 240, 234, 0.9), rgba(255, 255, 255, 0.88));
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.vote-hint {
  margin-bottom: 0;
  color: var(--muted);
}

.side-stack {
  display: grid;
  gap: 24px;
}

.info-card,
.result-card {
  padding: 22px;
}

.steps {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.results-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(16, 22, 29, 0.08);
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 700;
}

.result-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 22, 29, 0.08);
}

.result-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #6aa88d);
}

.result-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.admin-shell {
  display: grid;
  gap: 24px;
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 22, 29, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.admin-field {
  display: grid;
  gap: 6px;
}

.admin-field span {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
}

.admin-field input {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(16, 22, 29, 0.2);
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
}

.admin-field.compact span {
  font-size: 0.78rem;
}

.admin-key-box {
  display: grid;
  gap: 8px;
}

.admin-key-box input {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(16, 22, 29, 0.2);
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
}

.admin-history {
  padding: 22px;
}

.admin-history-list {
  display: grid;
  gap: 14px;
}

.history-card {
  border: 1px solid rgba(16, 22, 29, 0.12);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.75);
}

.history-card h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.history-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1218;
    --bg-accent: #122019;
    --surface: rgba(17, 24, 34, 0.82);
    --surface-strong: #101722;
    --text: #eaf0f8;
    --muted: #9ca9bb;
    --border: rgba(216, 228, 245, 0.16);
    --shadow: 0 26px 90px rgba(0, 0, 0, 0.48);
    --accent: #46a892;
    --accent-strong: #72cab7;
    --accent-soft: #193830;
    --danger: #f08f75;
  }

  body {
    background:
      radial-gradient(circle at top left, rgba(70, 168, 146, 0.2), transparent 34%),
      radial-gradient(circle at top right, rgba(240, 143, 117, 0.16), transparent 28%),
      linear-gradient(180deg, #0d1218 0%, #121a24 100%);
  }

  body::before {
    background-image: linear-gradient(rgba(234, 240, 248, 0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(234, 240, 248, 0.04) 1px, transparent 1px);
  }

  .hero-card,
  .poll-card,
  .info-card,
  .result-card {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow);
  }

  .status-panel {
    background: linear-gradient(180deg, rgba(17, 24, 34, 0.9), rgba(18, 32, 25, 0.58));
    border-color: rgba(114, 202, 183, 0.24);
  }

  .user-card,
  .result-item,
  .admin-row,
  .history-card {
    background: rgba(16, 23, 34, 0.82);
    border-color: rgba(216, 228, 245, 0.14);
  }

  .callout {
    background: rgba(234, 240, 248, 0.08);
  }

  .ghost-button {
    background: rgba(16, 23, 34, 0.86);
    border-color: rgba(216, 228, 245, 0.24);
    color: var(--text);
  }

  .ghost-button:hover {
    background: rgba(23, 33, 47, 0.96);
    border-color: rgba(114, 202, 183, 0.44);
  }

  .primary-button {
    background: linear-gradient(135deg, #293849, #1f2a38);
    color: #f4f7fb;
  }

  .primary-button:disabled {
    background: rgba(234, 240, 248, 0.2);
  }

  .vote-option {
    background: rgba(16, 23, 34, 0.84);
    border-color: rgba(216, 228, 245, 0.16);
  }

  .vote-option:hover {
    border-color: rgba(114, 202, 183, 0.44);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  }

  .vote-option:has(input:checked) {
    border-color: rgba(114, 202, 183, 0.7);
    background: linear-gradient(180deg, rgba(25, 56, 48, 0.9), rgba(16, 23, 34, 0.94));
  }

  .result-bar {
    background: rgba(234, 240, 248, 0.14);
  }

  .result-fill {
    background: linear-gradient(90deg, var(--accent), #8ad7c3);
  }

  .admin-row,
  .history-card {
    border-color: rgba(216, 228, 245, 0.16);
  }

  .admin-field input,
  .admin-key-box input {
    background: rgba(12, 18, 27, 0.94);
    color: var(--text);
    border-color: rgba(216, 228, 245, 0.24);
  }

  .admin-field input::placeholder,
  .admin-key-box input::placeholder {
    color: #7f8ea3;
  }

  .history-card ul,
  .steps,
  .user-meta,
  .result-note,
  .vote-hint,
  .helper-text,
  .admin-field span {
    color: var(--muted);
  }
}

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

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

  .admin-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1160px);
    padding: 10px 0 24px;
  }

  .hero-card,
  .poll-card,
  .info-card,
  .result-card {
    border-radius: 22px;
  }

  .hero-card,
  .poll-card,
  .info-card,
  .result-card,
  .status-panel {
    padding: 18px;
  }

  .form-footer,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .discord-button,
  .ghost-button,
  .primary-button {
    width: 100%;
  }
}
