/* ============================================================
   童趣中国 · 小小地理探险家
   A warm, tactile "magnetic map" interface for curious kids
   ============================================================ */

@font-face {
  font-family: 'ZCOOL KuaiLe';
  src: url('assets/fonts/ZCOOLKuaiLe.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/Nunito-Variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --bg: #f4eee2;
  --paper: #fffdf8;
  --paper-soft: #fbf6ec;
  --ink: #3d342c;
  --ink-2: #6e6154;
  --muted: #948678;
  --line: rgba(70, 52, 35, 0.1);
  --line-strong: rgba(70, 52, 35, 0.16);
  --coral: #e96b4c;
  --coral-deep: #c74f34;
  --teal: #2f8b80;
  --teal-deep: #1f6b62;
  --gold: #f2b84b;
  --cream: #f7f1e6;
  --font-display: 'ZCOOL KuaiLe', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --font-ui: 'Nunito', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  --shadow-stage: 0 30px 70px -34px rgba(67, 49, 30, 0.34), 0 2px 0 rgba(255, 255, 255, 0.9) inset;
  --shadow-soft: 0 12px 30px -18px rgba(73, 53, 32, 0.4);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  height: 100dvh;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(233, 107, 76, 0.48);
  outline-offset: 3px;
}

::selection { background: #ffd9c9; color: var(--ink); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Background theatre ---------- */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 12% -10%, #fff7e8 0%, transparent 60%),
    linear-gradient(160deg, #f7f1e6 0%, #f2eadc 58%, #efe7d8 100%);
}
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(76px);
  opacity: 0.65;
}
.blob-peach { width: 520px; height: 520px; left: -180px; top: -190px; background: #ffcfae; }
.blob-sky { width: 540px; height: 540px; right: -200px; top: -230px; background: #c9e8f4; opacity: 0.55; }
.blob-mint { width: 520px; height: 520px; left: 28%; bottom: -330px; background: #cfe5c1; opacity: 0.42; }
.bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(95, 74, 48, 0.15) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.26;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 10%, transparent 75%);
}
.doodle {
  position: absolute;
  color: rgba(199, 113, 74, 0.4);
  font-family: var(--font-ui);
  font-weight: 800;
  user-select: none;
}
.doodle-a { left: 4.5%; top: 22%; font-size: 26px; transform: rotate(12deg); }
.doodle-b { right: 5%; top: 17%; font-size: 34px; color: rgba(47, 139, 128, 0.32); }
.doodle-c { right: 12%; bottom: 12%; font-size: 22px; color: rgba(242, 184, 75, 0.62); }
.doodle-d { left: 2.5%; bottom: 22%; font-size: 30px; color: rgba(47, 139, 128, 0.22); }

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 12px 26px 10px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #f58b68 0%, #e85f40 58%, #d95336 100%);
  box-shadow: 0 5px 0 #b8432c, 0 14px 24px -10px rgba(207, 75, 49, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  transform: rotate(-3deg);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.brand:hover .brand-mark { transform: rotate(3deg) translateY(-1px); }
.brand-mark svg { width: 34px; height: 34px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-name {
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.08;
  letter-spacing: 1.5px;
  color: var(--ink);
}
.brand-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 3.4px;
  color: var(--muted);
  transform: translateX(0.6px);
}

.view-tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px -16px rgba(62, 44, 27, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
}
.tab-glider {
  position: absolute;
  z-index: 0;
  top: 5px;
  left: 5px;
  height: calc(100% - 10px);
  border-radius: 13px;
  background: var(--ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.13);
  transition: transform 0.34s cubic-bezier(0.22, 0.8, 0.24, 1), width 0.34s cubic-bezier(0.22, 0.8, 0.24, 1);
}
.view-tab {
  position: relative;
  z-index: 1;
  height: 37px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.view-tab svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.view-tab.is-active { color: #fffdf8; }
.view-tab:not(.is-active):hover { color: var(--ink); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(78, 58, 38, 0.08), 0 8px 18px -14px rgba(63, 45, 28, 0.55);
  backdrop-filter: blur(12px);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.icon-btn:hover { background: #fffdf8; color: var(--ink); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(1px); box-shadow: none; }
.icon-btn svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn.small { width: 37px; height: 37px; border-radius: 12px; }
.icon-btn.small svg { width: 18px; height: 18px; }
.sound-btn .sound-off { display: none; }
body.sound-muted .sound-btn .sound-on { display: none; }
body.sound-muted .sound-btn .sound-off { display: block; }

/* ---------- Main layout ---------- */
.app {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 26px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 424px;
  gap: 18px;
}

/* ---------- Map stage ---------- */
.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 19px 20px 15px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.95) 0%, rgba(255, 251, 243, 0.88) 100%);
  box-shadow: var(--shadow-stage);
  overflow: hidden;
  animation: rise-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.map-stage::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 23px;
  border: 1px dashed rgba(124, 99, 68, 0.08);
  pointer-events: none;
}
.stage-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}
.stage-heading { min-width: 0; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--teal);
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 139, 128, 0.13);
}
.stage-head h1 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(23px, 2.05vw, 30px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.6px;
  color: var(--ink);
}
.stage-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.stage-tools { display: flex; align-items: center; gap: 8px; padding-top: 4px; flex: 0 0 auto; }
.chip-btn {
  height: 37px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(79, 59, 38, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.chip-btn:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 4px 0 rgba(79, 59, 38, 0.08); }
.chip-btn:active { transform: translateY(2px); box-shadow: none; }
.chip-btn span { font-size: 14px; }

.toolbar {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  padding: 1px 1px 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }
.tool-pill {
  height: 31px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(246, 239, 227, 0.85);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.tool-pill:hover { background: #fffdf8; color: var(--ink); transform: translateY(-1px); }
.tool-pill.is-active {
  color: #fffdf8;
  background: var(--ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}
.region-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.tool-pill.is-active .region-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }
.metric-pill .metric-icon { font-size: 13px; line-height: 1; }
.metric-pill.is-active { background: var(--metric-dark, var(--ink)); }

/* ---------- Map board ---------- */
.map-board {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 9px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(97, 76, 51, 0.09);
  background:
    radial-gradient(ellipse 72% 64% at 46% 46%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #fcf8f0 0%, #f8f2e7 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.95),
    inset 0 -22px 36px rgba(201, 180, 149, 0.13);
  cursor: grab;
  touch-action: none;
}
.map-board.is-dragging { cursor: grabbing; }
.board-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(112, 89, 61, 0.15) 1px, transparent 1px);
  background-size: 19px 19px;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 80% 76% at 50% 48%, #000 20%, transparent 82%);
  pointer-events: none;
}
#chinaMap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

/* province pieces */
.province {
  cursor: pointer;
  outline: none;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.24s ease;
  will-change: transform;
}
.province-edge {
  fill: var(--piece, #dbe8c4);
  filter: brightness(0.78) saturate(1.08);
  stroke: none;
  pointer-events: none;
}
.province-shape {
  fill: var(--piece, #dbe8c4);
  stroke: #fffdf8;
  stroke-width: 1.55;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 0.24s ease, opacity 0.24s ease;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.3)) drop-shadow(0 5px 5px rgba(78, 58, 36, 0.1));
}
.province:hover,
.province:focus-visible {
  transform: translateY(-5px) scale(1.012);
}
.province:hover .province-shape,
.province:focus-visible .province-shape {
  filter: drop-shadow(0 3px 0 rgba(255, 255, 255, 0.5)) drop-shadow(0 10px 12px rgba(78, 58, 36, 0.22));
  stroke: #fff;
  stroke-width: 2;
}
.province:focus-visible .province-shape {
  stroke: var(--coral);
  stroke-width: 2.6;
}
.province.is-selected {
  transform: translateY(-6px) scale(1.018);
}
.province.is-selected .province-shape {
  filter: drop-shadow(0 3px 0 rgba(255, 255, 255, 0.45)) drop-shadow(0 14px 18px rgba(66, 47, 29, 0.28));
  stroke: var(--ink);
  stroke-width: 2.1;
}
.province.is-dim { opacity: 0.19; }
.province.is-dim:hover { opacity: 0.52; }
.province.is-rank-highlight {
  transform: translateY(-4px) scale(1.01);
}
.province.is-rank-highlight .province-shape {
  stroke: var(--ink);
  stroke-width: 2.2;
}
#chinaMap.is-panning .province,
#chinaMap.is-panning .province-shape { transition: none; }

/* map typography */
.map-label {
  font-family: var(--font-ui);
  font-size: 12.3px;
  font-weight: 900;
  letter-spacing: 0.45px;
  fill: #3f342a;
  paint-order: stroke;
  stroke: #fffdf8;
  stroke-width: 4.1px;
  stroke-linejoin: round;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.map-label-group { transition: opacity 0.3s ease; }
.map-label-group.is-dim { opacity: 0.2; }
.map-label-group.is-active .map-label { fill: var(--ink); stroke-width: 4px; }
.pin-line {
  stroke: rgba(66, 53, 40, 0.6);
  stroke-width: 0.9;
  stroke-dasharray: 2 2;
  fill: none;
}
.pin-dot { fill: #4b3f33; stroke: #fffdf8; stroke-width: 1; }
.pin-badge circle {
  fill: #fffdf8;
  stroke: #4b3f33;
  stroke-width: 1.1;
  filter: drop-shadow(0 2px 2px rgba(74, 55, 35, 0.18));
}
.pin-badge text {
  font-family: var(--font-ui);
  font-size: 9.2px;
  font-weight: 900;
  fill: #3f342a;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.map-label-group { cursor: pointer; outline: none; }
.map-label-group:focus-visible .pin-badge circle,
.map-label-group:focus-visible .pin-dot { stroke: var(--coral); stroke-width: 2.2; }

/* top-three medals in ranking mode */
.rank-flag { pointer-events: none; animation: badge-pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.rank-flag circle {
  stroke: #fffdf8;
  stroke-width: 1.6;
  filter: drop-shadow(0 3px 4px rgba(66, 47, 28, 0.24));
}
.rank-flag text {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 1000;
  fill: #fffdf8;
  text-anchor: middle;
  dominant-baseline: central;
}
.rank-flag .flag-star { font-size: 7px; fill: #fff8e4; }

/* compass + inset */
.map-compass { pointer-events: none; opacity: 0.82; }
.map-compass .ring { fill: none; stroke: rgba(84, 67, 47, 0.3); stroke-width: 1; }
.map-compass .ring-inner { fill: rgba(255, 253, 248, 0.72); stroke: rgba(84, 67, 47, 0.2); }
.map-compass .needle-n { fill: #d96a4d; }
.map-compass .needle-s { fill: #4c897f; }
.map-compass .letter {
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 900;
  fill: #756553;
  text-anchor: middle;
}
.sea-inset { pointer-events: none; }
.sea-inset .card {
  fill: #eaf7fa;
  stroke: #c2e2e8;
  stroke-width: 1;
  filter: drop-shadow(0 5px 8px rgba(54, 96, 104, 0.1));
}
.sea-inset .title {
  font-family: var(--font-ui);
  font-size: 9.4px;
  font-weight: 900;
  letter-spacing: 1.4px;
  fill: #357786;
  text-anchor: middle;
}
.sea-inset .island { fill: #4f94a4; stroke: #4f94a4; stroke-width: 1; stroke-linejoin: round; }
.sea-inset .dash { fill: #428b9c; stroke: #428b9c; stroke-width: 2.2; stroke-linejoin: round; }
.sea-inset .wave { fill: none; stroke: #a9d4dd; stroke-width: 1.1; stroke-linecap: round; }
.sea-inset .tiny-label {
  font-family: var(--font-ui);
  font-size: 7px;
  font-weight: 800;
  fill: #5c8f9a;
  letter-spacing: 0.6px;
}

/* ---------- Map overlays ---------- */
.zoom-controls {
  position: absolute;
  z-index: 5;
  right: 14px;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px -14px rgba(65, 47, 28, 0.55);
  backdrop-filter: blur(8px);
}
.zoom-controls button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.zoom-controls button:hover { background: #fffdf8; color: var(--ink); }
.zoom-controls button svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.map-hint {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 13px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(103, 81, 54, 0.1);
  box-shadow: 0 8px 22px -16px rgba(65, 47, 28, 0.6);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
  pointer-events: none;
  animation: hint-float 3.4s ease-in-out infinite;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.map-hint.is-hidden { opacity: 0; transform: translate(-50%, 7px); }
.map-focus {
  position: absolute;
  z-index: 6;
  left: 14px;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(103, 81, 54, 0.1);
  box-shadow: 0 9px 22px -16px rgba(65, 47, 28, 0.65);
  backdrop-filter: blur(8px);
  animation: detail-in 0.25s ease both;
}
.focus-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(233, 107, 76, 0.14);
  flex: 0 0 auto;
}
.map-focus-open {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
}
.map-focus-open strong {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.4px;
}
.map-focus-open:hover strong { color: var(--coral-deep); }
.map-focus-city {
  height: 22px;
  padding: 0 7px;
  border: 0;
  border-radius: 999px;
  background: #fff1e9;
  color: var(--coral-deep);
  font-size: 8.5px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.15s ease;
}
.map-focus-city:hover { background: #ffdfd1; }
.map-focus-close {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(61, 52, 44, 0.07);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.map-focus-close:hover { background: rgba(233, 107, 76, 0.13); color: var(--coral-deep); }

.heat-legend {
  position: absolute;
  z-index: 4;
  left: 14px;
  bottom: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(103, 81, 54, 0.1);
  box-shadow: 0 8px 22px -16px rgba(65, 47, 28, 0.55);
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
.legend-title { letter-spacing: 0.4px; color: var(--ink); }
.legend-bar {
  width: 74px;
  height: 7px;
  border-radius: 99px;
  background: linear-gradient(90deg, hsl(var(--legend-hue, 25) 46% 89%), hsl(var(--legend-hue, 25) 72% 55%));
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.legend-low, .legend-high { opacity: 0.85; }

.map-tooltip {
  position: absolute;
  z-index: 9;
  min-width: 154px;
  max-width: 220px;
  padding: 9px 11px;
  border-radius: 13px;
  background: rgba(52, 43, 34, 0.96);
  color: #fffdf8;
  box-shadow: 0 12px 26px -12px rgba(35, 25, 16, 0.7);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 0.12s ease;
}
.map-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}
.map-tooltip[hidden] { display: none; }
.tooltip-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
  color: #d9c7b1;
  text-transform: uppercase;
}
.tooltip-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.tooltip-dot { width: 8px; height: 8px; border-radius: 50%; }
.tooltip-meta {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.5;
  color: #e8dccd;
}

/* ---------- Province quick index (mobile) ---------- */
.province-index { display: none; }

/* ---------- Side panel ---------- */
.side-panel {
  position: relative;
  min-height: 0;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.94);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-stage);
  overflow: hidden;
  animation: rise-in 0.6s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.panel-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 91, 62, 0.28) transparent;
}
.panel-scroll::-webkit-scrollbar,
.rank-list::-webkit-scrollbar,
.modal-body::-webkit-scrollbar { width: 7px; }
.panel-scroll::-webkit-scrollbar-thumb,
.rank-list::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(115, 91, 62, 0.25);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.rank-panel { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.rank-panel[hidden], .rank-toolbar[hidden], .heat-legend[hidden], .map-tooltip[hidden], #rankingWrap[hidden] { display: none !important; }

/* ---------- Empty state ---------- */
.empty-state {
  min-height: 100%;
  padding: 26px 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.empty-art {
  position: relative;
  width: 300px;
  height: 244px;
  margin-bottom: 2px;
  flex: 0 0 auto;
}
.orbit {
  position: absolute;
  inset: 26px 5px 10px;
  border-radius: 50%;
  border: 1.5px dashed rgba(47, 139, 128, 0.25);
  transform: rotate(-8deg);
}
.orbit::before {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--coral);
  top: 21px; right: 25px;
  box-shadow: 0 0 0 4px rgba(233, 107, 76, 0.14);
}
.polaroid {
  position: absolute;
  width: 128px;
  padding: 6px 6px 22px;
  border-radius: 7px;
  background: #fffef9;
  box-shadow: 0 14px 28px -16px rgba(64, 45, 26, 0.5), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.polaroid img {
  width: 100%;
  height: 104px;
  object-fit: cover;
  border-radius: 3px;
  background: #e9dfd0;
}
.polaroid span {
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 1px;
}
.polaroid::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 38px;
  height: 15px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(247, 211, 141, 0.72);
  box-shadow: 0 1px 2px rgba(127, 95, 42, 0.12);
}
.polaroid.p1 { left: 6px; top: 42px; transform: rotate(-8deg); z-index: 1; }
.polaroid.p2 { left: 88px; top: 20px; transform: rotate(3deg); z-index: 3; }
.polaroid.p3 { right: 3px; top: 58px; transform: rotate(9deg); z-index: 2; }
.empty-art:hover .p1 { transform: rotate(-11deg) translateY(-3px); }
.empty-art:hover .p2 { transform: rotate(1deg) translateY(-5px); }
.empty-art:hover .p3 { transform: rotate(12deg) translateY(-2px); }
.compass-badge {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 6px;
  width: 68px;
  height: 68px;
  transform: translateX(-50%) rotate(-5deg);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #3e9a8e, #23766d);
  border: 3px solid #fffdf8;
  box-shadow: 0 8px 0 rgba(30, 95, 88, 0.3), 0 14px 20px -10px rgba(30, 80, 74, 0.55);
}
.compass-badge svg {
  width: 34px; height: 34px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.empty-kicker {
  margin-top: 8px;
  color: var(--coral);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 2.8px;
}
.art-sheet {
  position: absolute;
  left: 24px;
  top: 24px;
  width: 272px;
  height: 184px;
  padding: 7px;
  border-radius: 14px;
  background: #fffef9;
  box-shadow: 0 22px 40px -24px rgba(64, 45, 26, 0.65), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transform: rotate(-3deg);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.empty-art:hover .art-sheet { transform: rotate(-1.2deg) translateY(-4px); }
.art-photo {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 9px;
  background: #dfeaec;
}
.art-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 48%; }
.art-photo-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 20, 16, 0) 45%, rgba(20, 20, 16, 0.66) 100%);
}
.art-note {
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 11px;
  color: #fffdf8;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.7px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.art-thumb {
  position: absolute;
  z-index: 3;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border-radius: 50%;
  border: 4px solid #fffef9;
  background: #e9dfcf;
  box-shadow: 0 9px 20px -10px rgba(50, 35, 20, 0.6);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.thumb-one { left: -17px; top: 11px; transform: rotate(-8deg); }
.thumb-two { right: -15px; bottom: 10px; transform: rotate(7deg); }
.empty-art:hover .thumb-one { transform: rotate(-11deg) scale(1.04); }
.empty-art:hover .thumb-two { transform: rotate(10deg) scale(1.04); }
.art-thumb img { width: 100%; height: 100%; object-fit: cover; }
.art-thumb span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2px 0 3px;
  background: rgba(44, 34, 24, 0.52);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 1px;
}
.art-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 58px;
  height: 19px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(247, 211, 141, 0.78);
  box-shadow: 0 1px 2px rgba(127, 95, 42, 0.14);
}
.art-stamp {
  position: absolute;
  z-index: 4;
  right: 11px;
  top: 10px;
  padding: 4px 6px;
  border: 1.5px solid rgba(185, 74, 49, 0.58);
  border-radius: 4px;
  color: #b34932;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1.08;
  text-align: center;
  transform: rotate(8deg);
  background: rgba(255, 250, 238, 0.7);
  letter-spacing: 1px;
}
.art-compass {
  left: 1px;
  bottom: -5px;
  width: 64px;
  height: 64px;
  z-index: 5;
  transform: rotate(-6deg);
}
.empty-state h2 {
  margin-top: 7px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.24;
  letter-spacing: 0.8px;
}
.empty-state > p {
  max-width: 280px;
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.8;
  font-weight: 600;
}
.empty-actions { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 9px; flex-wrap: wrap; }
.empty-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px dashed var(--line-strong);
  width: 100%;
}
.empty-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
}
.empty-meta strong { color: var(--ink); font-family: var(--font-ui); font-weight: 900; }

/* ---------- Shared buttons ---------- */
.btn-primary, .btn-ghost {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 13px;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.17s ease, box-shadow 0.17s ease, background 0.17s ease;
}
.btn-primary {
  border: 0;
  color: #fffdf8;
  background: linear-gradient(145deg, #f07a59, #e35f40);
  box-shadow: 0 4px 0 #b9472e, 0 10px 18px -10px rgba(199, 79, 52, 0.65);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #b9472e, 0 14px 22px -10px rgba(199, 79, 52, 0.7); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #b9472e; }
.btn-primary svg, .btn-ghost svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.btn-ghost {
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink-2);
  box-shadow: 0 3px 0 rgba(76, 57, 37, 0.09);
}
.btn-ghost:hover { transform: translateY(-1px); color: var(--ink); background: #fff; }
.btn-ghost:active { transform: translateY(2px); box-shadow: none; }
.btn-wide { width: 100%; }

/* ---------- Place detail card ---------- */
.place-card {
  --tone: #ffc9a3;
  min-height: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;
  animation: detail-in 0.36s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.photo-hero {
  position: relative;
  flex: 0 0 auto;
  height: 226px;
  overflow: hidden;
  border-radius: 23px;
  background: linear-gradient(145deg, var(--tone), #f4e4ce);
  box-shadow: 0 10px 28px -18px rgba(63, 44, 26, 0.5);
}
.photo-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  transform: scale(1.015);
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.photo-hero:hover img { transform: scale(1.06); }
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(26, 20, 14, 0.24) 0%, transparent 31%, rgba(26, 20, 14, 0.02) 52%, rgba(26, 20, 14, 0.76) 100%),
    linear-gradient(90deg, rgba(26, 20, 14, 0.18), transparent 42%);
  pointer-events: none;
}
.hero-top {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.region-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.9);
  color: var(--ink);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px -8px rgba(33, 24, 16, 0.6);
  backdrop-filter: blur(8px);
}
.region-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
.hero-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(36, 28, 21, 0.28);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.16s ease, transform 0.16s ease;
}
.hero-close:hover { background: rgba(36, 28, 21, 0.55); transform: rotate(8deg); }
.hero-bottom {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 11px;
  color: #fffdf8;
}
.hero-emoji {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 24px;
  border-radius: 14px;
  background: rgba(255, 252, 245, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 16px -8px rgba(0, 0, 0, 0.5);
}
.hero-title { min-width: 0; flex: 1; }
.hero-title h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 33px;
  line-height: 1.05;
  letter-spacing: 1.4px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.36);
}
.hero-sub {
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: rgba(255, 253, 248, 0.8);
  text-transform: uppercase;
}
.hero-sub .sep { opacity: 0.5; }
.abbr-seal {
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
  border-radius: 11px;
  border: 1.5px solid rgba(255, 250, 238, 0.92);
  background: rgba(255, 250, 238, 0.95);
  color: var(--coral-deep);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 5px 14px -8px rgba(0, 0, 0, 0.55), inset 0 0 0 3px rgba(255, 250, 238, 1), inset 0 0 0 4px rgba(199, 79, 52, 0.22);
  transform: rotate(-5deg);
}
.photo-caption {
  position: absolute;
  z-index: 2;
  left: 16px;
  bottom: 67px;
  color: rgba(255, 253, 248, 0.78);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.photo-caption::before { content: "◉ "; font-size: 8px; opacity: 0.8; }

.place-body {
  padding: 14px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.quick-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.fact-tile {
  position: relative;
  padding: 9px 10px 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: #fffaf2;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--tone) 19%, #fffdf8) 0%, #fffdf8 78%);
  box-shadow: 0 4px 12px -10px rgba(75, 55, 34, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.fact-label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.8px;
}
.fact-label span { font-size: 11px; }
.fact-value {
  margin-top: 2px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.fact-value small {
  margin-left: 2px;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0;
}
.fact-rank {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.75);
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
}
.fact-rank.is-top { color: var(--coral-deep); background: #ffe6da; }

.intro-block {
  padding: 12px 13px 13px;
  border-radius: 17px;
  background: var(--paper-soft);
  border: 1px solid rgba(114, 89, 58, 0.07);
}
.block-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--teal-deep);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
}
.intro-block p {
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.82;
  font-weight: 600;
}
.fact-ticket {
  position: relative;
  padding: 13px 14px 12px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, #fff5d2, #ffedb8);
  border: 1px solid rgba(218, 169, 62, 0.24);
  box-shadow: 0 6px 18px -13px rgba(140, 102, 20, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transform: rotate(-0.35deg);
}
.fact-ticket::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 46px;
  height: 12px;
  transform: translateX(-50%) rotate(1.4deg);
  background: rgba(255, 253, 248, 0.55);
  border-left: 1px dashed rgba(160, 123, 38, 0.16);
  border-right: 1px dashed rgba(160, 123, 38, 0.16);
}
.fact-ticket .ticket-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #95651a;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
}
.fact-ticket p {
  margin-top: 5px;
  color: #5d471c;
  font-size: 12px;
  line-height: 1.75;
  font-weight: 700;
}
.nearby-grid { display: grid; gap: 11px; }
.mini-section h3 {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: var(--ink-2);
}
.spot-list { margin-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.spot-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(92, 72, 48, 0.06);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.spot-item:hover {
  background: #fff;
  border-color: rgba(233, 107, 76, 0.24);
  transform: translateX(2px);
}
.feature-chevron {
  flex: 0 0 auto;
  margin-left: auto;
  align-self: center;
  color: var(--coral);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}
.feature-hint {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff4ec;
  color: var(--coral-deep);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}
.spot-bullet {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tone) 36%, #fff);
  color: var(--ink);
  font-size: 8px;
  font-weight: 900;
}
.spot-copy { min-width: 0; }
.spot-name { font-size: 11px; font-weight: 900; line-height: 1.3; }
.spot-desc { margin-top: 1px; color: var(--muted); font-size: 10px; line-height: 1.55; font-weight: 600; }
.food-chips { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.food-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fffdf8;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.food-chip:hover { background: #fff; border-color: rgba(233, 107, 76, 0.35); transform: translateY(-1px); }
.food-chip > span { color: var(--coral); font-size: 12px; line-height: 1; margin-left: 1px; }
.food-chip::before { content: "·"; color: var(--coral); font-weight: 900; }
.city-teaser {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 10px 10px 11px;
  border-radius: 16px;
  border: 1px solid rgba(47, 139, 128, 0.16);
  background:
    radial-gradient(ellipse at top left, rgba(255, 255, 255, 0.9), transparent 60%),
    linear-gradient(145deg, #eff9f4, #fbf6ed);
  overflow: hidden;
}
.city-teaser::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -22px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px dashed rgba(47, 139, 128, 0.18);
  pointer-events: none;
}
.city-teaser.is-compact { margin-top: 13px; }
.city-teaser-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #fffdf8;
  border: 1px solid rgba(47, 139, 128, 0.12);
  box-shadow: 0 4px 10px -8px rgba(45, 80, 67, 0.5);
  font-size: 17px;
}
.city-teaser-copy { min-width: 0; flex: 1; }
.city-teaser-kicker {
  color: var(--teal-deep);
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
}
.city-teaser-title {
  margin-top: 1px;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 900;
  line-height: 1.25;
}
.city-teaser-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.45;
}
.capital-name { color: #d43f2c; }
.city-teaser-btn {
  flex: 0 0 auto;
  align-self: center;
  height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(47, 139, 128, 0.18);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--teal-deep);
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.city-teaser-btn:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 5px 12px -9px rgba(36, 91, 80, 0.5); }
.city-teaser-btn span { color: var(--coral); font-size: 12px; }
.card-actions { display: flex; gap: 7px; margin-top: 2px; }
.card-actions .btn-primary { flex: 1; }
.card-actions .btn-ghost { flex: 0 0 auto; padding: 0 13px; }
.data-note {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
  text-align: center;
  letter-spacing: 0.2px;
}

/* ---------- Ranking panel ---------- */
.rank-head {
  flex: 0 0 auto;
  padding: 18px 18px 8px;
}
.rank-head .eyebrow { color: var(--coral); }
.rank-head .eyebrow-dot { background: var(--coral); box-shadow: 0 0 0 3px rgba(233, 107, 76, 0.13); }
.rank-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 4px; }
.rank-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0.7px;
}
.rank-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.rank-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
  font-weight: 600;
}
.podium {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  padding: 4px 14px 14px;
}
.podium-place {
  width: 106px;
  padding: 9px 6px 8px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, #fffdf8, #f8f1e4);
  box-shadow: 0 5px 0 rgba(92, 69, 45, 0.09), 0 12px 22px -18px rgba(65, 46, 26, 0.5);
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.podium-place:hover { transform: translateY(-3px); box-shadow: 0 8px 0 rgba(92, 69, 45, 0.08), 0 16px 24px -16px rgba(65, 46, 26, 0.5); }
.podium-place.is-first {
  width: 116px;
  padding-top: 12px;
  background: linear-gradient(180deg, #fff9e8, #ffefc2);
  box-shadow: 0 6px 0 rgba(197, 147, 38, 0.2), 0 16px 28px -18px rgba(142, 101, 18, 0.55);
}
.podium-photo {
  position: relative;
  width: 58px;
  height: 58px;
  margin: 0 auto;
}
.is-first .podium-photo { width: 66px; height: 66px; }
.podium-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fffdf8;
  box-shadow: 0 5px 12px -7px rgba(55, 38, 20, 0.6);
  background: #eadfcd;
}
.medal {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #fffdf8;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 1000;
  box-shadow: 0 3px 7px -3px rgba(62, 43, 23, 0.55);
}
.medal.m1 { background: linear-gradient(145deg, #f7c94b, #e6a521); }
.medal.m2 { background: linear-gradient(145deg, #c7ced6, #96a1ad); }
.medal.m3 { background: linear-gradient(145deg, #e7a277, #c9794e); }
.podium-name {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podium-value {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 900;
  color: var(--coral-deep);
  white-space: nowrap;
}
.is-first .podium-value { color: #9a6815; }
.podium-place:nth-child(1) .podium-value { color: var(--muted); }
.rank-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 11px 8px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 91, 62, 0.28) transparent;
}
.rank-row {
  display: grid;
  grid-template-columns: 22px 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 5px 7px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}
.rank-row:hover { background: rgba(255, 255, 255, 0.9); transform: translateX(2px); }
.rank-num {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}
.rank-row:nth-child(1) .rank-num { color: #d49b16; }
.rank-row:nth-child(2) .rank-num { color: #8d99a5; }
.rank-row:nth-child(3) .rank-num { color: #c4774c; }
.rank-abbr {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--piece, #f0e5d4);
  color: #4c4034;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 3px rgba(84, 62, 37, 0.08);
}
.rank-main { min-width: 0; }
.rank-name-line { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.rank-name {
  font-size: 11.5px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-bar {
  height: 4px;
  margin-top: 4px;
  border-radius: 99px;
  background: #eee5d7;
  overflow: hidden;
}
.rank-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone, #e96b4c) 58%, #fff), var(--tone, #e96b4c));
  transition: width 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.rank-value {
  min-width: 55px;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}
.rank-value small { margin-left: 1px; font-size: 8px; color: var(--muted); font-weight: 800; }
.rank-approx { margin-left: 2px; color: var(--coral); font-size: 10px; font-weight: 900; }
.rank-row:focus-visible {
  outline: 2px solid rgba(233, 107, 76, 0.55);
  outline-offset: -2px;
}
.podium-place:focus-visible {
  outline: 2px solid rgba(233, 107, 76, 0.55);
  outline-offset: 2px;
}
.rank-foot {
  flex: 0 0 auto;
  padding: 7px 15px 11px;
  border-top: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
  text-align: center;
}

/* ---------- Footer ---------- */
.page-foot {
  flex: 0 0 auto;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 28px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.35px;
}
.foot-links { display: inline-flex; align-items: center; gap: 7px; }
.foot-links button {
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: var(--ink-2);
  font-size: inherit;
  font-weight: 800;
  cursor: pointer;
  border-bottom: 1px dashed rgba(110, 97, 84, 0.38);
}
.foot-links button:hover { color: var(--coral-deep); border-color: var(--coral); }

/* ---------- Modal ---------- */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(43, 33, 23, 0.46);
  backdrop-filter: blur(9px) saturate(0.9);
  animation: fade-in 0.2s ease both;
}
.modal-card {
  position: relative;
  width: min(1000px, 100%);
  height: min(86vh, 780px);
  max-height: min(86vh, 780px);
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  grid-template-rows: minmax(0, 1fr);
  border-radius: 27px;
  background: var(--paper);
  box-shadow: 0 40px 90px -28px rgba(30, 21, 12, 0.7), 0 2px 0 rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
  animation: modal-pop 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.modal-close {
  position: absolute;
  z-index: 8;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(49, 40, 31, 0.82);
  color: #fff;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 14px -8px rgba(31, 22, 14, 0.7);
  backdrop-filter: blur(8px);
  transition: background 0.16s ease, transform 0.16s ease;
}
.modal-close:hover { background: rgba(49, 40, 31, 0.96); transform: rotate(8deg); }
.modal-photo {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--tone, #eeddc6);
}
.modal-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}
.modal-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 17, 12, 0.25) 0%, transparent 34%, rgba(23, 17, 12, 0.78) 100%);
  pointer-events: none;
}
.modal-photo-content {
  position: absolute;
  z-index: 2;
  left: 24px;
  right: 24px;
  bottom: 24px;
  color: #fffdf8;
}
.modal-photo-content .eyebrow { color: rgba(255, 253, 248, 0.75); }
.modal-photo-content .eyebrow-dot { background: currentColor; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2); }
.modal-photo-content h2 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: 2px;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.35);
}
.modal-photo-content .modal-sub {
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(255, 253, 248, 0.82);
}
.modal-photo-content .seal {
  margin-top: 15px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 250, 238, 0.94);
  color: var(--coral-deep);
  font-family: var(--font-display);
  font-size: 27px;
  transform: rotate(-5deg);
  box-shadow: inset 0 0 0 3px #fffaf0, inset 0 0 0 4px rgba(199, 79, 52, 0.24), 0 7px 16px -8px rgba(0, 0, 0, 0.55);
}
.modal-photo-content .modal-caption {
  margin-top: 14px;
  font-size: 9.5px;
  color: rgba(255, 253, 248, 0.7);
  font-weight: 700;
  letter-spacing: 0.3px;
}
.modal-body {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 28px 28px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 91, 62, 0.28) transparent;
}
.modal-body .modal-lede {
  padding-right: 30px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.85;
  font-weight: 600;
}
.modal-section { margin-top: 20px; }
.modal-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
  color: var(--ink);
}
.modal-facts {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.modal-fact {
  padding: 10px;
  border-radius: 13px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--tone-soft, #ffd9c1) 18%, #fffdf8), #fffdf8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px -11px rgba(70, 50, 28, 0.5);
}
.modal-fact .k { color: var(--muted); font-size: 8.5px; font-weight: 900; letter-spacing: 0.8px; }
.modal-fact .v {
  margin-top: 2px;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}
.modal-fact .v small { margin-left: 2px; color: var(--muted); font-size: 8px; font-weight: 800; }
.modal-fact .r { margin-top: 2px; color: var(--coral-deep); font-size: 8px; font-weight: 900; }
.modal-fact:nth-child(4), .modal-fact:nth-child(5) { grid-column: span 1; }
.modal-ticket {
  margin-top: 16px;
  padding: 15px 16px;
  border-radius: 17px;
  background: linear-gradient(145deg, #fff4cf, #ffecb3);
  border: 1px solid rgba(218, 169, 62, 0.25);
  transform: rotate(-0.25deg);
}
.modal-ticket .k { color: #95651a; font-size: 9px; font-weight: 900; letter-spacing: 1.2px; }
.modal-ticket p { margin-top: 5px; color: #5d471c; font-size: 12.5px; line-height: 1.8; font-weight: 700; }
.spot-grid {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.spot-card {
  position: relative;
  width: 100%;
  padding: 11px 10px 25px;
  border-radius: 14px;
  background: var(--paper-soft);
  border: 1px solid rgba(106, 82, 52, 0.07);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.spot-card:hover {
  background: #fff;
  border-color: rgba(233, 107, 76, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -14px rgba(80, 55, 29, 0.55);
}
.spot-card .icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--tone-soft, #ffd9c1) 48%, #fff);
  font-size: 14px;
}
.spot-card h4 { margin: 7px 0 0; font-size: 11px; font-weight: 900; line-height: 1.3; }
.spot-card p { margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.6; font-weight: 600; }
.spot-open {
  position: absolute;
  right: 9px;
  bottom: 8px;
  color: var(--coral-deep);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
.modal-chips { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.modal-chips span,
.modal-chips button {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fffdf8;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font: inherit;
  font-size: 10.5px;
  font-weight: 800;
}
.modal-chips button { cursor: pointer; transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease; }
.modal-chips button:hover { background: #fff; border-color: rgba(233, 107, 76, 0.35); transform: translateY(-1px); }
.modal-chips button span { color: var(--coral); }
.quiz-card {
  margin-top: 18px;
  padding: 15px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at top right, rgba(122, 203, 186, 0.2), transparent 55%),
    linear-gradient(145deg, #eef9f5, #fbfdfb);
  border: 1px solid rgba(47, 139, 128, 0.16);
}
.quiz-kicker { color: var(--teal-deep); font-size: 9px; font-weight: 900; letter-spacing: 1.4px; }
.quiz-question { margin-top: 4px; font-size: 13px; line-height: 1.5; font-weight: 900; }
.quiz-options { margin-top: 9px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.quiz-option {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(47, 139, 128, 0.14);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: border 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.quiz-option:hover:not(:disabled) { border-color: var(--teal); transform: translateY(-1px); }
.quiz-option:disabled { cursor: default; }
.quiz-option.is-correct { background: var(--teal); border-color: var(--teal); color: #fff; }
.quiz-option.is-wrong { background: #ffe3da; border-color: #f1a28d; color: #8e3b27; }
.quiz-option.is-muted { opacity: 0.45; }
.quiz-feedback { min-height: 16px; margin-top: 7px; color: var(--teal-deep); font-size: 10px; font-weight: 800; line-height: 1.5; }
.modal-actions { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.modal-actions .btn-primary { flex: 1; min-width: 160px; }

/* ---------- Feature story modal ---------- */
.feature-card {
  position: relative;
  width: min(980px, 100%);
  height: min(84vh, 660px);
  display: grid;
  grid-template-columns: 0.94fr 1.06fr;
  border-radius: 27px;
  background: var(--paper);
  box-shadow: 0 40px 90px -28px rgba(30, 21, 12, 0.7), 0 2px 0 rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
  animation: modal-pop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.feature-photo {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--tone, #ead9c4);
}
.feature-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.feature-photo-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(24, 18, 13, 0.22) 0%, transparent 30%, transparent 62%, rgba(24, 18, 13, 0.64) 100%);
}
.feature-photo-badge {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 16px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 252, 245, 0.9);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  box-shadow: 0 5px 14px -10px rgba(32, 23, 14, 0.6);
  backdrop-filter: blur(8px);
}
.feature-photo-place {
  position: absolute;
  z-index: 2;
  left: 18px;
  right: 18px;
  bottom: 17px;
  color: rgba(255, 253, 248, 0.92);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 9px rgba(0, 0, 0, 0.45);
}
.feature-body {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 31px 30px 24px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 91, 62, 0.28) transparent;
}
.feature-body .eyebrow { color: var(--teal); }
.feature-body h2 {
  margin-top: 7px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 1.2px;
  color: var(--ink);
  padding-right: 34px;
}
.feature-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.feature-tags span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 800;
}
.feature-long {
  margin-top: 17px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.9;
  font-weight: 600;
}
.feature-tip {
  margin-top: 18px;
  padding: 13px 14px;
  border-radius: 15px;
  background: linear-gradient(145deg, #fff6d8, #ffecb8);
  border: 1px solid rgba(218, 169, 62, 0.22);
}
.feature-tip-kicker {
  display: block;
  color: #95651a;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.1px;
}
.feature-tip p { margin-top: 4px; color: #5d471c; font-size: 11.5px; line-height: 1.7; font-weight: 700; }
.feature-mission {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 15px;
  background: #f1f8f6;
  border: 1px dashed rgba(47, 139, 128, 0.24);
}
.feature-mission .feature-tip-kicker { color: var(--teal-deep); }
.feature-mission p { margin-top: 4px; color: var(--ink-2); font-size: 11px; line-height: 1.7; font-weight: 600; }
.feature-fallback-note { margin-top: 10px; color: var(--muted); font-size: 8.5px; font-weight: 600; }
.feature-nav {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.feature-nav-btn {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.feature-nav-btn:hover { border-color: var(--coral); color: var(--coral-deep); transform: translateY(-1px); }
.feature-counter { color: var(--muted); font-family: var(--font-ui); font-size: 9px; font-weight: 900; letter-spacing: 0.6px; }
.feature-actions { margin-top: 10px; }
.feature-actions .btn-ghost { width: 100%; min-height: 38px; font-size: 10.5px; }
.feature-credit {
  margin-top: 8px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
  letter-spacing: 0.1px;
}

/* ---------- Province city atlas modal ---------- */
.city-card {
  position: relative;
  width: min(1140px, 100%);
  height: min(86vh, 760px);
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(280px, 0.72fr);
  grid-template-rows: minmax(0, 1fr);
  border-radius: 27px;
  background: var(--paper);
  box-shadow: 0 40px 90px -28px rgba(30, 21, 12, 0.7), 0 2px 0 rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
}
.city-map-panel {
  min-width: 0;
  min-height: 0;
  padding: 23px 22px 18px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 25% 25%, rgba(255, 255, 255, 0.8), transparent 60%),
    linear-gradient(160deg, #fbf6ed, #f4ecdf);
  border-right: 1px dashed var(--line-strong);
}
.city-map-head { flex: 0 0 auto; padding-right: 34px; }
.city-map-head .eyebrow { color: var(--coral); }
.city-map-head .eyebrow-dot { background: var(--coral); box-shadow: 0 0 0 3px rgba(233, 107, 76, 0.13); }
.city-map-head h2 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 29px;
  letter-spacing: 0.8px;
  line-height: 1.2;
}
.city-map-sub { margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.6; font-weight: 600; }
.city-map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 11px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(99, 77, 51, 0.08);
  background:
    radial-gradient(ellipse at 50% 48%, rgba(255, 255, 255, 0.85), transparent 68%),
    #fbf7ef;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), inset 0 -18px 30px rgba(197, 177, 147, 0.12);
}
.city-atlas-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.city-outline { fill: #f0e7d8; stroke: #ddcdb4; stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.city-piece { cursor: pointer; outline: none; }
.city-shape {
  fill: var(--city-fill, #ffe1c7);
  stroke: #fffdf8;
  stroke-width: 1.25;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: none;
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 1.5px 1.5px rgba(85, 61, 35, 0.08));
}
.city-piece:hover .city-shape { filter: drop-shadow(0 4px 5px rgba(85, 61, 35, 0.16)); stroke: #fff; stroke-width: 1.8; }
.city-piece.is-active .city-shape {
  stroke: var(--ink);
  stroke-width: 2.2;
  filter: drop-shadow(0 5px 7px rgba(73, 51, 28, 0.2));
}
.city-piece:focus-visible .city-shape { stroke: var(--coral); stroke-width: 2.4; }
.city-piece.is-capital .city-shape { stroke: rgba(212, 63, 44, 0.5); }
.city-marker {
  fill: var(--city-fill, #ffd9c1);
  stroke: #fffdf8;
  stroke-width: 1.6;
  filter: drop-shadow(0 2px 2px rgba(85, 61, 35, 0.18));
}
.city-piece.is-active .city-marker { stroke: var(--ink); stroke-width: 2.3; }
.city-label {
  font-family: var(--font-ui);
  font-size: 9.6px;
  font-weight: 800;
  fill: #514538;
  paint-order: stroke;
  stroke: #fffdf8;
  stroke-width: 3.3px;
  stroke-linejoin: round;
  pointer-events: none;
  letter-spacing: 0.15px;
}
.city-label.is-capital {
  fill: #d43f2c;
  font-size: 10.6px;
  font-weight: 900;
  stroke: #fffaf0;
  stroke-width: 3.6px;
}
.city-capital-marker { pointer-events: none; }
.city-capital-marker .capital-halo {
  fill: rgba(255, 236, 218, 0.9);
  stroke: rgba(212, 63, 44, 0.58);
  stroke-width: 1.2;
  stroke-dasharray: 2.4 2;
}
.city-capital-marker .capital-marker-label { font-size: 13px; }
.city-map-legend {
  position: absolute;
  z-index: 3;
  left: 12px;
  bottom: 11px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 8.5px;
  font-weight: 800;
  box-shadow: 0 6px 16px -13px rgba(65, 47, 28, 0.6);
  backdrop-filter: blur(6px);
}
.city-map-legend .legend-star { color: #d43f2c; font-size: 10px; }
.city-side {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px 19px 18px;
  overflow: hidden;
  background: rgba(255, 253, 248, 0.95);
}
.city-side-head { flex: 0 0 auto; padding-right: 32px; }
.city-side-head .eyebrow { color: var(--teal); }
.city-side-head .eyebrow-dot { background: var(--teal); box-shadow: 0 0 0 3px rgba(47, 139, 128, 0.13); }
.city-side-tip { margin-top: 5px; color: var(--muted); font-size: 9.5px; font-weight: 600; }
.city-info {
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 16px;
  background: linear-gradient(150deg, #fbf6ec, #fffdf8);
  border: 1px solid rgba(107, 82, 52, 0.08);
}
.city-info-kicker { color: var(--coral-deep); font-size: 8px; font-weight: 900; letter-spacing: 1.2px; }
.city-info h3 {
  margin-top: 2px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: 0.8px;
}
.city-info h3.capital-name { color: #d43f2c; }
.city-info-type { margin-top: 2px; color: var(--muted); font-size: 8.5px; font-weight: 800; letter-spacing: 0.3px; }
.city-info p { margin-top: 7px; color: var(--ink-2); font-size: 10.5px; line-height: 1.7; font-weight: 600; }
.city-list-head {
  flex: 0 0 auto;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
}
.city-list {
  flex: 1 1 auto;
  min-height: 90px;
  margin-top: 4px;
  padding-right: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(115, 91, 62, 0.25) transparent;
}
.city-list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.city-list-item:hover { background: #fffaf1; }
.city-list-item.is-active { background: #fff; border-color: rgba(83, 64, 43, 0.12); box-shadow: 0 3px 8px -8px rgba(70, 50, 28, 0.5); }
.city-list-star { width: 11px; flex: 0 0 auto; color: var(--coral); font-size: 9px; text-align: center; }
.city-list-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-list-item.is-capital .city-list-name { color: #d43f2c; font-weight: 900; }
.city-list-type { margin-left: auto; flex: 0 0 auto; color: var(--muted); font-size: 7.5px; font-weight: 800; }
.city-list-item.is-capital .city-list-type { color: var(--coral-deep); }
.city-back { flex: 0 0 auto; width: 100%; min-height: 36px; margin-top: 9px; font-size: 10px; }

/* info modal */
.info-card {
  width: min(650px, 100%);
  height: min(84vh, 720px);
  max-height: min(84vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 40px 90px -28px rgba(30, 21, 12, 0.7);
  overflow: hidden;
  animation: modal-pop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.info-head {
  flex: 0 0 auto;
  padding: 24px 26px 16px;
  border-bottom: 1px dashed var(--line-strong);
  background: linear-gradient(180deg, #fffcf5, #fffdf8);
}
.info-head .eyebrow { color: var(--coral); }
.info-head .eyebrow-dot { background: var(--coral); box-shadow: 0 0 0 3px rgba(233, 107, 76, 0.13); }
.info-head h2 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.8px;
}
.info-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 26px 24px; }
.info-body p { color: var(--ink-2); font-size: 12.5px; line-height: 1.85; font-weight: 600; }
.info-body p + p { margin-top: 9px; }
.info-body h3 { margin-top: 18px; font-size: 11px; font-weight: 900; letter-spacing: 1.2px; }
.how-grid { margin-top: 12px; display: grid; gap: 8px; }
.how-step {
  display: flex;
  gap: 11px;
  padding: 11px;
  border-radius: 14px;
  background: var(--paper-soft);
  border: 1px solid rgba(110, 86, 56, 0.06);
}
.how-num {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink);
  color: #fffdf8;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 900;
}
.how-step strong { display: block; font-size: 11.5px; font-weight: 900; }
.how-step span { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.share-box { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.share-url {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(47, 139, 128, 0.2);
  border-radius: 11px;
  background: #f1faf6;
  color: var(--teal-deep);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}
.share-url:hover { background: #e8f7f1; transform: translateY(-1px); }
.share-url span { word-break: break-all; }
.share-url em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff;
  color: var(--coral-deep);
  font-style: normal;
  font-size: 9px;
  font-weight: 900;
}
.credit-list { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.credit-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--paper-soft);
  font-size: 9.5px;
  line-height: 1.5;
}
.credit-item strong { font-weight: 900; }
.credit-item a { color: var(--teal-deep); text-decoration: none; word-break: break-all; }
.credit-item a:hover { text-decoration: underline; }
.data-table { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 10px; }
.data-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); line-height: 1.5; }
.data-table td:first-child { width: 76px; font-weight: 900; color: var(--ink); }
.source-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.source-links a {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 800;
  text-decoration: none;
}
.source-links a:hover { border-color: var(--teal); color: var(--teal-deep); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(51, 42, 33, 0.96);
  color: #fffdf8;
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: 0 14px 32px -12px rgba(31, 21, 12, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.noscript {
  position: fixed;
  z-index: 300;
  inset: auto 20px 20px;
  padding: 14px;
  border-radius: 14px;
  background: #3d342c;
  color: #fff;
  text-align: center;
  font-size: 13px;
}

/* ---------- Animations ---------- */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px) scale(0.992); }
  to { opacity: 1; transform: none; }
}
@keyframes detail-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes hint-float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -3px); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.975); }
  to { opacity: 1; transform: none; }
}
@keyframes badge-pop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}
.map-label-group, .rank-flag { transform-box: fill-box; transform-origin: center; }
.province-shape { animation: piece-pop 0.48s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; animation-delay: calc(var(--index, 0) * 17ms + 100ms); }
/* After the page-load entrance, DOM reordering for z-order must stay silent. */
#chinaMap.is-settled .province-shape { animation: none; }

@keyframes piece-pop {
  from { opacity: 0; transform: scale(0.93); }
  to { opacity: 1; transform: scale(1); }
}


/* ---------- Responsive ---------- */
@media (max-width: 1440px) {
  .app { grid-template-columns: minmax(0, 1fr) 404px; gap: 15px; padding: 0 20px 10px; }
  .topbar { padding-left: 22px; padding-right: 22px; }
  .map-stage { padding: 17px 17px 13px; }
  .stage-head h1 { font-size: 26px; }
  .photo-hero { height: 212px; }
  .brand-name { font-size: 23px; }
}
@media (max-width: 1200px) {
  .app { grid-template-columns: minmax(0, 1fr) 376px; gap: 13px; padding: 0 15px 9px; }
  .topbar { gap: 16px; padding: 10px 17px 8px; }
  .brand-mark { width: 45px; height: 45px; border-radius: 14px; }
  .brand-mark svg { width: 31px; height: 31px; }
  .brand-name { font-size: 21px; }
  .brand-tag { font-size: 8px; letter-spacing: 2.6px; }
  .view-tab { padding: 0 12px; font-size: 12px; }
  .map-stage { padding: 15px 14px 12px; border-radius: 26px; }
  .stage-head h1 { font-size: 23px; }
  .stage-sub { font-size: 11px; }
  .photo-hero { height: 198px; }
  .empty-art { transform: scale(0.9); margin-top: -12px; margin-bottom: -10px; }
  .empty-state h2 { font-size: 27px; }
  .rank-head h2 { font-size: 23px; }
}

@media (max-width: 1080px) {
  body { height: auto; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
  .app {
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding-bottom: 11px;
  }
  .map-stage { flex: 0 0 auto; height: min(70vh, 700px); min-height: 540px; }
  .side-panel { flex: 0 0 auto; min-height: 470px; overflow: visible; }
  .panel-scroll { overflow: visible; height: auto; }
  .rank-panel { height: auto; overflow: visible; }
  .rank-list { overflow: visible; max-height: none; }
  .empty-state { min-height: 500px; }
  .place-card { min-height: 0; }
  .page-foot { padding-bottom: 12px; }
  .rank-head { padding-top: 20px; }
  .rank-list { padding-bottom: 4px; }
  .rank-foot { padding-bottom: 14px; }
}

@media (max-width: 900px) {
  .feature-card {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    height: calc(100dvh - 36px);
    max-height: calc(100dvh - 36px);
    border-radius: 23px;
  }
  .feature-photo {
    flex: 0 0 auto;
    height: 225px;
    min-height: 225px;
  }
  .feature-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px 19px 17px;
    overflow-y: auto;
  }
  .feature-body h2 { font-size: 32px; padding-right: 28px; }
  .feature-long { font-size: 12.5px; margin-top: 13px; }
  .feature-nav { padding-top: 16px; }
  .city-card {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: calc(100dvh - 36px);
    max-height: calc(100dvh - 36px);
    border-radius: 23px;
  }
  .city-map-panel {
    flex: 0 0 auto;
    height: 56%;
    min-height: 0;
    padding: 17px 15px 12px;
    border-right: 0;
    border-bottom: 1px dashed var(--line-strong);
  }
  .city-map-head { padding-right: 28px; }
  .city-map-head h2 { font-size: 24px; }
  .city-map-wrap { margin-top: 8px; border-radius: 16px; }
  .city-label { font-size: 13px; stroke-width: 4px; }
  .city-label.is-capital { font-size: 14px; }
  .city-capital-marker .capital-marker-label { font-size: 15px; }
  .city-map-legend { font-size: 7.5px; left: 8px; bottom: 8px; }
  .city-side {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: 13px 15px 12px;
    overflow-y: auto;
  }
  .city-side-tip { display: none; }
  .city-info { margin-top: 8px; padding: 10px 11px; }
  .city-info h3 { font-size: 23px; }
  .city-info p { display: none; }
  .city-list-head { margin-top: 9px; }
  .city-list { min-height: 50px; max-height: 150px; }
  .city-back { min-height: 34px; margin-top: 7px; }
  .city-teaser { flex-wrap: wrap; gap: 7px; }
  .city-teaser-copy { flex: 1 1 calc(100% - 50px); }
  .city-teaser-btn { margin-left: 43px; height: 27px; }
}

@media (max-width: 760px) {
  body { min-height: 100dvh; }
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 13px 8px;
  }
  .brand { order: 1; gap: 9px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 4px 0 #b8432c, 0 10px 18px -9px rgba(207, 75, 49, 0.6); }
  .brand-mark svg { width: 29px; height: 29px; }
  .brand-name { font-size: 21px; }
  .brand-tag { display: none; }
  .top-actions { order: 2; gap: 6px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 12px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .view-tabs { order: 3; width: 100%; margin-top: 1px; padding: 4px; }
  .view-tab { flex: 1; height: 34px; font-size: 12px; padding: 0 8px; }
  .view-tab svg { width: 16px; height: 16px; }
  .app { padding: 0 9px 9px; gap: 10px; }
  .map-stage { height: auto; min-height: 0; padding: 13px 11px 10px; border-radius: 24px; }
  .stage-head { align-items: center; gap: 8px; }
  .eyebrow { font-size: 8.5px; letter-spacing: 1.7px; }
  .stage-head h1 { font-size: 20px; margin-top: 3px; }
  .stage-sub { font-size: 10px; max-width: 210px; white-space: normal; }
  .stage-tools { padding-top: 0; gap: 5px; }
  .chip-btn { height: 33px; padding: 0 9px; font-size: 10.5px; gap: 3px; }
  .chip-btn span { font-size: 12px; }
  #cityMapBtn { display: none; }
  .icon-btn.small { width: 32px; height: 32px; }
  .toolbar { margin-top: 9px; gap: 4px; flex-wrap: wrap; overflow: visible; }
  .tool-pill { height: 28px; padding: 0 9px; font-size: 10.5px; }
  .map-label, .pin-group { display: none; }
  .map-board { flex: none; height: 40vh; min-height: 300px; max-height: 400px; margin-top: 6px; border-radius: 18px; }
  .map-focus { left: 8px; top: 8px; padding: 4px 5px 4px 8px; }
  .map-focus-open { font-size: 8px; }
  .map-focus-open strong { font-size: 11px; }
  .map-focus-close { width: 20px; height: 20px; }
  .map-hint { bottom: 9px; padding: 6px 9px; font-size: 9px; }
  .heat-legend { left: 9px; bottom: 9px; font-size: 8px; padding: 6px 7px; gap: 4px; }
  .legend-bar { width: 50px; height: 6px; }
  .zoom-controls { right: 8px; top: 8px; padding: 3px; gap: 3px; }
  .zoom-controls button { width: 27px; height: 27px; font-size: 17px; }
  .zoom-controls button svg { width: 13px; height: 13px; }
  .province-index {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 8px 20px 2px 1px;
    scrollbar-width: none;
    flex: 0 0 auto;
    mask-image: linear-gradient(90deg, #000 0%, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 92%, transparent 100%);
  }
  .province-index::-webkit-scrollbar { display: none; }
  .province-index::before {
    content: "速查";
    flex: 0 0 auto;
    align-self: center;
    padding-right: 3px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 1px;
  }
  .province-chip {
    flex: 0 0 auto;
    height: 25px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fffdf8;
    color: var(--ink-2);
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(79, 59, 38, 0.06);
  }
  .province-chip.is-active { background: var(--ink); color: #fffdf8; }
  .side-panel { border-radius: 24px; min-height: 430px; }
  .empty-art { width: 304px; }
  .empty-state { min-height: 470px; padding: 18px 18px; }
  .empty-art { transform: scale(0.83); margin: -20px 0 -16px; }
  .empty-state h2 { font-size: 26px; }
  .empty-state > p { font-size: 11.5px; }
  .empty-meta { margin-top: 14px; padding-top: 12px; }
  .photo-hero { height: 214px; border-radius: 19px; }
  .place-card { padding: 7px; }
  .place-body { padding: 12px 5px 6px; }
  .hero-title h2 { font-size: 29px; }
  .hero-emoji { width: 40px; height: 40px; font-size: 21px; border-radius: 12px; }
  .abbr-seal { width: 39px; height: 39px; font-size: 21px; }
  .fact-value { font-size: 18px; }
  .rank-head { padding: 17px 15px 7px; }
  .rank-head h2 { font-size: 23px; }
  .podium { padding: 0 9px 11px; gap: 5px; }
  .podium-place { width: 31%; padding: 8px 4px 7px; }
  .podium-place.is-first { width: 33%; }
  .podium-photo { width: 48px; height: 48px; }
  .is-first .podium-photo { width: 55px; height: 55px; }
  .podium-name { font-size: 12.5px; }
  .podium-value { font-size: 8px; }
  .rank-row { min-height: 38px; }
  .page-foot { padding: 0 14px 11px; font-size: 8.5px; }
  .page-foot > span:first-child { display: none; }
  .page-foot { justify-content: center; }
  .modal-backdrop { padding: 9px; align-items: flex-end; }
  .modal-card { grid-template-columns: 1fr; grid-template-rows: none; height: 92vh; max-height: 92vh; display: flex; flex-direction: column; border-radius: 23px; }
  .modal-photo { min-height: 210px; height: 210px; flex: 0 0 auto; }
  .modal-body { height: auto; flex: 1 1 auto; min-height: 0; }
  .modal-photo-content { left: 17px; right: 17px; bottom: 16px; }
  .modal-photo-content h2 { font-size: 35px; }
  .modal-photo-content .seal { margin-top: 8px; width: 38px; height: 38px; font-size: 21px; }
  .modal-photo-content .modal-caption { margin-top: 7px; font-size: 8.5px; }
  .modal-body { padding: 18px 16px 20px; overflow-y: auto; }
  .modal-body .modal-lede { font-size: 12.5px; }
  .modal-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spot-grid { grid-template-columns: 1fr; }
  .spot-card { display: flex; align-items: flex-start; gap: 8px; }
  .spot-card .icon { flex: 0 0 auto; }
  .spot-card h4 { margin-top: 0; }
  .quiz-options { grid-template-columns: 1fr; }
  .modal-actions .btn-primary { min-width: 0; }
  .info-card { height: 88vh; max-height: 88vh; }
  .info-head { padding: 20px 18px 13px; }
  .info-body { padding: 15px 18px 20px; }
  .info-head h2 { font-size: 24px; }
  .modal-close { top: 10px; right: 10px; width: 33px; height: 33px; }
  .toast { bottom: 18px; max-width: calc(100vw - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 19px; }
  .icon-btn { width: 35px; height: 35px; }
  .view-tab { font-size: 11.5px; }
  .stage-head h1 { font-size: 18px; }
  .stage-sub { max-width: 100%; white-space: normal; }
  .map-board { height: 39vh; min-height: 278px; }
  .empty-art { transform: scale(0.74); margin: -34px 0 -26px; }
  .empty-state h2 { font-size: 24px; }
  .empty-actions .btn-primary { min-height: 40px; }
  .modal-photo { height: 185px; min-height: 185px; }
  .modal-photo-content h2 { font-size: 31px; }
  .rank-abbr { width: 25px; height: 25px; font-size: 13px; }
  .rank-row { grid-template-columns: 18px 26px minmax(0, 1fr) auto; gap: 5px; padding-left: 4px; padding-right: 4px; }
  .rank-value { min-width: 48px; font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   City encyclopedia, city rankings, history time machine
   ============================================================ */
.taoyuan-body .city-detail-tags span {
  color: var(--ink-2);
  background: var(--paper-soft);
  border-color: var(--line);
}
.history-teaser {
  padding: 12px 13px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f4efff, #fffdf8);
  border: 1px solid rgba(123, 93, 183, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.history-teaser.is-compact { margin-top: 2px; }
.history-teaser-head { display: flex; align-items: center; gap: 8px; }
.history-teaser-icon {
  width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 9px; background: #fffdf8; border: 1px solid rgba(123, 93, 183, 0.14); font-size: 14px;
}
.history-teaser-kicker { color: #7a62b5; font-size: 7.5px; font-weight: 900; letter-spacing: 1.1px; }
.history-teaser h3 { margin-top: 1px; font-size: 11px; font-weight: 900; line-height: 1.3; }
.history-teaser-btn {
  margin-left: auto; flex: 0 0 auto; border: 0; background: transparent;
  color: var(--coral-deep); font-size: 8.5px; font-weight: 900; cursor: pointer; white-space: nowrap;
}
.history-era-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.history-era-row span {
  padding: 3px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(123, 93, 183, 0.13); color: #66518f; font-size: 8px; font-weight: 800;
}
.history-teaser-text { margin-top: 6px; color: var(--ink-2); font-size: 10.5px; line-height: 1.72; font-weight: 600; }
.history-teaser:not(.is-compact) .history-teaser-text { font-size: 12.5px; line-height: 1.85; }

.city-detail-link, .city-rank-link {
  border: 1px solid rgba(47, 139, 128, 0.18);
  background: #f2fbf7;
  color: var(--teal-deep);
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.city-detail-link {
  width: 100%; margin-top: 9px; height: 30px; font-size: 9px;
}
.city-detail-link:hover, .city-rank-link:hover { background: #fff; transform: translateY(-1px); }
.city-detail-link span { color: var(--coral); font-size: 11px; }
.city-rank-link {
  height: 24px; padding: 0 8px; margin-top: 6px; font-size: 8px; color: var(--coral-deep);
  background: #fff5ed; border-color: rgba(233, 107, 76, 0.18);
}
.rank-city-entry {
  margin-top: 7px; height: 27px; padding: 0 10px;
  border: 1px solid rgba(233, 107, 76, 0.18); border-radius: 999px;
  background: #fff4ec; color: var(--coral-deep);
  font-size: 9px; font-weight: 900; cursor: pointer;
}
.rank-city-entry:hover { background: #ffe9dd; }
.rank-city-entry span { font-size: 11px; }

/* City detail */
.city-detail-card {
  position: relative;
  width: min(1060px, 100%);
  height: min(86vh, 760px);
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  border-radius: 27px;
  background: var(--paper);
  box-shadow: 0 40px 90px -28px rgba(30, 21, 12, 0.7), 0 2px 0 rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
}
.city-detail-visual { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: linear-gradient(145deg, #efe3d2, #fbf6ed); }
.city-detail-visual > img { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.city-detail-fallback { position: absolute; z-index: 0; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #fffdf8, #eee3d3 75%); }
.city-thumb-svg { width: 100%; height: 100%; display: block; }
.city-thumb-outline { fill: #e8dccb; stroke: #cdbb9f; stroke-width: 1; }
.city-thumb-piece { fill: #f3e8d8; stroke: #fffdf8; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.city-thumb-piece.is-current { fill: var(--tone, #ffd9c1); stroke: var(--ink); stroke-width: 2.1; filter: drop-shadow(0 4px 5px rgba(65, 46, 27, 0.22)); }
.city-thumb-marker { fill: #f3e8d8; stroke: #fffdf8; stroke-width: 1.4; }
.city-thumb-marker.is-current { fill: var(--tone, #ffd9c1); stroke: var(--ink); stroke-width: 2; }
.city-detail-shade { position: absolute; z-index: 2; inset: 0; background: linear-gradient(180deg, rgba(22, 17, 13, 0.2) 0%, transparent 30%, rgba(22, 17, 13, 0.7) 100%); }
.city-detail-top { position: absolute; z-index: 3; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 8px; }
.city-capital-pill { padding: 5px 8px; border-radius: 999px; color: #fff; background: rgba(212, 63, 44, 0.82); font-size: 9px; font-weight: 900; }
.city-detail-title { position: absolute; z-index: 3; left: 18px; right: 18px; bottom: 18px; color: #fff; }
.city-detail-title .eyebrow { color: rgba(255, 253, 248, 0.78); }
.city-detail-title .eyebrow-dot { background: currentColor; box-shadow: none; }
.city-detail-title h2 { margin-top: 5px; font-family: var(--font-display); font-size: 38px; line-height: 1.1; letter-spacing: 1px; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); }
.city-detail-sub { margin-top: 3px; color: rgba(255, 253, 248, 0.82); font-size: 9.5px; font-weight: 800; }
.city-detail-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.city-detail-tags span { padding: 4px 7px; border-radius: 999px; color: #fffdf8; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.25); font-size: 8px; font-weight: 800; }
.city-detail-body { min-width: 0; overflow-y: auto; padding: 28px 26px 20px; scrollbar-width: thin; scrollbar-color: rgba(115, 91, 62, 0.28) transparent; }
.city-detail-lede { padding-right: 30px; color: var(--ink-2); font-size: 13px; line-height: 1.85; font-weight: 600; }
.taoyuan-body .city-detail-lede { padding-right: 34px; }
.city-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 15px; }
.city-stat-card { padding: 10px 10px 9px; border-radius: 13px; background: linear-gradient(145deg, #fbf6ec, #fffdf8); border: 1px solid rgba(106, 82, 52, 0.08); }
.city-stat-card .k { display: block; color: var(--muted); font-size: 8px; font-weight: 900; }
.city-stat-card .k i { font-style: normal; opacity: 0.7; }
.city-stat-card strong { display: block; margin-top: 2px; font-family: var(--font-ui); font-size: 18px; line-height: 1.15; white-space: nowrap; }
.city-stat-card strong small { margin-left: 2px; color: var(--muted); font-size: 7.5px; font-weight: 800; }
.city-rank-badge { display: block; margin-top: 3px; color: var(--coral-deep); font-size: 7.5px; font-weight: 900; line-height: 1.4; }
.city-rank-badge i { font-style: normal; margin: 0 2px; opacity: 0.4; }
.city-history-block { margin-top: 15px; padding: 13px 14px; border-radius: 15px; background: #f4efff; border: 1px solid rgba(123, 93, 183, 0.14); }
.city-block-title { display: flex; align-items: center; gap: 5px; color: #6d5799; font-size: 10px; font-weight: 900; letter-spacing: 1px; }
.city-history-block p { margin-top: 6px; color: var(--ink-2); font-size: 11.5px; line-height: 1.8; font-weight: 600; }
.city-rank-table { margin-top: 13px; border-top: 1px dashed var(--line); }
.city-rank-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 8px; padding: 7px 1px; border-bottom: 1px dashed var(--line); }
.city-rank-row > span { color: var(--ink-2); font-size: 9.5px; font-weight: 800; }
.city-rank-row strong { font-family: var(--font-ui); font-size: 12px; font-weight: 900; }
.city-rank-row strong small { margin-left: 2px; color: var(--muted); font-size: 7px; }
.city-rank-row em { color: var(--muted); font-size: 7.5px; font-style: normal; font-weight: 800; text-align: right; }
.taoyuan-peek { margin-top: 14px; padding: 13px; border-radius: 16px; background: linear-gradient(145deg, #fff4ef, #fffdf8); border: 1px solid rgba(233, 107, 76, 0.18); }
.taoyuan-peek-head { display: flex; align-items: center; gap: 8px; }
.taoyuan-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: #fff; font-size: 16px; }
.taoyuan-peek-head p { color: var(--coral-deep); font-size: 7.5px; font-weight: 900; letter-spacing: 1px; }
.taoyuan-peek-head h3 { margin-top: 1px; font-family: var(--font-display); font-size: 20px; font-weight: 400; }
.taoyuan-peek > p { margin-top: 7px; color: var(--ink-2); font-size: 10px; line-height: 1.7; font-weight: 600; }
.taoyuan-peek-btn { margin-top: 7px; border: 0; background: transparent; padding: 0; color: var(--coral-deep); font-size: 9px; font-weight: 900; cursor: pointer; }
.city-detail-actions { display: flex; gap: 7px; margin-top: 15px; }
.city-detail-actions > * { flex: 1; min-height: 38px; font-size: 10px; }
/* Detail rank table uses the same row name as the ranking modal, so scope it. */
.city-detail-body .city-rank-row {
  grid-template-columns: 70px minmax(0, 1fr) auto;
  width: auto; padding: 7px 1px; border-radius: 0;
  background: transparent; cursor: default;
}
.city-detail-body .city-rank-row:hover { background: transparent; }
.city-detail-body .city-rank-row > span { white-space: nowrap; }

/* Taoyuan county */
.taoyuan-card {
  position: relative; width: min(980px, 100%); height: min(84vh, 700px);
  display: grid; grid-template-columns: 0.86fr 1.14fr; border-radius: 27px; overflow: hidden;
  background: var(--paper); box-shadow: 0 40px 90px -28px rgba(30, 21, 12, 0.7);
}
.taoyuan-photo { position: relative; min-height: 0; overflow: hidden; background: linear-gradient(145deg, #f4b6b0, #f7dec6); }
.taoyuan-photo img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; z-index: 1; }
.taoyuan-photo-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 90px; opacity: 0.65; background: radial-gradient(circle at 30% 25%, #ffe8de, #f7cfc2); }
.taoyuan-photo-shade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, transparent 25%, rgba(33, 20, 15, 0.72) 100%); }
.taoyuan-photo-copy { position: absolute; z-index: 3; left: 20px; right: 20px; bottom: 20px; color: #fff; }
.taoyuan-photo-copy .eyebrow { color: rgba(255,253,248,.8); }
.taoyuan-photo-copy .eyebrow-dot { background: currentColor; box-shadow: none; }
.taoyuan-photo-copy h2 { margin-top: 5px; font-family: var(--font-display); font-size: 38px; font-weight: 400; }
.taoyuan-photo-copy > p:last-child { margin-top: 4px; color: rgba(255,253,248,.8); font-size: 9.5px; font-weight: 700; }
.taoyuan-body { overflow-y: auto; padding: 28px 26px 20px; }
.taoyuan-timeline { margin-top: 13px; display: flex; flex-direction: column; gap: 6px; }
.taoyuan-timeline > div { display: flex; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--paper-soft); }
.taoyuan-timeline span { flex: 0 0 54px; color: var(--coral-deep); font-size: 9px; font-weight: 900; }
.taoyuan-timeline p { color: var(--ink-2); font-size: 10px; line-height: 1.6; font-weight: 600; }

/* City rankings modal */
.city-rank-card {
  position: relative; width: min(1020px, 100%); height: min(86vh, 760px);
  display: flex; flex-direction: column; border-radius: 27px; overflow: hidden;
  background: var(--paper); box-shadow: 0 40px 90px -28px rgba(30, 21, 12, 0.7);
}
.city-rank-head { flex: 0 0 auto; padding: 24px 27px 12px; border-bottom: 1px dashed var(--line-strong); }
.city-rank-head .eyebrow { color: var(--coral); }
.city-rank-head .eyebrow-dot { background: var(--coral); box-shadow: 0 0 0 3px rgba(233,107,76,.13); }
.city-rank-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 4px; }
.city-rank-title-row h2 { font-family: var(--font-display); font-size: 28px; font-weight: 400; letter-spacing: 0.6px; }
.city-rank-title-row > span { color: var(--muted); font-size: 8.5px; font-weight: 800; }
.city-rank-sub { margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.5; font-weight: 600; }
.city-rank-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 11px; }
.city-scope-switch { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--paper-soft); border: 1px solid var(--line); }
.city-scope-switch button, .city-metric-switch button {
  height: 27px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent;
  color: var(--ink-2); font-size: 9px; font-weight: 800; cursor: pointer;
}
.city-scope-switch button.is-active { background: var(--ink); color: #fffdf8; box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.city-province-select { display: inline-flex; align-items: center; gap: 5px; height: 33px; padding: 0 7px 0 9px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf8; color: var(--muted); font-size: 8px; font-weight: 900; }
.city-province-select.is-muted { opacity: 0.5; }
.city-province-select select { max-width: 120px; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 9px; font-weight: 800; outline: none; cursor: pointer; }
.city-metric-switch { display: flex; gap: 4px; margin-left: auto; }
.city-metric-switch button { border: 1px solid var(--line); background: #fffdf8; }
.city-metric-switch button.is-active { color: #fff; background: var(--coral); border-color: var(--coral); box-shadow: 0 2px 0 #bd4c33; }
.city-rank-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 13px 20px 5px; }
.city-rank-podium { display: flex; align-items: stretch; justify-content: center; gap: 7px; padding: 3px 0 12px; }
.city-podium-place { width: 150px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(160deg,#fffdf8,#f8f1e4); text-align: center; cursor: pointer; }
.city-podium-place.city-podium-1 { background: linear-gradient(160deg,#fff9e8,#ffefc2); border-color: rgba(213,165,49,.25); }
.city-podium-medal { display: block; font-size: 19px; }
.city-podium-place strong { display: block; margin-top: 2px; font-size: 13px; font-weight: 900; }
.city-podium-place > span:last-child { display: block; margin-top: 2px; color: var(--coral-deep); font-size: 9px; font-weight: 900; }
.city-rank-list { display: flex; flex-direction: column; gap: 2px; }
.city-rank-row { width: 100%; display: grid; grid-template-columns: 26px 31px minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 7px 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; }
.city-rank-row:hover { background: #fffaf1; }
.city-rank-num { color: var(--muted); font-family: var(--font-ui); font-size: 10px; font-weight: 900; text-align: center; }
.city-rank-abbr { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #f7eee0; color: var(--ink-2); font-family: var(--font-display); font-size: 12px; }
.city-rank-main { min-width: 0; }
.city-rank-main strong { display: block; font-size: 11px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-rank-main small { display: block; margin-top: 1px; color: var(--muted); font-size: 7.5px; font-weight: 700; }
.city-rank-value { color: var(--ink-2); font-family: var(--font-ui); font-size: 10px; font-weight: 900; white-space: nowrap; }
.city-rank-value small { margin-left: 1px; color: var(--muted); font-size: 7px; }
.city-rank-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 11px; }
.city-rank-foot { flex: 0 0 auto; padding: 7px 20px 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 7.5px; text-align: center; }

/* History time machine */
.history-card {
  position: relative; width: min(1120px, 100%); height: min(86vh, 780px);
  display: flex; flex-direction: column; border-radius: 27px; overflow: hidden;
  background: var(--paper); box-shadow: 0 40px 90px -28px rgba(30, 21, 12, 0.7);
}
.history-head { flex: 0 0 auto; padding: 24px 28px 13px; background: linear-gradient(180deg,#fffdf8,#fbf6ec); border-bottom: 1px dashed var(--line-strong); }
.history-head .eyebrow { color: #7a62b5; }
.history-head .eyebrow-dot { background: #7a62b5; box-shadow: 0 0 0 3px rgba(122,98,181,.13); }
.history-head h2 { margin-top: 3px; font-family: var(--font-display); font-size: 31px; font-weight: 400; letter-spacing: .8px; }
.history-head > p:not(.eyebrow) { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.55; font-weight: 600; }
.dynasty-ribbon { display: flex; align-items: center; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.dynasty-ribbon span { padding: 4px 8px; border-radius: 999px; background: #f2ecff; color: #66518f; font-size: 8.5px; font-weight: 900; }
.dynasty-ribbon i { width: 12px; height: 1px; background: #c8b9e8; }
.history-layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.history-index { min-height: 0; overflow-y: auto; padding: 15px 14px; border-right: 1px dashed var(--line-strong); background: #fbf7ef; }
.history-index-label { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: 1px; }
.history-province-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 7px; }
.history-province-btn { height: 31px; display: flex; align-items: center; gap: 5px; padding: 0 7px; border: 1px solid transparent; border-radius: 8px; background: #fffdf8; color: var(--ink-2); font-size: 9.5px; font-weight: 800; text-align: left; cursor: pointer; }
.history-province-btn:hover { border-color: var(--line); }
.history-province-btn.is-active { background: var(--ink); color: #fffdf8; border-color: var(--ink); }
.history-province-btn span { font-size: 13px; }
.history-index-note { margin-top: 12px; color: var(--muted); font-size: 8px; line-height: 1.6; font-weight: 600; }
.history-content { min-height: 0; overflow-y: auto; padding: 21px 26px 20px; }
.history-detail-head .eyebrow { color: var(--coral); }
.history-detail-head .eyebrow-dot { background: var(--coral); box-shadow: 0 0 0 3px rgba(233,107,76,.13); }
.history-detail-head h2 { margin-top: 4px; font-family: var(--font-display); font-size: 30px; font-weight: 400; letter-spacing: .7px; }
.history-detail-sub { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.6; font-weight: 600; }
.history-timeline { margin-top: 15px; display: flex; flex-direction: column; gap: 7px; }
.history-node { display: flex; gap: 9px; padding: 9px 11px; border-radius: 11px; background: #fbf6ec; border: 1px solid rgba(106,82,52,.06); }
.history-node-dot { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--font-ui); font-size: 8px; font-weight: 900; }
.history-node strong { color: var(--coral-deep); font-size: 9px; font-weight: 900; }
.history-node p { margin-top: 2px; color: var(--ink-2); font-size: 10.5px; line-height: 1.65; font-weight: 600; }
.history-long { margin-top: 15px; color: var(--ink-2); font-size: 12px; line-height: 1.9; font-weight: 600; }
.history-taoyuan { margin-top: 15px; display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 13px; background: #fff4ef; border: 1px dashed rgba(233,107,76,.25); }
.history-taoyuan > span { font-size: 22px; }
.history-taoyuan strong { display: block; font-size: 10px; font-weight: 900; }
.history-taoyuan p { margin-top: 1px; color: var(--muted); font-size: 8.5px; font-weight: 600; }
.history-taoyuan button { margin-left: auto; border: 0; background: transparent; color: var(--coral-deep); font-size: 8.5px; font-weight: 900; cursor: pointer; white-space: nowrap; }
.history-actions { margin-top: 16px; }
.history-actions .btn-ghost { min-height: 36px; font-size: 10px; }
.history-empty { padding: 30px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .city-detail-card { display: flex; flex-direction: column; height: calc(100dvh - 36px); max-height: calc(100dvh - 36px); border-radius: 23px; }
  .city-detail-visual { flex: 0 0 auto; height: 245px; min-height: 245px; }
  .city-detail-top { right: 58px; }
  .city-detail-body { flex: 1 1 auto; min-height: 0; padding: 17px 16px 15px; }
  .city-stat-grid { gap: 5px; }
  .city-stat-card strong { font-size: 16px; }
  .city-detail-title h2 { font-size: 33px; }
  .taoyuan-card { display: flex; flex-direction: column; height: calc(100dvh - 36px); max-height: calc(100dvh - 36px); border-radius: 23px; }
  .taoyuan-photo { flex: 0 0 auto; height: 220px; min-height: 220px; }
  .taoyuan-body { flex: 1 1 auto; min-height: 0; padding: 18px 16px 15px; }
  .taoyuan-photo-copy h2 { font-size: 33px; }
  .city-rank-card { height: calc(100dvh - 36px); max-height: calc(100dvh - 36px); border-radius: 23px; }
  .city-rank-head { padding: 19px 16px 10px; }
  .city-rank-title-row h2 { font-size: 24px; }
  .city-rank-controls { gap: 5px; }
  .city-metric-switch { margin-left: 0; width: 100%; }
  .city-metric-switch button { flex: 1; padding: 0 5px; font-size: 8px; }
  .city-rank-body { padding: 10px 10px 3px; }
  .city-podium-place { width: 30%; padding: 8px 5px; }
  .city-podium-place strong { font-size: 11px; }
  .city-podium-place > span:last-child { font-size: 8px; }
  .city-rank-foot { font-size: 7px; }
  .history-card { height: calc(100dvh - 36px); max-height: calc(100dvh - 36px); border-radius: 23px; }
  .history-head { padding: 18px 17px 10px; }
  .history-head h2 { font-size: 26px; }
  .history-head > p:not(.eyebrow) { font-size: 9px; }
  .dynasty-ribbon { margin-top: 8px; }
  .history-layout { display: flex; flex-direction: column; }
  .history-index { flex: 0 0 auto; max-height: 220px; overflow-y: auto; border-right: 0; border-bottom: 1px dashed var(--line-strong); padding: 10px 12px; }
  .history-province-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
  .history-province-btn { height: 26px; padding: 0 4px; font-size: 8px; gap: 2px; }
  .history-province-btn span { font-size: 10px; }
  .history-index-note { display: none; }
  .history-content { flex: 1 1 auto; padding: 15px 16px 18px; }
  .history-detail-head h2 { font-size: 26px; }
  .history-long { font-size: 11px; }
}

/* ============================================================
   World map view
   ============================================================ */
.world-territories { pointer-events: none; }
.world-territory {
  fill: #e5ebe7;
  stroke: #fffdf8;
  stroke-width: 0.55;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.world-territory-label text {
  fill: #8b9b94;
  font-family: var(--font-ui);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  paint-order: stroke;
  stroke: rgba(255, 253, 248, 0.9);
  stroke-width: 2px;
}
.world-country { cursor: pointer; outline: none; }
.world-country .country-shape {
  fill: var(--continent-color, #e7dfd2);
  stroke: #fffdf8;
  stroke-width: 0.65;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: none;
  filter: drop-shadow(0 1px 1px rgba(70, 51, 32, 0.12));
}
.world-country:hover .country-shape,
.world-country:focus-visible .country-shape {
  stroke: #8c6a47;
  stroke-width: 1.1;
  filter: drop-shadow(0 3px 3px rgba(70, 51, 32, 0.22));
}
.world-country.is-selected .country-shape {
  stroke: var(--ink);
  stroke-width: 1.35;
  filter: drop-shadow(0 4px 4px rgba(70, 51, 32, 0.3));
}
.world-country.is-dim { opacity: 0.28; }
.world-country[data-code="CHN"] .country-shape {
  fill: #ffc9a4;
  stroke: #a15d3c;
  stroke-width: 1;
}
.world-country[data-code="CHN"]:hover .country-shape,
.world-country[data-code="CHN"].is-selected .country-shape {
  stroke: var(--ink);
  stroke-width: 1.5;
}
.world-marker-dot {
  fill: var(--continent-color, #e7dfd2);
  stroke: #fffdf8;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1px 1px rgba(70, 51, 32, 0.2));
}
.world-country:hover .world-marker-dot,
.world-country.is-selected .world-marker-dot {
  fill: var(--coral);
  stroke: var(--ink);
  stroke-width: 1.3;
}
.world-marker-hit { fill: transparent; }
.world-grid line { stroke: rgba(90, 123, 123, 0.12); stroke-width: 0.65; stroke-dasharray: 2 5; }
.world-equator { stroke: rgba(79, 124, 126, 0.3); stroke-width: 0.9; stroke-dasharray: 5 6; }
.world-label text {
  fill: #5b4634;
  font-family: var(--font-ui);
  font-size: 8.6px;
  font-weight: 900;
  letter-spacing: 0.4px;
  paint-order: stroke;
  stroke: rgba(255, 253, 248, 0.94);
  stroke-width: 2.2px;
  stroke-linejoin: round;
}
.world-label.is-dim { opacity: 0.18; }
.world-label.is-active text { fill: var(--coral-deep); font-size: 10px; }
.world-ocean-labels text {
  fill: #7da0a0;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
  opacity: 0.46;
  pointer-events: none;
}
#chinaMap.is-world .map-compass { opacity: 0.8; }
.map-board.is-world { background: linear-gradient(180deg, #fffdf8, #f6fbf8 70%, #eef8f4); }

/* World quick index */
.country-index { display: none; gap: 5px; overflow-x: auto; flex: 0 0 auto; padding: 8px 20px 2px 1px; scrollbar-width: none; }
.country-index:not([hidden]) { display: flex; }
.province-index[hidden] { display: none !important; }
.country-index::-webkit-scrollbar { display: none; }
.country-index::before { display: none !important; }
.country-index-label { flex: 0 0 auto; align-self: center; padding-right: 3px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: 1px; }
.country-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; height: 27px; padding: 0 8px 0 5px; }
.country-chip img { width: 18px; height: 12px; object-fit: cover; border-radius: 2px; box-shadow: 0 1px 2px rgba(54, 41, 27, 0.18); flex: 0 0 auto; }
.country-chip span { font-size: 9.5px; line-height: 1; white-space: nowrap; }
.country-chip.is-active { background: var(--ink); color: #fffdf8; border-color: var(--ink); }

/* World country card */
.world-card {
  border-radius: 23px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 22px 46px -26px rgba(51, 36, 22, 0.55);
}
.country-hero {
  position: relative;
  min-height: 218px;
  padding: 20px 19px 17px;
  display: flex;
  align-items: flex-end;
  gap: 13px;
  background:
    radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.9), transparent 43%),
    linear-gradient(145deg, var(--tone, #ffd7b8), #fff9ef);
  color: var(--ink);
  overflow: hidden;
}
.country-hero::after {
  content: "";
  position: absolute;
  right: -22px; top: -26px;
  width: 150px; height: 150px;
  border: 1px dashed rgba(80, 61, 42, 0.14);
  border-radius: 50%;
  pointer-events: none;
}
.country-flag-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 72px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #fffdf8;
  border: 3px solid rgba(255, 253, 248, 0.9);
  box-shadow: 0 5px 13px -5px rgba(61, 44, 27, 0.45);
}
.country-flag-wrap img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.country-flag-emoji { position: absolute; z-index: 0; font-size: 25px; opacity: 0.5; }
.country-hero-copy { position: relative; z-index: 1; min-width: 0; }
.country-hero-copy .region-pill { background: rgba(255, 253, 248, 0.6); border-color: rgba(80, 61, 42, 0.1); color: var(--ink-2); font-size: 8px; }
.country-hero-copy .region-pill .dot { background: var(--coral); }
.country-hero-copy h2 { margin-top: 5px; font-family: var(--font-display); font-size: 30px; font-weight: 400; line-height: 1.1; letter-spacing: 0.7px; }
.country-en { margin-top: 2px; color: var(--muted); font-size: 9.5px; font-weight: 800; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-capital { margin-top: 8px; color: var(--ink-2); font-size: 11px; font-weight: 800; }
.country-capital > span { margin-right: 4px; padding: 3px 6px; border-radius: 999px; background: rgba(255, 253, 248, 0.62); color: var(--coral-deep); font-size: 7.5px; }
.country-capital small { margin-left: 3px; color: var(--muted); font-size: 8px; font-weight: 700; }
.world-card .hero-close {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  left: auto;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.72);
  border-color: rgba(80, 61, 42, 0.12);
  backdrop-filter: blur(8px);
}
.world-card .hero-close:hover { background: rgba(255, 253, 248, 0.96); }
.country-body { padding: 15px 16px 17px; }
.country-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.country-fact { padding: 9px 10px 8px; border-radius: 12px; background: linear-gradient(145deg, #fbf6ec, #fffdf8); border: 1px solid rgba(106, 82, 52, 0.08); }
.country-fact .fact-label { font-size: 8.5px; }
.country-fact .fact-value { margin-top: 2px; font-family: var(--font-ui); font-size: 18px; font-weight: 900; line-height: 1.15; white-space: nowrap; }
.country-fact .fact-value small { margin-left: 2px; color: var(--muted); font-size: 7.5px; font-weight: 800; }
.world-rank-pill { display: inline-block; margin-top: 4px; color: var(--coral-deep); font-size: 7.5px; font-weight: 900; }
.country-info { margin-top: 13px; border-top: 1px dashed var(--line); }
.country-info h3 { padding: 10px 0 3px; color: var(--ink-2); font-size: 10px; font-weight: 900; letter-spacing: 0.7px; }
.country-info-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 5px 1px; border-bottom: 1px dashed rgba(124, 99, 68, 0.1); }
.country-info-row > span { color: var(--muted); font-size: 8.5px; font-weight: 800; }
.country-info-row > strong { color: var(--ink-2); font-size: 10px; font-weight: 900; text-align: right; }
.country-info-row > strong small { margin-left: 2px; color: var(--muted); font-size: 7.5px; font-weight: 700; }
.china-world-callout {
  display: flex; align-items: center; gap: 8px;
  margin-top: 13px; padding: 11px 12px;
  border-radius: 14px; background: linear-gradient(145deg, #fff1e9, #fffdf8);
  border: 1px solid rgba(233, 107, 76, 0.18);
}
.china-world-callout > img { width: 30px; height: 21px; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 3px rgba(54, 41, 27, 0.2); }
.china-world-callout strong { display: block; font-size: 10px; font-weight: 900; }
.china-world-callout p { margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.45; font-weight: 600; }
.china-world-callout button { margin-left: auto; border: 0; background: transparent; color: var(--coral-deep); font-size: 8.5px; font-weight: 900; white-space: nowrap; cursor: pointer; }
.world-only-note { margin-top: 13px; padding: 9px 11px; border-radius: 12px; background: #f5f8f4; color: var(--muted); font-size: 8.5px; line-height: 1.55; font-weight: 600; }

/* World empty state */
.world-empty { padding: 4px 0 10px; text-align: center; }
.world-empty-art { position: relative; height: 176px; margin: 0 -4px 2px; display: grid; place-items: center; overflow: hidden; }
.world-globe { position: relative; z-index: 2; font-size: 82px; line-height: 1; filter: drop-shadow(0 13px 13px rgba(107, 82, 48, 0.2)); transform: rotate(-7deg); }
.world-orbit { position: absolute; width: 210px; height: 92px; border: 1.5px dashed rgba(76, 139, 131, 0.28); border-radius: 50%; transform: rotate(-18deg); }
.world-orbit.orbit-b { width: 250px; height: 120px; border-color: rgba(233, 107, 76, 0.2); transform: rotate(14deg); }
.world-flag-strip { position: absolute; z-index: 3; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px 7px; border-radius: 10px; background: rgba(255, 253, 248, 0.82); box-shadow: 0 4px 12px -8px rgba(56, 40, 24, 0.4); }
.world-flag-strip img { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; }
.world-empty .empty-kicker { margin-top: 0; }
.world-empty h2 { margin-top: 3px; font-family: var(--font-display); font-size: 28px; font-weight: 400; line-height: 1.25; letter-spacing: 0.5px; }
.world-empty > p:not(.empty-kicker) { margin: 8px auto 0; max-width: 290px; color: var(--muted); font-size: 11px; line-height: 1.78; font-weight: 600; }
.world-empty .empty-actions { margin-top: 15px; flex-wrap: wrap; }
.world-empty .empty-actions > * { flex: 1 1 120px; min-height: 38px; font-size: 10px; }
.world-empty .empty-meta { margin-top: 14px; border-top: 0; }
.world-empty .empty-meta strong { font-size: 14px; }

@media (max-width: 900px) {
  .country-index:not([hidden]) { display: none !important; }
  .country-hero { min-height: 188px; padding: 16px 14px 14px; }
  .country-hero-copy h2 { font-size: 26px; }
  .country-flag-wrap { width: 58px; height: 40px; border-width: 2px; }
  .country-body { padding: 13px 13px 15px; }
  .country-fact .fact-value { font-size: 16px; }
  .world-empty-art { height: 145px; }
  .world-globe { font-size: 66px; }
  .world-empty h2 { font-size: 25px; }
}
@media (max-width: 760px) {
  .country-index:not([hidden]) { display: flex !important; }
  .world-label-layer { display: none; }
  .world-ocean-labels { display: none; }
  .country-index-label { display: none; }
  .country-chip { height: 25px; padding: 0 7px 0 4px; }
  .country-chip img { width: 16px; height: 11px; }
  .country-chip span { font-size: 9px; }
  .world-country .country-shape { stroke-width: 0.5; }
  .world-country[data-code="CHN"] .country-shape { stroke-width: 0.8; }
}

/* ============================================================
   Country ranking + full country dossier
   ============================================================ */
.country-rank-view .world-country[data-code="CHN"] .country-shape { fill: var(--continent-color); }
.country-podium { display: flex; align-items: stretch; justify-content: center; gap: 7px; padding: 4px 12px 12px; }
.country-podium-place {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 8px 9px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(160deg, #fffdf8, #f8f1e4);
  text-align: center;
  cursor: pointer;
}
.country-podium-place.is-first { background: linear-gradient(160deg,#fff9e8,#ffefc2); border-color: rgba(213,165,49,.25); }
.country-podium-flag { position: relative; width: 42px; height: 28px; margin: 0 auto 5px; border-radius: 4px; overflow: visible; }
.country-podium-flag img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; box-shadow: 0 3px 8px -3px rgba(54,41,27,.35); }
.country-podium-flag .medal { position: absolute; right: -7px; bottom: -5px; width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--paper); color: #fff; font-family: var(--font-ui); font-size: 8px; font-weight: 900; }
.country-podium-place .podium-name { margin-top: 2px; font-size: 11px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-podium-place .podium-value { margin-top: 2px; color: var(--coral-deep); font-family: var(--font-ui); font-size: 8.5px; font-weight: 900; }
.country-rank-row .country-rank-flag { width: 27px; height: 19px; display: inline-flex; align-items: center; overflow: hidden; border-radius: 3px; }
.country-rank-row .country-rank-flag img { width: 100%; height: 100%; object-fit: cover; }
.country-rank-en { margin-left: 4px; color: var(--muted); font-size: 7px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-rank-row .rank-name-line { display: flex; align-items: baseline; min-width: 0; }
.world-country.is-rank-highlight .country-shape { stroke: var(--ink); stroke-width: 1.25; filter: drop-shadow(0 3px 3px rgba(70,51,32,.3)); }

.country-profile-preview {
  margin-top: 13px; padding: 12px;
  border-radius: 14px; background: #f4efff; border: 1px solid rgba(123,93,183,.15);
}
.country-preview-head { display: flex; align-items: center; gap: 5px; color: #6d5799; }
.country-preview-head h3 { font-size: 10px; font-weight: 900; letter-spacing: .5px; }
.country-profile-preview > p { margin-top: 6px; color: var(--ink-2); font-size: 10.5px; line-height: 1.72; font-weight: 600; }
.country-preview-highlights { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; }
.country-preview-highlights span { color: var(--ink-2); font-size: 8.5px; line-height: 1.5; font-weight: 600; }
.country-preview-highlights b { display: inline-block; min-width: 25px; margin-right: 4px; color: #6d5799; font-size: 8px; font-weight: 900; }
.country-preview-link { border: 0; background: transparent; padding: 0; color: var(--coral-deep); font: inherit; font-size: 8.5px; font-weight: 800; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; cursor: pointer; }
.country-preview-link:hover { color: var(--ink); }
.country-preview-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.country-preview-tags span { padding: 3px 7px; border-radius: 999px; background: #fffdf8; color: #66518f; font-size: 7.5px; font-weight: 800; }
.country-profile-preview > button { margin-top: 8px; border: 0; background: transparent; padding: 0; color: var(--coral-deep); font-size: 9px; font-weight: 900; cursor: pointer; }

.country-modal-card {
  position: relative; width: min(1040px, 100%); height: min(88vh, 820px);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 27px;
  background: var(--paper); box-shadow: 0 40px 90px -28px rgba(30,21,12,.7);
}
.country-modal-hero { flex: 0 0 auto; display: flex; align-items: center; gap: 17px; padding: 22px 28px; background: linear-gradient(120deg, var(--tone), #fff9ef 74%); border-bottom: 1px solid rgba(106,82,52,.08); }
.country-modal-flag { position: relative; flex: 0 0 auto; width: 92px; height: 63px; display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: #fffdf8; border: 3px solid rgba(255,253,248,.9); box-shadow: 0 7px 16px -7px rgba(54,41,27,.45); }
.country-modal-flag img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.country-modal-flag > span { position: absolute; z-index: 0; font-size: 30px; opacity: .45; }
.country-modal-copy { min-width: 0; }
.country-modal-copy .eyebrow { color: var(--coral-deep); }
.country-modal-copy .eyebrow-dot { background: var(--coral); box-shadow: 0 0 0 3px rgba(233,107,76,.14); }
.country-modal-copy h2 { font-family: var(--font-display); font-size: 34px; font-weight: 400; line-height: 1.08; letter-spacing: .8px; }
.country-modal-copy .country-en { margin-top: 2px; font-size: 10px; }
.country-modal-capital { margin-top: 6px; color: var(--ink-2); font-size: 11px; font-weight: 800; }
.country-modal-capital small { margin-left: 3px; color: var(--muted); font-size: 8px; }
.country-modal-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.country-modal-tags span { padding: 3px 7px; border-radius: 999px; background: rgba(255,253,248,.65); color: var(--ink-2); font-size: 7.5px; font-weight: 800; }
.country-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 26px 20px; }
.country-modal-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.country-modal-facts > div { padding: 9px 11px; border-radius: 11px; background: linear-gradient(145deg,#fbf6ec,#fffdf8); border: 1px solid rgba(106,82,52,.08); }
.country-modal-facts span { display: block; color: var(--muted); font-size: 8px; font-weight: 900; }
.country-modal-facts strong { display: block; margin-top: 2px; font-family: var(--font-ui); font-size: 16px; font-weight: 900; white-space: nowrap; }
.country-modal-facts strong small { margin-left: 2px; color: var(--muted); font-size: 7px; }
.country-modal-section { margin-top: 16px; }
.country-modal-section h3 { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; color: var(--ink-2); font-size: 11px; font-weight: 900; letter-spacing: .4px; }
.country-modal-section > p { color: var(--ink-2); font-size: 11.5px; line-height: 1.85; font-weight: 600; }
.country-timeline { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.country-timeline > div { display: flex; gap: 8px; padding: 7px 10px; border-radius: 10px; background: #fbf6ec; }
.country-timeline > div > span { flex: 0 0 18px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--font-ui); font-size: 7px; font-weight: 900; }
.country-timeline strong { color: var(--coral-deep); font-size: 8.5px; font-weight: 900; }
.country-timeline p { margin-top: 1px; color: var(--ink-2); font-size: 10px; line-height: 1.55; font-weight: 600; }
.country-people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.country-person { padding: 9px 10px; border-radius: 11px; background: #f4efff; border: 1px solid rgba(123,93,183,.13); }
.country-person strong { display: block; color: #5d4789; font-size: 10px; font-weight: 900; }
.country-person p { margin-top: 3px; color: var(--ink-2); font-size: 9px; line-height: 1.55; font-weight: 600; }
.country-sights-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.country-sight { display: flex; gap: 7px; padding: 9px 10px; border-radius: 11px; background: linear-gradient(145deg,#fff8ed,#fffdf8); border: 1px solid rgba(233,107,76,.11); }
.country-sight > span { flex: 0 0 18px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 6px; background: var(--coral); color: #fff; font-family: var(--font-ui); font-size: 8px; font-weight: 900; }
.country-sight strong { display: block; font-size: 9.5px; font-weight: 900; }
.country-sight p { margin-top: 2px; color: var(--muted); font-size: 8.5px; line-height: 1.5; font-weight: 600; }
.country-modal-china { margin-top: 15px; display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-radius: 13px; background: linear-gradient(145deg,#fff1e9,#fffdf8); border: 1px solid rgba(233,107,76,.16); }
.country-modal-china img { width: 32px; height: 22px; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 3px rgba(54,41,27,.2); }
.country-modal-china strong { display: block; font-size: 9.5px; font-weight: 900; }
.country-modal-china p { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 600; }
.country-modal-china button { margin-left: auto; border: 0; background: transparent; color: var(--coral-deep); font-size: 8.5px; font-weight: 900; white-space: nowrap; cursor: pointer; }

@media (max-width: 900px) {
  .country-podium { padding: 2px 4px 9px; }
  .country-podium-place { padding: 8px 4px; }
  .country-podium-flag { width: 34px; height: 23px; }
  .country-podium-place .podium-name { font-size: 9.5px; }
  .country-modal-card { height: calc(100dvh - 36px); max-height: calc(100dvh - 36px); border-radius: 23px; }
  .country-modal-hero { padding: 17px 16px; gap: 11px; }
  .country-modal-flag { width: 64px; height: 44px; border-width: 2px; }
  .country-modal-copy h2 { font-size: 27px; }
  .country-modal-copy .country-en { font-size: 8.5px; }
  .country-modal-body { padding: 14px 15px 17px; }
  .country-modal-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .country-modal-facts strong { font-size: 15px; }
  .country-people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .country-sights-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .country-podium-place .podium-value { font-size: 7.5px; }
  .country-rank-en { display: none; }
  .country-rank-row .country-rank-flag { width: 24px; height: 17px; }
  .country-modal-card { width: 100%; height: calc(100dvh - 18px); max-height: calc(100dvh - 18px); border-radius: 20px; }
  .country-modal-hero { padding: 15px 14px; gap: 9px; }
  .country-modal-flag { width: 55px; height: 38px; }
  .country-modal-copy h2 { font-size: 24px; }
  .country-modal-tags { display: none; }
  .country-modal-body { padding: 12px 13px 15px; }
  .country-people-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) and (min-width: 761px) {
  .topbar { gap: 8px; padding: 8px 12px; }
  .brand { gap: 7px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .brand-mark svg { width: 26px; height: 26px; }
  .brand-name { font-size: 19px; }
  .brand-tag { display: none; }
  .view-tabs { gap: 2px; padding: 4px; }
  .view-tab { height: 34px; padding: 0 8px; gap: 4px; font-size: 11px; }
  .view-tab svg { width: 15px; height: 15px; }
  .top-actions { gap: 5px; }
  .icon-btn { width: 36px; height: 36px; border-radius: 12px; }
  .icon-btn svg { width: 17px; height: 17px; }
}

/* ---------- Country feature detail pages (people + sights) ---------- */
.country-section-hint {
  margin-left: 4px;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0;
}
.country-person,
.country-sight {
  width: 100%;
  position: relative;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.country-person { display: block; }
.country-person:hover,
.country-sight:hover {
  border-color: rgba(233, 107, 76, .25);
  background: #fff9f2;
  transform: translateY(-1px);
}
.country-card-chevron {
  position: absolute;
  right: 8px;
  bottom: 7px;
  color: var(--coral-deep);
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
}
.country-sight .country-card-chevron { bottom: 10px; }
.country-person { padding-right: 20px; }
.country-sight { padding-right: 23px; }

.country-feature-card {
  position: relative;
  width: min(900px, 100%);
  height: min(84vh, 720px);
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  overflow: hidden;
  border-radius: 27px;
  background: var(--paper);
  box-shadow: 0 40px 90px -28px rgba(30,21,12,.7);
}
.country-feature-visual {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px 22px;
  background:
    radial-gradient(circle at 78% 16%, rgba(255,255,255,.9), transparent 42%),
    radial-gradient(circle at 18% 88%, rgba(255,255,255,.55), transparent 38%),
    linear-gradient(150deg, var(--tone, #ffd7b8), #fff8ef 78%);
  text-align: center;
}
.country-feature-visual::before,
.country-feature-visual::after {
  content: "";
  position: absolute;
  border: 1px dashed rgba(70, 51, 32, .14);
  border-radius: 50%;
  pointer-events: none;
}
.country-feature-visual::before { width: 260px; height: 260px; top: -80px; right: -70px; }
.country-feature-visual::after { width: 210px; height: 210px; bottom: -90px; left: -70px; border-color: rgba(255,255,255,.55); }
.country-feature-photo { position: absolute; z-index: 0; inset: 0; overflow: hidden; background: #e5ded2; }
.country-feature-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.country-feature-shade { position: absolute; z-index: 1; inset: 0; background: linear-gradient(180deg, rgba(25,19,13,.04) 0%, rgba(25,19,13,.08) 35%, rgba(25,19,13,.58) 100%); opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.country-feature-visual.has-photo .country-feature-shade { opacity: 1; }
.country-feature-visual.has-photo .country-feature-icon { font-size: 45px; margin-top: 12px; opacity: .96; }
.country-feature-visual.has-photo .country-feature-copy > p,
.country-feature-visual.has-photo .country-feature-copy h2 { color: #fffdf8; text-shadow: 0 2px 12px rgba(0,0,0,.42); }
.country-feature-visual.has-photo .country-feature-copy > p { color: rgba(255,253,248,.8); }
.country-feature-visual.has-photo .country-feature-copy > span { color: #fffdf8; background: rgba(255,253,248,.18); border: 1px solid rgba(255,253,248,.28); }
.country-feature-stamp {
  position: relative;
  z-index: 2;
  width: 66px;
  height: 45px;
  padding: 3px;
  border-radius: 7px;
  background: #fffdf8;
  box-shadow: 0 6px 14px -8px rgba(54,41,27,.45);
  transform: rotate(-5deg);
}
.country-feature-stamp img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.country-feature-icon {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 20px;
  font-size: 76px;
  line-height: 1;
  filter: drop-shadow(0 12px 12px rgba(59, 41, 25, .18));
}
.country-feature-copy { position: relative; z-index: 2; width: 100%; margin-top: 18px; }
.country-feature-copy > p { color: rgba(61, 44, 27, .64); font-size: 9px; font-weight: 900; letter-spacing: 1.2px; }
.country-feature-copy h2 { margin-top: 4px; font-family: var(--font-display); font-size: 31px; font-weight: 400; line-height: 1.16; letter-spacing: .6px; }
.country-feature-copy > span { display: inline-block; margin-top: 7px; padding: 4px 9px; border-radius: 999px; background: rgba(255,253,248,.62); color: var(--coral-deep); font-size: 8px; font-weight: 900; letter-spacing: .5px; }
.country-feature-body {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 29px 28px 21px;
}
.country-feature-body .eyebrow { color: var(--coral); }
.country-feature-body .eyebrow-dot { background: var(--coral); box-shadow: 0 0 0 3px rgba(233,107,76,.13); }
.country-feature-lede { margin-top: 8px; color: var(--ink-2); font-size: 14px; line-height: 1.9; font-weight: 700; }
.country-feature-section { margin-top: 17px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.country-feature-section h3 { color: var(--ink-2); font-size: 11px; font-weight: 900; letter-spacing: .5px; }
.country-feature-section p { margin-top: 6px; color: var(--ink-2); font-size: 11.5px; line-height: 1.82; font-weight: 600; }
.country-feature-quiz { padding: 12px 13px; border-radius: 13px; background: #f4efff; border: 1px solid rgba(123,93,183,.14); }
.country-feature-quiz h3 { color: #6d5799; }
.country-feature-quiz p { color: #5d487e; font-size: 10.5px; }
.country-feature-facts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 15px; }
.country-feature-facts span { padding: 4px 8px; border-radius: 999px; background: var(--paper-soft); color: var(--ink-2); font-size: 8px; font-weight: 800; }
.country-feature-actions { margin-top: 16px; }
.country-feature-actions .btn-ghost { min-height: 36px; font-size: 10px; }

@media (max-width: 900px) {
  .country-feature-card { display: flex; flex-direction: column; height: calc(100dvh - 36px); max-height: calc(100dvh - 36px); border-radius: 23px; }
  .country-feature-visual { flex: 0 0 auto; min-height: 220px; padding: 18px 16px 16px; }
  .country-feature-icon { font-size: 58px; margin-top: 11px; }
  .country-feature-copy { margin-top: 11px; }
  .country-feature-copy h2 { font-size: 26px; }
  .country-feature-stamp { width: 55px; height: 38px; }
  .country-feature-body { flex: 1 1 auto; padding: 18px 17px 17px; }
  .country-feature-lede { font-size: 12.5px; }
}
@media (max-width: 760px) {
  .country-person, .country-sight { transform: none; }
  .country-feature-card { width: 100%; height: calc(100dvh - 18px); max-height: calc(100dvh - 18px); border-radius: 20px; }
  .country-feature-visual { min-height: 195px; }
  .country-feature-icon { font-size: 50px; margin-top: 8px; }
  .country-feature-copy h2 { font-size: 23px; }
  .country-feature-copy > p { font-size: 8px; }
  .country-feature-body { padding: 14px 14px 15px; }
}
