/* Base tokens (design A, superseded by the design C block at the end of this file) */
:root {
  --paper: #e3f3e6;        /* forest mist */
  --surface: #fffdf6;      /* cream */
  --ink: #2a2e2b;
  --ink-soft: #5b6e60;
  --line: #cfe5d2;
  --bamboo: #5aa469;       /* resident pandas */
  --bamboo-deep: #2f5d3a;
  --bamboo-pale: #eaf5e6;
  --amber: #e08a1e;        /* return within a year */
  --amber-pale: #ffe9c7;
  --home: #8a948d;         /* back in China */
  --blush: #ffb4c2;
  --focus: #2f6fb3;
  --map-bg: #8fd6cf;       /* mint sea of the illustrated map */
  --press: #c3dcc6;        /* jelly-button shadow */
  --radius-lg: 28px;
  --radius-sm: 12px;
  --font: "Gowun Dodum", "IBM Plex Sans KR", system-ui, sans-serif;
  --display: "Jua", "Gowun Dodum", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #13211a; --surface: #1c2b22; --ink: #e6efe6; --ink-soft: #a7b8ab; --line: #2f4536;
    --bamboo: #7cc47f; --bamboo-deep: #a6dba8; --bamboo-pale: #22352a; --amber: #f0a23a; --amber-pale: #3d2d16;
    --home: #7d877f; --blush: #e79aab; --focus: #7fb2ea; --map-bg: #2f6f6c; --press: #0d1712;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #13211a; --surface: #1c2b22; --ink: #e6efe6; --ink-soft: #a7b8ab; --line: #2f4536;
  --bamboo: #7cc47f; --bamboo-deep: #a6dba8; --bamboo-pale: #22352a; --amber: #f0a23a; --amber-pale: #3d2d16;
  --home: #7d877f; --blush: #e79aab; --focus: #7fb2ea; --map-bg: #2f6f6c; --press: #0d1712;
  color-scheme: dark;
}

/* Base -------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Top bar ----------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 76px; height: 46px; display: block; transform-origin: 30% 90%; }
.brand:hover .brand-mark { animation: panda-wiggle 0.7s ease-in-out; }
@keyframes panda-wiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-5deg) translateY(-2px); } 70% { transform: rotate(4deg); } }
@media (max-width: 900px) { .brand-mark { width: 62px; height: 38px; } }
.brand h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.tagline { font-size: 13px; color: var(--ink-soft); }

.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search input {
  width: 260px; max-width: 100%;
  font: inherit; font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
}
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.toggle button {
  font: inherit; font-size: 13px; border: 0; background: none; color: var(--ink-soft);
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Hidden-panda game ------------------------------------------------- */
.egg-hunt { position: relative; }
.egg-counter {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13px; color: var(--ink);
  padding: 5px 12px 5px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.egg-counter b { font-variant-numeric: tabular-nums; }
.egg-counter.is-complete { background: var(--bamboo-pale); border-color: var(--bamboo); }
.egg-hints {
  position: absolute; z-index: 1200; top: calc(100% + 8px); left: 0; width: 300px; max-width: calc(100vw - 32px);
  padding: 14px 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.egg-hints-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.egg-hints ol { margin: 0 0 10px; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.egg-hints li.is-found { color: var(--bamboo); font-weight: 500; }

.egg { border: 0; background: none; padding: 0; cursor: pointer; line-height: 0; vertical-align: middle; }
.egg img { display: block; width: 18px; height: 18px; transition: transform 0.2s ease, opacity 0.2s ease; }
.egg:hover img, .egg:focus-visible img { transform: scale(1.35) rotate(-8deg); opacity: 1; }
.egg.is-found img { filter: grayscale(1); opacity: 0.25; }
.egg-legend img { opacity: 0.35; width: 16px; height: 16px; transform: translateY(3px); }
.egg-news { margin-left: 4px; }
.egg-news img { width: 14px; height: 14px; opacity: 0.22; }
.egg-footer { display: block; margin-top: 10px; }
.egg-footer img { width: 16px; height: 16px; opacity: 0.3; }
.egg-panel { display: block; margin: 10px 0 0 auto; }
.egg-panel img { width: 14px; height: 14px; opacity: 0.2; }
.egg-ocean img { width: 20px; height: 20px; opacity: 0.4; animation: egg-bob 3.5s ease-in-out infinite; }
@keyframes egg-bob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-4px) rotate(6deg); } }
.egg-flyer { position: fixed; z-index: 3000; width: 40px; height: 40px; pointer-events: none; }
.egg-toast {
  position: fixed; z-index: 2500; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 32px); text-align: center;
}
.egg-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Layout ------------------------------------------------------------ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: minmax(480px, 64vh) auto;
  grid-template-areas: "map panel" "news news";
  gap: 16px;
  padding: 0 24px 24px;
}
.map-wrap { grid-area: map; position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--map-bg); }
#map { position: absolute; inset: 0; background: var(--map-bg); }
.panel {
  grid-area: panel; background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--line); overflow-y: auto; min-height: 0;
}
.news { grid-area: news; }

/* Legend ------------------------------------------------------------ */
.legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 500;
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 6px 12px; border-radius: 999px;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-resident { background: var(--bamboo); }
.dot-soon { background: var(--amber); }
.dot-home { background: var(--home); }

/* Map markers ------------------------------------------------------- */
/* Panda-face marker; the status colour lives on the count badge (same colours as the legend). */
.zoo-marker {
  --status: var(--bamboo);
  position: relative; width: 44px; height: 44px;
  transform-origin: 50% 85%;
  transition: transform 0.15s ease;
  cursor: pointer;
}
.zoo-marker img {
  display: block; width: 44px; height: 44px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.28));
  user-select: none;
}
.zoo-marker .count {
  position: absolute; right: -6px; bottom: -3px;
  min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 999px; border: 2px solid #fff;
  background: var(--status); color: #fff;
  font: 700 11px/1 var(--font); font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.map-far .zoo-marker img { width: 34px; height: 34px; margin: 5px; }
.map-far .zoo-marker .count { right: -1px; bottom: 1px; }
.zoo-marker.is-soon { --status: var(--amber); }
.zoo-marker.is-home { --status: var(--home); }
.zoo-marker.is-home img { filter: grayscale(0.55) opacity(0.82) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2)); }
.leaflet-marker-icon:hover .zoo-marker { transform: scale(1.12); }
.zoo-marker.is-active { transform: scale(1.3); animation: panda-bounce 0.9s ease-in-out 2; }
.zoo-marker.is-active .count { background: #18201b; }
@keyframes panda-bounce { 0%, 100% { translate: 0 0; } 40% { translate: 0 -5px; } 60% { translate: 0 -1px; } }
.leaflet-tooltip.zoo-tip { font: 13px/1.4 var(--font); border-radius: var(--radius-sm); }
.leaflet-container { font-family: var(--font); }
.leaflet-container { background: var(--map-bg); }

/* Photos */
.photos { margin: 4px 0 8px; }
.photos button { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; border-radius: var(--radius-sm); overflow: hidden; }
.photos img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-main { width: 100%; aspect-ratio: 4 / 3; background: var(--bamboo-pale); }
.photo-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 6px; }
.photo-thumb { aspect-ratio: 1; background: var(--bamboo-pale); }
.photo-more { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--focus); }
.photos-empty p { font-size: 13px; color: var(--ink-soft); }

