/* Layout: one full-screen night-sea map; a floating header, a bottom clue card, and a right-hand admin drawer. */
:root {
  --sea: #0a1c21;
  --sea-line: #12303a;
  --land: #173035;
  --land-hover: #1f3f45;
  --coast: #3b6168;
  --ink: #e9f1ec;
  --muted: #92aaa6;
  --panel: rgba(12, 30, 35, .92);
  --panel-solid: #10262c;
  --line: #2a474d;
  --citrine: #ffc55c;
  --citrine-ink: #2a1c00;
  --amethyst: #c3a1ff;
  --found: #7f9892;
  --danger: #ff8a7a;
  --shadow: 0 10px 34px rgba(0, 0, 0, .45);
  --plane: #f4f8f6;
  --plane-edge: #0a1c21;
  --plane-trail: #ffffff;
  --rail: #6f9aa0;
  --rail-tie: #173035;
  --train-edge: #0a1c21;
  --whale: #5f8796; --whale-belly: #c9dde2; --foam: #e9f6f7;
  --font-display: "Huninn", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-body: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --sea: #d7e6e3; --sea-line: #c6dad6; --land: #f6f3ea; --land-hover: #ece6d6; --coast: #9db3ad;
    --ink: #13292b; --muted: #587170; --panel: rgba(255, 253, 248, .94); --panel-solid: #fffdf8; --line: #d7e0dc;
    --citrine: #d48a00; --citrine-ink: #ffffff; --amethyst: #7a4fd6; --found: #8a9d98; --danger: #c0392b;
    --shadow: 0 10px 30px rgba(20, 50, 50, .18); --plane: #ffffff; --plane-edge: #587170; --plane-trail: #ffffff; color-scheme: light;
    --rail: #7d8f8a; --rail-tie: #f6f3ea;
    --train-edge: #3d5654; --whale: #3f6676; --whale-belly: #dfe9ea; --foam: #ffffff;
  }
}
:root[data-theme="light"] {
  --sea: #d7e6e3; --sea-line: #c6dad6; --land: #f6f3ea; --land-hover: #ece6d6; --coast: #9db3ad;
  --ink: #13292b; --muted: #587170; --panel: rgba(255, 253, 248, .94); --panel-solid: #fffdf8; --line: #d7e0dc;
  --citrine: #d48a00; --citrine-ink: #ffffff; --amethyst: #7a4fd6; --found: #8a9d98; --danger: #c0392b;
  --shadow: 0 10px 30px rgba(20, 50, 50, .18); --plane: #ffffff; --plane-edge: #587170; --plane-trail: #ffffff; color-scheme: light;
    --rail: #7d8f8a; --rail-tie: #f6f3ea;
    --train-edge: #3d5654; --whale: #3f6676; --whale-belly: #dfe9ea; --foam: #ffffff;
}

html, body { height: 100%; margin: 0; }
[hidden] { display: none !important; }
body { background: var(--sea); color: var(--ink); font-family: var(--font-body); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--citrine); }
:focus-visible { outline: 2px solid var(--citrine); outline-offset: 2px; }

