/* Amar Bangladesh - Travel Tracker Modern Duolingo & 3D Map Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700;800&family=Nunito:wght@700;800;900&display=swap');

:root {
  /* Duolingo Vibrant & Travel Palette */
  --duo-green: #58cc02;
  --duo-green-dark: #46a302;
  --duo-green-light: #e7f9d8;
  --duo-emerald: #0e7552;
  --duo-emerald-dark: #074e36;
  --duo-emerald-light: #d1fae5;
  --duo-yellow: #ffc800;
  --duo-yellow-dark: #e5b300;
  --duo-blue: #1cb0f6;
  --duo-blue-dark: #1899d6;
  --duo-red: #ff4b4b;
  --duo-red-dark: #ea2b2b;

  /* Surfaces & Neutrals */
  --bg-main: #f7f9fa;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;
  --border-darker: #d1d5db;
  --text-main: #1f2937;
  --text-muted: #6b7280;

  /* 3D Map Palette */
  --map-unvisited: #e8ecef;
  --map-unvisited-hover: #dbe4ea;
  --map-visited: #10b981;
  --map-visited-hover: #059669;
  --map-3d-edge: #cbd5e1;
  --map-3d-edge-visited: #047857;
  --pin-red: #ef4444;

  --font-bangla: 'Hind Siliguri', 'Segoe UI', sans-serif;
  --font-duo: 'Nunito', 'Hind Siliguri', sans-serif;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* Night Theme / Dark Mode */
body.theme-night {
  --bg-main: #0b0f19;
  --card-bg: #131c2e;
  --border-color: #202b3f;
  --border-darker: #2d3b55;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;

  /* 3D Map in Night Mode */
  --map-unvisited: #1e293b;
  --map-unvisited-hover: #293548;
  --map-visited: #10b981;
  --map-visited-hover: #059669;
  --map-3d-edge: #0c1422;
  --map-3d-edge-visited: #064e3b;
  --pin-red: #ef4444;
}

