@import url("https://fonts.googleapis.com/css2?family=Pretendard:wght@400;500;700&display=swap");

:root {
  --bg-color: #0f172a;
  --card-color: #1e293b;
  --accent-color: #38bdf8;
  --accent-strong: #0ea5e9;
  --text-color: #f8fafc;
  --muted-color: #94a3b8;
  --danger-color: #f97316;
  --success-color: #34d399;
  --meh-color: #a78bfa;
  --border-color: rgba(148, 163, 184, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: radial-gradient(circle at top, #1f2937 0, var(--bg-color) 60%);
  color: var(--text-color);
  min-height: 100vh;
}

a {
  color: var(--accent-color);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
}

.header h1 {
  margin: 0;
  font-size: 28px;
}

.header p {
  margin: 4px 0 0;
  color: var(--muted-color);
  max-width: 420px;
  line-height: 1.4;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.controls select {
  padding: 8px 12px;
  background: var(--card-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
}

.main {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.current-topic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.topic-card,
.chart-card,
.map-section,
.archive-section {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.4);
}

.topic-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-color);
  font-weight: 600;
  font-size: 14px;
}

.vote-count {
  font-size: 14px;
  color: var(--muted-color);
}

.topic-headline {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.3;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-color);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topic-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.topic-image-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.12);
}

.topic-image-frame.hidden {
  display: none;
}

.topic-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topic-summary {
  margin: 0 0 20px;
  color: var(--muted-color);
  line-height: 1.6;
}

.topic-timer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.timer-label {
  font-size: 14px;
  color: var(--muted-color);
}

.timer-value {
  font-family: "SFMono-Regular", "JetBrains Mono", monospace;
  font-size: 20px;
  letter-spacing: 1px;
}

.topic-actions {
  display: flex;
  gap: 12px;
}

.vote-button {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(56, 189, 248, 0.12);
  color: var(--text-color);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
  position: relative;
  overflow: hidden;
}

.vote-button[data-choice="kill"] {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.25);
}

.vote-button[data-choice="save"] {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.25);
}

.vote-button[data-choice="meh"] {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.25);
}

.vote-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
}

.vote-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  background: rgba(56, 189, 248, 0.35);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.vote-button.animate-pop {
  animation: vote-pop 0.24s ease;
}

.vote-button.animate-pop::after {
  animation: vote-ripple 0.42s ease;
}

@keyframes vote-pop {
  0% {
    transform: scale(1);
  }
  60% {
    transform: scale(1.08);
  }
  85% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes vote-ripple {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0.45;
  }
  70% {
    opacity: 0.2;
  }
  100% {
    transform: translate(-50%, -50%) scale(8);
    opacity: 0;
  }
}

.chart-card h3,
.map-section h3,
.archive-section h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.choice-breakdown {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted-color);
  font-size: 14px;
  flex-wrap: wrap;
}

.map-wrapper {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  min-height: 320px;
  background: rgba(15, 23, 42, 0.3);
}

#mapContainer {
  width: 100%;
  height: 360px;
}

.map-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  color: var(--muted-color);
  font-size: 15px;
  transition: opacity 0.25s ease;
}

.map-status.hidden {
  opacity: 0;
  pointer-events: none;
}

.map-description {
  margin-top: 12px;
  color: var(--muted-color);
  font-size: 14px;
  line-height: 1.5;
}

.archive-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.archive-image {
  position: relative;
  margin: 0 0 12px;
  width: 100%;
  padding-top: 56.25%;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.12);
}

.archive-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.toast-container {
  margin-top: 12px;
  min-height: 24px;
}

.toast-message {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(30, 64, 175, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--text-color);
  font-size: 14px;
  max-width: 100%;
  word-break: keep-all;
}

.toast-message.hidden {
  display: none;
}

