/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1c2333;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #e63946;
  --accent2: #ff6b6b;
  --green: #3fb950;
  --gold: #d4a017;
  --blue: #58a6ff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #1a0a0a 0%, var(--bg) 100%);
}
.header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
}
.header h1 .suit { opacity: 0.6; }
.header .tagline {
  color: var(--text-dim);
  font-size: 1rem;
  margin-top: 0.3rem;
}
.header .subtitle {
  color: var(--gold);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-weight: 600;
}

/* ── Container ───────────────────────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ── Section ─────────────────────────────────────────────────────────────── */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title .icon { font-size: 1.3rem; }

/* ── News ────────────────────────────────────────────────────────────────── */
.news-list { list-style: none; }
.news-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.news-item:last-child { border-bottom: none; }
.news-item .title { font-weight: 600; font-size: 0.95rem; }
.news-item .meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  gap: 1rem;
}
.news-item.pinned { border-left: 3px solid var(--gold); padding-left: 0.75rem; }
.news-item.pinned .title { color: var(--gold); }
.show-more-btn {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.show-more-btn:hover { background: var(--border); }

.news-refresh {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
  text-align: right;
}
.news-empty {
  color: var(--text-dim);
  font-style: italic;
  padding: 1rem 0;
}

/* ── Slider ──────────────────────────────────────────────────────────────── */
.slider-container {
  margin: 1rem 0;
}
.slider-value {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent2);
  margin-bottom: 0.75rem;
  min-height: 2.5rem;
}
.slider-value.permanent { color: var(--accent); font-size: 1.4rem; }

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--green) 0%, var(--gold) 50%, var(--accent) 97%, #8b0000 100%);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.vote-btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 1rem auto;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background 0.2s, transform 0.1s;
}
.vote-btn:hover { background: var(--accent2); }
.vote-btn:active { transform: scale(0.98); }
.vote-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
  color: var(--text-dim);
}

.votes-remaining {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}
.votes-remaining .count { color: var(--accent2); font-weight: 700; }

/* ── Chart ───────────────────────────────────────────────────────────────── */
.chart-container {
  margin-top: 1.5rem;
  position: relative;
  height: 300px;
}
.chart-container canvas { width: 100% !important; }
.total-votes {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}
.total-votes .num { color: var(--gold); font-weight: 700; }

/* ── Map ─────────────────────────────────────────────────────────────────── */
#heatmap {
  height: 450px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 1rem;
}
.map-instructions {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}
.lodge-marker {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.error { border-color: var(--accent); color: var(--accent2); }
.toast.success { border-color: var(--green); color: var(--green); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header h1 { font-size: 1.6rem; }
  .section { padding: 1rem; }
  .slider-value { font-size: 1.4rem; }
  #heatmap { height: 350px; }
  .chart-container { height: 250px; }
}