.lightbox { border: 0; padding: 0; max-width: min(92vw, 1000px); background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); }
.lightbox::backdrop { background: rgba(10, 14, 12, 0.78); }
.lightbox img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.lightbox-credit { font-size: 12px; color: var(--ink-soft); padding: 10px 16px 14px; }
.lightbox-close { position: absolute; top: 8px; right: 8px; font: inherit; font-size: 13px; border: 0; border-radius: 999px; padding: 4px 12px; background: var(--surface); color: var(--ink); cursor: pointer; }
.news-list .orig { font-size: 12px; color: var(--ink-soft); margin: -2px 0 6px; line-height: 1.5; }
.news-list .lang { font-size: 11px; margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: var(--bamboo-pale); color: var(--ink-soft); }

/* Panel: empty state ------------------------------------------------ */
.panel-empty { padding: 24px; color: var(--ink-soft); }
.empty-title { color: var(--ink); font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.overview { margin-top: 16px; font-size: 13px; line-height: 1.7; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bamboo-pale); color: var(--ink); }
.country-summary { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 2px; }
.country-summary button {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0;
  padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; text-align: left;
}
.country-summary button:hover { background: var(--bamboo-pale); }
.country-summary .count { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* Panel: zoo + panda ------------------------------------------------ */
.panel-body { padding: 20px 22px 26px; }
.zoo-line { font-size: 13px; color: var(--ink-soft); }
.zoo-line strong { color: var(--ink); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.chip {
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.hanzi {
  font-family: var(--brush);
  font-size: 84px; line-height: 1; letter-spacing: 0.04em;
  margin: 18px 0 4px;
  color: var(--ink);
}
.panda-name { font-size: 22px; font-weight: 700; line-height: 1.3; }
.panda-name .en { font-size: 14px; font-weight: 400; color: var(--ink-soft); margin-left: 6px; }

.status-badge {
  display: inline-block; margin-top: 10px;
  font-size: 13px; font-weight: 500;
  padding: 3px 10px; border-radius: var(--radius-sm);
  background: var(--bamboo-pale); color: var(--bamboo);
}
.status-badge.is-soon { background: var(--amber-pale); color: var(--amber); }
.status-badge.is-home { background: color-mix(in srgb, var(--home) 18%, transparent); color: var(--ink-soft); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 20px 0 0; font-size: 14px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; }

/* Timeline: birth -> arrival -> return (a real sequence) */
.timeline { margin: 24px 0 0; }
.timeline h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.track { position: relative; height: 6px; border-radius: 3px; background: var(--line); margin: 0 6px; }
.track-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--bamboo); }
.track.is-soon .track-fill { background: var(--amber); }
.track-now {
  position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--surface); border: 3px solid var(--ink);
}
.track-stops { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--ink-soft); }
.track-stops div:last-child { text-align: right; }
.track-stops b { display: block; color: var(--ink); font-weight: 500; font-size: 13px; }
.countdown { margin-top: 14px; font-size: 14px; }
.countdown b { font-size: 20px; font-variant-numeric: tabular-nums; }