#app { position: relative; height: 100%; overflow: hidden; }
#stage { position: absolute; inset: 0; touch-action: none; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
/* the pins / numbers / cloud layer over the map (app.js): only the pins themselves take taps, the rest falls through to the map */
#marks { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; overflow: visible; }
#marks .shop, #marks .count, #marks .cloud { pointer-events: auto; }
#map3d { position: absolute; inset: 0; }
#map3d .maplibregl-ctrl-attrib { font-size: 10px; }
#map3d .maplibregl-ctrl-bottom-right { bottom: calc(env(safe-area-inset-bottom, 0px)); right: 64px; }
.county { fill: var(--land); stroke: var(--coast); stroke-width: .6; vector-effect: non-scaling-stroke; transition: fill .2s; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.county.active { fill: var(--land-hover); stroke: var(--citrine); stroke-opacity: .7; stroke-width: 1.2; }
/* the island in relief (app.js depth()): shadow on the sea, the cliff walls (darker toward the bottom), light across the top */
#app { background: radial-gradient(ellipse 80% 70% at 55% 45%, color-mix(in srgb, var(--sea) 88%, #fff 12%), var(--sea) 70%); }
.land-shadow use { fill: #000; opacity: .38; pointer-events: none; }
:root[data-theme="light"] .land-shadow use { opacity: .2; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .land-shadow use { opacity: .2; } }
.land-ext use { fill: color-mix(in srgb, var(--coast) calc(100% - var(--t) * 45%), #000); pointer-events: none; }
.land-light use { pointer-events: none; }
.light-hi { stop-color: #fff; stop-opacity: .16; }
.light-mid { stop-color: #fff; stop-opacity: 0; }
.light-lo { stop-color: #000; stop-opacity: .14; }
.lift-shadow { fill: #000; opacity: .14; pointer-events: none; }
.lift-ext { fill: color-mix(in srgb, var(--citrine) 35%, var(--coast)); pointer-events: none; }
.lift-top { fill: var(--land-hover); stroke: var(--citrine); stroke-opacity: .8; stroke-width: 1.4; vector-effect: non-scaling-stroke; pointer-events: none; }
.plane .body { fill: var(--plane); stroke: var(--plane-edge); stroke-width: .6; }
.plane .shadow { fill: #000; opacity: .22; }
.plane .trail { fill: none; stroke-width: 2; stroke-linecap: round; }
.rail-bed { fill: none; stroke: var(--rail); stroke-width: 1.8; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rail-ties { fill: none; stroke: var(--rail-tie); stroke-width: .7; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.train .body { stroke: var(--train-edge); stroke-width: .5; stroke-opacity: .7; }
.train .stripe, .train .stripe2 { fill: none; stroke-linecap: round; }
.rail-hsr { fill: none; stroke: var(--rail); stroke-width: 1.4; stroke-dasharray: 6 2; vector-effect: non-scaling-stroke; }
.station.hsr rect { fill: var(--panel-solid); stroke: #f26a21; stroke-width: 1.4; }
.train .roof-unit { fill: rgba(0, 0, 0, .16); }
.train .glass { fill: #1d2a33; opacity: .85; }
.train .head { fill: #fff3b0; }
.train .tail { fill: #ff4b3a; }
:root:not([data-theme="light"]) .train .head { filter: drop-shadow(0 0 2px #ffe7a0); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .train .head { filter: none; } }
.station circle { fill: var(--panel-solid); stroke: var(--rail); stroke-width: 1.4; }
.station text { font-size: 10px; fill: var(--muted); paint-order: stroke; stroke: var(--land); stroke-width: 3px; stroke-linejoin: round; letter-spacing: .05em; }
.whale-body { fill: var(--whale); }
.whale-belly { fill: var(--whale-belly); opacity: .9; }
.whale-eye { fill: #0a1c21; }
.whale-ripple { fill: none; stroke: var(--foam); stroke-width: 1.2; }
.whale-drop { fill: var(--foam); }
.attrib { position: absolute; left: 16px; bottom: calc(4px + env(safe-area-inset-bottom, 0px)); font-size: 10px; color: var(--muted); opacity: .8; z-index: 3; }
.attrib a { color: inherit; }
.county-label { fill: var(--muted); font-family: var(--font-display); text-anchor: middle; pointer-events: none; letter-spacing: .1em; }
.graticule { fill: none; stroke: var(--sea-line); stroke-width: 1; vector-effect: non-scaling-stroke; }

.area { fill: var(--citrine); fill-opacity: .08; stroke: var(--citrine); stroke-opacity: .55; stroke-dasharray: 4 4; pointer-events: none; }
.area.found { fill: var(--found); stroke: var(--found); fill-opacity: .06; }
.marker { cursor: pointer; outline: none; }
.marker:focus-visible .core { stroke: var(--ink); stroke-width: 3; }
.marker .hit { fill: transparent; }
.marker .core { fill: var(--citrine); stroke: var(--sea); stroke-width: 2; animation: blink 1.1s ease-in-out infinite; }
.marker.found .core { animation: none; }
.marker .ring { fill: none; stroke: var(--citrine); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pulse 1.8s ease-out infinite; }
.marker .ring.r2 { animation-delay: .9s; }
.marker .glow { fill: var(--citrine); opacity: .35; filter: blur(4px); transform-box: fill-box; transform-origin: center; animation: breathe 1.8s ease-in-out infinite; }
.marker.found .core { fill: var(--found); }
.marker.found .ring, .marker.found .glow { display: none; }
.marker.found .tick { display: block; }
.marker .tick { display: none; stroke: var(--sea); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.marker.selected .core { fill: var(--amethyst); }
.marker.selected .ring { stroke: var(--amethyst); }
.exact-pin { fill: var(--danger); stroke: var(--panel-solid); stroke-width: 2; }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.4); opacity: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .marker .ring, .marker .glow { animation: none; } .marker .ring.r2 { display: none; } }

/* Header */
.top { position: absolute; top: 12px; left: 16px; right: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; pointer-events: none; z-index: 5; }
.top > * { pointer-events: auto; }
.brand { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); backdrop-filter: blur(8px); min-width: 0; max-width: min(420px, 100%); box-sizing: border-box; }
.brand h1 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 400; letter-spacing: .12em; display: flex; align-items: center; gap: 8px; }
.brand h1 .gem { width: 14px; height: 14px; flex: none; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.brand p b { color: var(--citrine); font-weight: 600; }
.brand .tagline { color: var(--ink); font-size: 13px; line-height: 1.5; margin-top: 6px; white-space: pre-wrap; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--citrine); color: var(--citrine-ink); }
.seg button .n { font-family: var(--font-mono); font-size: 11px; margin-left: 4px; opacity: .8; }
.pill-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
select.pill-btn { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.pill-btn.view[aria-pressed="true"] { background: var(--ink); color: var(--panel-solid); border-color: var(--ink); }
.pill-btn.admin[aria-pressed="true"] { background: var(--amethyst); color: var(--panel-solid); border-color: var(--amethyst); }

/* Zoom buttons */
.zoom { position: absolute; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 6px; z-index: 4; }
.zoom button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); font-size: 18px; }

/* Toast / notices */
.notice { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(28px + env(safe-area-inset-bottom, 0px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); max-width: min(420px, calc(100% - 32px)); width: max-content; box-sizing: border-box; font-size: 14px; line-height: 1.55; z-index: 6; text-align: center; }
.notice strong { font-family: var(--font-display); font-weight: 400; font-size: 16px; display: block; margin-bottom: 2px; }

/* Clue card */
.card { position: absolute; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(380px, calc(100% - 32px)); max-height: 62%; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(10px); padding: 18px; z-index: 7; box-sizing: border-box; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-head > div { min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.item { color: var(--amethyst); border-color: color-mix(in srgb, var(--amethyst) 45%, transparent); }
.chip.status-hidden { color: var(--citrine); border-color: color-mix(in srgb, var(--citrine) 45%, transparent); }
.chip.status-found { color: var(--found); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.card h2 { font-family: var(--font-display); font-weight: 400; font-size: 22px; margin: 10px 0 4px; letter-spacing: .04em; text-wrap: balance; }
.meta { color: var(--muted); font-size: 13px; }
.head-btns { display: flex; align-items: center; gap: 2px; flex: none; }
.back { border: 1px solid var(--line); background: none; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; letter-spacing: .06em; color: var(--ink); white-space: nowrap; cursor: pointer; }
.back:hover, .back:focus-visible { border-color: var(--citrine); color: var(--citrine); }
.close { border: 0; background: none; width: 32px; height: 32px; border-radius: 10px; font-size: 20px; color: var(--muted); flex: none; }
.clue { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.clue .label { font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.clue p { margin: 6px 0 0; line-height: 1.75; font-size: 15px; white-space: pre-wrap; }
.hint-btn { margin-top: 10px; border: 1px dashed var(--line); background: none; border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--citrine); width: 100%; }
.found-note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--found) 16%, transparent); font-size: 14px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Buttons */
.btn { border: 1px solid var(--line); background: none; border-radius: 10px; padding: 8px 14px; font-size: 14px; text-decoration: none; color: inherit; display: inline-block; }
.btn.primary { background: var(--citrine); color: var(--citrine-ink); border-color: var(--citrine); }
.btn.violet { background: var(--amethyst); color: var(--panel-solid); border-color: var(--amethyst); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* Admin drawer */
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 100%); background: var(--panel-solid); border-left: 1px solid var(--line); box-shadow: var(--shadow); z-index: 8; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); box-sizing: border-box; }
.drawer header { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.drawer header h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 19px; letter-spacing: .08em; }
.drawer .body { overflow: auto; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1; }
.account { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.account .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.summary div { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.summary b { display: block; font-family: var(--font-mono); font-size: 18px; font-weight: 500; }
.summary span { font-size: 11px; color: var(--muted); }
.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: none; text-align: left; }
.row .d { width: 10px; height: 10px; border-radius: 50%; background: var(--citrine); }
.row.found .d { background: var(--found); }
.row .t { min-width: 0; }
.row .t b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t span { color: var(--muted); font-size: 12px; }
.row .t > span { display: block; }
/* the shop's description under its name: at most two lines */
.row .t .desc { color: var(--ink); opacity: .78; font-size: 13px; line-height: 1.55; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.row .t .desc.tags { color: var(--citrine); opacity: 1; }
.row .t .closed-tag { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.row .c { color: var(--muted); font-size: 12px; }
.help { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; }
form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.field input, .field select, .field textarea { background: var(--sea); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font-size: 15px; width: 100%; box-sizing: border-box; }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.coord { font-family: var(--font-mono); font-size: 12px; color: var(--muted); background: var(--sea); border: 1px dashed var(--line); border-radius: 10px; padding: 9px 11px; }
.coord.missing { color: var(--danger); }
.err { color: var(--danger); font-size: 13px; }
.ok { color: var(--citrine); font-size: 13px; }

/* Admin login */
.login { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--sea) 70%, transparent); backdrop-filter: blur(6px); }
.login form { width: min(360px, 100%); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; box-sizing: border-box; }
.login h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 22px; letter-spacing: .1em; }

@media (max-width: 560px) {
  .drawer { top: auto; height: 78%; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; }
  .card { left: 16px; right: 16px; width: auto; }
  .brand h1 { font-size: 19px; }
}

/* ---------- 礦店地圖 additions (the rest of this file is shared with 晶島尋寶) ---------- */
:root { --t-store: #f08a6a; --t-studio: #5dcaa5; --t-market: #ffc55c; --t-museum: #b39cf5; --t-online: #8ab8ff; --t-other: #b9c4c0;
  --cl-top: #244147; --cl-hi: #2b4a50; --cl-hi2: #284549; --cl-s1: #1a3338; --cl-s2: #14292e; --cl-s3: #0f2328; --cl-shade: rgba(0, 0, 0, .3); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --t-store: #c9532f; --t-studio: #178a68; --t-market: #b87d0c; --t-museum: #6f5bc4; --t-online: #3f78d6; --t-other: #7d8f8a;
  --cl-top: #f6f3ea; --cl-hi: #fbf9f3; --cl-hi2: #faf7f0; --cl-s1: #e2e6dc; --cl-s2: #cfdad3; --cl-s3: #b9c9c2; --cl-shade: rgba(59, 97, 104, .14); } }
:root[data-theme="light"] { --t-store: #c9532f; --t-studio: #178a68; --t-market: #b87d0c; --t-museum: #6f5bc4; --t-online: #3f78d6; --t-other: #7d8f8a;
  --cl-top: #f6f3ea; --cl-hi: #fbf9f3; --cl-hi2: #faf7f0; --cl-s1: #e2e6dc; --cl-s2: #cfdad3; --cl-s3: #b9c9c2; --cl-shade: rgba(59, 97, 104, .14); }
/* the whole-island view: one number per county (app.js drawCounts) */
.count { cursor: pointer; outline: none; }
.count .count-ring { fill: var(--citrine); opacity: .28; transition: transform .2s; transform-box: fill-box; transform-origin: center; }
.count .count-dot { fill: var(--citrine); stroke: #fff; stroke-width: 1.5; }
.count .count-n { fill: var(--citrine-ink); font: 700 13px Arial, sans-serif; text-anchor: middle; pointer-events: none; }
.count:hover .count-ring, .count:focus-visible .count-ring { transform: scale(1.25); }
.shop { cursor: pointer; outline: none; }
.shop .hit { fill: transparent; }
.shop .icon { transition: transform .15s; transform-box: fill-box; transform-origin: 50% 100%; }
.shop .icon .shade { fill: #000; opacity: .2; }
.shop .pin { fill: var(--t-other); stroke: var(--sea); stroke-width: 1.5; stroke-linejoin: round; }
.shop .pick { fill: #ffc940; stroke: #6b4a00; stroke-width: .9; stroke-linejoin: round; }
.exact-pin { stroke-linejoin: round; }
.shop .hole { fill: var(--sea); }
.shop:hover .icon, .shop:focus-visible .icon { transform: scale(1.12); }
.shop.selected .icon { filter: drop-shadow(0 0 1.5px var(--ink)) drop-shadow(0 0 1.5px var(--ink)); }
.shop.closed { opacity: .55; }
.shop.closed .icon, .shop.closed .pick { filter: grayscale(1); }
.search-box { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; box-shadow: var(--shadow); backdrop-filter: blur(8px); width: 150px; }
.chip.t { color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.chip.pick { color: var(--citrine); border-color: color-mix(in srgb, var(--citrine) 45%, transparent); }
.info { margin: 12px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.info dt { color: var(--muted); font-size: 12px; letter-spacing: .08em; padding-top: 2px; white-space: nowrap; }
.info dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.row .d.t { background: var(--c); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin: 0; }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 5px; }
/* phone: the title on the left; on the right, row 1 = search (long) + a small round light/dark button, row 2 = county + type */
@media (max-width: 560px) {
  .top { flex-wrap: nowrap; align-items: flex-start; }
  .brand { flex: none; }
  .controls { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 6px; }
  .controls > * { min-width: 0; width: 100%; box-sizing: border-box; }
  .search-box { grid-column: 1 / 3; grid-row: 1; width: 100%; }
  #theme-btn { grid-column: 3; grid-row: 1; width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 15px; line-height: 1; }
  #theme-btn .lbl { display: none; }
  #county { grid-column: 1; grid-row: 2; }
  #type { grid-column: 2 / 4; grid-row: 2; }
  .controls select.pill-btn { padding-left: 10px; padding-right: 22px; background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%; text-overflow: ellipsis; }
  .attrib { right: 64px; }   /* the credits wrap, so keep them clear of the zoom buttons */
}
/* Townships / districts: faint borders and names */
/* flying to a county or a shop (app.js flyTo): the map moves as one picture; pins and numbers wait for it to land */
#stage.flying, #stage.flying #marks * { pointer-events: none; }
#stage.flying #map { will-change: transform; }
/* while the map is being zoomed or dragged (app.js): no blurred shadows, so every frame stays cheap on a phone */
#stage.moving .land-shadow, #stage.moving .cl-shadow, #stage.moving .lift-shadow { display: none; }
.town-line { fill: none; stroke: var(--coast); stroke-opacity: .42; stroke-width: .5; vector-effect: non-scaling-stroke; pointer-events: none; }
.town-label { fill: var(--muted); fill-opacity: .38; font-family: var(--font-body); text-anchor: middle; dominant-baseline: middle; pointer-events: none; letter-spacing: .06em; }

/* 線上礦店 cloud */
.cloud { cursor: pointer; outline: none; }
.cloud .hit { fill: transparent; }
.cloud-body { transition: transform .2s; transform-box: fill-box; transform-origin: 50% 70%; }
.cloud:hover .cloud-body, .cloud:focus-visible .cloud-body { transform: scale(1.06) translateY(-2px); }
/* the cloud looks like a county: land fill, thin coast outline; picked = the same highlight as a picked county */
.cl-edge { fill: var(--land); stroke: var(--coast); stroke-width: .9px; vector-effect: non-scaling-stroke; transition: fill .2s, stroke .2s; }
.cl-face { fill: var(--land); transition: fill .2s; }
.cl-shadow { fill: #000; opacity: .3; pointer-events: none; }
:root[data-theme="light"] .cl-shadow { opacity: .16; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .cl-shadow { opacity: .16; } }
.cl-ext { fill: color-mix(in srgb, var(--coast) calc(100% - var(--t) * 45%), #000); pointer-events: none; }
.cloud.active .cl-ext { fill: color-mix(in srgb, var(--citrine) 35%, var(--coast)); }
.cl-shopshade { fill: var(--coast); opacity: .35; }
.cloud.active .cl-edge { fill: var(--land-hover); stroke: var(--citrine); stroke-opacity: .7; stroke-width: 2px; }
.cloud.active .cl-face { fill: var(--land-hover); }
.cloud-badge circle { fill: var(--citrine); }
.cloud-badge text { fill: var(--citrine-ink); font: 700 11px Arial, sans-serif; text-anchor: middle; pointer-events: none; }
/* same look as the county names (.county-label) */
.cloud-label { fill: var(--muted); font-family: var(--font-display); letter-spacing: .1em; text-anchor: middle; pointer-events: none; }
.cloud-opt { flex-direction: row !important; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; line-height: 1.6; }
.cloud-opt input { width: auto; margin-top: 4px; }

/* 列表打開時像捲軸一樣由上往下展開，項目依序出現 */
@keyframes ck-unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes ck-item { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.unroll { animation: ck-unroll .55s cubic-bezier(.3, .7, .2, 1) both; }
.unroll > * { animation: ck-item .35s ease both; animation-delay: .62s; }
.unroll > :nth-child(1) { animation-delay: 0.080s; }
.unroll > :nth-child(2) { animation-delay: 0.125s; }
.unroll > :nth-child(3) { animation-delay: 0.170s; }
.unroll > :nth-child(4) { animation-delay: 0.215s; }
.unroll > :nth-child(5) { animation-delay: 0.260s; }
.unroll > :nth-child(6) { animation-delay: 0.305s; }
.unroll > :nth-child(7) { animation-delay: 0.350s; }
.unroll > :nth-child(8) { animation-delay: 0.395s; }
.unroll > :nth-child(9) { animation-delay: 0.440s; }
.unroll > :nth-child(10) { animation-delay: 0.485s; }
.unroll > :nth-child(11) { animation-delay: 0.530s; }
.unroll > :nth-child(12) { animation-delay: 0.575s; }
/* 礦友留言 */
.shop-notes { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.shop-notes h3 { margin: 0 0 8px; font-size: 14px; font-weight: 500; letter-spacing: .12em; display: flex; gap: 8px; align-items: baseline; }
.shop-notes h3 span { font-size: 12px; color: var(--muted); letter-spacing: 0; }
.snote { padding: 10px 0; border-bottom: 1px solid var(--line); }
.snote .who { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.snote .who b { color: var(--ink); font-weight: 500; }
.snote p { margin: 4px 0 0; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.sreply { margin-top: 8px; font-size: 13px; line-height: 1.7; padding: 7px 11px; border-radius: 10px; background: color-mix(in srgb, var(--citrine) 14%, transparent); white-space: pre-wrap; word-break: break-word; }
.sreply b { display: block; font-size: 11px; letter-spacing: .12em; color: var(--citrine); font-weight: 500; }
.sadmin { display: flex; gap: 6px; margin-top: 6px; }
.more-notes { background: none; border: 0; padding: 10px 0 2px; font: inherit; font-size: 13px; color: var(--citrine); cursor: pointer; }
.note-form { display: grid; gap: 8px; margin-top: 12px; }
.note-form input, .note-form textarea { font: inherit; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--panel-solid); color: var(--ink); width: 100%; box-sizing: border-box; }
.note-form textarea { min-height: 72px; resize: vertical; line-height: 1.6; }
.nf-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nf-count { font-size: 12px; color: var(--muted); }
.row .t .note-count { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }
