:root {
  --paper: #f3ead8;
  --paper-light: #fbf6ea;
  --paper-deep: #e7d9bf;
  --ink: #28231c;
  --ink-soft: #4f473b;
  --muted: #7b705f;
  --line: #cbb998;
  --line-dark: #9f8a68;
  --cinnabar: #b4382c;
  --cinnabar-dark: #8c261d;
  --cinnabar-soft: #d66b57;
  --jade: #356b5a;
  --jade-soft: #a9cbb8;
  --jade-pale: #dbe9df;
  --gold: #b28a47;
  --amber: #c98b39;
  --shadow-sm: 0 2px 8px rgba(62, 46, 23, 0.08);
  --shadow-md: 0 12px 35px rgba(62, 46, 23, 0.13);
  --shadow-lg: 0 28px 80px rgba(50, 36, 16, 0.22);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(ellipse at 14% -8%, rgba(255, 251, 240, 0.95) 0%, rgba(255, 251, 240, 0) 44%),
    radial-gradient(ellipse at 92% 106%, rgba(210, 183, 137, 0.35) 0%, rgba(210, 183, 137, 0) 54%),
    linear-gradient(135deg, #f4ecdc 0%, #eee3ce 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(2px);
}
body::before { width: 46vw; height: 46vw; left: -22vw; top: 30vh; background: radial-gradient(circle, rgba(176, 142, 83, 0.08), transparent 68%); }
body::after { width: 40vw; height: 40vw; right: -18vw; top: -8vw; background: radial-gradient(circle, rgba(180, 56, 44, 0.05), transparent 68%); }

.paper-texture {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image:
    repeating-linear-gradient(0deg, rgba(102, 80, 45, 0.035) 0, rgba(102, 80, 45, 0.035) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.2) 1px, transparent 1px, transparent 5px);
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 3px;
}

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 84px;
  padding: 12px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid rgba(159, 138, 104, 0.38);
  background: linear-gradient(180deg, rgba(248, 242, 230, 0.94), rgba(243, 234, 216, 0.82));
  backdrop-filter: blur(14px) saturate(1.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  color: var(--ink);
  text-decoration: none;
  user-select: none;
}
.brand-seal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 3px;
  color: #f8efd9;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 45%),
    var(--cinnabar);
  border: 1px solid rgba(110, 24, 18, 0.42);
  box-shadow: inset 0 0 0 2px rgba(248, 239, 217, 0.2), 0 4px 12px rgba(140, 38, 29, 0.18);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font-family: var(--serif); font-size: 22px; letter-spacing: 0.12em; font-weight: 700; }
.brand-copy small { color: var(--muted); font-size: 8px; letter-spacing: 0.18em; font-weight: 600; }

.mode-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(159, 138, 104, 0.44);
  border-radius: 999px;
  background: rgba(251, 246, 234, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 8px rgba(80, 58, 25, 0.05);
}
.mode-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 104px;
  padding: 7px 15px 7px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.mode-tab:hover { background: rgba(180, 56, 44, 0.07); }
