:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --surface: rgba(255, 255, 255, 0.9);
  --line: rgba(23, 32, 51, 0.1);
  --accent: #ea580c;
  --accent-soft: rgba(234, 88, 12, 0.1);
  --success: #087f5b;
}

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

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, rgba(251, 146, 60, 0.22), transparent 30%),
    radial-gradient(circle at 85% 90%, rgba(99, 102, 241, 0.17), transparent 32%),
    linear-gradient(145deg, #f8fafc, #e2e8f0);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, a {
  font: inherit;
}

.shell {
  width: min(680px, 100%);
  margin: 0 auto;
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 8px 10px 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-size: 13px;
  backdrop-filter: blur(12px);
}

.connection-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.connection-dot.online {
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.connection-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-name {
  max-width: 190px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button,
.login-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}

.text-button {
  padding: 7px 11px;
  background: transparent;
  color: var(--muted);
}

.login-button {
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 650;
}

.hero {
  padding: 54px 18px 28px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1, h2, p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 7vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.description {
  max-width: 540px;
  margin: 14px auto 0;
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-wrap;
}

.panel,
.option-card,
.submit-panel,
.metrics {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.empty-state {
  padding: 48px 24px;
  border-radius: 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 12px 0 8px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.empty-icon {
  font-size: 34px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 18px;
  border-radius: 20px;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px;
}

.metric + .metric {
  border-left: 1px solid var(--line);
}

.metric strong {
  font-size: 24px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.notice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 18px;
  padding: 15px 18px;
  border-radius: 16px;
  font-size: 13px;
}

.notice.success {
  border: 1px solid rgba(8, 127, 91, 0.2);
  background: rgba(16, 185, 129, 0.1);
  color: #08634a;
}

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

.option-card {
  position: relative;
  width: 100%;
  padding: 20px 22px;
  border-radius: 20px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.option-card:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.12);
}

.option-card.selected,
.option-card.voted-for {
  border-color: var(--option-color, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--option-color, var(--accent)) 18%, transparent),
    0 16px 45px rgba(15, 23, 42, 0.09);
}

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

.option-card.locked:not(.voted-for) {
  opacity: 0.62;
}

.option-heading,
.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.option-name {
  font-size: 17px;
  font-weight: 720;
}

.option-count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.option-count strong {
  color: var(--ink);
  font-size: 20px;
}

.option-note {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.progress-row {
  gap: 10px;
}

.progress-track {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9edf3;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--option-color, var(--accent));
  transition: width 400ms ease;
}

.percentage {
  width: 44px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}

.checkmark {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  color: transparent;
  font-size: 13px;
}

.selected .checkmark,
.voted-for .checkmark {
  border-color: var(--option-color, var(--accent));
  background: var(--option-color, var(--accent));
  color: #fff;
}

.submit-panel {
  margin-top: 20px;
  padding: 20px;
  border-radius: 20px;
}

.privacy-note {
  padding: 15px 16px;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.55;
}

.privacy-note p {
  margin: 4px 0 0;
}

.selection-hint {
  margin: 16px 0 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.primary-button {
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #f97316, #c2410c);
  color: #fff;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 9px 25px rgba(234, 88, 12, 0.28);
}

.primary-button:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

.message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 17px;
  border-radius: 13px;
  background: #172033;
  color: #fff;
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.25);
  font-size: 13px;
}

.message.error {
  background: #991b1b;
}

[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  body {
    padding: 14px;
  }

  .account-bar {
    align-items: flex-start;
    border-radius: 18px;
  }

  .account-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .account-name {
    max-width: 120px;
  }

  .hero {
    padding-top: 42px;
  }

  .option-card {
    padding: 18px;
  }
}