.note { margin-top: 20px; font-size: 14px; line-height: 1.7; }
.return-note { margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.facts-cn { margin-top: 24px; }
.facts-cn h3 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.facts-cn ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.facts-cn li { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bamboo-pale); }
.facts-cn p { font-size: 13.5px; line-height: 1.65; margin: 4px 0 6px; }
.fact-cat { display: inline-block; font-size: 11px; font-weight: 700; color: var(--bamboo); }
.fact-src { font-size: 11.5px; color: var(--ink-soft); }
.fact-src:hover { color: var(--ink); }
.videos { margin-top: 24px; }
.videos h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.video-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.video { display: block; text-decoration: none; color: var(--ink); }
.video img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); background: var(--bamboo-pale); }
.video-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; line-height: 1.45; margin-top: 6px; }
.video:hover .video-title { text-decoration: underline; }
.video-meta { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.videos-empty { font-size: 13px; color: var(--ink-soft); }
.video-more {
  display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 500; text-decoration: none;
  padding: 7px 14px; border-radius: 999px; background: var(--ink); color: var(--paper);
}
.video-more:hover { opacity: 0.88; }
.sources { margin-top: 18px; font-size: 12px; color: var(--ink-soft); }
.sources ul { padding-left: 18px; margin: 4px 0 0; }
.sources a { word-break: break-all; }

/* News -------------------------------------------------------------- */
.news-head { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 12px; flex-wrap: wrap; }
.news-head h2 { font-size: 18px; font-weight: 700; }
.news-scope { font-size: 13px; color: var(--ink-soft); }
.link-btn { font: inherit; font-size: 13px; background: none; border: 0; color: var(--focus); cursor: pointer; padding: 0; text-decoration: underline; }
.news-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0 28px;
}
.news-list li { border-top: 1px solid var(--line); padding: 14px 0 16px; }
.news-list time { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.news-list .src { font-size: 12px; color: var(--ink-soft); margin-left: 8px; }
.news-list a { display: block; font-weight: 500; font-size: 15px; line-height: 1.45; text-decoration: none; margin: 4px 0 6px; }
.news-list a:hover { text-decoration: underline; }
.news-list p { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.news-empty { color: var(--ink-soft); font-size: 14px; padding: 12px 0; }

.foot { padding: 0 24px 28px; font-size: 12px; color: var(--ink-soft); }

/* Responsive -------------------------------------------------------- */
@media (max-width: 900px) {
  .topbar { padding: 12px 16px; }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56vh auto auto;
    grid-template-areas: "map" "panel" "news";
    padding: 0 16px 16px;
  }
  .search input { width: 100%; }
  .controls { width: 100%; }
  .search { flex: 1; }
  .hanzi { font-size: 64px; }
  .foot { padding: 0 16px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ===== Design A: 대나무숲 소풍 — overrides on top of the base layout ===== */
body { background: radial-gradient(circle at 6% -8%, color-mix(in srgb, var(--surface) 75%, transparent) 0 24%, transparent 25%), var(--paper); }
.brand h1, .empty-title, .panda-name, .news-head h2, .timeline h3, .videos h3, .facts-cn h3,
.egg-counter, .egg-hints-title, .toggle button, .chip, .video-more, .news-list a { font-family: var(--display); font-weight: 400; }
.brand h1 { font-size: 30px; color: var(--bamboo-deep); }
.search input { border: 3px solid var(--line); background: var(--surface); }
.toggle { border: 3px solid var(--bamboo-deep); box-shadow: 0 4px 0 var(--bamboo-deep); }
.toggle button { font-size: 14px; }
.toggle button[aria-pressed="true"] { background: var(--bamboo-deep); color: var(--surface); }
.egg-counter { border: 3px solid var(--bamboo-deep); box-shadow: 0 4px 0 var(--bamboo-deep); color: var(--bamboo-deep); font-size: 15px; }
.egg-counter:active, .toggle button:active, .video-more:active { transform: translateY(3px); }

.map-wrap { border-radius: 36px; box-shadow: 0 6px 0 var(--press); }
.map-wrap::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 6px color-mix(in srgb, var(--surface) 55%, transparent); pointer-events: none; z-index: 440; }
.map-bamboo { position: absolute; z-index: 445; bottom: -14px; width: 12px; border-radius: 8px; background: linear-gradient(#7cc47f, #4e9b57); pointer-events: none; }
.map-bamboo::before { content: ""; position: absolute; left: -2px; right: -2px; top: 38%; height: 4px; border-radius: 4px; background: #3f8048; }
.map-bamboo::after { content: ""; position: absolute; left: 10px; top: 20%; width: 26px; height: 9px; border-radius: 0 100% 0 100%; background: #6fb875; transform: rotate(-20deg); }
.legend { background: var(--surface); border-radius: 999px; box-shadow: 0 3px 0 var(--press); }
.leaflet-container { background: var(--map-bg); }
.leaflet-control-attribution { border-radius: 10px 0 0 0; }

/* Panel with panda ears */
.panel { position: relative; overflow: visible; display: flex; flex-direction: column; border: 0; border-radius: 30px; margin-top: 22px; box-shadow: 0 6px 0 var(--press); }
.panel::before, .panel::after { content: ""; position: absolute; top: -22px; width: 54px; height: 54px; border-radius: 50%; background: #2a2e2b; z-index: -1; }
.panel::before { left: 34px; } .panel::after { right: 34px; }
.panel-empty, .panel-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; border-radius: 30px; }
.panda-name { font-size: 36px; line-height: 1.15; color: var(--bamboo-deep); margin-top: 8px; }
.panda-alt { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: var(--ink-soft); margin-top: 2px; }
.status-badge { border-radius: 999px; padding: 3px 12px; }
.chip { border: 2px solid var(--line); }
.chip[aria-pressed="true"] { background: var(--bamboo-deep); border-color: var(--bamboo-deep); color: var(--surface); }
.overview { border-radius: 20px; }
.country-summary button { border-radius: 14px; }
.photo-main, .photo-thumb, .video img { border-radius: 16px; }
.facts-cn li { border-radius: 18px; }

/* Stay timeline drawn as a bamboo stalk, the current day as a panda face */
.track { height: 14px; border-radius: 10px; background: var(--bamboo-pale); }
.track-fill { border-radius: 10px; background: repeating-linear-gradient(90deg, var(--bamboo) 0 18px, var(--bamboo-deep) 18px 21px); }
.track.is-soon .track-fill { background: repeating-linear-gradient(90deg, #f3b45c 0 18px, var(--amber) 18px 21px); }
.track-now { width: 28px; height: 28px; border: 0; background: url("favicon.svg") center / contain no-repeat; }

.news-list { gap: 14px; }
.news-list li { border-top: 0; background: var(--surface); border-radius: 22px; padding: 14px 16px 16px; box-shadow: 0 4px 0 var(--press); }
.news-list a { font-size: 16.5px; }
.video-more { background: var(--bamboo-deep); color: var(--surface); box-shadow: 0 4px 0 color-mix(in srgb, var(--bamboo-deep) 60%, #000); font-size: 15px; }
.zoo-marker .count { font-family: var(--display); font-weight: 400; font-size: 12.5px; }

/* Return flight route */
.route-flight { fill: none; stroke: #ffffff; stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 2 10; animation: route-dash 1.1s linear infinite; }
.route-glow { fill: none; stroke: rgba(224, 138, 30, 0.55); stroke-width: 9; stroke-linecap: round; }
.route-ground { fill: none; stroke: #ffe9a8; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 7; }
@keyframes route-dash { to { stroke-dashoffset: -24; } }
.route-plane { line-height: 0; }
.route-plane svg { width: 34px; height: 30px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)); }
.route-stop { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--amber); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.leaflet-tooltip.route-label { font: 13px/1.35 var(--font); border-radius: 10px; padding: 4px 9px; }
.route-steps { margin-top: 22px; padding: 14px 16px; border-radius: 20px; background: var(--amber-pale); }
.route-steps h3 { font-family: var(--display); font-weight: 400; font-size: 16px; margin-bottom: 6px; }
.route-steps ol { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.7; }
.route-steps p { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* Panda-finding game */
.game-open { display: inline-flex; align-items: center; gap: 6px; font: 15px var(--display); color: var(--surface); background: var(--bamboo-deep); border: 0; border-radius: 999px; padding: 7px 14px 7px 8px; cursor: pointer; box-shadow: 0 4px 0 color-mix(in srgb, var(--bamboo-deep) 60%, #000); }
.game-open:active { transform: translateY(3px); }
.game { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 30px; padding: 20px 20px 22px; background: var(--surface); color: var(--ink); box-shadow: 0 8px 0 var(--press); overflow-y: auto; }
.game::backdrop { background: rgba(20, 40, 28, 0.55); }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-head h2 { font: 28px var(--display); color: var(--bamboo-deep); }
.game-close { font: inherit; font-size: 14px; border: 2px solid var(--line); background: none; color: var(--ink); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.game-modes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.game-mode { font: 15px var(--display); display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.game-mode small { font: 11px var(--font); color: var(--ink-soft); background: var(--amber-pale); border-radius: 999px; padding: 1px 7px; }
.game-mode[aria-pressed="true"] { background: var(--bamboo-deep); border-color: var(--bamboo-deep); color: var(--surface); }
.game-mode[aria-pressed="true"] small { color: var(--ink); }
.game-mode:disabled { opacity: 0.5; cursor: not-allowed; }
.game-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin: 16px 0 10px; }
.game-q { font: 22px var(--display); }
.game-q b { font-weight: 400; color: var(--amber); }
.game-time { font-size: 14px; color: var(--ink-soft); }
.game-time b { font: 22px var(--display); font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }
.game-hint { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; background: var(--amber-pale); margin-bottom: 10px; font-size: 14px; }
.game-hint img { width: 72px; height: 72px; object-fit: cover; border-radius: 14px; }
/* 4×4 square tiles; the board is as wide as the screen height allows (header + question ≈ 300px), so all 16 fit without scrolling. */
.game-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, max(280px, calc(100dvh - 300px))); margin: 0 auto; }
.game-tile { position: relative; padding: 0; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: var(--bamboo-pale); cursor: pointer; }
.game-tile img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; transition: transform 0.15s ease; }
.game-tile:hover img { transform: scale(1.06); }
.game-label { position: absolute; left: 0; right: 0; bottom: 0; font: 13px var(--display); color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); padding: 14px 4px 5px; text-align: center; }
.game-label:empty { display: none; }
.game-tile.is-wrong img { filter: grayscale(1) brightness(0.8); }
.game-tile.is-answer { box-shadow: 0 0 0 5px var(--amber), 0 0 0 9px var(--surface); z-index: 1; }
.game-grid.is-done .game-tile:not(.is-answer) img { filter: saturate(0.6) brightness(0.9); }
.game-result { margin-top: 14px; padding: 12px 16px; border-radius: 20px; background: var(--bamboo-pale); font-size: 14px; }
.game-win { font: 22px var(--display); color: var(--bamboo-deep); }
.game-result details { margin-top: 6px; font-size: 12.5px; color: var(--ink-soft); }
.game-result ul { margin: 6px 0 0; padding-left: 18px; }
.game-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.game-btn { font: 15px var(--display); border: 0; border-radius: 999px; padding: 8px 16px; cursor: pointer; background: var(--bamboo-deep); color: var(--surface); box-shadow: 0 4px 0 color-mix(in srgb, var(--bamboo-deep) 60%, #000); }
.game-btn.ghost { background: var(--amber-pale); color: var(--ink); box-shadow: 0 4px 0 var(--press); }
.game-btn:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 560px) { .game-grid { gap: 6px; } .game-q { font-size: 19px; } }
.game-hint[hidden], .game-result[hidden] { display: none; }

/* Top mini-game menu */
.minigames { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 24px; background: var(--bamboo-deep); color: var(--surface); }
.minigames-title { display: inline-flex; align-items: center; gap: 6px; font: 17px var(--display); margin-right: 4px; }
.minigames .game-open { background: var(--surface); color: var(--bamboo-deep); box-shadow: 0 3px 0 color-mix(in srgb, var(--bamboo-deep) 55%, #000); }
.minigames .egg-counter { background: var(--surface); border-color: var(--surface); box-shadow: 0 3px 0 color-mix(in srgb, var(--bamboo-deep) 55%, #000); }
.minigames .egg-hints { color: var(--ink); }
@media (max-width: 900px) { .minigames { padding: 8px 16px; } }

/* Panda World Cup */
.game-head h2 small { font: 15px var(--font); color: var(--ink-soft); margin-left: 6px; }
.wc-q { font: 22px var(--display); text-align: center; margin: 16px 0 12px; }
.wc-match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.wc-pick { padding: 0; border: 0; border-radius: 24px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--bamboo-pale); cursor: pointer; box-shadow: 0 5px 0 var(--press); transition: transform 0.15s ease; }
.wc-pick:hover { transform: translateY(-4px) rotate(-1deg); }
.wc-pick:active { transform: translateY(2px); }
.wc-pick img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; }
.wc-vs { font: 30px var(--display); color: var(--amber); }
.wc-win { text-align: center; margin-top: 12px; }
.wc-win img { width: min(360px, 100%); aspect-ratio: 1; object-fit: cover; object-position: center 35%; border-radius: 28px; box-shadow: 0 0 0 6px var(--amber), 0 10px 0 6px var(--press); }
.wc-reveal { font: 22px var(--display); margin-top: 18px; }
.wc-reveal b { font-weight: 400; font-size: 40px; color: var(--bamboo-deep); }
.wc-meta, .wc-credit { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.wc-win .game-actions { justify-content: center; }
@media (max-width: 560px) { .wc-match { gap: 6px; } .wc-vs { font-size: 20px; } }

/* 대나무 쌓기 */
.bb-help { margin: 6px 0 10px; color: var(--ink-soft); font-size: 14px; }
.bb-canvas { display: block; width: min(100%, 360px, calc((100dvh - 270px) * 2 / 3)); aspect-ratio: 2 / 3; height: auto; margin: 0 auto; border-radius: 20px; touch-action: none; cursor: pointer; border: 3px solid var(--line); }
.bb-canvas:focus-visible { outline: 3px solid var(--amber, #e08a1e); outline-offset: 3px; }
.fact-note { font-size: 13px; color: var(--ink-soft); margin: 0 0 8px; }
.bb-challenge { margin: 0 0 10px; padding: 8px 12px; border-radius: 14px; background: var(--amber-pale); color: var(--ink); font-size: 14px; text-align: center; }
.bb-challenge[hidden], .bb-share[hidden] { display: none; }
.bb-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; margin-top: 12px; }
.bb-name-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.bb-name-label input, .bb-link { font: inherit; font-size: 14px; border: 2px solid var(--line); border-radius: 999px; padding: 5px 12px; background: var(--surface); color: var(--ink); width: 150px; }
.bb-link { width: min(100%, 320px); }
.bb-share-msg { flex-basis: 100%; text-align: center; font-size: 13px; color: var(--bamboo-deep); margin: 0; }
.bb-share-msg:empty { display: none; }

/* 대나무 쌓기 HUD and drop button */
.bb-hud { display: flex; align-items: flex-end; gap: 14px; max-width: 360px; margin: 8px auto 2px; }
.bb-height { margin: 0 auto 0 0; font: 18px var(--display); color: var(--bamboo-deep); }
.bb-height b { font-size: 38px; font-weight: 400; color: var(--amber); font-variant-numeric: tabular-nums; }
.bb-stat { display: grid; justify-items: center; gap: 2px; font-size: 12px; color: var(--ink-soft); }
.bb-stat b { font: 18px var(--display); font-weight: 400; color: var(--ink); }
.bb-wobble { display: inline-flex; gap: 4px; padding: 3px 0; }
.bb-wobble i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink-soft); }
.bb-wobble i.on { background: #c0582f; border-color: #c0582f; }
.bb-combo-row { display: flex; align-items: center; gap: 8px; max-width: 360px; margin: 0 auto 8px; font-size: 12px; color: var(--ink-soft); }
.bb-combo-row progress { flex: 0 1 90px; height: 8px; accent-color: var(--amber); }
.bb-drop { display: block; width: 100%; max-width: 360px; margin: 12px auto 0; font: 20px var(--display); color: var(--ink); background: #ffd46b; border: 0; border-radius: 18px; padding: 14px; cursor: pointer; box-shadow: 0 5px 0 #d49a2a; touch-action: manipulation; }
.bb-drop:active { transform: translateY(4px); box-shadow: 0 1px 0 #d49a2a; }
.bb-drop[hidden] { display: none; }

/* World-map labels (Korean country and ocean names) */
.country-label { background: none; border: 0; }
.country-label span { display: block; transform: translate(-50%, -50%); white-space: nowrap; font: 12px var(--font); font-weight: 700; color: #5c5246; letter-spacing: 0.02em; text-shadow: 0 0 3px #fffaf0, 0 0 3px #fffaf0, 0 0 2px #fffaf0; }
.country-label.major span { font-size: 14px; }
.country-label.tiny span { font-size: 11px; }
.country-label.ocean span { font: italic 15px var(--font); color: #3f7396; letter-spacing: 0.3em; text-shadow: none; opacity: 0.8; }
.leaflet-container[data-zoom="2"] .country-label.minor,
.leaflet-container[data-zoom="2"] .country-label.tiny,
.leaflet-container[data-zoom="3"] .country-label.tiny,
.leaflet-container[data-zoom="4"] .country-label.tiny { display: none; }
.egg-status { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }

/* Panda panel: name first, photo as a framed card, quiet scrollbar, smaller ears */
.panel::before, .panel::after { width: 42px; height: 42px; top: -15px; }
.panel::before { left: 26px; } .panel::after { right: 26px; }
.panel-empty, .panel-body { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--bamboo) 40%, transparent) transparent; }
.zoo-line { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; }
.chips { gap: 6px; margin: 10px 0 0; }
.chips .chip { padding: 4px 12px; font-size: 14px; }
.panda-head { margin: 16px 0 14px; }
.panda-head .panda-name { margin-top: 0; font-size: 34px; }
.panda-head .panda-alt { margin-top: 4px; }
.panda-head .status-badge { display: inline-block; margin-top: 10px; font-size: 13px; }
.photos { position: relative; margin: 0 0 18px; }
.photo-main { border-radius: 22px; box-shadow: 0 4px 0 var(--press); }
.photo-strip { gap: 6px; margin-top: 10px; }
.photo-thumb { border-radius: 12px; }
.photo-more { position: absolute; top: 10px; right: 10px; margin: 0; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--bamboo-deep); font: 13px var(--display); text-decoration: none; box-shadow: 0 2px 0 var(--press); }
.photo-more:hover { background: var(--surface); }
.photos-empty { display: grid; place-items: center; align-content: center; gap: 10px; aspect-ratio: 16 / 9; border-radius: 22px; background: var(--bamboo-pale); border: 2px dashed var(--line); text-align: center; }
.photos-empty .photo-more { position: static; }

/* Header: logo, mini-game menu, search/filter, hidden-panda counter pinned to the far right */
.topbar { justify-content: flex-start; }
.topbar .controls { margin-left: auto; }
.topbar .egg-hunt { margin-left: 4px; }
.topbar .egg-hints { left: auto; right: 0; }
.game-menu { position: relative; }
.game-menu-btn { display: inline-flex; align-items: center; gap: 7px; font: 16px var(--display); color: var(--surface); background: var(--bamboo-deep); border: 0; border-radius: 999px; padding: 8px 14px 8px 9px; cursor: pointer; box-shadow: 0 4px 0 color-mix(in srgb, var(--bamboo-deep) 60%, #000); }
.game-menu-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--bamboo-deep) 60%, #000); }
.game-menu-btn .caret { width: 0; height: 0; margin-left: 2px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transition: transform 0.15s ease; }
.game-menu-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.game-menu-list { position: absolute; z-index: 1200; top: calc(100% + 10px); left: 0; min-width: 210px; display: grid; gap: 4px; padding: 8px; border-radius: 22px; background: var(--surface); box-shadow: 0 6px 0 var(--press), 0 12px 28px rgba(0, 0, 0, 0.12); }
.game-menu-list[hidden] { display: none; }
.game-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: 16px var(--display); color: var(--bamboo-deep); background: none; border: 0; border-radius: 14px; padding: 9px 12px; cursor: pointer; }
.game-menu-item:hover, .game-menu-item:focus-visible { background: var(--bamboo-pale); }
@media (max-width: 900px) {
  .topbar .controls { order: 3; margin-left: 0; width: 100%; }
  .topbar .egg-hunt { margin-left: auto; }
}
@media (min-width: 901px) {
  .topbar { flex-wrap: nowrap; }
  .topbar .controls { flex-wrap: nowrap; min-width: 0; flex: 0 1 auto; }
  .topbar .search { min-width: 0; flex: 1 1 150px; }
  .topbar .search input { width: 100%; min-width: 120px; }
  .topbar .egg-counter, .topbar .toggle button, .game-menu-btn { white-space: nowrap; }
}
@media (min-width: 901px) and (max-width: 1180px) { .topbar .tagline { display: none; } }

/* Cluster of nearby zoos: two stacked faces and the total count */
.zoo-marker.is-cluster img { position: relative; }
.zoo-marker.is-cluster img.back { position: absolute; left: -9px; top: -7px; transform: rotate(-12deg) scale(0.86); filter: brightness(0.94) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2)); }
.map-far .zoo-marker.is-cluster img.back { left: -4px; top: -2px; }
.zoo-marker.is-cluster .count { min-width: 22px; height: 22px; font-size: 12px; }
.zoo-tip .tip-hint { font-size: 12px; color: var(--ink-soft); }

/* Illustrated map: sticker shadow under the land, doodles in the sea */
.leaflet-land-pane svg { filter: drop-shadow(0 4px 0 rgba(30, 90, 86, 0.18)); }
.doodle { background: none; border: 0; }
.doodle svg { display: block; width: 100%; height: 100%; }
.leaflet-container[data-zoom="5"] .doodle, .leaflet-container[data-zoom="6"] .doodle, .leaflet-container[data-zoom="7"] .doodle,
.leaflet-container[data-zoom="8"] .doodle, .leaflet-container[data-zoom="9"] .doodle { display: none; }
.country-label.ocean span { color: #ffffff; opacity: 0.9; text-shadow: 0 1px 0 rgba(30, 90, 86, 0.35); }

/* No "ears" on the panel: they read as stray dots, not as a panda */
.panel::before, .panel::after { content: none; display: none; }
.panel { margin-top: 0; }
@media (max-width: 480px) {
  .game-menu-btn { font-size: 14px; padding: 7px 10px 7px 7px; gap: 5px; }
  .game-menu-btn img { width: 18px; height: 18px; }
  .topbar .egg-counter { font-size: 13px; padding: 5px 9px 5px 6px; gap: 4px; }
  .topbar .egg-counter img { width: 17px; height: 17px; }
}

/* ===================================================================
   Design C: "판다 스티커 다이어리" (panda sticker diary)
   Grid note paper, pencil-brown ink, white stickers held by masking tape,
   handwritten Gaegu for titles and numbers, Gowun Dodum for reading text.
   =================================================================== */
:root {
  --paper: #fffaf0;  --grid: #ecdfc7;
  --surface: #ffffff; --ink: #3b2f2a; --ink-soft: #8c7b70; --line: #e6d6bf;
  --pink: #ffc6d3; --mint: #c9ecd5; --butter: #ffe8a3;
  --bamboo: #5fae7e; --bamboo-deep: #3b2f2a; --bamboo-pale: #eef8f1;
  --amber: #d08a1c; --amber-pale: #fff3cc; --home: #a9998c; --blush: #ffc6d3;
  --focus: #4f86d4; --map-bg: #e3f2f4; --press: #eadcc4;
  --sticker-shadow: 0 0 0 6px var(--surface), 3px 6px 0 6px rgba(59, 47, 42, 0.12);
  --radius-lg: 14px; --radius-sm: 10px;
  --display: "Gaegu", "Gowun Dodum", cursive;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #24201c; --grid: #352e27; --surface: #2e2823; --ink: #f2e8dc; --ink-soft: #bba897; --line: #4a3f35;
    --pink: #8a4f5e; --mint: #3f6a52; --butter: #7a6630;
    --bamboo: #7cc89a; --bamboo-deep: #f2e8dc; --bamboo-pale: #2f3a30; --amber: #f0b54a; --amber-pale: #4a3d1f; --home: #8f8275;
    --focus: #8cb6ee; --map-bg: #22383b; --press: #17130f;
    --sticker-shadow: 0 0 0 6px var(--surface), 3px 6px 0 6px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --paper: #24201c; --grid: #352e27; --surface: #2e2823; --ink: #f2e8dc; --ink-soft: #bba897; --line: #4a3f35;
  --pink: #8a4f5e; --mint: #3f6a52; --butter: #7a6630;
  --bamboo: #7cc89a; --bamboo-deep: #f2e8dc; --bamboo-pale: #2f3a30; --amber: #f0b54a; --amber-pale: #4a3d1f; --home: #8f8275;
  --focus: #8cb6ee; --map-bg: #22383b; --press: #17130f;
  --sticker-shadow: 0 0 0 6px var(--surface), 3px 6px 0 6px rgba(0, 0, 0, 0.35);
}

body {
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px; color: var(--ink);
}
body::before, body::after { display: none; }

/* Header: handwritten title with a highlighter stroke, mint menu sticker, butter memo counter, dashed search */
.brand h1 { font: 700 42px/1 var(--display); color: var(--ink); transform: rotate(-2deg); background: linear-gradient(transparent 60%, var(--pink) 60%); padding: 0 4px; display: inline-block; }
.tagline { font: 700 17px var(--display); color: var(--ink-soft); }
.game-menu-btn { font: 700 19px var(--display); color: var(--ink); background: var(--mint); border-radius: 6px; padding: 5px 12px 5px 7px; transform: rotate(-1.5deg); box-shadow: 2px 3px 0 rgba(59, 47, 42, 0.18); }
.game-menu-btn:active { transform: rotate(-1.5deg) translateY(2px); box-shadow: 1px 1px 0 rgba(59, 47, 42, 0.18); }
.game-menu-list { border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--sticker-shadow); padding: 10px; }
.game-menu-item { font: 700 19px var(--display); color: var(--ink); border-radius: 8px; }
.game-menu-item:hover, .game-menu-item:focus-visible { background: var(--butter); }
.egg-counter, .topbar .egg-counter { font: 700 19px var(--display); color: var(--ink); background: var(--butter); border: 0; border-radius: 6px; padding: 4px 12px 4px 6px; transform: rotate(2deg); box-shadow: 2px 3px 0 rgba(59, 47, 42, 0.18); }
.egg-counter:active { transform: rotate(2deg) translateY(2px); }
.egg-counter.is-complete { background: var(--mint); }
.egg-hints { border-radius: var(--radius-lg); border: 0; background: var(--surface); box-shadow: var(--sticker-shadow); }
.egg-hints-title { font: 700 19px var(--display); }
.search input { background: var(--surface); border: 2px dashed #cbb9a5; border-radius: 10px; color: var(--ink); }
.search input::placeholder { color: #a8978a; }
.toggle { background: var(--surface); border: 2px dashed #cbb9a5; border-radius: 10px; box-shadow: none; padding: 3px; }
.toggle button { font: 700 17px var(--display); color: var(--ink-soft); border-radius: 7px; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Stickers with masking tape: map (mint tape) and panel (pink tape) */
.map-wrap, .panel { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--sticker-shadow); border: 0; overflow: visible; }
.map-wrap::after { content: none; }
.map-wrap::before { content: ""; position: absolute; z-index: 700; top: -13px; left: 50%; width: 96px; height: 24px; background: color-mix(in srgb, var(--mint) 88%, transparent); transform: translateX(-50%) rotate(-4deg); pointer-events: none; }
#map, .map-wrap .leaflet-container { border-radius: var(--radius-lg); overflow: hidden; }
.panel { transform: rotate(0.5deg); }
.panel > .panel-empty, .panel > .panel-body { border-radius: var(--radius-lg); }
.panel::before { content: ""; display: block; position: absolute; z-index: 5; top: -13px; left: 50%; width: 96px; height: 24px; border-radius: 0; background: color-mix(in srgb, var(--pink) 90%, transparent); transform: translateX(-50%) rotate(5deg); }
.panel::after { content: none; display: none; }
.legend { background: var(--surface); border-radius: 8px; box-shadow: 2px 3px 0 rgba(59, 47, 42, 0.14); font-family: var(--font); }
.dot-resident { background: var(--mint); box-shadow: 0 0 0 2px #7fc79b inset; }
.dot-soon { background: var(--butter); box-shadow: 0 0 0 2px #e0b84a inset; }

/* Map markers: the count as a hand-written number on a mint or butter dot */
.zoo-marker { --status: var(--mint); }
.zoo-marker.is-soon { --status: var(--butter); }
.zoo-marker.is-home { --status: #e4dbd1; }
.zoo-marker .count { background: var(--status); color: #3b2f2a; border: 0; box-shadow: 0 0 0 3px #fff, 1px 2px 0 3px rgba(59, 47, 42, 0.15); font: 700 16px/1 var(--display); min-width: 24px; height: 24px; right: -9px; bottom: -7px; }
.zoo-marker.is-active .count { background: var(--pink); }
.leaflet-tooltip.zoo-tip { border-radius: 8px; border: 0; box-shadow: 2px 3px 0 rgba(59, 47, 42, 0.18); }
.country-label span { color: #8c7b70; text-shadow: 0 0 3px #fffaf0, 0 0 3px #fffaf0; }
.country-label.ocean span { font: 700 17px var(--display); color: #7aa8b0; letter-spacing: 0.25em; text-shadow: none; }
.country-label.memo span { font: 700 19px var(--display); color: #8c7b70; letter-spacing: 0; transform: translate(-6%, -50%) rotate(-3deg); text-shadow: 0 0 3px var(--map-bg), 0 0 3px var(--map-bg); }
.leaflet-land-pane svg { filter: none; }

/* Panel content */
.zoo-line { color: var(--ink-soft); }
.chip { font: 700 18px var(--display); border: 2px dashed var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--mint); border: 2px solid var(--mint); color: var(--ink); }
.panda-head .panda-name, .panda-name { font: 700 44px/1.05 var(--display); color: var(--ink); }
.panda-alt { color: var(--ink-soft); }
.panda-alt span[lang="zh"] { font-size: 18px; color: var(--ink); }
.status-badge, .panda-head .status-badge { display: inline-block; font: 700 18px var(--display); color: var(--ink); background: var(--butter); border-radius: 4px; padding: 0 10px; transform: rotate(-2deg); }
.status-badge.is-resident { background: var(--mint); }
.status-badge.is-home { background: #ece5dd; color: var(--ink-soft); }
.photo-main { border-radius: 10px; box-shadow: 0 0 0 5px var(--surface), 2px 5px 0 5px rgba(59, 47, 42, 0.12); transform: rotate(-0.8deg); }
.photo-thumb { border-radius: 8px; }
.photo-more { font: 700 16px var(--display); color: var(--ink); background: var(--butter); border-radius: 4px; box-shadow: 1px 2px 0 rgba(59, 47, 42, 0.18); transform: rotate(2deg); }
.photos-empty { border-radius: 10px; background: var(--paper); border: 2px dashed var(--line); }
.facts dt { color: var(--ink-soft); }
.track { height: 10px; border-radius: 0; background: none; border-bottom: 3px dotted #cbb9a5; }
.track-fill, .track.is-soon .track-fill { height: 3px; margin-top: 7px; border-radius: 0; background: #e58aa1; }
.timeline h3, .videos h3, .facts-cn h3, .route-steps h3, .news-head h2 { font: 700 22px var(--display); color: var(--ink); }
.overview { background: var(--amber-pale); border-radius: 8px; transform: rotate(-0.6deg); }
.country-summary button { border-radius: 8px; }
.country-summary button:hover { background: var(--paper); }
.facts-cn li { border-radius: 10px; background: var(--paper); border: 1.5px dashed var(--line); }
.fact-cat { font: 700 15px var(--display); background: var(--mint); color: var(--ink); border-radius: 4px; }
.fact-note { color: var(--ink-soft); }
.route-steps { background: var(--amber-pale); border-radius: 10px; }
.video img { border-radius: 8px; }
.link-btn, .video-more { font-family: var(--display); font-weight: 700; }

/* News: a row of stickers, each stuck on at its own small angle */
.news-list > * { background: var(--surface); border-radius: 12px; box-shadow: var(--sticker-shadow); border: 0; }
.news-list > *:nth-child(3n + 2) { transform: rotate(-1deg); }
.news-list > *:nth-child(3n) { transform: rotate(1.2deg); }

/* Dialogs and games */
.game { background-color: var(--paper); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 22px 22px; border-radius: 16px; box-shadow: var(--sticker-shadow); }
.game-head h2 { font: 700 34px var(--display); color: var(--ink); transform: rotate(-1.5deg); }
.game-close { font: 700 17px var(--display); border: 2px dashed #cbb9a5; border-radius: 8px; background: var(--surface); }
.game-mode { font: 700 18px var(--display); border: 2px dashed var(--line); border-radius: 8px; }
.game-mode[aria-pressed="true"] { background: var(--mint); border: 2px solid var(--mint); color: var(--ink); }
.game-mode small { background: var(--butter); color: var(--ink); }
.game-q, .wc-q { font: 700 26px var(--display); }
.game-q b { color: #d0607e; }
.game-time b, .game-win, .wc-reveal { font-family: var(--display); font-weight: 700; color: var(--ink); }
.game-btn { font: 700 19px var(--display); border-radius: 8px; background: var(--ink); color: var(--paper); box-shadow: 2px 3px 0 rgba(59, 47, 42, 0.25); }
.game-btn.ghost { background: var(--butter); color: var(--ink); box-shadow: 2px 3px 0 rgba(59, 47, 42, 0.18); }
.game-tile { border-radius: 8px; box-shadow: 0 0 0 3px var(--surface), 1px 3px 0 3px rgba(59, 47, 42, 0.1); }
.game-label { font: 700 16px var(--display); }
.wc-vs { font: 700 34px var(--display); color: #d0607e; }
.bb-height, .bb-height b { font-family: var(--display); color: var(--ink); }
.bb-height b { color: #d0607e; }
.bb-drop { font: 700 22px var(--display); color: var(--ink); background: var(--butter); border-radius: 8px; box-shadow: 2px 4px 0 rgba(59, 47, 42, 0.22); }
.bb-canvas { border: 0; border-radius: 10px; box-shadow: var(--sticker-shadow); }
.egg-toast { font: 700 19px var(--display); background: var(--butter); color: var(--ink); border-radius: 6px; box-shadow: 2px 3px 0 rgba(59, 47, 42, 0.2); }
@media (prefers-reduced-motion: reduce) {
  .brand h1, .game-menu-btn, .egg-counter, .panel, .photo-main, .status-badge, .photo-more, .overview, .news-list > *, .game-head h2 { transform: none; }
}
.news-list a { font: 700 22px/1.2 var(--display); color: var(--ink); }
.empty-title { font: 700 27px/1.2 var(--display); color: var(--ink); }
.tagline { font-size: 18px; }
.news-head h2 { font-size: 30px; }
.legend { font-size: 13px; }

/* The ocean panda is tiny and only appears once you zoom into the sea */
.egg-ocean img { width: 10px; height: 10px; opacity: 0.55; }
.leaflet-container[data-zoom="2"] .egg-ocean, .leaflet-container[data-zoom="3"] .egg-ocean, .leaflet-container[data-zoom="4"] .egg-ocean { display: none; }

/* "여기 쌍둥이 있음!" note pinned beside the Everland marker at every zoom */
.twin-memo { background: none; border: 0; }
.twin-memo span { display: block; white-space: nowrap; font: 700 19px var(--display); color: #8c7b70; transform: rotate(-3deg); transform-origin: left bottom; text-shadow: 0 0 3px var(--map-bg), 0 0 3px var(--map-bg), 0 0 2px var(--map-bg); }
.egg-island img { width: 10px; height: 10px; opacity: 0.6; }
.leaflet-container[data-zoom="2"] .egg-island, .leaflet-container[data-zoom="3"] .egg-island, .leaflet-container[data-zoom="4"] .egg-island { display: none; }

/* Coupang Partners rail: below the news by default, a sticky right column on wide screens */
.layout { grid-template-areas: "map panel" "news news" "ad ad"; }
.ad-rail { grid-area: ad; justify-self: center; display: grid; justify-items: center; gap: 6px; width: 136px; padding: 10px 8px; background: var(--surface); border-radius: 12px; box-shadow: var(--sticker-shadow); }
.ad-label { font: 700 16px var(--display); color: var(--ink-soft); margin: 0; }
.ad-slot { width: 120px; min-height: 840px; }
.ad-slot iframe { display: block; }
.ad-disclosure { margin: 0; font-size: 10.5px; line-height: 1.45; color: var(--ink-soft); text-align: center; }
@media (min-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 1fr) 380px 136px; grid-template-areas: "map panel ad" "news news ad"; }
  .ad-rail { position: sticky; top: 16px; align-self: start; }
}
@media (max-width: 900px) {
  .layout { grid-template-areas: "map" "panel" "news" "ad"; }
}

/* One typeface everywhere: Gaegu (handwritten). Regular for reading text, bold for titles and numbers.
   Hanzi are not in Gaegu and fall back to the system CJK font. */
:root { --font: "Gaegu", cursive; --display: "Gaegu", cursive; }
*, *::before, *::after { font-family: "Gaegu", cursive !important; }
body { font-size: 18px; line-height: 1.55; }
/* Gaegu runs small: reading text gets about 4px more than it had in Gowun Dodum */
.zoo-marker .count, .map-far .zoo-marker .count { font-size: 16px; }
.leaflet-tooltip, .leaflet-tooltip.zoo-tip, .route-label { font-size: 16px; }
.country-label span { font-size: 16px; }
.country-label.major span { font-size: 18px; }
.country-label.tiny span { font-size: 15px; }
.leaflet-control-attribution, .leaflet-control-attribution a, .leaflet-control-attribution span { font-size: 14px; }
.legend, .legend span { font-size: 16px; }
.zoo-line, .zoo-line strong { font-size: 17px; }
.chips .chip { font-size: 18px; }
.panda-alt, .panda-alt span { font-size: 18px; }
.facts dt, .facts dd, .facts dd span { font-size: 18px; }
.track-stops div, .track-stops b { font-size: 16px; }
.countdown, .note, .return-note { font-size: 18px; }
.route-steps li, .route-steps li span { font-size: 17px; }
.route-steps p, .sources, .sources a { font-size: 16px; }
.fact-note, .facts-cn li p { font-size: 17.5px; }
.fact-cat { font-size: 16px; }
.fact-src { font-size: 15px; }
.video-title { font-size: 16px; }
.video-meta { font-size: 14.5px; }
.video-more, .link-btn, .news-scope { font-size: 17px; }
.news-list time, .news-list .src, .news-list .orig { font-size: 15.5px; }
.news-list p { font-size: 17px; }
.news-list .lang { font-size: 14px; }
.ad-disclosure { font-size: 13px; }
.foot p { font-size: 16px; }
.search input, .toggle button { font-size: 17px; }
.leaflet-marker-icon .zoo-marker .count, .map-far .leaflet-marker-icon .zoo-marker .count { font-size: 16px; }
.leaflet-tooltip.route-label { font-size: 16px; }
section.facts-cn .fact-note { font-size: 16.5px; }

/* Hint box inside the hidden-panda popover */
.egg-hint-box { display: grid; gap: 8px; margin: 4px 0 10px; }
.egg-hint-btn { justify-self: start; font: 700 18px var(--display); color: var(--ink); background: var(--butter); border: 0; border-radius: 6px; padding: 4px 12px; cursor: pointer; box-shadow: 2px 3px 0 rgba(59, 47, 42, 0.18); transform: rotate(-1.5deg); }
.egg-hint-credit { font-size: 15px; color: var(--ink-soft); }
.egg-hint-gate { padding: 10px 12px; border-radius: 10px; background: var(--paper); border: 2px dashed var(--line); font-size: 16px; }
.egg-hint-gate[hidden] { display: none; }
.egg-hint-gate p { margin: 0 0 8px; }
.egg-hint-list { margin: 0; padding-left: 18px; font-size: 16px; line-height: 1.5; }
.egg-hint-list:empty { display: none; }
.egg-hint-list li.is-found { color: var(--ink-soft); text-decoration: line-through; }
.bb-hint-msg { flex-basis: 100%; margin: 0; text-align: center; font: 700 18px var(--display); color: #d0607e; }
.bb-hint-msg:empty { display: none; }

/* "공식 사진 보기" links to official photo pages */
.photo-official { display: inline-block; font: 700 16px var(--display); color: var(--ink); background: var(--mint); border-radius: 4px; padding: 3px 10px; text-decoration: none; box-shadow: 1px 2px 0 rgba(59, 47, 42, 0.18); transform: rotate(-1deg); }
.photo-official:hover { background: var(--butter); }
.photo-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.photos-empty .photo-official { margin: 2px 0; }

/* Mobile: news beside the Coupang rail; the list is cut at the rail's height until "뉴스 더보기" */
.news-more { display: block; margin: 12px auto 0; font: 700 18px var(--display); color: var(--ink); background: var(--butter); border: 0; border-radius: 8px; padding: 8px 18px; cursor: pointer; box-shadow: 2px 3px 0 rgba(59, 47, 42, 0.18); }
.news-more[hidden] { display: none; }
.news.is-clamped .news-list { overflow: hidden; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) 136px; grid-template-areas: "map map" "panel panel" "news ad"; column-gap: 12px; }
  .ad-rail { align-self: start; justify-self: end; position: sticky; top: 12px; }
  .news-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) { .layout { grid-template-columns: minmax(0, 1fr) 128px; } .ad-rail { width: 128px; padding: 6px 4px; } }
.foot-links { margin-top: 6px; font-size: 17px; }
.foot-links a { color: var(--ink-soft); }
