* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f6f7fb;
  color: #1f1f1f;
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

.hero {
  background: linear-gradient(135deg, #111827, #374151);
  color: white;
  padding: 60px 20px;
}

.tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 10px;
}

.subtitle {
  max-width: 700px;
  font-size: 18px;
  line-height: 1.7;
}

main {
  padding: 30px 0 60px;
}

.card {
  background: white;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.section-intro {
  margin-bottom: 20px;
}

.interactive-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.district-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.small-note {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
}

.district-btn {
  border: none;
  background: #e0e7ff;
  color: #1e3a8a;
  padding: 16px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s ease;
}

.district-btn:hover {
  background: #c7d2fe;
  transform: translateY(-2px);
}

.info-panel {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  min-height: 260px;
}

.info-panel h3 {
  margin-top: 0;
}

@media (max-width: 800px) {

  .grid-two,
  .interactive-layout {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 34px;
  }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.summary-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
}

.summary-box h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.summary-box ul {
  padding-left: 18px;
  margin: 0;
}

.summary-box li {
  margin-bottom: 8px;
}

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

.sources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.source-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  height: 100%;
}

.source-box h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.source-box a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}

.source-box a:hover {
  text-decoration: underline;
}

.reading-list {
  padding-left: 18px;
  margin: 0;
}

.reading-list li,
.source-box li {
  margin-bottom: 8px;
}

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

.map-placeholder {
  width: 100%;
  height: 320px;
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  border-radius: 18px;
  position: relative;
  margin-top: 16px;
  overflow: hidden;
}

.map-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-overlay p {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
}

.map-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

.map-card {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

#map {
  width: 100%;
  min-height: 460px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
}

#map svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-legend {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
}

.legend-scale {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.legend-gradient {
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(to right, #dbeafe, #93c5fd, #60a5fa, #2563eb, #1e3a8a);
}

.district-shape {
  stroke: #ffffff;
  stroke-width: 2;
  cursor: pointer;
  transition: opacity 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
}

.district-shape:hover {
  opacity: 0.9;
  stroke: #111827;
}

.district-shape.active {
  stroke: #111827;
  stroke-width: 3;
}

.map-label {
  font-size: 12px;
  font-weight: 700;
  fill: #111827;
  text-anchor: middle;
  pointer-events: none;
}

.district-btn.active-btn {
  background: #1e3a8a;
  color: white;
}

@media (max-width: 800px) {
  .map-card {
    grid-template-columns: 1fr;
  }
}

.map-wrapper {
  position: relative;
}

#map-tooltip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  background: rgba(17, 24, 39, 0.95);
  color: white;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  max-width: 220px;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.district-shape {
  stroke: #ffffff;
  stroke-width: 2;
  cursor: pointer;
  transition: opacity 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease, filter 0.2s ease;
}

.district-shape:hover {
  opacity: 0.95;
  stroke: #111827;
  stroke-width: 3;
  filter: brightness(1.03);
}

.site-footer {
  margin-top: 60px;
  background: #111827;
  color: #e5e7eb;
  padding: 40px 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.footer-left h3 {
  margin: 0 0 10px 0;
  color: white;
}

.footer-left p {
  max-width: 420px;
  font-size: 14px;
  color: #cbd5e1;
}

.footer-right {
  text-align: right;
  font-size: 14px;
  color: #cbd5e1;
}

.footer-note {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.8;
}

@media (max-width: 800px) {
  .footer-content {
    flex-direction: column;
    text-align: left;
  }

  .footer-right {
    text-align: left;
  }
}

.footer-hero {
  margin-top: 60px;
  background: linear-gradient(135deg, #111827, #374151);
  color: white;
  padding: 80px 20px;
}

.footer-hero-content {
  text-align: center;
  max-width: 800px;
}

.footer-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  margin-bottom: 18px;
}

.footer-hero h2 {
  font-size: 34px;
  margin-bottom: 16px;
}

.footer-subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 28px;
}

.footer-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  opacity: 0.8;
}

.footer-meta span {
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 999px;
}

@media (max-width: 800px) {
  .footer-hero h2 {
    font-size: 26px;
  }

  .footer-subtitle {
    font-size: 16px;
  }
}

.takeaways-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.takeaway-box {
  border-radius: 18px;
  padding: 22px;
  border: 1px solid transparent;
}

.takeaway-box h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 20px;
}