body.theme-night .app-header {
  background-color: rgba(19, 28, 46, 0.94);
  border-bottom-color: #202b3f;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

body.theme-night .brand-title {
  color: #f8fafc;
}

body.theme-night .stat-pill {
  background: #172237;
  border-color: #26354d;
  box-shadow: 0 2px 0 #26354d;
}

body.theme-night .duo-btn-white {
  background-color: #172237;
  color: #e2e8f0;
  border-color: #26354d;
  box-shadow: 0 4px 0 #0f172a;
}
body.theme-night .duo-btn-white:hover {
  background-color: #1f2d47;
}

body.theme-night .map-showcase-card {
  background: #131c2e;
  border-color: #202b3f;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

body.theme-night .headline-title {
  color: #f8fafc;
}

body.theme-night .pct-badge {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #059669;
  box-shadow: 0 2px 0 #047857;
}

body.theme-night .duo-progress-track {
  background-color: #1e293b;
}

body.theme-night .division-quick-pills {
  border-bottom-color: #1e293b;
}

body.theme-night .div-btn {
  background: #172237;
  border-color: #26354d;
  color: #cbd5e1;
}
body.theme-night .div-btn:hover {
  background: #1e2d47;
  border-color: #10b981;
}

body.theme-night .map-viewport-wrapper {
  background: radial-gradient(circle at 50% 50%, #152033 0%, #0e1625 100%);
  border-color: #1e293b;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.theme-night .floating-btn {
  background-color: #172237;
  border-color: #26354d;
  box-shadow: 0 4px 0 #0f172a;
  color: #e2e8f0;
}

body.theme-night .panel-box {
  background: #131c2e;
  border-color: #202b3f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

body.theme-night .panel-box-title {
  color: #f8fafc;
}

body.theme-night .profile-mascot-box {
  border-color: #065f46;
  background: linear-gradient(180deg, #131c2e 0%, #0d2820 100%);
}

body.theme-night .traveler-name-edit {
  color: #f8fafc;
}

body.theme-night .traveler-rank-badge {
  color: #6ee7b7;
  background: #064e3b;
}

body.theme-night .mascot-speech-bubble {
  background: #172436;
  border-color: #059669;
  color: #a7f3d0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

body.theme-night .div-row-card {
  background: #172237;
  border-color: #26354d;
}
body.theme-night .div-row-card:hover {
  background: #1c2a44;
  border-color: #10b981;
}
body.theme-night .div-row-card.completed {
  background: #0d2a21;
  border-color: #059669;
}
body.theme-night .div-ratio-pill {
  background: #131c2e;
  border-color: #26354d;
  color: #cbd5e1;
}
body.theme-night .div-row-card.completed .div-ratio-pill {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #059669;
}
body.theme-night .div-mini-progress-track {
  background: #25334c;
}

body.theme-night .district-search-input {
  background: #172237;
  border-color: #26354d;
  color: #f8fafc;
}
body.theme-night .district-search-input:focus {
  border-color: #10b981;
}

body.theme-night .districts-found-badge {
  background: #1e2d47;
  color: #94a3b8;
}

body.theme-night .district-item-row {
  background: #172237;
  border-color: #26354d;
  color: #e2e8f0;
}
body.theme-night .district-item-row:hover {
  background: #1c2a44;
  border-color: #10b981;
}
body.theme-night .district-item-row.checked {
  background: #0d2e24;
  border-color: #059669;
  color: #a7f3d0;
}
body.theme-night .item-checkbox {
  background: #131c2e;
  border-color: #3b4d6b;
}
body.theme-night .item-division-tag {
  background: #131c2e;
  border-color: #26354d;
  color: #94a3b8;
}

body.theme-night .achievement-card {
  background: #172237;
  border-color: #26354d;
}
body.theme-night .achievement-card.unlocked {
  background: #2a2312;
  border-color: #f59e0b;
}
body.theme-night .achievement-card .ach-title {
  color: #f8fafc;
}

body.theme-night .modal-box {
  background: #131c2e;
  border-color: #26354d;
}
body.theme-night .modal-title {
  color: #f8fafc;
}

/* Night Map District Labels */
body.theme-night .district-label-text {
  fill: #94a3b8;
  stroke: #0b0f19;
  stroke-width: 2.5px;
}

body.theme-night .district-label-group.visited .district-label-text {
  fill: #ffffff;
  stroke: #022c22;
  stroke-width: 3.8px;
}

body.theme-night .district-path {
  stroke: #222f44;
}
body.theme-night .district-path.visited {
  stroke: #34d399;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-bangla);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  user-select: none;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Duolingo 3D Tactile Push-Down Buttons */
.duo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-duo);
  font-size: 14px;
  font-weight: 800;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.duo-btn:active {
  transform: translateY(3px) !important;
}

.duo-btn-green {
  background-color: var(--duo-green);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--duo-green-dark);
}
.duo-btn-green:hover {
  filter: brightness(1.06);
}
.duo-btn-green:active {
  box-shadow: 0 1px 0 var(--duo-green-dark);
}

.duo-btn-white {
  background-color: #ffffff;
  color: #374151;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 0 var(--border-color);
}
.duo-btn-white:hover {
  background-color: #f9fafb;
}
.duo-btn-white:active {
  box-shadow: 0 1px 0 var(--border-color);
}

.duo-btn-red {
  background-color: var(--duo-red);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--duo-red-dark);
}
.duo-btn-red:active {
  box-shadow: 0 1px 0 var(--duo-red-dark);
}

.duo-btn-sm {
  padding: 7px 14px;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
}

.duo-btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 0 var(--border-color);
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--border-color);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-flag-badge {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  color: #111827;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Live Duolingo Stats Bar */
.header-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f8fafc;
  border: 2px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14.5px;
  font-weight: 700;
  box-shadow: 0 2px 0 var(--border-color);
}

.stat-pill .stat-icon {
  font-size: 16px;
}

.stat-pill .stat-val {
  color: #059669;
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-tool-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-download-card {
  white-space: nowrap;
}

.btn-label-desktop {
  display: inline;
}

.btn-label-mobile {
  display: none;
}

/* Main Grid Layout: Big Map on Left, Sidebar on Right */
.app-main-grid {
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 26px;
  align-items: start;
}

@media (max-width: 1180px) {
  .app-main-grid {
    grid-template-columns: 1fr;
  }
}

/* LEFT COLUMN: Map Showcase Card */
.map-primary-column {
  width: 100%;
}

.map-showcase-card {
  background: var(--card-bg);
  border: 2.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
  padding: 26px 30px;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Poster Top Header with Optional Avatar */
.poster-identity-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
}

.poster-profile-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.poster-avatar-frame {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  border: 3.5px solid var(--duo-emerald);
  padding: 3px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.poster-avatar-pic {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
}

.poster-text-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.poster-subtitle-tag {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.poster-traveler-name {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.15;
}

body.theme-night .poster-traveler-name {
  color: #f8fafc;
}

.progress-details-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.headline-pct-tag {
  background: var(--duo-emerald-light);
  color: var(--duo-emerald-dark);
  border: 2px solid #a7f3d0;
  font-size: 17px;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 12px;
}

body.theme-night .headline-pct-tag {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #059669;
}

.travel-sub-info {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.big-ratio-box {
  display: flex;
  align-items: baseline;
  font-family: var(--font-bangla);
  line-height: 1;
}

.ratio-current {
  font-size: 48px;
  font-weight: 900;
  color: var(--duo-emerald);
}

.ratio-total {
  font-size: 30px;
  font-weight: 800;
  color: #9ca3af;
  margin-left: 2px;
}

/* Duolingo Chunky Progress Bar */
.duo-progress-track {
  width: 100%;
  height: 20px;
  background-color: #e5e7eb;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 16px;
}

.duo-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 20px;
  position: relative;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.progress-gloss-line {
  position: absolute;
  top: 2px;
  left: 6px;
  right: 6px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
}

/* Division Quick Pills */
.division-quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid #f1f5f9;
}

.div-btn {
  padding: 6px 12px;
  font-family: var(--font-bangla);
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
}

.div-btn:hover {
  border-color: #10b981;
  background: #ffffff;
}

.div-btn.active {
  background: #0e7552;
  color: #ffffff;
  border-color: #0e7552;
  box-shadow: 0 3px 0 #074731;
}

.div-mini-count {
  font-size: 11px;
  background: rgba(0,0,0,0.06);
  padding: 1px 6px;
  border-radius: 8px;
}

.div-btn.active .div-mini-count {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}

/* 3D Map Viewport Area */
.map-viewport-wrapper {
  position: relative;
  width: 100%;
  height: 740px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fdfdfc;
  border-radius: var(--radius-lg);
  border: 2px solid #f1f5f9;
  overflow: hidden;
}

#bangladesh-map-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* 3D Extruded Foundation */
.map-3d-base-group {
  pointer-events: none;
}

.district-base-slab {
  fill: var(--map-3d-edge);
  stroke: var(--map-3d-edge);
  stroke-width: 1px;
  stroke-linejoin: round;
  transition: fill 0.25s ease;
}

.district-base-slab.visited {
  fill: var(--map-3d-edge-visited);
  stroke: var(--map-3d-edge-visited);
}

/* Interactive Surface Tiles */
.district-path {
  fill: var(--map-unvisited);
  stroke: #ffffff;
  stroke-width: 1.1px;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.22s ease, stroke 0.15s ease, filter 0.15s ease;
}

.district-path:hover {
  fill: var(--map-unvisited-hover);
  stroke: #0e7552;
  stroke-width: 1.8px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
}

.district-path.visited {
  fill: var(--map-visited);
  stroke: #ffffff;
  stroke-width: 1.3px;
}

.district-path.visited:hover {
  fill: var(--map-visited-hover);
  filter: brightness(1.1) drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}

/* Small Bengali District Names On Map */
.district-label-group {
  pointer-events: none;
}

.district-label-text {
  font-family: var(--font-bangla);
  font-size: 8.5px;
  font-weight: 600;
  fill: #64748b;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: #ffffff;
  stroke-width: 2.2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: font-size 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), fill 0.2s ease, font-weight 0.2s ease;
}

/* Selected districts: Large, bold, standout! */
.district-label-group.visited .district-label-text {
  fill: #064e3b;
  font-weight: 900;
  font-size: 13.5px;
  stroke: #ffffff;
  stroke-width: 3.8px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}

/* Red Pin Markers for Visited Districts */
.district-pin-outer {
  fill: var(--pin-red);
  stroke: #ffffff;
  stroke-width: 1.4px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

.district-pin-inner {
  fill: #ffffff;
}

/* Floating Controls */
.map-floating-bar {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

.floating-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: #ffffff;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 0 var(--border-color);
  color: #1f2937;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
}

.floating-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--border-color);
}

/* Hover Tooltip */
.map-tooltip {
  position: absolute;
  pointer-events: none;
  background: #111827;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 100;
  display: none;
  transform: translate(-50%, -120%);
  white-space: nowrap;
  border: 2px solid #374151;
}

.map-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #111827 transparent;
  display: block;
  width: 0;
}

.map-bottom-hint {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}

/* RIGHT COLUMN: Sidebar Panels */
.sidebar-secondary-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-box {
  background: var(--card-bg);
  border: 2.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-box-title {
  font-size: 17px;
  font-weight: 800;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sidebar Profile Setup Box */
.profile-setup-box {
  background: var(--card-bg);
  border-color: var(--border-color);
  padding: 18px 20px;
}

body.theme-night .profile-setup-box {
  background: #131c2e;
  border-color: #202b3f;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.form-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

body.theme-night .form-label {
  color: #e2e8f0;
}

.duo-input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-bangla);
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: #f8fafc;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.duo-input:focus {
  border-color: #10b981;
}

body.theme-night .duo-input {
  background: #172237;
  border-color: #26354d;
  color: #f8fafc;
}

body.theme-night .duo-input:focus {
  border-color: #10b981;
}

.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.photo-preview-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 12px;
}

body.theme-night .photo-preview-block {
  background: #0d2820;
  border-color: #065f46;
}

.preview-thumb-frame {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #10b981;
  flex-shrink: 0;
}

.preview-thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-status-text {
  font-size: 12.5px;
  font-weight: 700;
  color: #15803d;
}

body.theme-night .preview-status-text {
  color: #6ee7b7;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

/* Checklist Panel Box */
.checklist-panel-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Modern Polished Search Input */
.search-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 15px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 2;
}

.district-search-input {
  width: 100%;
  padding: 10px 36px 10px 36px;
  font-family: var(--font-bangla);
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: #f8fafc;
  color: var(--text-main);
  outline: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.district-search-input:focus {
  border-color: #10b981;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

body.theme-night .district-search-input {
  background: #172237;
  border-color: #26354d;
  color: #f8fafc;
  box-shadow: none;
}

body.theme-night .district-search-input:focus {
  border-color: #10b981;
  background: #1a273e;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  background: #e2e8f0;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  z-index: 2;
}

body.theme-night .clear-search-btn {
  background: #25334c;
  color: #94a3b8;
}

.clear-search-btn:hover {
  background: #cbd5e1;
}

.district-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.district-scroll-list::-webkit-scrollbar {
  width: 6px;
}
.district-scroll-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}
body.theme-night .district-scroll-list::-webkit-scrollbar-thumb {
  background: #2d3b55;
}

.district-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: all 0.12s ease;
}

.district-item-row:hover {
  border-color: #10b981;
  background: #ffffff;
}

.district-item-row.checked {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

body.theme-night .district-item-row {
  background: #172237;
  border-color: #26354d;
  color: #e2e8f0;
}
body.theme-night .district-item-row:hover {
  background: #1c2a44;
  border-color: #10b981;
}
body.theme-night .district-item-row.checked {
  background: #0d2e24;
  border-color: #059669;
  color: #a7f3d0;
}

.item-left-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  transition: all 0.12s ease;
  flex-shrink: 0;
}

body.theme-night .item-checkbox {
  background: #131c2e;
  border-color: #3b4d6b;
}

.district-item-row.checked .item-checkbox {
  background: #10b981;
  border-color: #10b981;
}

.item-district-name {
  font-size: 14px;
  font-weight: 700;
}

.district-item-row.checked .item-district-name {
  font-weight: 800;
  color: #047857;
}

body.theme-night .district-item-row.checked .item-district-name {
  color: #6ee7b7;
}

.item-division-tag {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  background: #ffffff;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

body.theme-night .item-division-tag {
  background: #131c2e;
  border-color: #26354d;
  color: #94a3b8;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 3px solid var(--border-color);
  box-shadow: 0 20px 48px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 440px;
  padding: 24px;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.open .modal-box {
  transform: scale(1);
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 10px;
}

.modal-body {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #111827;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}

/* Badges & Achievements */
.badges-panel-box {
  margin-top: 20px;
}

.badge-count-pill {
  font-size: 12px;
  font-weight: 800;
  color: #047857;
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  padding: 3px 9px;
  border-radius: 12px;
}

body.theme-night .badge-count-pill {
  background: #064e3b;
  border-color: #059669;
  color: #6ee7b7;
}

.badges-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.badge-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 4px 8px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  opacity: 0.5;
  transition: all 0.25s ease;
  user-select: none;
}

body.theme-night .badge-card-item {
  background: #172237;
  border-color: #334155;
}

.badge-card-icon {
  font-size: 24px;
  line-height: 1;
  margin-bottom: 5px;
  filter: grayscale(90%);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.badge-card-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 2px;
  line-height: 1.2;
}

body.theme-night .badge-card-name {
  color: #94a3b8;
}

.badge-card-req {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

body.theme-night .badge-card-req {
  color: #64748b;
}

/* Unlocked State */
.badge-card-item.unlocked {
  opacity: 1;
  background: linear-gradient(145deg, #fffbeb, #fef3c7);
  border: 1.5px solid #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  transform: translateY(-2px);
}

body.theme-night .badge-card-item.unlocked {
  background: linear-gradient(145deg, #2a2010, #1c150b);
  border-color: #d97706;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.25);
}

.badge-card-item.unlocked .badge-card-icon {
  filter: none;
  transform: scale(1.15);
}

.badge-card-item.unlocked .badge-card-name {
  color: #92400e;
  font-weight: 800;
}

body.theme-night .badge-card-item.unlocked .badge-card-name {
  color: #fde68a;
}

.badge-card-item.unlocked .badge-card-req {
  color: #b45309;
}

body.theme-night .badge-card-item.unlocked .badge-card-req {
  color: #fcd34d;
}

/* Responsive (Tablet & Mobile) */
@media (max-width: 768px) {
  /* Clean 2-Row Mobile Header: No awkward line wrapping */
  .app-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 8px;
    column-gap: 8px;
    padding: 10px 12px;
    align-items: center;
  }

  .brand-section {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    gap: 8px;
  }

  .brand-flag-badge {
    font-size: 24px;
  }

  .brand-title {
    font-size: 16px;
    line-height: 1.15;
  }

  .brand-subtitle {
    font-size: 10.5px;
  }

  /* header-actions contents so download button and tools can separate in grid */
  .header-actions {
    display: contents;
  }

  /* Row 1, Right: Download Poster Button */
  .btn-download-card {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-self: end;
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .btn-label-desktop {
    display: none;
  }

  .btn-label-mobile {
    display: inline;
  }

  /* Row 2, Left: Stats Pills */
  .header-stats {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .stat-pill {
    padding: 4px 8px;
    font-size: 11.5px;
    gap: 4px;
    border-radius: 14px;
    white-space: nowrap;
  }

  .stat-pill .stat-icon {
    font-size: 13px;
  }

  /* Row 2, Right: Utility Buttons (🌙, 🔊, 🔄) */
  .header-tools {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-self: end;
  }

  .btn-tool-item {
    padding: 6px;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-tool-item .btn-label {
    display: none;
  }

  .btn-tool-item .btn-icon {
    font-size: 14px;
    margin: 0;
  }

  .app-main-grid {
    padding: 12px;
    gap: 16px;
  }

  .map-showcase-card {
    padding: 16px 12px;
  }

  .map-viewport-wrapper {
    height: 480px;
  }

  .headline-title {
    font-size: 18px;
  }

  .ratio-current {
    font-size: 32px;
  }

  .ratio-total {
    font-size: 22px;
  }

  .badges-grid-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}

@media (max-width: 360px) {
  .brand-subtitle {
    display: none;
  }
  .stat-pill {
    padding: 3px 5px;
    font-size: 10.5px;
  }
}

