:root {
  --ink: #2a241c;
  --muted: #6d6256;
  --paper: #f3efe8;
  --card: #fff;
  --line: #e3d9cc;
  --forest: #1c1612;
  --forest-2: #3a2c22;
  --gold: #e0b15a;
  --gold-2: #f0d48a;
  --danger: #8d2f2f;
  --shadow: 0 10px 28px rgba(20, 12, 8, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  line-height: 1.65;
}
main { flex: 1 0 auto; }
a { color: inherit; }
img { max-width: 100%; }

.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.kv { position: relative; background: #120e0c; line-height: 0; }
.kv img { width: 100%; height: auto; display: block; }
.census-bar {
  background: #120e0c;
  color: #f4efe6;
  border-bottom: 1px solid rgba(224, 177, 90, 0.35);
}
.census-bar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  min-height: 44px;
  font-size: 14px;
}
.census-bar p { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.census-bar strong { color: #f0d48a; font-size: 20px; letter-spacing: 0.04em; }
.census-note { color: #b7aa9a; }
.game-start {
  position: absolute;
  right: 2.4%;
  bottom: 3%;
  z-index: 2;
  width: 118px;
  height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 50%;
  text-decoration: none;
  color: #f0d48a;
  background:
    radial-gradient(circle at 50% 42%, #4a341c 0%, #1a120c 68%);
  border: 4px solid #e0b15a;
  box-shadow: 0 0 0 7px rgba(18, 14, 12, 0.45), 0 10px 24px rgba(0, 0, 0, 0.4);
  line-height: 1.15;
  letter-spacing: 0.18em;
  font-weight: 800;
}
.game-start strong { color: #fffaf2; font-size: 22px; letter-spacing: 0.22em; }
.game-start span { font-size: 13px; }
.game-start:hover { background: radial-gradient(circle at 50% 42%, #6a4a24 0%, #24180e 70%); }
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #16110e;
  color: #f7f1e4;
  border-bottom: 3px solid #e0b15a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.top-bar, .top > .wrap { display: flex; align-items: center; gap: 18px; min-height: 72px; }
.top > .wrap { justify-content: space-between; }
.brand { display: flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
.logo { height: 58px; width: auto; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
}
.nav a {
  position: relative;
  color: #f4efe6;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 12px;
  background: transparent;
  border: 0;
}
.nav a:hover, .nav a[aria-current="page"] { color: #e0b15a; }
.nav a[aria-current="page"]::after, .nav a:hover::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  background: #e0b15a;
}
a.nav-play {
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  margin: 6px 0;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  letter-spacing: 0.12em;
  background: radial-gradient(circle at 50% 40%, #f3d48a, #c4893a 72%);
  color: #1c1610;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 0 0 4px #16110e, 0 0 0 6px #e0b15a;
}
a.nav-play:hover { background: #f0d48a; color: #1c1610; }
.page-banner {
  background: linear-gradient(180deg, #2a2118 0%, #1a140f 100%);
  color: #f7f1e4;
  padding: 26px 0 18px;
  border-bottom: 1px solid #3a2c22;
}
.page-banner h2 { margin: 0 0 6px; color: #fffaf2; }
.page-banner .sub { color: #d9cbb3; margin: 0; }
.crumb { margin: 0 0 6px; color: #b7aa9a; font-size: 13px; }
.crumb a { color: #e0b15a; text-decoration: none; }
a.entry {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  min-height: 180px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
a.entry:hover { transform: translateY(-3px); border-color: var(--gold); }
.entry-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #4a3428;
  color: #f0d48a;
  font-weight: 700;
}
.entry-go { margin-top: auto; color: var(--gold); font-weight: 700; }
.entry p { margin: 0; color: var(--muted); }

.band { padding: 34px 0; }
.band.tight { padding-top: 0; }
.bulletin {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 16px 18px 10px;
  border-bottom: 2px solid #2a2118;
}
.board-head.plain { padding: 0 0 8px; border-bottom: 2px solid #2a2118; margin-bottom: 12px; }
.board-head span { color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; }
.news-row {
  display: grid;
  grid-template-columns: 108px 52px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 18px;
  border-bottom: 1px solid #efe8dc;
}
.news-row:last-child { border-bottom: 0; }
.news-row time { color: #8a7b68; font-variant-numeric: tabular-nums; }
.news-row strong { display: block; }
.news-row p { margin: 2px 0 0; color: var(--muted); }
.tag {
  display: inline-block;
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #8a5a18;
  border: 1px solid #e0b15a;
  background: #fff8ea;
  line-height: 1.7;
}
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr); gap: 22px; align-items: start; }
.side-play {
  background: #1c1612;
  color: #f7f1e4;
  padding: 18px 18px 20px;
  border-top: 3px solid #e0b15a;
  box-shadow: var(--shadow);
}
.side-play h2 { color: #f0d48a; }
.side-play .sub { color: #d9cbb3; }
.play-list { list-style: none; margin: 0 0 8px; padding: 0; }
.play-list li { display: flex; gap: 10px; margin: 0 0 12px; }
.play-list span {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e0b15a;
  color: #1c1610;
  font-weight: 800;
  font-size: 13px;
}
.play-list p { margin: 0; color: #efe6d8; }
.play-list strong { display: block; color: #fffaf2; }
.portals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.portal {
  display: block;
  padding: 18px 16px 16px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid #2a2118;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.portal:hover { transform: translateY(-3px); border-top-color: #e0b15a; }
.portal span { color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: 0.14em; }
.portal strong { display: block; margin: 4px 0; font-size: 22px; }
.portal p { margin: 0; color: var(--muted); }
.soon-copy {
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px 18px;
}
.soon-copy h3 { margin: 14px 0 6px; }
.soon-copy h3:first-child { margin-top: 0; }
.soon-copy p { margin: 0; color: var(--muted); }
.soon-feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr); gap: 18px; align-items: start; }
.soon-photo { position: relative; }
.soon-photo .job-shade { border-radius: 0; }
.soon-photo img { width: 100%; height: auto; display: block; border-radius: 0; box-shadow: var(--shadow); }
.step { border-top: 3px solid #2a2118; }
.step-no {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: #1c1612;
  color: #f0d48a;
  font-weight: 800;
}
.step h3, .step p { margin: 0 0 6px; }
.step p { color: var(--muted); }
#rule-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border: 1px solid var(--line);
}
.rule { margin: 0; border: 0; border-bottom: 1px solid #efe8dc; border-radius: 0; box-shadow: none; }
.rule:nth-child(odd) { border-right: 1px solid #efe8dc; }
.rule p { margin: 6px 0 0; color: var(--muted); }
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 36;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #e0b15a;
  background: #4a3428;
  color: #fffaf2;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(28, 22, 16, 0.35);
}
.to-top[hidden] { display: none; }
.to-top:hover { background: #6a4b34; }
.rule strong { display: block; }
.hall { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr); gap: 18px; align-items: start; }
.kicker { margin: 0 0 8px; color: var(--gold); font-weight: 700; letter-spacing: 0.16em; }
h1 { margin: 0; font-size: clamp(36px, 6vw, 64px); line-height: 1.15; }
.lead { max-width: 640px; font-size: 18px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  background: var(--forest);
  color: #fffaf2;
  box-shadow: 0 3px 0 rgba(28, 22, 16, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.gold { background: var(--gold); color: #1c1610; box-shadow: 0 3px 0 #8a5a18; }
.btn.gold:hover { background: #d9a24e; }
.btn.ghost { background: transparent; border-color: var(--forest); color: var(--forest); box-shadow: none; }
.btn.ghost.light { border-color: #e0b15a; color: #f0d48a; }
.btn:focus-visible, .nav a:focus-visible, .to-top:focus-visible, .job-thumb:focus-visible {
  outline: 3px solid #e0b15a;
  outline-offset: 2px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #3dba6e; box-shadow: 0 0 0 4px rgba(61, 186, 110, 0.2); }

section[id] { scroll-margin-top: 88px; }
#jobs, #maps, #guide { padding: 28px 0 48px; }
h2 { margin: 0; font-size: 26px; letter-spacing: 0.06em; }
.sub { margin: 0 0 18px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 16px 16px 14px;
  box-shadow: none;
}
.card h3 { margin: 0 0 6px; }
.meta { color: var(--gold); font-size: 13px; font-weight: 700; }
.job-art { width: min(180px, 100%); height: auto; display: block; margin: 0 auto 10px; background: transparent; }
.job-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; }
.job-thumbs[hidden] { display: none; }
.job-thumb {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.job-thumb:hover { transform: translateY(-3px); border-color: var(--gold); }
.job-thumb strong { font-size: 16px; }
.job-frame { position: relative; }
.job-frame img { width: 100%; height: auto; display: block; margin: 0; }
.job-shade {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 22, 16, 0.62);
  color: #fffaf2;
}
.job-shade span {
  padding: 6px 10px;
  border: 2px solid #e0b15a;
  background: rgba(74, 52, 40, 0.9);
  font-weight: 700;
  letter-spacing: 0.12em;
}
.job-detail[hidden] { display: none; }
.job-detail { margin-top: 8px; }
.job-detail h3 { margin: 14px 0 4px; font-size: 28px; }
.job-stage { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin: 12px 0; }
.job-portrait { width: min(220px, 46vw); height: auto; display: block; }
.job-portrait.over {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  pointer-events: none;
  animation: job-blink 1.4s steps(1) infinite;
}
.job-pose { position: relative; width: min(220px, 46vw); }
.job-dragon { width: min(180px, 40vw); height: auto; image-rendering: pixelated; }
@keyframes job-blink { 50% { opacity: 0; } }
.job-closed {
  display: inline-block;
  margin: 8px 0;
  padding: 4px 10px;
  border: 2px solid #e0b15a;
  background: #4a3428;
  color: #fffaf2;
  font-weight: 700;
}
.job-closed[hidden] { display: none; }
.job-route {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.job-route strong { display: block; font-size: 18px; }
.job-route .path { margin: 4px 0; color: var(--gold); font-weight: 700; }
.path { margin: 8px 0 0; }
.finder { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.finder input { flex: 1 1 240px; width: auto; }
.map-tools { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.map-tools .btn { min-height: 36px; }
.atlas {
  position: relative;
  height: auto;
  margin-top: 12px;
  border-radius: 18px;
  border: 4px solid #6a4b34;
  background: #cfe7f6;
  overflow: hidden;
  line-height: 0;
}
.atlas .map { width: 100%; height: auto; display: block; }
.link-hit {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.link-hit:hover { background: rgba(255, 214, 120, 0.28); box-shadow: inset 0 0 0 2px rgba(90, 52, 20, 0.45); }
.link-hit.closed { cursor: default; }
.marker {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: radial-gradient(circle at 35% 35%, #9fd7ff, #2f78d6 62%, #163a78);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.marker.town { width: 20px; height: 20px; margin: -10px 0 0 -10px; background: radial-gradient(circle at 35% 35%, #ffe7a0, #e0a030 62%, #8a4e12); }
.marker.active, .marker.town.active {
  z-index: 5;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  background: radial-gradient(circle at 35% 35%, #fff, #ff5a5a 46%, #9b1010);
  box-shadow: 0 0 0 4px #fff, 0 0 0 9px #e23b3b, 0 0 18px 6px rgba(226, 59, 59, 0.85);
  animation: marker-pulse 1s ease-in-out infinite;
}
.marker-label {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -34px);
  padding: 2px 8px;
  border-radius: 8px;
  background: #4a3428;
  color: #fffaf2;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 0 #e0b15a;
}
@keyframes marker-pulse {
  50% { transform: scale(1.18); }
}
.map-frame { position: relative; }
.spot-arrow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 25;
}
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: 140px;
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  background: #4a3428;
  color: #fffaf2;
}
.pin.town { background: #c4893a; color: #1c1610; font-weight: 700; z-index: 2; }
.pin.active { outline: 2px solid #1c1610; }
.region-tab, .spot-tab {
  border: 0;
  background: #f3e6cb;
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  cursor: pointer;
}
.region-tab.active, .spot-tab.active { background: #4a3428; color: #fffaf2; }
.result ul, .modal-body ul { margin: 0; padding-left: 18px; }
.modal {
  position: fixed;
  z-index: 40;
  display: block;
  width: max-content;
  max-width: calc(100% - 16px);
  background: none;
  pointer-events: none;
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative;
  width: min(440px, calc(100vw - 48px));
  max-height: 300px;
  display: flex;
  flex-direction: column;
  background: #fffaf2;
  border: 4px solid #6a4b34;
  border-radius: 6px 18px 18px 18px;
  box-shadow: 0 12px 32px rgba(28, 22, 16, 0.35);
  pointer-events: auto;
}
.chat-nameplate {
  position: absolute;
  left: 22px;
  bottom: 100%;
  min-width: 148px;
  margin-bottom: -4px;
  padding: 6px 16px 8px;
  background: #4a3428;
  color: #fffaf2;
  border: 3px solid #e0b15a;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}
.chat-nameplate h3 { margin: 0; font-size: 22px; line-height: 1.2; }
.chat-nameplate .meta { margin: 0; color: var(--gold-2); font-size: 13px; }
.chat-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  min-height: 32px;
  color: var(--ink);
}
.modal-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 84px 0 16px;
  background: #fffaf2;
  border-radius: 4px 16px 0 0;
}
.modal-tabs[hidden] { display: none; }
.search-back {
  display: block;
  width: calc(100% - 96px);
  margin: 10px 76px 0 12px;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: #f3e6cb;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  padding: 4px 10px;
  cursor: pointer;
}
.search-back[hidden] { display: none; }
.modal-tab {
  border: 0;
  border-radius: 12px 12px 0 0;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: #f3e6cb;
  color: var(--ink);
}
.modal-tab.active { background: #4a3428; color: #fffaf2; }
.modal-body {
  padding: 10px 16px 14px;
  overflow: auto;
  background: #fffaf2;
  border-radius: 0 0 12px 12px;
}
.modal-body h4 { margin: 14px 0 6px; font-size: 16px; }
.hit { margin: 0 0 10px; }
.result { margin-top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.note { color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips[hidden] { display: none; }
.chip { padding: 4px 10px; border-radius: 999px; background: #f3e6cb; font-size: 14px; }
.closed { margin-top: 14px; color: var(--muted); }

footer {
  margin-top: 0;
  padding: 28px 0 22px;
  color: #d9cbb3;
  background: #120e0c;
  border-top: 3px solid #e0b15a;
}
footer a { color: #f0d48a; text-decoration: none; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.foot p { margin: 4px 0 0; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.foot .btn.gold { color: #1c1610; }
.legal { margin: 16px auto 0; padding-top: 12px; border-top: 1px solid rgba(224, 177, 90, 0.25); color: #8d8072; font-size: 13px; }

.admin-body { background: #efe4cf; }
.login, .panel { width: min(920px, calc(100% - 32px)); margin: 32px auto; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
input {
  width: min(420px, 100%);
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font: inherit;
}
.err { color: var(--danger); min-height: 1.4em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: #fff; border-radius: 16px; padding: 14px; border: 1px solid var(--line); }
.stat b { display: block; font-size: 28px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr { cursor: pointer; }
.detail { display: none; background: #fffaf2; }
.detail.open { display: table-row; }
.gear { margin: 0; padding-left: 18px; }
input:focus, .finder input:focus {
  outline: 3px solid rgba(196, 137, 58, 0.45);
  border-color: var(--gold);
}
@media (max-width: 900px) {
  .split, .portals, #rule-list { grid-template-columns: 1fr; }
  .rule:nth-child(odd) { border-right: 0; }
  .game-start { width: 92px; height: 92px; right: 12px; bottom: 12px; }
  .game-start strong { font-size: 18px; }
}
@media (max-width: 720px) {
  .hall, .soon-feature, .split, .portals, #rule-list { grid-template-columns: 1fr; }
  .news-row { grid-template-columns: 92px 48px minmax(0, 1fr); gap: 8px; padding: 12px; }
  .foot { align-items: flex-start; flex-direction: column; }
  .path img { width: 40px; height: 40px; }
  h1 { font-size: 36px; }
  table { font-size: 14px; }
}

/* ===== 手機與觸控優化 ===== */
html { -webkit-text-size-adjust: 100%; }
a, button { -webkit-tap-highlight-color: rgba(224, 177, 90, 0.25); }
.marker::before { content: ""; position: absolute; inset: -12px; }
.top-bar { padding-top: env(safe-area-inset-top); }
@media (hover: none) {
  a.entry:hover, .portal:hover, .job-thumb:hover, .btn:hover { transform: none; }
}
@media (max-width: 820px) {
  .wrap { width: calc(100% - 28px); }
  .top > .wrap.top-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 12px;
    min-height: 0;
    padding: 8px 0 0;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .logo { height: 40px; }
  a.nav-play {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    height: 38px;
    margin: 0;
    padding: 0 18px;
    border-radius: 999px;
    letter-spacing: 0.08em;
    box-shadow: 0 0 0 2px #e0b15a;
  }
  a.nav-play br { display: none; }
  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    margin: 6px -14px 0;
    padding: 0 8px;
    gap: 0;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; padding: 11px 12px; font-size: 15px; white-space: nowrap; scroll-snap-align: start; }
  .nav a[aria-current="page"]::after, .nav a:hover::after { left: 10px; right: 10px; bottom: 2px; }
  section[id] { scroll-margin-top: 100px; }
}
@media (max-width: 720px) {
  body { line-height: 1.6; }
  .census-bar .wrap { gap: 2px 18px; min-height: 38px; font-size: 13px; padding: 4px 0; }
  .census-bar strong { font-size: 17px; }
  .page-banner { padding: 18px 0 14px; }
  .page-banner h2 { font-size: 22px; }
  .page-banner .sub { font-size: 14px; }
  .band { padding: 22px 0; }
  #jobs, #maps, #guide { padding: 18px 0 36px; }
  h2 { font-size: 22px; }
  h1 { font-size: clamp(30px, 9vw, 40px); }
  .lead { font-size: 16px; }
  .actions { gap: 10px; }
  .actions .btn { flex: 1 1 140px; }
  .btn { min-height: 46px; }
  .game-start { width: 76px; height: 76px; right: 10px; bottom: 10px; border-width: 3px; box-shadow: 0 0 0 4px rgba(18, 14, 12, 0.45), 0 6px 14px rgba(0, 0, 0, 0.4); }
  .game-start strong { font-size: 15px; letter-spacing: 0.12em; }
  .game-start span { font-size: 11px; }
  .board-head { padding: 12px 14px 8px; }
  .news-row { grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 12px 14px; }
  .news-row > :nth-child(3) { grid-column: 1 / -1; }
  .side-play { padding: 16px 14px 18px; }
  .grid { grid-template-columns: 1fr; }
  .portal { padding: 14px 14px 12px; }
  .portal strong { font-size: 19px; }
  .soon-copy { padding: 14px; }
  .job-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .job-thumb { padding: 8px; border-radius: 14px; gap: 6px; }
  .job-thumb strong { font-size: 15px; }
  .job-detail h3 { font-size: 24px; }
  .job-stage { gap: 10px; }
  .job-portrait, .job-pose { width: min(170px, 44vw); }
  .job-dragon { width: min(140px, 36vw); }
  .job-route { padding: 12px; }
  .job-route strong { font-size: 17px; }
  .path { word-break: keep-all; overflow-wrap: anywhere; }
  .chips { gap: 8px; }
  .chip, .region-tab, .spot-tab { padding: 8px 14px; min-height: 40px; font-size: 15px; }
  .finder { gap: 8px; }
  .finder { flex-wrap: nowrap; }
  .finder input { flex: 1 1 0; min-width: 0; }
  .finder .btn { flex: 0 0 auto; padding: 0 22px; }
  #region-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 8px -14px 0;
    padding: 2px 14px 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  #region-tabs::-webkit-scrollbar { display: none; }
  #region-tabs .region-tab { flex: 0 0 auto; }
  .news-row .tag { justify-self: start; }
  .map-tools { flex-wrap: wrap; gap: 8px; }
  .atlas { border-width: 3px; border-radius: 12px; margin-top: 8px; }
  .marker { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
  .marker.town { width: 17px; height: 17px; margin: -8px 0 0 -8px; }
  .marker.active, .marker.town.active { width: 26px; height: 26px; margin: -13px 0 0 -13px; box-shadow: 0 0 0 3px #fff, 0 0 0 7px #e23b3b, 0 0 12px 4px rgba(226, 59, 59, 0.85); }
  .marker-label { font-size: 13px; padding: 1px 6px; }
  .modal-card { width: calc(100vw - 32px); max-height: min(300px, 46vh); }
  .chat-nameplate { left: 14px; min-width: 120px; padding: 4px 12px 6px; }
  .chat-nameplate h3 { font-size: 18px; }
  .modal-tabs { padding: 10px 64px 0 12px; }
  .modal-tab { padding: 8px 12px; }
  .modal-body { padding: 8px 12px 12px; font-size: 15px; }
  .chat-close { min-height: 40px; min-width: 40px; }
  .rule { padding: 14px; }
  .foot .btn.gold { width: 100%; }
  .foot-nav { gap: 6px 18px; }
  footer { padding: 22px 0 calc(18px + env(safe-area-inset-bottom)); }
  .to-top { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 46px; height: 46px; }
  .login, .panel { width: calc(100% - 24px); margin: 18px auto; }
  table { display: block; overflow-x: auto; white-space: nowrap; font-size: 13px; }
  th, td { padding: 8px 10px; }
}
@media (max-width: 360px) {
  .job-thumbs { gap: 8px; }
  .nav a { padding: 11px 9px; font-size: 14px; }
}