.mode-tab:active { transform: scale(0.985); }
.mode-char {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(159, 138, 104, 0.38);
  border-radius: 50%;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  transition: all 0.2s ease;
}
.mode-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; line-height: 1.2; white-space: nowrap; }
.mode-meta b { color: var(--ink-soft); font-size: 13px; letter-spacing: 0; }
.mode-tab.active {
  color: #f9f1df;
  background: linear-gradient(145deg, #bc4032, #9d2d23);
  box-shadow: 0 5px 14px rgba(142, 38, 29, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.mode-tab.active:hover { background: linear-gradient(145deg, #c34738, #a63126); }
.mode-tab.active .mode-char { color: #f9f1df; border-color: rgba(249, 241, 223, 0.4); background: rgba(255, 255, 255, 0.1); }
.mode-tab.active .mode-meta, .mode-tab.active .mode-meta b { color: rgba(249, 241, 223, 0.86); }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-width: 190px; }
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(159, 138, 104, 0.42);
  border-radius: 50%;
  background: rgba(251, 246, 234, 0.7);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}
.icon-button:hover { background: #fffaf0; border-color: var(--line-dark); }
.icon-button svg { width: 18px; height: 18px; fill: var(--ink-soft); }
.icon-button.off { opacity: 0.48; }
.icon-button.off::after { content: ""; position: absolute; width: 24px; height: 1px; background: var(--ink-soft); transform: rotate(-45deg); }
.icon-button { position: relative; }
.rank-button {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(159, 138, 104, 0.5);
  border-radius: 999px;
  background: rgba(251, 246, 234, 0.75);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.rank-button:hover { background: #fffaf1; border-color: var(--line-dark); }
.rank-button:active { transform: translateY(1px); }
.rank-button svg { width: 17px; height: 17px; fill: var(--cinnabar); }

/* ---------- Layout ---------- */
.game-shell {
  display: grid;
  grid-template-columns: 324px minmax(0, 1fr);
  gap: 20px;
  width: min(1580px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 2.5vw, 34px) 12px;
}

.hud { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ---------- Target card ---------- */
.target-card {
  position: relative;
  min-height: 172px;
  padding: 18px 20px 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(180, 56, 44, 0.08), transparent 55%),
    linear-gradient(150deg, rgba(255, 252, 245, 0.92), rgba(241, 231, 210, 0.92));
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.target-card::before {
  content: "";
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--cinnabar), #d08f4e);
  opacity: 0.82;
}
.target-card::after {
  content: "山河";
  position: absolute;
  right: 12px; bottom: -9px;
  color: rgba(180, 56, 44, 0.055);
  font-family: var(--serif);
  font-size: 74px;
  font-weight: 700;
  letter-spacing: 0.05em;
  pointer-events: none;
  user-select: none;
}
.target-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; letter-spacing: 0.11em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #c0ad8b; box-shadow: 0 0 0 3px rgba(192, 173, 139, 0.16); }
.status-dot.live { background: var(--jade); box-shadow: 0 0 0 3px rgba(53, 107, 90, 0.16); animation: breathe 1.8s ease-in-out infinite; }
.target-name {
  position: relative;
  z-index: 1;
  min-height: 58px;
  margin-top: 18px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(30px, 2.5vw, 41px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.target-parent { position: relative; z-index: 1; margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.45; letter-spacing: 0.04em; }
.target-hint {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  padding: 7px 9px;
  border-left: 2px solid var(--amber);
  background: rgba(201, 139, 57, 0.1);
  color: #7c5b26;
  font-size: 11px;
  line-height: 1.45;
}
.target-card.shake { animation: cardShake 0.38s ease; }
.target-card.correct { animation: cardCorrect 0.55s ease; }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: 1.08fr 1fr 0.82fr; gap: 8px; }
.stat-block {
  min-width: 0;
  padding: 13px 12px 11px;
  border: 1px solid rgba(159, 138, 104, 0.38);
  border-radius: 4px;
  background: rgba(251, 246, 234, 0.64);
}
.stat-block > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; letter-spacing: 0.12em; }
.stat-block > div { display: flex; align-items: baseline; gap: 3px; }
.stat-block strong { color: var(--ink); font-family: var(--serif); font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.stat-block small { color: var(--muted); font-size: 9px; }
.stat-remaining { background: rgba(180, 56, 44, 0.055); border-color: rgba(180, 56, 44, 0.19); }
.stat-remaining strong { color: var(--cinnabar); font-size: 28px; }

.progress-card { padding: 2px 1px 0; }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 9px; letter-spacing: 0.1em; }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(159, 138, 104, 0.22); }
.progress-track i { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cinnabar), #cf8750); transition: width 0.3s ease; }

/* ---------- Detail mini maps ---------- */
.detail-card {
  padding: 12px 12px 10px;
  border: 1px solid rgba(159, 138, 104, 0.4);
  border-radius: 4px;
  background: rgba(251, 246, 234, 0.58);
}
.detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.detail-head span { color: var(--ink-soft); font-family: var(--serif); font-size: 14px; font-weight: 700; letter-spacing: 0.08em; }
.detail-head small { color: var(--muted); font-size: 9px; }
.detail-maps { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.detail-map { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.detail-map svg { display: block; max-width: 100%; height: auto; overflow: hidden; border: 1px solid rgba(159, 138, 104, 0.22); border-radius: 2px; background: rgba(255, 252, 245, 0.56); }
.detail-hk svg { width: 160px; }
.detail-mo svg { width: 96px; }
.detail-map > span { color: var(--muted); font-size: 9px; letter-spacing: 0.12em; }
.detail-map .region { cursor: pointer; }

.hud-actions { display: flex; gap: 16px; padding: 2px 2px 0; }
.text-button { padding: 0; border: 0; background: none; color: var(--cinnabar); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(180, 56, 44, 0.3); text-underline-offset: 3px; }
.text-button:hover { text-decoration-color: currentColor; }
.text-button.muted { color: var(--muted); text-decoration-color: rgba(123, 112, 95, 0.3); }
.hud-footnote { margin: 0; padding: 0 2px; color: rgba(123, 112, 95, 0.9); font-size: 9px; line-height: 1.6; }


.label-layer { pointer-events: none; }
.map-label {
  fill: #3c3326;
  stroke: rgba(250, 245, 233, 0.92);
  stroke-width: 2.2px;
  paint-order: stroke fill;
  font-family: var(--serif);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
}
.map-label.latest { fill: #225445; }
.inset-label {
  fill: #4a3c28;
  stroke: rgba(250, 245, 233, 0.94);
  stroke-width: 1.6px;
  paint-order: stroke fill;
  font-family: var(--serif);
  font-size: 10.5px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
}

/* ---------- Map stage ---------- */
.map-stage { min-width: 0; }
.map-frame {
  position: relative;
  height: calc(100vh - 186px);
  min-height: 640px;
  overflow: hidden;
  border: 1px solid #b7a17e;
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 252, 243, 0.95) 0%, rgba(247, 239, 223, 0.72) 52%, rgba(231, 216, 188, 0.62) 100%),
    repeating-linear-gradient(0deg, rgba(107, 82, 43, 0.025) 0, rgba(107, 82, 43, 0.025) 1px, transparent 1px, transparent 4px);
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}
.map-frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 1;
  border: 1px solid rgba(159, 138, 104, 0.2);
  border-radius: 3px;
  pointer-events: none;
}
.map-topline {
  position: absolute;
  top: 17px; left: 22px; right: 22px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.13em;
  pointer-events: none;
}
.map-badge { padding: 4px 7px; border: 1px solid rgba(159, 138, 104, 0.32); border-radius: 2px; background: rgba(251, 246, 234, 0.55); color: #88775d; font-size: 8px; letter-spacing: 0.08em; }

#map {
  position: absolute;
  inset: 42px 14px 12px;
  width: calc(100% - 28px);
  height: calc(100% - 54px);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#map.dragging { cursor: grabbing; }
.base-layer { pointer-events: none; }
.base-region { fill: #e6dac1; stroke: #b29b78; stroke-width: 0.5; vector-effect: non-scaling-stroke; }
.region {
  fill: var(--tone, #eadfc9);
  stroke: #8f7a5a;
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 0.16s ease, stroke 0.16s ease, opacity 0.16s ease;
}
.region:hover { fill: #e9bd7c; stroke: #7e6441; }
.tone-0 { --tone: #eadfc9; }
.tone-1 { --tone: #e4d7be; }
.tone-2 { --tone: #eee4d1; }
.tone-3 { --tone: #e7dbc2; }
.region.answered { fill: var(--jade-soft); stroke: var(--jade); }
.region.answered:hover { fill: #b7d6c4; }
.region.wrong { fill: #d96b58 !important; stroke: #8c261d !important; }
.region.just-correct { animation: correctFlash 0.7s ease; }
.inset-region.just-correct, .detail-region.just-correct { animation: correctFlash 0.7s ease; }

.map-controls {
  position: absolute;
  top: 68px; right: 20px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(159, 138, 104, 0.4);
  border-radius: 4px;
  background: rgba(251, 246, 234, 0.82);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(4px);
}
.map-controls button {
  display: grid;
  place-items: center;
  width: 30px; height: 28px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.map-controls button:hover { background: rgba(180, 56, 44, 0.1); color: var(--cinnabar); }
.map-controls button svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- South China Sea inset ---------- */
.inset-card {
  position: absolute;
  right: 24px; bottom: 22px;
  z-index: 7;
  width: 148px;
  padding: 7px 7px 6px;
  border: 1px solid rgba(140, 118, 83, 0.5);
  border-radius: 3px;
  background: rgba(249, 243, 230, 0.93);
  box-shadow: 0 8px 24px rgba(59, 44, 20, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(3px);
}
.inset-head { margin-bottom: 4px; color: var(--ink-soft); font-family: var(--serif); font-size: 10px; font-weight: 700; text-align: center; letter-spacing: 0.12em; }
#inset { display: block; width: 100%; aspect-ratio: 240 / 318; overflow: hidden; border: 1px solid rgba(159, 138, 104, 0.26); background: rgba(239, 228, 206, 0.5); }
.inset-base { fill: #e6dac1; stroke: #ab9574; stroke-width: 0.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.inset-dash { fill: #7e6b4e; opacity: 0.8; pointer-events: none; }
.inset-foot { margin-top: 5px; color: var(--muted); font-size: 7px; text-align: center; letter-spacing: 0.08em; }
.inset-region { stroke-width: 0.65; }
.inset-region:hover { fill: #e9bd7c; }


.boundary-layer { pointer-events: none; }
.boundary {
  fill: none;
  stroke: rgba(67, 53, 33, 0.62);
  stroke-width: 1.35;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.boundary.province { stroke: rgba(61, 47, 29, 0.82); stroke-width: 1.7; }
.boundary.city { stroke: rgba(91, 73, 47, 0.42); stroke-width: 1.05; }
.boundary.continent { stroke: rgba(54, 42, 25, 0.7); stroke-width: 1.8; }

.region.cont-asia { --tone: #e8d7b7; }
.region.cont-europe { --tone: #d8e2df; }
.region.cont-africa { --tone: #e5cda7; }
.region.cont-north-america { --tone: #dce5d2; }
.region.cont-south-america { --tone: #ecd1bc; }
.region.cont-oceania { --tone: #d1e1de; }
.region.cont-antarctica { --tone: #e5e7e4; }
.region.cont-other { --tone: #e0d6c1; }
.region.non-targetable { opacity: 0.62; }

.continent-legend {
  position: absolute;
  left: 24px; bottom: 22px;
  z-index: 7;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  max-width: 290px;
  padding: 8px 10px;
  border: 1px solid rgba(140, 118, 83, 0.48);
  border-radius: 3px;
  background: rgba(249, 243, 230, 0.9);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  backdrop-filter: blur(3px);
}
.continent-legend[hidden] { display: none !important; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.legend-swatch { display: inline-block; width: 8px; height: 8px; border: 1px solid rgba(90, 73, 48, 0.35); border-radius: 1px; }
.legend-swatch.cont-asia { background: #e8d7b7; }
.legend-swatch.cont-europe { background: #d8e2df; }
.legend-swatch.cont-africa { background: #e5cda7; }
.legend-swatch.cont-north-america { background: #dce5d2; }
.legend-swatch.cont-south-america { background: #ecd1bc; }
.legend-swatch.cont-oceania { background: #d1e1de; }
.legend-swatch.cont-antarctica { background: #e5e7e4; }
.legend-swatch.cont-other { background: #e0d6c1; }

.inset-card[hidden], .detail-card[hidden] { display: none !important; }

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  left: 50%; bottom: 22px;
  z-index: 15;
  max-width: min(440px, 80%);
  padding: 10px 18px;
  border: 1px solid rgba(159, 138, 104, 0.38);
  border-radius: 999px;
  background: rgba(42, 36, 28, 0.9);
  color: #f7eedc;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.success { background: rgba(42, 88, 72, 0.94); border-color: rgba(169, 203, 184, 0.4); }
.toast.error { background: rgba(132, 45, 35, 0.94); border-color: rgba(232, 172, 158, 0.35); }

/* ---------- Start overlay ---------- */
.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(244, 235, 217, 0.2) 0%, rgba(239, 228, 207, 0.74) 62%, rgba(233, 220, 195, 0.88) 100%);
  backdrop-filter: blur(2px);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.start-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.start-card {
  position: relative;
  width: min(540px, 94%);
  padding: clamp(24px, 4vw, 44px) clamp(22px, 4.2vw, 50px) 28px;
  border: 1px solid rgba(144, 122, 86, 0.62);
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 12% 5%, rgba(255, 255, 255, 0.8), transparent 42%),
    linear-gradient(145deg, rgba(252, 247, 237, 0.97), rgba(241, 231, 210, 0.97));
  box-shadow: 0 30px 80px rgba(58, 42, 18, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  text-align: center;
}
.start-card::before, .start-card::after {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  border-color: rgba(180, 56, 44, 0.4);
  border-style: solid;
}
.start-card::before { top: 8px; left: 8px; border-width: 1px 0 0 1px; }
.start-card::after { right: 8px; bottom: 8px; border-width: 0 1px 1px 0; }
.start-kicker { color: var(--cinnabar); font-size: 10px; font-weight: 700; letter-spacing: 0.18em; }
.start-title { margin: 13px 0 12px; font-family: var(--serif); font-size: clamp(42px, 5.2vw, 66px); font-weight: 700; line-height: 1.1; letter-spacing: 0.12em; text-indent: 0.12em; color: #2b251d; }
.start-desc { max-width: 380px; margin: 0 auto; color: #675b49; font-size: 13px; line-height: 1.8; }
.start-rule { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin: 22px 0 20px; padding: 12px 0; border-top: 1px solid rgba(159, 138, 104, 0.24); border-bottom: 1px solid rgba(159, 138, 104, 0.24); color: var(--muted); font-size: 9px; letter-spacing: 0.08em; }
.start-rule span { display: inline-flex; align-items: center; gap: 6px; }
.rule-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 2px; border: 1px solid rgba(127, 106, 73, 0.4); }
.rule-swatch.pending { background: #e9dfca; }
.rule-swatch.done { background: var(--jade-soft); border-color: var(--jade); }
.rule-swatch.sea { background: repeating-linear-gradient(90deg, #a98c5f 0 2px, transparent 2px 4px); }
.start-meta { display: flex; justify-content: center; gap: clamp(22px, 5vw, 42px); margin-bottom: 23px; }
.start-meta div { display: flex; flex-direction: column; gap: 3px; }
.start-meta strong { font-family: var(--serif); font-size: 24px; line-height: 1; }
.start-meta span { color: var(--muted); font-size: 8px; letter-spacing: 0.12em; }
.start-note { margin: 15px 0 0; color: rgba(123, 112, 95, 0.82); font-size: 8px; line-height: 1.5; }

/* ---------- Buttons ---------- */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 28px;
  border: 1px solid rgba(112, 28, 21, 0.35);
  border-radius: 2px;
  background: linear-gradient(145deg, #bc4032, #9b2c22);
  color: #faf2e1;
  box-shadow: 0 7px 18px rgba(140, 38, 29, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.primary-button:hover { filter: brightness(1.06); box-shadow: 0 9px 22px rgba(140, 38, 29, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.primary-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.primary-button.compact { min-height: 40px; padding: 0 18px; font-size: 12px; white-space: nowrap; }
.primary-button:disabled { opacity: 0.55; cursor: wait; transform: none; }
.ghost-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  border: 1px solid rgba(127, 106, 73, 0.5);
  border-radius: 2px;
  background: rgba(251, 246, 234, 0.55);
  color: var(--ink-soft);
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.ghost-button:hover { background: #fffaf0; border-color: var(--line-dark); }

/* ---------- Loading ---------- */
.map-loading { position: absolute; inset: 0; z-index: 25; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(243, 234, 216, 0.88); color: var(--muted); font-size: 11px; letter-spacing: 0.12em; backdrop-filter: blur(3px); }
.map-loading[hidden] { display: none; }
.loading-seal { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(180, 56, 44, 0.38); color: var(--cinnabar); font-family: var(--serif); font-size: 22px; animation: sealSpin 2.2s ease-in-out infinite; }
.map-loading p { margin: 0; }

/* ---------- Modal base ---------- */
.modal { width: min(560px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 40px); margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink); }
.modal::backdrop { background: rgba(43, 35, 23, 0.45); backdrop-filter: blur(4px); }
.modal[open] { animation: modalIn 0.24s ease both; }
.modal-inner { position: relative; overflow: auto; max-height: calc(100vh - 40px); padding: 28px 32px 30px; border: 1px solid rgba(144, 122, 86, 0.68); border-radius: 5px; background: linear-gradient(145deg, #fcf7ed, #f0e4cf); box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.55); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.modal-kicker { margin: 0 0 4px; color: var(--cinnabar); font-size: 8px; font-weight: 700; letter-spacing: 0.2em; }
.modal-head h2, .confirm-inner h2 { margin: 0; font-family: var(--serif); font-size: 26px; letter-spacing: 0.08em; }
.modal-close { display: grid; place-items: center; width: 34px; height: 34px; margin: -4px -6px 0 0; border: 1px solid rgba(159, 138, 104, 0.35); border-radius: 50%; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: rgba(180, 56, 44, 0.08); color: var(--cinnabar); }

/* ---------- Result ---------- */
.finish-modal { width: min(600px, calc(100vw - 32px)); }
.result-inner { text-align: center; padding: 34px 38px 30px; }
.result-seal { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 12px; border: 1px solid rgba(180, 56, 44, 0.5); border-radius: 3px; color: var(--cinnabar); font-family: var(--serif); font-size: 28px; font-weight: 700; box-shadow: inset 0 0 0 3px rgba(180, 56, 44, 0.08); }
.result-kicker { margin: 0; color: var(--muted); font-size: 9px; letter-spacing: 0.2em; }
.result-title { margin: 7px 0 5px; font-family: var(--serif); font-size: 36px; letter-spacing: 0.12em; text-indent: 0.12em; }
.result-subtitle { margin: 0; color: var(--muted); font-size: 11px; letter-spacing: 0.05em; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 24px 0 18px; border-top: 1px solid rgba(159, 138, 104, 0.25); border-bottom: 1px solid rgba(159, 138, 104, 0.25); background: rgba(159, 138, 104, 0.25); }
.result-stats div { padding: 14px 8px; background: linear-gradient(180deg, rgba(252, 247, 237, 0.9), rgba(244, 234, 216, 0.9)); }
.result-stats span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; letter-spacing: 0.12em; }
.result-stats strong { color: var(--ink); font-family: var(--serif); font-size: 23px; line-height: 1; }
.rank-status { min-height: 20px; margin: 0 0 14px; color: #7c5b26; font-size: 11px; line-height: 1.6; }
.rank-status.success { color: var(--jade); font-weight: 600; }
.rank-status.muted { color: var(--muted); }
.score-form { margin: 6px 0 18px; padding: 14px 16px; border: 1px dashed rgba(180, 56, 44, 0.32); background: rgba(180, 56, 44, 0.04); text-align: left; }
.score-form label { display: block; margin-bottom: 9px; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.score-input-row { display: flex; gap: 8px; }
.score-input-row input { min-width: 0; flex: 1; height: 40px; padding: 0 12px; border: 1px solid rgba(159, 138, 104, 0.55); border-radius: 2px; background: rgba(255, 252, 245, 0.8); color: var(--ink); font-size: 13px; }
.score-input-row input::placeholder { color: #a99a82; }
.form-note { margin: 8px 0 0; color: var(--muted); font-size: 8px; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.result-actions .text-button { flex-basis: 100%; margin-top: 5px; }

/* ---------- Leaderboard ---------- */
.leaderboard-modal { width: min(760px, calc(100vw - 32px)); }
.board-tabs { display: flex; gap: 3px; margin: 20px 0 10px; padding: 3px; border: 1px solid rgba(159, 138, 104, 0.34); border-radius: 2px; background: rgba(159, 138, 104, 0.08); }
.board-tabs button { flex: 1; height: 32px; border: 0; border-radius: 1px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; cursor: pointer; }
.board-tabs button:hover { background: rgba(180, 56, 44, 0.06); }
.board-tabs button.active { background: var(--cinnabar); color: #fbf3e2; box-shadow: 0 2px 6px rgba(140, 38, 29, 0.2); }
.board-note { margin: 0 0 12px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.board-table-wrap { min-height: 190px; max-height: min(58vh, 560px); overflow: auto; border: 1px solid rgba(159, 138, 104, 0.3); background: rgba(255, 252, 245, 0.35); }
.board-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.board-table th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; background: #ecdfc7; color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: 0.12em; text-align: left; white-space: nowrap; }
.board-table td { padding: 9px 12px; border-top: 1px solid rgba(159, 138, 104, 0.17); color: var(--ink-soft); white-space: nowrap; }
.board-table tr:nth-child(even) td { background: rgba(159, 138, 104, 0.035); }
.board-table td:nth-child(1) { width: 54px; color: var(--muted); font-family: var(--serif); font-size: 13px; }
.board-table tr.top-1 td:nth-child(1) { color: #a37622; font-weight: 700; }
.board-table tr.top-2 td:nth-child(1) { color: #7b7a72; font-weight: 700; }
.board-table tr.top-3 td:nth-child(1) { color: #9a5f35; font-weight: 700; }
.board-table td:nth-child(2) { max-width: 240px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.board-table td:nth-child(3) { font-family: var(--serif); font-size: 13px; color: var(--ink); }
.board-table td:nth-child(5) { color: var(--muted); font-size: 9px; }
.board-empty { padding: 48px 12px !important; color: var(--muted) !important; text-align: center; font-size: 10px; letter-spacing: 0.1em; }
.board-foot { margin: 10px 0 0; color: var(--muted); font-size: 8px; text-align: right; letter-spacing: 0.14em; }

/* ---------- Confirm ---------- */
.confirm-modal { width: min(420px, calc(100vw - 32px)); }
.confirm-inner { text-align: center; padding: 30px; }
.confirm-mark { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 13px; border: 1px solid rgba(180, 56, 44, 0.48); border-radius: 50%; color: var(--cinnabar); font-family: var(--serif); font-size: 22px; }
.confirm-inner p { margin: 10px 0 22px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.confirm-actions { display: flex; justify-content: center; gap: 9px; }

/* ---------- Footer ---------- */
.site-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; width: min(1580px, 100%); margin: 0 auto; padding: 2px clamp(16px, 3vw, 42px) 14px; color: rgba(123, 112, 95, 0.78); font-size: 8px; letter-spacing: 0.05em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.footer-links a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid transparent; }
.footer-links a:hover { color: var(--cinnabar); border-bottom-color: currentColor; }

/* ---------- Animations ---------- */
@keyframes breathe { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }
@keyframes cardShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes cardCorrect { 0% { box-shadow: 0 0 0 0 rgba(53, 107, 90, 0.25); } 45% { box-shadow: 0 0 0 7px rgba(53, 107, 90, 0.1); } 100% { box-shadow: 0 0 0 0 rgba(53, 107, 90, 0); } }
@keyframes correctFlash { 0% { fill: #f6dfa8; stroke: #b28a47; } 55% { fill: #b9d8c6; } 100% { fill: var(--jade-soft); } }
@keyframes sealSpin { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }


/* ---------- Mobile floating target ---------- */
.mobile-target { display: none; }
.mobile-target[hidden] { display: none !important; }

@media (max-width: 1180px) {
  .mobile-target:not([hidden]) {
    position: absolute;
    top: 42px; left: 14px; right: 14px;
    z-index: 9;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2px 12px;
    padding: 8px 12px;
    border: 1px solid rgba(159, 138, 104, 0.5);
    border-radius: 3px;
    background: rgba(251, 246, 234, 0.94);
    box-shadow: 0 4px 16px rgba(62, 46, 23, 0.12);
    backdrop-filter: blur(5px);
  }
  .mobile-target-name { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
  .mobile-target-name span { flex: none; color: var(--muted); font-size: 8px; letter-spacing: 0.1em; }
  .mobile-target-name { flex: 1 1 auto; flex-wrap: wrap; }
  .mobile-target-name strong { white-space: normal; overflow-wrap: anywhere; font-family: var(--serif); font-size: 20px; line-height: 1.2; }
  .mobile-target-remaining { display: flex; align-items: baseline; gap: 4px; flex: none; }
  .mobile-target-remaining b { color: var(--cinnabar); font-family: var(--serif); font-size: 19px; }
  .mobile-target-remaining span { color: var(--muted); font-size: 8px; letter-spacing: 0.08em; }
  .mobile-target-name small { color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-target-stats { display: flex; align-items: center; gap: 10px; flex-basis: 100%; margin-top: 2px; color: var(--muted); font-size: 8px; letter-spacing: 0.04em; }
  .mobile-target-stats b { color: var(--ink-soft); font-family: var(--serif); font-size: 11px; font-weight: 600; }
  .mobile-target-stats button { margin-left: auto; padding: 2px 8px; border: 1px solid rgba(180, 56, 44, 0.3); border-radius: 2px; background: rgba(180, 56, 44, 0.06); color: var(--cinnabar); font-size: 8px; cursor: pointer; }
  .mobile-target p { flex-basis: 100%; margin: 1px 0 0; color: #7c5b26; font-size: 9px; line-height: 1.35; }
  .mobile-target p[hidden] { display: none; }
  .map-topline { display: none; }
  #map { inset: 14px 10px 10px; width: calc(100% - 20px); height: calc(100% - 24px); }
  .map-controls { top: 158px; right: 14px; }
  .detail-card.floating {
    position: fixed;
    left: 50%; bottom: 12px;
    z-index: 80;
    width: min(360px, calc(100vw - 24px));
    transform: translateX(-50%);
    background: rgba(251, 246, 234, 0.97);
    box-shadow: 0 16px 46px rgba(50, 36, 16, 0.26);
    backdrop-filter: blur(8px);
  }
  .detail-card.floating .detail-hk svg { width: 145px; }
  .detail-card.floating .detail-mo svg { width: 86px; }
  .continent-legend { left: 14px; bottom: 14px; max-width: 230px; padding: 6px 8px; font-size: 7px; gap: 4px 8px; }
}


/* ---------- SEO / content pages ---------- */
.content-route .game-shell { display: none; }
.content-route .seo-content { border-top: 0; padding-top: clamp(38px, 6vw, 76px); }
.seo-content {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 52px) clamp(16px, 3vw, 42px) clamp(42px, 6vw, 80px);
  border-top: 1px solid rgba(159, 138, 104, 0.32);
  color: var(--ink-soft);
}
.seo-inner { max-width: 1000px; margin: 0 auto; }
.seo-kicker { margin: 0 0 9px; color: var(--cinnabar); font-size: 9px; font-weight: 700; letter-spacing: 0.2em; }
.seo-content h1 { margin: 0 0 16px; color: var(--ink); font-family: var(--serif); font-size: clamp(30px, 4vw, 48px); line-height: 1.22; letter-spacing: 0.03em; }
.seo-content h2 { margin: 30px 0 10px; color: var(--ink); font-family: var(--serif); font-size: clamp(19px, 2.2vw, 25px); letter-spacing: 0.04em; }
.seo-lead { max-width: 820px; margin: 0 0 23px; color: #5e5343; font-size: 14px; line-height: 1.9; }
.seo-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 22px 0 30px; }
.seo-fact { padding: 14px 12px; border: 1px solid rgba(159, 138, 104, 0.35); border-radius: 3px; background: rgba(251, 246, 234, 0.58); }
.seo-fact strong { display: block; color: var(--cinnabar); font-family: var(--serif); font-size: 27px; line-height: 1; }
.seo-fact span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: 0.06em; }
.seo-columns { display: grid; grid-template-columns: 1fr 1.2fr; gap: 34px; }
.seo-columns section { min-width: 0; overflow-x: auto; }
.seo-steps, .seo-list { margin: 0; padding-left: 20px; color: #5e5343; font-size: 12px; line-height: 1.95; }
.seo-list { margin: 0 0 10px; }
.seo-steps li { margin-bottom: 6px; }
.seo-table { width: 100%; border-collapse: collapse; font-size: 11px; line-height: 1.55; }
.seo-table th { padding: 8px 9px; border-bottom: 1px solid rgba(159, 138, 104, 0.45); background: rgba(159, 138, 104, 0.1); color: var(--muted); font-size: 8px; letter-spacing: 0.08em; text-align: left; white-space: nowrap; }
.seo-table td { padding: 8px 9px; border-bottom: 1px solid rgba(159, 138, 104, 0.18); }
.seo-faq { display: grid; gap: 6px; }
.seo-faq-item { padding: 11px 13px; border: 1px solid rgba(159, 138, 104, 0.28); border-radius: 3px; background: rgba(251, 246, 234, 0.44); }
.seo-faq-item summary { color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.5; cursor: pointer; }
.seo-faq-item p { margin: 9px 0 0; color: #665a48; font-size: 11px; line-height: 1.8; }
.seo-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 24px; }
.seo-links a { display: flex; flex-direction: column; gap: 3px; padding: 12px 13px; border: 1px solid rgba(159, 138, 104, 0.32); border-radius: 3px; color: var(--ink-soft); text-decoration: none; background: rgba(251, 246, 234, 0.42); transition: border-color 0.16s, background 0.16s; }
.seo-links a:hover { border-color: var(--cinnabar); background: rgba(180, 56, 44, 0.05); }
.seo-links strong { font-family: var(--serif); font-size: 14px; }
.seo-links span { color: var(--muted); font-size: 9px; }
.seo-source { margin: 26px 0 0; padding-top: 14px; border-top: 1px solid rgba(159, 138, 104, 0.22); color: rgba(123, 112, 95, 0.85); font-size: 9px; line-height: 1.7; }
.notfound-page { width: min(760px, calc(100% - 32px)); margin: 10vh auto; }
.notfound-page h1 { font-family: var(--serif); font-size: clamp(36px, 6vw, 64px); margin: 0 0 12px; }
.notfound-page p { color: var(--muted); font-size: 13px; }
.notfound-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.notfound-links a { padding: 9px 14px; border: 1px solid var(--line); border-radius: 2px; color: var(--ink-soft); text-decoration: none; font-size: 11px; }
.notfound-links a:hover { border-color: var(--cinnabar); color: var(--cinnabar); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .game-shell { grid-template-columns: 1fr; }
  .hud { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(190px, 0.75fr); gap: 10px 14px; align-items: start; }
  .target-card { grid-row: span 2; min-height: 160px; }
  .stats-grid { grid-column: 2; }
  .progress-card { grid-column: 2; padding: 0 2px 2px; }
  .detail-card { grid-column: 2; }
  .hud-actions, .hud-footnote { grid-column: 1 / -1; }
  .hud-footnote { display: none; }
  .map-frame { height: min(76vh, 760px); min-height: 580px; }
  .detail-hk svg { width: 130px; }
  .detail-mo svg { width: 78px; }
}

@media (max-width: 900px) {
  .site-header { flex-wrap: wrap; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
  .brand { min-width: 0; }
  .header-actions { min-width: 0; margin-left: auto; }
  .mode-tabs { order: 3; width: 100%; justify-content: center; }
  .mode-tab { flex: 1; justify-content: center; min-width: 0; }
  .brand-copy strong { font-size: 19px; }
  .brand-copy small { font-size: 7px; }
  .map-frame { height: 68vh; min-height: 520px; }
}

@media (max-width: 680px) {
  .seo-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-columns { grid-template-columns: 1fr; gap: 10px; }
  .seo-links { grid-template-columns: 1fr; }
  .seo-content { padding-left: 18px; padding-right: 18px; }
  .seo-content h1 { font-size: 32px; }
  .seo-lead { font-size: 13px; }
  .site-header { min-height: 74px; }
  .brand-copy small { display: none; }
  .brand-seal { width: 36px; height: 36px; font-size: 14px; }
  .brand-copy strong { font-size: 18px; }
  .rank-button { width: 40px; padding: 0; justify-content: center; }
  .rank-button span { display: none; }
  .game-shell { padding-top: 12px; }
  .hud { grid-template-columns: 1fr; }
  .target-card, .stats-grid, .progress-card, .detail-card, .hud-actions { grid-column: 1; grid-row: auto; }
  .target-card { min-height: 144px; }
  .target-name { min-height: 50px; font-size: 32px; }
  .detail-card { order: 6; }
  .detail-map { align-items: flex-start; }
  .detail-hk svg { width: 150px; }
  .detail-mo svg { width: 90px; }
  .map-frame { height: 66vh; min-height: 460px; }
  .map-topline { left: 15px; right: 15px; top: 14px; }
  .map-controls { top: 56px; right: 14px; }
  .inset-card { width: 112px; right: 15px; bottom: 15px; padding: 5px; }
  .continent-legend { max-width: 210px; font-size: 7px; }
  .start-overlay { padding: 14px; }
  .start-card { padding: 26px 18px 22px; width: 98%; }
  .start-title { font-size: 42px; }
  .start-desc { font-size: 12px; }
  .start-rule { gap: 12px; margin: 17px 0 15px; }
  .start-meta { gap: 24px; margin-bottom: 18px; }
  .start-meta strong { font-size: 21px; }
  .toast { bottom: 15px; font-size: 11px; white-space: normal; width: max-content; }
  .result-inner { padding: 28px 20px 24px; }
  .modal-inner { padding: 24px 20px; }
  .result-stats strong { font-size: 19px; }
  .score-input-row { flex-direction: column; }
  .result-actions .primary-button, .result-actions .ghost-button { flex: 1; }
  .site-footer { flex-direction: column; gap: 4px; }
}

@media (max-width: 420px) {
  .mode-tab { padding: 6px 8px; gap: 6px; }
  .mode-char { width: 28px; height: 28px; font-size: 16px; }
  .mode-meta { font-size: 8px; }
  .mode-meta b { font-size: 11px; }
  .stat-block strong { font-size: 19px; }
  .stat-remaining strong { font-size: 24px; }
  .map-frame { min-height: 420px; }
  .inset-card { width: 96px; }
}

@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; }
}


/* Compact: map-first layout, compact floating HUD */
@media (max-width: 1180px) {
  .hud { display: contents; }
  .hud > .target-card,
  .hud > .stats-grid,
  .hud > .progress-card,
  .hud > .hud-actions,
  .hud > .hud-footnote { display: none !important; }
  .hud > .detail-card:not(.floating) { display: none !important; }
  .game-shell { display: block; padding: 10px 12px 0; }
  .map-frame { height: calc(100vh - 164px); height: calc(100dvh - 164px); min-height: 500px; }
  .map-controls { top: 158px; right: 14px; }
  .site-footer { padding-top: 9px; }
  .start-overlay { padding: 12px; }
  .start-card { width: min(540px, 96%); padding: 24px 22px 20px; }
  .start-title { font-size: clamp(38px, 10vw, 56px); }
  .start-meta { margin-bottom: 18px; }
}

@media (max-width: 420px) {
  .map-frame { height: calc(100vh - 158px); height: calc(100dvh - 158px); min-height: 470px; }
  .start-card { padding: 22px 16px 18px; }
  .start-rule { margin: 14px 0 13px; }
}


/* World map is wide; avoid a tall empty frame on phones. */
@media (max-width: 680px) {
  .map-frame.world-mode { height: 430px; min-height: 0; }
}
@media (max-width: 420px) {
  .map-frame.world-mode { height: 390px; min-height: 0; }
}
