@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --bg: #f5efe6;
  --ink: #1f1a16;
  --muted: #6e6258;
  --accent: #e45a2b;
  --accent-2: #f0b429;
  --card: #fffaf3;
  --line: #e1d7cc;
  --shadow: 0 24px 60px rgba(31, 26, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fffaf3 0%, #f5efe6 45%, #efe4d6 100%);
  min-height: 100vh;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.hero {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--ink);
  color: #f9efe0;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  width: fit-content;
}

.hero__title {
  font-family: "DM Serif Display", serif;
  font-size: clamp(32px, 5vw, 56px);
  margin: 0;
  letter-spacing: 0.01em;
}

.hero__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.poll {
  background: var(--card);
  border-radius: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  position: relative;
  overflow: hidden;
}

.poll::after {
  content: "";
  position: absolute;
  inset: -40% auto auto -10%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 90, 43, 0.18), transparent 70%);
  pointer-events: none;
}

.poll__header {
  display: grid;
  gap: 12px;
}

.poll__meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.poll__date {
  font-weight: 600;
  color: var(--ink);
  background: #f6e6d9;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.poll__tag {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.poll__live {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(228, 90, 43, 0.35);
  animation: pulse 2s infinite ease-in-out;
}

.poll__question {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
}

.poll__desc {
  margin: 0;
  color: var(--muted);
}

.poll__options {
  display: grid;
  gap: 16px;
}

.poll__highlight {
  border: 1px dashed #e3d2c2;
  border-radius: 18px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(228, 90, 43, 0.08), rgba(240, 180, 41, 0.12));
  display: grid;
  gap: 10px;
  position: relative;
}

.highlight__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.highlight__title {
  font-size: 20px;
  font-weight: 600;
}

.highlight__meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.highlight__bar {
  width: 100%;
  height: 8px;
  background: rgba(31, 26, 22, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.highlight__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width 600ms ease;
}

.poll__highlight {
  border: 1px dashed #e3d2c2;
  border-radius: 18px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(228, 90, 43, 0.08), rgba(240, 180, 41, 0.12));
  display: grid;
  gap: 10px;
  position: relative;
}

.highlight__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.highlight__title {
  font-size: 20px;
  font-weight: 600;
}

.highlight__meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.highlight__bar {
  width: 100%;
  height: 8px;
  background: rgba(31, 26, 22, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.highlight__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width 600ms ease;
}

.option {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: #fff;
  display: grid;
  gap: 12px;
  position: relative;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  opacity: 0;
  transform: translateY(12px);
}

.option.option--reveal {
  opacity: 1;
  transform: translateY(0);
}

.option:hover {
  transform: translateY(-2px);
  border-color: #d0c2b4;
  box-shadow: 0 12px 24px rgba(31, 26, 22, 0.08);
}

.option__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.option__label {
  font-size: 18px;
  font-weight: 600;
}

.option__vote {
  border: none;
  background: var(--ink);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.option__vote:hover {
  transform: translateY(-1px);
  background: #3b2f27;
}

.option__vote:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.option__bar {
  width: 100%;
  height: 10px;
  background: #f3ece4;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.option__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width 600ms ease;
}

.option__stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.option--selected {
  border-color: var(--accent);
  box-shadow: 0 18px 30px rgba(228, 90, 43, 0.18);
}

.poll__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.poll__stats {
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.poll__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.poll__reset,
.poll__share {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.poll__share {
  border-color: var(--ink);
  color: var(--ink);
}

.poll__share:hover {
  background: #f5e7d8;
}

.poll__reset:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.poll__toast {
  position: absolute;
  right: 24px;
  bottom: 24px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.poll__toast.poll__toast--show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 48px 18px 64px;
  }

  .poll {
    padding: 22px;
  }

  .option__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .option__vote {
    width: 100%;
  }

  .poll__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .poll__actions {
    width: 100%;
  }

  .poll__actions button {
    width: 100%;
  }
}

/* App shell + routed pages */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(255, 250, 243, 0.95);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.logo {
  font-family: "DM Serif Display", serif;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
}

.beta {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 18px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.nav a:hover {
  color: var(--ink);
}

.app-main {
  flex: 1;
}

.app-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.app-footer {
  padding: 24px 32px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.page-hero h1,
.page-header h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin: 6px 0 10px;
}

.page-hero .eyebrow,
.page-header .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
}

.sub {
  color: var(--muted);
  margin: 0 0 18px;
}

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

.hero-metrics {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 6px;
  box-shadow: 0 8px 18px rgba(31, 26, 22, 0.08);
}

.metric-card span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 22px;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.btn.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
}

.section {
  margin-top: 40px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.category-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.category-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
}

.category-card .meta {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 13px;
  gap: 4px;
}

.card-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.highlight-card {
  border-radius: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #fff4e8, #fff);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.highlight-card.alt {
  background: linear-gradient(135deg, #f8f2ff, #fff);
}

.highlight-card .eyebrow {
  margin: 0;
}

.highlight-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

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

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.filter-pill.active {
  background: #f4e4d6;
  color: var(--ink);
  border-color: #e0cbb8;
}

.tab {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--muted);
}

.tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.poll-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 16px;
}

.poll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.poll-card-simple {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 12px;
}

.poll-card-simple__actions {
  display: flex;
  justify-content: flex-end;
}

.poll-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.poll-card__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f4ece2;
  color: var(--muted);
}

.badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0efe9;
  color: var(--muted);
}

.badge--hot {
  background: #ffe1d4;
  color: #b23a12;
}

.badge--closed {
  background: #eee;
  color: #7a7a7a;
}

.poll-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.poll-detail {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.poll-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.poll-question {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

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

.option-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.option-info {
  display: grid;
  gap: 4px;
}

.option-progress {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.option-progress__bar {
  width: 220px;
  height: 8px;
  background: #f3ece4;
  border-radius: 999px;
  overflow: hidden;
}

.option-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
}

.poll-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.poll-actions--voted::before {
  content: "투표 완료";
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  margin-right: 8px;
}

.login-hint {
  font-size: 12px;
  color: var(--muted);
  align-self: center;
}

.poll-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  max-width: 640px;
}

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

.span-2 {
  grid-column: span 2;
}


.option-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn.small {
  padding: 6px 10px;
  font-size: 12px;
}


.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}

.field {
  display: grid;
  gap: 8px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-family: inherit;
}

.select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
}

.inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.admin-seed {
  margin-top: 28px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.seed-status {
  font-size: 13px;
  color: var(--muted);
}

.policy {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-top: 18px;
}

.notice {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 26, 22, 0.45);
}

.modal__content {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  width: min(420px, 92vw);
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 840px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .nav {
    flex-wrap: wrap;
  }

  .poll-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Auth Styles */
#auth-container {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
}

.auth-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 150ms ease;
}

.auth-btn:hover {
  border-color: var(--ink);
  background: #fff;
  transform: translateY(-1px);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.user-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  margin-right: 4px;
}

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

.auth-name {
  font-size: 12px;
  color: var(--muted);
}

.auth-debug {
  margin: 12px auto 0;
  max-width: 1100px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: #fff7ea;
  color: var(--muted);
  font-size: 12px;
}