.takeaway-box p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
}

.takeaway-blue {
  background: #e0f2fe;
  border-color: #bae6fd;
}

.takeaway-gold {
  background: #fef3c7;
  border-color: #fde68a;
}

.takeaway-green {
  background: #dcfce7;
  border-color: #bbf7d0;
}

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

.factors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.factor-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 20px;
  border-radius: 18px;
  cursor: pointer;
  transition: 0.2s ease;
}

.factor-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.factor-info {
  margin-top: 20px;
  padding: 18px;
  background: #eef2ff;
  border-radius: 14px;
}

.summary-blue {
  background: #e0f2fe;
  border-color: #bae6fd;
}

.summary-gold {
  background: #fef3c7;
  border-color: #fde68a;
}

.summary-purple {
  background: #ede9fe;
  border-color: #ddd6fe;
}

.summary-box h3 {
  font-size: 20px;
}

.summary-box {
  transition: 0.2s ease;
}

.summary-box:hover {
  transform: translateY(-3px);
}

.bar-chart-card {
  margin-top: 18px;
  padding: 20px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bar-row {
  display: grid;
  grid-template-columns: 60px 1fr 80px;
  align-items: center;
  gap: 14px;
}

.bar-label {
  font-weight: 700;
  color: #111827;
}

.bar-track {
  width: 100%;
  height: 18px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.bar-value {
  font-size: 14px;
  color: #374151;
  text-align: right;
}

.bar-blue {
  background: #60a5fa;
}

.bar-gold {
  background: #fbbf24;
}

.bar-purple {
  background: #a78bfa;
}

.bar-green {
  background: #34d399;
}

.bar-pink {
  background: #f472b6;
}

@media (max-width: 700px) {
  .bar-row {
    grid-template-columns: 50px 1fr 70px;
    gap: 10px;
  }

  .bar-value {
    font-size: 13px;
  }
}

.card-emphasis {
  background: linear-gradient(135deg,
      #e0e7ff,
      #f1f5f9);
  border: 1px solid #c7d2fe;
}

.card-emphasis .factor-box {
  background: white;
  border: 1px solid #e0e7ff;
}

.card-emphasis {
  position: relative;
}

.card-emphasis::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 6px;
  width: 100%;
  background: linear-gradient(to right, #2563eb, #6366f1);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

.card-emphasis .interactive-layout {
  background: white;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #e0e7ff;
}

.card-emphasis .district-btn {
  background: #e0f2fe;
}

.card-emphasis .district-btn:hover {
  background: #bfdbfe;
}

.reflection-section .small-note {
  max-width: 850px;
}

.matching-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 24px;
}

.matching-column h3 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 18px;
}

.matching-column {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #dbe4ff;
  border-radius: 18px;
  padding: 18px;
}

.match-card {
  width: 100%;
  text-align: left;
  border: 1px solid #d1d5db;
  background: white;
  color: #111827;
  padding: 16px 18px;
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.match-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.match-card.selected {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.match-card.correct {
  border-color: #10b981;
  background: #dcfce7;
  color: #065f46;
  cursor: default;
}

.match-card.wrong {
  border-color: #ef4444;
  background: #fee2e2;
}

.match-card.matched {
  opacity: 0.85;
}

.match-status {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #eef2ff;
  color: #312e81;
  font-weight: 500;
}

.match-reflection {
  margin-top: 18px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid #c7d2fe;
}

.match-reflection h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.hidden {
  display: none;
}

@media (max-width: 800px) {
  .matching-board {
    grid-template-columns: 1fr;
  }
}