:root {
  --bg: #08090d;
  --surface: #11131b;
  --surface-2: #171a24;
  --border: #252a38;
  --border-gold: rgba(243, 184, 68, 0.35);

  /* Colors sampled from Overtime Roleplay Remastered Logo */
  --gold: #f3b844;
  --gold-hover: #ffd06b;
  --amber: #e86f2c;
  --cyan: #2ca3fa;
  --violet: #8b46d6;
  --danger: #ef4444;
  --success: #22c55e;

  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(44, 163, 250, 0.08), transparent 36%),
    radial-gradient(circle at 88% 4%, rgba(243, 184, 68, 0.09), transparent 38%);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

/* GPU-friendly view entrance animation */
@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view:not(.hidden) {
  animation: viewEnter 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .view:not(.hidden) {
    animation: none;
  }
  .btn,
  .q-card,
  .mc-option,
  .radio-card,
  .progress-fill {
    transition: none !important;
  }
  .btn-primary:hover,
  .q-card:hover {
    transform: none !important;
  }
}

/* Topbar & Progress Bar */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 9, 13, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 16px;
}

.progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--gold), var(--amber));
  transition: width 0.22s ease-out;
  will-change: width;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-main {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--text);
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.user-pill img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
  will-change: transform;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 0.96rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--amber));
  color: #090a0f;
  font-weight: 700;
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-gold);
  color: var(--gold);
}

.btn-outline:hover {
  background: rgba(243, 184, 68, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Main & Alerts */
.main-wrap {
  flex: 1;
  padding-top: 40px;
  padding-bottom: 64px;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  animation: viewEnter 0.2s ease-out both;
}

.alert.success {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
}

.alert.error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

/* Hero / Home */
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 36px;
  align-items: start;
}

.eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 10px;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  line-height: 1.2;
  margin-bottom: 20px;
  color: #fff;
}

.hero-paragraphs p {
  color: #d1d5db;
  margin-bottom: 16px;
  font-size: 1rem;
}

.hero-cta-row {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.helper-note {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px;
}

.logo-showcase {
  display: flex;
  justify-content: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.logo-showcase img {
  max-width: 220px;
  height: auto;
  border-radius: 8px;
}

.rules-box h3 {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 12px;
}

.rules-box ul {
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.rules-box li {
  margin-bottom: 8px;
}

/* Panels & Forms */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.panel-narrow {
  max-width: 680px;
  margin: 0 auto;
}

.center-text {
  text-align: center;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.section-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.65rem;
}

.voter-status-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.draft-status {
  font-size: 0.78rem;
  color: var(--cyan);
  background: rgba(44, 163, 250, 0.1);
  border: 1px solid rgba(44, 163, 250, 0.28);
  padding: 5px 10px;
  border-radius: 6px;
}

.voter-tag {
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: transform 0.18s ease, border-color 0.18s ease;
  will-change: transform;
}

.q-card:hover {
  transform: translateY(-2px);
  border-color: rgba(243, 184, 68, 0.28);
}

.q-card-accent {
  border-left: 3px solid var(--gold);
}

.q-meta {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.q-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.q-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.req {
  color: var(--amber);
}

.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  transition: border-color 0.15s ease;
}

.input:focus {
  outline: none;
  border-color: var(--gold);
}

.textarea {
  resize: vertical;
  min-height: 90px;
}

.mc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mc-option,
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mc-option:hover,
.radio-card:hover {
  border-color: var(--border-gold);
  background: rgba(243, 184, 68, 0.04);
}

.mc-option input,
.radio-card input {
  margin-top: 4px;
  accent-color: var(--gold);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-card strong {
  display: block;
  font-size: 0.94rem;
}

.radio-card span {
  display: block;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 12px;
  flex-wrap: wrap;
}

.footer-meta-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Badges & Summary */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.badge-gold {
  background: rgba(243, 184, 68, 0.15);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.badge-cyan {
  background: rgba(44, 163, 250, 0.14);
  color: var(--cyan);
  border: 1px solid rgba(44, 163, 250, 0.35);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.lead-text {
  font-size: 1.02rem;
  color: #e5e7eb;
  margin: 12px 0 20px;
}

.submission-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.submission-summary span {
  color: var(--text-muted);
  margin-right: 6px;
}

.notice-box {
  background: rgba(44, 163, 250, 0.08);
  border: 1px solid rgba(44, 163, 250, 0.35);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.resubmit-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 4px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
}

.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.pill-count {
  background: var(--amber);
  color: #08090d;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
}

.filter-bar {
  margin-bottom: 16px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: var(--border-gold);
  color: var(--text);
}

.filter-pill.active {
  background: rgba(243, 184, 68, 0.14);
  border-color: var(--gold);
  color: var(--gold);
}

.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  animation: viewEnter 0.2s ease-out both;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.answer-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

.answer-item small {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  margin-bottom: 3px;
}

.answer-item p {
  font-size: 0.92rem;
  color: #f3f4f6;
  white-space: pre-wrap;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  font-size: 0.84rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}