:root {
  color-scheme: light;
  --ink: #1f2b39;
  --ink-2: #2c3a4a;
  --ink-3: #526274;
  --paper: #ffffff;
  --paper-soft: #f5f7fa;
  --line: #dbe2e9;
  --accent: #ef2f36;
  --accent-2: #ff5a5f;
  --teal: #4dc2d2;
  --teal-dark: #237e8b;
  --success: #16a36f;
  --warning: #f4a620;
  --danger: #df3346;
  --shadow: 0 24px 70px rgba(14, 26, 40, .22);
  --shadow-soft: 0 12px 30px rgba(14, 26, 40, .16);
  --radius: 22px;
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { background: #dce4ea; color: var(--ink); overflow: hidden; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

.app-shell { position: relative; width: 100vw; height: 100dvh; overflow: hidden; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }

.home-screen {
  background:
    radial-gradient(circle at 22% 20%, rgba(255,255,255,.76), transparent 28%),
    radial-gradient(circle at 83% 12%, rgba(255,255,255,.38), transparent 23%),
    linear-gradient(145deg, #58cad8 0%, #78d6df 36%, #eff4f7 100%);
}
.home-atmosphere { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.grid-glow {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 78%);
}
.island { position: absolute; opacity: .22; filter: blur(.2px); background: #fff; transform: rotate(-17deg); border-radius: 45% 55% 60% 40% / 30% 44% 56% 70%; }
.island::before, .island::after { content: ""; position: absolute; background: inherit; border-radius: inherit; }
.island-a { width: 150px; height: 430px; right: 8%; top: 15%; }
.island-a::before { width: 42px; height: 105px; left: -46px; bottom: 34px; }
.island-a::after { width: 24px; height: 66px; right: -21px; top: 48px; }
.island-b { width: 110px; height: 320px; left: 5%; bottom: -80px; opacity: .12; }

.home-nav, .minimal-nav {
  position: relative; z-index: 4; height: 84px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 900; letter-spacing: -.04em; }
.brand.small { font-size: 18px; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-block;
  flex: 0 0 42px;
  background: url("/zzmap/brand-cat-icon.png") center center / contain no-repeat;
  color: transparent;
  font-size: 0;
  line-height: 0;
  border-radius: 0;
  box-shadow: none;
}
.brand.small .brand-mark, .hud-brand .brand-mark {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 0;
  font-size: 0;
}
.brand-text { font-size: 25px; }
.nav-chip { padding: 9px 14px; border: 1px solid rgba(31,43,57,.14); border-radius: 999px; background: rgba(255,255,255,.64); backdrop-filter: blur(14px); font-size: 13px; font-weight: 800; }

.home-card {
  position: relative; z-index: 3; width: min(680px, calc(100vw - 34px)); margin: min(6vh, 70px) auto 0; padding: 38px;
  background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.72); border-radius: 32px; box-shadow: var(--shadow); backdrop-filter: blur(24px);
}
.hero-copy { text-align: center; margin-bottom: 26px; }
.eyebrow { display: block; font-size: 11px; font-weight: 900; letter-spacing: .18em; color: var(--ink-3); text-transform: uppercase; }
.hero-copy h1 { margin: 10px 0 10px; font-size: clamp(34px, 5vw, 56px); line-height: 1; letter-spacing: -.055em; }
.hero-copy p { margin: 0 auto; max-width: 520px; color: var(--ink-3); line-height: 1.7; }

.action-button { border: 0; border-radius: 18px; min-height: 76px; padding: 15px 20px; display: flex; align-items: center; justify-content: center; gap: 14px; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; text-align: left; }
.action-button:hover { transform: translateY(-2px); filter: brightness(1.035); }
.action-button:active { transform: translateY(0) scale(.99); }
.action-button strong { display: block; font-size: 18px; font-weight: 900; }
.action-button small { display: block; margin-top: 4px; opacity: .75; font-size: 12px; }
.action-wide { width: 100%; }
.action-primary { color: #fff; background: linear-gradient(135deg, var(--accent), #d91f34); box-shadow: 0 13px 30px rgba(223,51,70,.27); }
.action-dark { color: #fff; background: var(--ink); box-shadow: 0 10px 20px rgba(31,43,57,.18); }
.button-icon { font-size: 25px; line-height: 1; }
.section-divider { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 26px 0 17px; color: #718093; font-weight: 700; }
.section-divider::before, .section-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.party-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.public-room-action { grid-column: 1 / -1; }
.home-note { margin: 18px 6px 0; color: #778594; font-size: 12px; line-height: 1.55; text-align: center; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(17,28,40,.52); backdrop-filter: blur(9px); }
.modal-card { position: fixed; z-index: 110; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(820px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); background: var(--paper); border: 1px solid rgba(255,255,255,.8); border-radius: 28px; box-shadow: var(--shadow); padding: 26px; overflow: hidden; }
.modal-card h2 { margin: 0 0 22px; text-align: center; font-size: 31px; letter-spacing: -.04em; }
.modal-card > p { color: var(--ink-3); line-height: 1.6; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-card { position: relative; min-height: 295px; border: 1.5px solid var(--ink); border-radius: 20px; background: #fff; color: var(--ink); padding: 24px 22px; cursor: pointer; text-align: center; transition: transform .18s, background .18s, color .18s, box-shadow .18s; }
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.mode-card.selected { background: var(--ink); color: #fff; box-shadow: var(--shadow-soft); }
.mode-card .mode-icon { position: absolute; right: 17px; top: 15px; color: var(--accent); font-size: 26px; font-weight: 900; }
.mode-card h3 { margin: 0 0 14px; font-size: 25px; }
.mode-card strong { display: block; font-size: 17px; }
.mode-card p { min-height: 74px; font-size: 13px; line-height: 1.65; opacity: .82; }
.mode-card small { font-weight: 900; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.primary-button, .secondary-button { min-height: 46px; border-radius: 13px; border: 0; padding: 10px 18px; font-weight: 900; cursor: pointer; }
.primary-button { flex: 1; color: #fff; background: var(--ink); }
.secondary-button { color: var(--ink); background: #eef2f5; }

.settings-modal { width: min(720px, calc(100vw - 20px)); padding: 0; }
.single-settings-modal { width: min(720px, calc(100vw - 20px)); }
.single-settings-scroll { padding-top: 8px; }
.single-movement-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.single-movement-option { min-width: 0; min-height: 88px; border: 0; border-right: 1px solid var(--line); padding: 13px 10px; color: #647386; background: #fff; cursor: pointer; text-align: center; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.single-movement-option:last-child { border-right: 0; }
.single-movement-option strong { display: block; color: inherit; font-size: 15px; line-height: 1.3; }
.single-movement-option small { display: block; margin-top: 6px; font-size: 10px; line-height: 1.4; opacity: .82; }
.single-movement-option:hover { background: #f3f6f8; color: var(--ink); }
.single-movement-option.selected { color: var(--ink); background: #e9edf1; box-shadow: inset 0 -3px 0 var(--ink); }
.single-settings-modal input[type="range"] { accent-color: var(--ink); }
.modal-title-row { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 22px 26px 0; }
.modal-title-row h2 { margin: 0; }
.settings-scroll { max-height: calc(100dvh - 190px); overflow: auto; padding: 18px 38px 8px; overscroll-behavior: contain; }
.settings-divider { display: flex; align-items: center; gap: 10px; color: #7a8795; font-size: 13px; margin: 21px 0 11px; }
.settings-divider::before, .settings-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.room-visibility-field {
  min-width: 0;
  margin: 16px 0 2px;
  border: 0;
  padding: 0;
}
.room-visibility-field legend {
  margin-bottom: 9px;
  color: #667585;
  font-size: 12px;
  font-weight: 900;
}
.room-visibility-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.room-visibility-options label {
  min-width: 0;
  cursor: pointer;
}
.room-visibility-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.room-visibility-options label > span {
  min-height: 80px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  padding: 12px 13px;
  display: block;
  color: #667585;
  background: #fff;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.room-visibility-options label:hover > span {
  transform: translateY(-1px);
  border-color: #aeb9c4;
}
.room-visibility-options input:checked + span {
  border-color: var(--ink);
  color: var(--ink);
  background: #e9edf1;
  box-shadow: inset 0 -3px 0 var(--ink);
}
.room-visibility-options strong {
  display: block;
  font-size: 15px;
  font-weight: 950;
}
.room-visibility-options small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.45;
}

.public-rooms-modal {
  width: min(850px, calc(100vw - 24px));
  padding: 24px;
}
.public-rooms-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.public-rooms-heading h2 {
  margin: 5px 0 0;
  text-align: left;
}
.public-rooms-refresh {
  flex: 0 0 auto;
  min-height: 42px;
}
.public-rooms-name-field {
  margin: 18px 0 12px;
}
.public-rooms-status {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 11px;
  color: #687787;
  background: #edf2f5;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.45;
}
.public-rooms-list {
  display: grid;
  gap: 10px;
  max-height: min(52dvh, 500px);
  margin-top: 10px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.public-room-empty {
  padding: 34px 16px;
  border: 1px dashed #c8d2dc;
  border-radius: 17px;
  color: #758291;
  background: #f5f8fa;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.6;
  text-align: center;
}
.public-room-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 14px;
  background: #fff;
}
.public-room-card.unavailable {
  opacity: .64;
}
.public-room-card-main {
  min-width: 0;
}
.public-room-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.public-room-card-host {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.public-room-badge {
  border-radius: 999px;
  padding: 4px 7px;
  color: #4f5e6d;
  background: #edf2f5;
  font-size: 9px;
  font-weight: 950;
  white-space: nowrap;
}
.public-room-badge.open {
  color: #087443;
  background: #dcfce7;
}
.public-room-badge.duel {
  color: #a32235;
  background: #ffe7eb;
}
.public-room-code {
  margin-left: auto;
  color: #7a8795;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
}
.public-room-summary {
  margin: 8px 0 0;
  color: #677585;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.55;
}
.public-room-metrics {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.public-room-metric {
  border-radius: 9px;
  padding: 5px 7px;
  color: #526172;
  background: #f0f4f7;
  font-size: 10px;
  font-weight: 900;
}
.public-room-join {
  min-width: 100px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 9px 13px;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  font-weight: 950;
}
.public-room-join:disabled {
  color: #8793a0;
  background: #e4e9ed;
  cursor: not-allowed;
}

.setting-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; padding: 7px 0; cursor: pointer; }
.setting-row > span { min-width: 0; }
.setting-row strong { display: block; font-size: 17px; line-height: 1.35; }
.setting-row small { display: block; margin-top: 2px; color: #677585; font-size: 11px; line-height: 1.45; }
.switch-input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: 0 0 auto; position: relative; width: 42px; height: 24px; border-radius: 999px; background: #d8dee4; transition: .2s; }
.switch::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .2s; }
.switch-input:checked + .switch { background: var(--ink); }
.switch-input:checked + .switch::after { transform: translateX(18px); }
.switch-input:disabled + .switch { opacity: .48; }
.range-block { padding: 7px 8px 10px; }
.range-title { margin: 1px 0 3px; font-size: 15px; }
.range-block input[type="range"] { width: 100%; accent-color: var(--ink); }
.range-labels { display: flex; justify-content: space-between; color: #657485; font-size: 12px; }
.disabled-block { opacity: .4; }
.sticky-actions { margin: 0; padding: 14px 28px 22px; background: #fff; border-top: 1px solid var(--line); }
.field-block { display: grid; gap: 7px; margin: 12px 0; font-weight: 800; font-size: 13px; }
.field-block input { width: 100%; height: 48px; border: 1px solid #cbd4dd; border-radius: 13px; padding: 0 14px; color: var(--ink); outline: none; background: #fff; }
.field-block input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(31,43,57,.08); }
.room-code-input { text-transform: uppercase; letter-spacing: .24em; font-size: 22px; font-weight: 900; text-align: center; }
.form-error { padding: 10px 12px; border-radius: 11px; background: #fff0f2; color: var(--danger); font-size: 13px; font-weight: 800; }
.api-modal { width: min(530px, calc(100vw - 24px)); }
.api-modal code { display: block; padding: 13px; border-radius: 12px; background: #101a25; color: #b8f7ff; overflow: auto; }
.tiny { font-size: 12px; }

.icon-button { width: 42px; height: 42px; border: 0; border-radius: 13px; display: grid; place-items: center; color: #fff; background: rgba(24,36,50,.92); font-weight: 900; cursor: pointer; box-shadow: var(--shadow-soft); }
.icon-button.ghost { background: rgba(255,255,255,.65); color: var(--ink); box-shadow: none; border: 1px solid rgba(31,43,57,.1); }
.icon-button.ghost.dark { background: #eef2f5; }
.icon-button.mini { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; }

.lobby-screen { background: linear-gradient(145deg, #68ccd8, #eef4f7 70%); }
.lobby-bg { position: absolute; inset: 0; background-image: radial-gradient(circle at 15% 15%, rgba(255,255,255,.75), transparent 25%), linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: auto, 46px 46px, 46px 46px; }
.status-badge { border-radius: 999px; padding: 7px 12px; background: rgba(255,255,255,.7); font-size: 12px; font-weight: 900; }
.status-badge.connected { color: var(--success); }
.lobby-layout { position: relative; z-index: 2; width: min(980px, calc(100vw - 30px)); margin: 34px auto; display: grid; grid-template-columns: minmax(0,1.4fr) minmax(280px,.8fr); gap: 16px; }
.lobby-card { background: rgba(255,255,255,.92); border-radius: 28px; box-shadow: var(--shadow); padding: 28px; backdrop-filter: blur(22px); }
.room-card h2 { margin: 8px 0 5px; font-size: 36px; letter-spacing: -.045em; }
.room-card > p { color: var(--ink-3); }
.room-code-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 23px 0; padding: 17px; border-radius: 17px; background: #f0f4f6; border: 1px solid var(--line); }
.room-code-box span, .room-meta-grid span { display: block; color: #788594; font-size: 11px; font-weight: 800; }
.room-code-box strong { display: block; margin-top: 2px; letter-spacing: .18em; font-size: 30px; }
.room-meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 21px; }
.room-meta-grid > div { padding: 13px; border-radius: 13px; border: 1px solid var(--line); background: #fff; }
.room-meta-grid strong { display: block; margin-top: 5px; font-size: 14px; }
.waiting-message { text-align: center; padding: 20px; color: #6d7b89; font-weight: 800; }
.card-heading { display: flex; align-items: center; justify-content: space-between; }
.card-heading h3 { margin: 4px 0 0; font-size: 25px; }
.count-pill { padding: 7px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 900; }
.player-list { display: grid; gap: 8px; margin-top: 18px; }
.player-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; }
.player-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-avatar { display: inline-block; color: var(--ink); background: none; font-weight: 900; font-size: 18px; line-height: 1; letter-spacing: .01em; }
.player-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 900; }
.host-crown { color: #eaa300; }

.game-screen { background: #13202d; }
.external-spectator-exit-button {
  position: fixed;
  z-index: 260;
  top: 72px;
  right: max(14px, env(safe-area-inset-right));
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 14px;
  padding: 0 16px;
  color: #fff;
  background: rgba(24,36,50,.96);
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: .02em;
  backdrop-filter: blur(8px);
}
.external-spectator-exit-button:hover { background: #26384b; }
.external-spectator-exit-button:focus-visible { outline: 3px solid rgba(98,211,223,.72); outline-offset: 2px; }
.game-screen.external-spectator-active #exitGameBtn { display: none; }
.street-view { position: absolute; inset: 0; background: #13202d; }
.nmpz-shield { position: absolute; inset: 0; z-index: 7; background: transparent; cursor: not-allowed; }
.street-loading { position: absolute; z-index: 15; inset: 0; display: grid; place-content: center; justify-items: center; gap: 7px; color: #fff; text-align: center; background: radial-gradient(circle at center, rgba(41,65,84,.82), rgba(16,27,39,.98)); }
.street-loading span { opacity: .7; font-size: 12px; }
.loader-globe { font-size: 52px; animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.game-hud { position: absolute; z-index: 30; pointer-events: none; }
.top-hud { left: 14px; right: 14px; top: 14px; display: flex; align-items: center; gap: 9px; }
.top-hud > * { pointer-events: auto; }
.hud-brand, .round-chip, .timer-chip { min-height: 50px; border-radius: 16px; background: rgba(24,36,50,.92); color: #fff; box-shadow: var(--shadow-soft); backdrop-filter: blur(16px); }
.hud-brand { display: flex; align-items: center; gap: 9px; padding: 8px 13px 8px 9px; font-weight: 900; }
.round-chip { display: flex; align-items: center; gap: 10px; padding: 8px 15px; }
.round-chip span, .timer-chip span { opacity: .65; font-size: 10px; font-weight: 800; }
.round-chip strong { font-size: 14px; }
.timer-chip { margin-left: auto; display: grid; align-content: center; justify-items: end; padding: 6px 14px; min-width: 92px; }
.timer-chip strong { font-size: 20px; letter-spacing: .03em; }
.timer-chip.urgent { background: rgba(208,43,61,.95); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.035); } }

.party-scoreboard { position: absolute; z-index: 29; top: 76px; left: 14px; width: min(285px, calc(100vw - 28px)); padding: 10px; border-radius: 16px; background: rgba(24,36,50,.9); color: #fff; box-shadow: var(--shadow-soft); backdrop-filter: blur(16px); }
.scoreboard-head { display: flex; justify-content: space-between; padding: 3px 5px 8px; color: rgba(255,255,255,.62); font-size: 10px; font-weight: 900; }
.scoreboard-list { display: grid; gap: 6px; }
.score-player { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 7px; border-radius: 11px; background: rgba(255,255,255,.08); }
.score-player.me { outline: 1px solid rgba(83,209,222,.7); }
.score-player.eliminated { opacity: .45; }
.score-player .mini-avatar { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: #3a4a5c; font-weight: 900; }
.score-main { min-width: 0; }
.score-main strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.score-main small { color: rgba(255,255,255,.62); font-size: 10px; }
.score-value { font-size: 12px; font-weight: 900; }

.street-view-quick-controls {
  position: absolute;
  z-index: 43;
  right: 14px;
  bottom: clamp(170px, 22dvh, 250px);
  display: grid;
  gap: 8px;
}
.street-view-control {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(24,36,50,.94);
  box-shadow: 0 8px 22px rgba(0,0,0,.26);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 21px;
  font-weight: 950;
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
}
.street-view-control:hover:not(:disabled) {
  transform: translateX(-2px);
  background: rgba(32,49,66,.98);
}
.street-view-control:disabled {
  opacity: .38;
  cursor: not-allowed;
}
.street-view-control::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 9px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  width: max-content;
  max-width: 180px;
  padding: 7px 9px;
  border-radius: 9px;
  color: #fff;
  background: rgba(15,23,34,.96);
  box-shadow: 0 5px 16px rgba(0,0,0,.24);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.street-view-control:hover:not(:disabled)::before,
.street-view-control:focus-visible:not(:disabled)::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.party-chat {
  position: fixed;
  z-index: 260;
  top: 92px;
  right: 14px;
  width: min(330px, calc(100vw - 28px));
  color: #fff;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,.24));
  transition: width .18s ease, opacity .18s ease, transform .18s ease;
}
.party-chat.ui-suspended {
  visibility: hidden;
  pointer-events: none;
}
.party-chat.collapsed {
  width: 50px;
}
.party-chat-toggle {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 15px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) auto 18px;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: rgba(24,36,50,.95);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  cursor: pointer;
  text-align: left;
}
.party-chat-toggle-icon {
  display: grid;
  place-items: center;
  font-size: 18px;
}
.party-chat-toggle-label {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.party-chat-toggle-chevron {
  font-size: 13px;
  font-weight: 950;
  transition: transform .18s ease;
}
.party-chat.collapsed .party-chat-toggle {
  width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  grid-template-columns: 1fr;
  border-radius: 15px;
  text-align: center;
}
.party-chat.collapsed .party-chat-toggle-label,
.party-chat.collapsed .party-chat-toggle-chevron {
  display: none;
}
.party-chat-unread {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  color: #fff;
  background: #ef2f48;
  font-size: 10px;
  font-weight: 950;
}
.party-chat.collapsed .party-chat-unread {
  position: absolute;
  top: -6px;
  right: -6px;
}
.party-chat-panel {
  margin-top: 7px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  background: rgba(24,36,50,.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.party-chat.collapsed .party-chat-panel {
  display: none;
}
.party-chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px 10px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.party-chat-heading .eyebrow {
  color: rgba(255,255,255,.48);
  font-size: 9px;
}
.party-chat-heading strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}
.party-chat-minimize {
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255,255,255,.09);
  cursor: pointer;
  font-size: 16px;
  font-weight: 950;
}
.party-chat-messages {
  height: min(300px, 38dvh);
  overflow-y: auto;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.party-chat-empty {
  padding: 26px 10px;
  color: rgba(255,255,255,.48);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}
.party-chat-message {
  width: fit-content;
  max-width: 88%;
  padding: 8px 10px;
  border-radius: 12px 12px 12px 4px;
  background: rgba(255,255,255,.09);
}
.party-chat-message.own {
  justify-self: end;
  border-radius: 12px 12px 4px 12px;
  background: rgba(80,194,207,.23);
}
.party-chat-message-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  color: rgba(255,255,255,.52);
  font-size: 9px;
  font-weight: 850;
}
.party-chat-message-text {
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.party-chat-form {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 7px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.party-chat-form input {
  min-width: 0;
  height: 39px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
  padding: 0 11px;
  color: #fff;
  background: rgba(255,255,255,.08);
  outline: none;
  font: inherit;
  font-size: 12px;
}
.party-chat-form input::placeholder {
  color: rgba(255,255,255,.38);
}
.party-chat-form input:focus {
  border-color: rgba(98,211,223,.72);
  box-shadow: 0 0 0 3px rgba(98,211,223,.1);
}
.party-chat-form button {
  min-width: 56px;
  border: 0;
  border-radius: 11px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 950;
}

.floating-map-button { position: absolute; z-index: 32; left: 18px; bottom: 18px; border: 0; border-radius: 17px; min-height: 56px; padding: 0 18px; display: flex; align-items: center; gap: 9px; color: #fff; background: rgba(24,36,50,.96); box-shadow: var(--shadow); cursor: pointer; }
.floating-map-button span { font-size: 22px; }
.guess-map-shell { --map-expanded-width: clamp(280px, 20vw, 430px); --map-expanded-height: clamp(240px, 32dvh, 360px); --map-collapsed-width: 204px; --map-collapsed-height: 156px; position: absolute; z-index: 40; left: 15px; bottom: 15px; width: var(--map-collapsed-width); height: var(--map-collapsed-height); min-width: 0; min-height: 0; border-radius: 18px; overflow: hidden; background: rgba(220,230,231,.78); border: 2px solid rgba(255,255,255,.58); box-shadow: var(--shadow); opacity: .58; backdrop-filter: blur(6px) saturate(.92); transition: width .2s ease, height .2s ease, opacity .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease; }
.guess-map-shell.expanded, .guess-map-shell.resizing, .guess-map-shell:focus-within { width: var(--map-expanded-width); height: var(--map-expanded-height); opacity: .98; background: #dce6e7; border-color: rgba(255,255,255,.78); }
.guess-map-shell.resizing { transition: none; user-select: none; }
.guess-map { position: absolute; inset: 0; cursor: crosshair; }
.guess-map .gm-style, .guess-map .gm-style > div, .guess-map .gm-style canvas, .guess-map .gm-style img { cursor: crosshair !important; }
.map-toolbar { position: absolute; z-index: 8; top: 10px; display: flex; gap: 7px; transition: transform .18s ease, opacity .18s ease, top .18s ease, left .18s ease; }
.map-toolbar-main { left: 10px; }
.map-tool { width: 45px; height: 34px; border: 0; border-radius: 999px; display: grid; place-items: center; color: #fff; background: rgba(24,36,50,.96); box-shadow: 0 5px 15px rgba(0,0,0,.2); cursor: pointer; font-size: 16px; font-weight: 900; touch-action: none; transition: width .18s ease, height .18s ease, font-size .18s ease, border-radius .18s ease; }
.map-tool.active { outline: 2px solid #62d3df; outline-offset: 1px; }
.map-resize-dock { position: absolute; z-index: 10; right: 10px; top: 10px; transform: none; padding: 0; transition: right .18s ease, top .18s ease; }
.map-resize-tool { width: 58px; height: 34px; border-radius: 999px; cursor: nesw-resize; font-size: 15px; box-shadow: 0 5px 15px rgba(0,0,0,.24); }
.map-resize-tool::after { content: ""; position: absolute; inset: -7px; }
.map-country-tag { position: absolute; z-index: 8; top: 53px; left: 10px; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--ink); font-size: 10px; font-weight: 900; transition: top .18s ease, transform .18s ease, opacity .18s ease, font-size .18s ease; }
.guess-submit { position: absolute; z-index: 9; left: 14px; right: 14px; bottom: 14px; min-height: 52px; border: 0; border-radius: 17px; color: #fff; background: rgba(24,36,50,.96); box-shadow: 0 10px 24px rgba(0,0,0,.27); font-weight: 900; cursor: pointer; transition: left .18s ease, right .18s ease, bottom .18s ease, min-height .18s ease, border-radius .18s ease, font-size .18s ease, opacity .18s ease; }
.guess-submit:disabled { color: rgba(255,255,255,.38); cursor: not-allowed; }
.guess-submit.ready { background: linear-gradient(135deg, var(--accent), #cf2034); }
.game-screen.public-viewer-mode .guess-map-shell {
  --map-expanded-width: clamp(420px, 42vw, 720px);
  --map-expanded-height: clamp(320px, 54dvh, 580px);
  width: var(--map-expanded-width);
  height: var(--map-expanded-height);
  opacity: .98;
  background: #dce6e7;
  border-color: rgba(255,255,255,.82);
}
.game-screen.public-viewer-mode .guess-submit {
  display: none;
}
.game-screen.public-viewer-mode .guess-map,
.game-screen.public-viewer-mode .guess-map .gm-style,
.game-screen.public-viewer-mode .guess-map .gm-style > div,
.game-screen.public-viewer-mode .guess-map .gm-style canvas,
.game-screen.public-viewer-mode .guess-map .gm-style img {
  cursor: default !important;
}
.game-screen.public-viewer-mode .map-country-tag::after {
  content: " · 公開觀戰";
  color: #a32235;
}
.game-screen.public-viewer-mode .street-view-quick-controls {
  opacity: .82;
}

.guess-map-shell:not(.expanded):not(.resizing):not(:focus-within) .map-toolbar { top: 7px; }
.guess-map-shell:not(.expanded):not(.resizing):not(:focus-within) .map-tool { width: 35px; height: 29px; font-size: 14px; }
.guess-map-shell:not(.expanded):not(.resizing):not(:focus-within) .map-resize-dock { right: 7px; top: 7px; }
.guess-map-shell:not(.expanded):not(.resizing):not(:focus-within) .map-resize-tool { width: 48px; height: 29px; border-radius: 999px; font-size: 12px; }
.guess-map-shell:not(.expanded):not(.resizing):not(:focus-within) .map-country-tag { top: 42px; font-size: 9px; opacity: .76; transform: scale(.96); transform-origin: left top; }
.guess-map-shell:not(.expanded):not(.resizing):not(:focus-within) .guess-submit { left: 8px; right: 8px; bottom: 8px; min-height: 37px; border-radius: 13px; font-size: 11px; }
.guess-rings { position: absolute; pointer-events: none; transform: translate(-50%, -50%); overflow: visible; filter: drop-shadow(0 1px 1px rgba(255,255,255,.3)); }
.guess-rings svg { overflow: visible; }
.guess-rings.is-hidden { display: none !important; }
.submitted-banner { position: absolute; z-index: 33; left: 50%; bottom: 18px; transform: translateX(-50%); min-width: min(460px, calc(100vw - 30px)); padding: 12px 17px; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #fff; background: rgba(24,36,50,.94); box-shadow: var(--shadow); text-align: center; }
.submitted-banner span { color: #78e5bc; font-weight: 900; }
.submitted-banner strong { font-size: 12px; }

.result-overlay { position: fixed; inset: 0; z-index: 200; background: #d8e1e7; }
.result-map { position: absolute; inset: 0; }

.round-result-status-hud {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  pointer-events: none;
}
.round-result-status-item {
  min-width: 132px;
  padding: 9px 12px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 15px;
  color: #fff;
  background: rgba(24,36,50,.94);
  box-shadow: 0 10px 24px rgba(14,26,40,.26);
  backdrop-filter: blur(16px);
  text-align: left;
}
.round-result-status-item.multiplier {
  min-width: 124px;
  background: rgba(87,28,40,.94);
}
.round-result-status-item span {
  display: block;
  margin-bottom: 4px;
  color: rgba(255,255,255,.68);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
}
.round-result-status-item strong {
  display: block;
  color: #fff;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.05;
  white-space: nowrap;
}

.round-result-opponents {
  min-width: 188px;
  max-width: min(270px, 28vw);
  max-height: 224px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 15px;
  color: #fff;
  background: rgba(24,36,50,.94);
  box-shadow: 0 10px 24px rgba(14,26,40,.26);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}
.round-result-opponents-title {
  display: block;
  padding: 9px 11px 7px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.72);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .05em;
}
.round-result-opponents-list {
  display: grid;
  max-height: 184px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.round-result-opponent-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 11px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.round-result-opponent-row:first-child { border-top: 0; }
.round-result-opponent-row.leader {
  background: rgba(255,255,255,.08);
}
.round-result-opponent-row.eliminated {
  opacity: .52;
}
.round-result-opponent-row.eliminated .round-result-opponent-score {
  color: #ffb9c3;
}
.round-result-opponent-row.low-hp:not(.eliminated) .round-result-opponent-score {
  color: #ffd46b;
}
.round-result-opponent-name {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.round-result-opponent-score {
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.result-card, .final-card { position: absolute; z-index: 2; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(720px, calc(100vw - 28px)); padding: 22px; border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); backdrop-filter: blur(20px); text-align: center; }

.result-card {
  left: 14px;
  right: 14px;
  bottom: 10px;
  transform: none;
  width: auto;
  max-height: min(43dvh, 410px);
  padding: 10px 14px 10px;
  overflow: auto;
  border-radius: 23px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 -8px 34px rgba(14,26,40,.21);
  scrollbar-width: thin;
}
.result-card-head {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 58px;
  padding: 0 92px;
  text-align: center;
}
.result-score-block {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 4px;
  padding: 0 4px;
}
.result-score-block .eyebrow {
  color: #697889;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .12em;
  text-align: center;
}
.result-score-line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  text-align: center;
}
.result-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 3.4vw, 50px);
  line-height: 1;
  letter-spacing: -.055em;
}
.result-card .result-score-line > p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 800;
}

.round-streetview-button {
  position: absolute;
  top: 6px;
  right: 4px;
  min-width: 58px;
  min-height: 36px;
  border: 1px solid rgba(207,216,225,.96);
  border-radius: 12px;
  padding: 6px 12px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(246,249,251,.98), rgba(232,239,245,.98));
  cursor: pointer;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.round-streetview-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 7px 16px rgba(24,36,50,.12);
}
.round-streetview-button:disabled {
  opacity: .46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.result-card-secondary {
  display: grid;
  gap: 4px;
}

.round-geo-breakdown {
  margin: 6px 0;
  overflow: hidden;
  border: 1px solid #d7e0e9;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(245,248,251,.98), rgba(236,241,246,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
  text-align: left;
}
.round-geo-loading, .round-geo-error {
  padding: 12px 14px;
  color: var(--ink-3);
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.4;
}
.round-geo-error strong { display: block; margin-bottom: 3px; color: var(--danger); }

.round-geo-strip {
  display: grid;
  gap: 0;
}

.round-geo-hero {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(203,212,221,.9);
  background: rgba(255,255,255,.82);
}
.round-geo-eyebrow {
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
  letter-spacing: .025em;
  line-height: 1.15;
}

.round-geo-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}
.round-geo-segment {
  min-width: 0;
  padding: 8px 10px 9px;
  border-right: 1px solid rgba(211,220,228,.95);
  background: rgba(247,250,252,.98);
}
.round-geo-segment:last-child { border-right: 0; }
.round-geo-segment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.round-geo-level {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}
.round-geo-status {
  display: inline-flex;
  width: fit-content;
  min-width: 50px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 950;
}
.round-geo-status.hit { color: #087443; background: #dcfce7; }
.round-geo-status.miss { color: #b42336; background: #ffe4e8; }
.round-geo-status.unknown { color: #64748b; background: #e8edf2; }

.round-geo-meta {
  display: grid;
  gap: 1px;
}
.round-geo-meta-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  background: transparent;
}
.round-geo-meta-row + .round-geo-meta-row {
  border-top: 1px dashed rgba(207,216,225,.78);
}
.round-geo-meta-row span {
  display: block;
  color: #6b7887;
  font-size: 12px;
  font-weight: 950;
  margin: 0;
}
.round-geo-value {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.round-geo-value.guess { color: #526172; }

.duel-damage-box { margin: 10px auto; padding: 10px 12px; border-radius: 12px; background: #fff0f2; color: var(--danger); font-weight: 900; }
.round-ranking { display: flex; gap: 6px; max-width: 100%; margin-top: 0; overflow-x: auto; overflow-y: hidden; padding: 0 1px 2px; scrollbar-width: thin; }
.ranking-row { flex: 0 0 min(310px, 82vw); display: grid; grid-template-columns: 22px minmax(0,1fr) auto auto; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 11px; background: #eef2f5; text-align: left; font-size: 11px; }
.ranking-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-row .rank-score { font-weight: 900; }
.ranking-row .rank-distance { color: var(--ink-3); }
.result-progress { display: grid; justify-items: stretch; gap: 4px; margin-top: 5px; color: var(--ink-3); font-size: 11px; }
.result-manual-progress { width: 100%; }
.next-journey-button { width: 100%; min-height: 39px; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--ink), #24384a); box-shadow: 0 9px 20px rgba(24,36,50,.18); cursor: pointer; font-weight: 900; letter-spacing: .02em; }
.next-journey-button:hover { filter: brightness(1.04); transform: translateY(-1px); }
.next-journey-button:disabled { opacity: .5; cursor: wait; transform: none; filter: none; }
.next-journey-button.hidden { display: none; }
.next-journey-status { color: var(--ink-3); font-weight: 800; }
.next-journey-status:empty { display: none; }
.final-overlay { background: #1b2a38; }
.final-history-map { position: absolute; inset: 0; background: #d8e1e7; }
.final-map-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(circle at 50% 40%, rgba(26,42,56,.08), rgba(14,27,40,.68) 78%); transition: opacity .22s ease; }
.final-card { z-index: 2; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(700px, calc(100vw - 28px)); max-width: 700px; max-height: calc(100dvh - 32px); overflow: auto; transform-origin: left bottom; transition: left .24s ease, top .24s ease, bottom .24s ease, width .24s ease, max-height .24s ease, transform .24s ease, opacity .2s ease, padding .2s ease, border-radius .2s ease; }
.final-card h2 { margin: 8px 0; font-size: 42px; transition: font-size .2s ease; }
.final-card > p { color: var(--ink-3); }
.final-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.final-history-heading > strong { font-size: 13px; letter-spacing: .05em; }
.final-round-tabs { display: flex; flex: 1 1 auto; flex-wrap: nowrap; justify-content: flex-start; gap: 6px; max-width: min(490px, 68vw); padding: 2px 1px 5px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.final-round-tab { flex: 0 0 auto; min-width: 34px; height: 34px; border: 1px solid #cbd4dd; border-radius: 10px; background: #eef2f5; color: var(--ink); cursor: pointer; font-weight: 900; }

.final-overlay.archive-peek .final-map-shade { opacity: .18; }
.final-overlay.archive-peek .final-card {
  left: 16px;
  top: auto;
  bottom: 16px;
  transform: none;
  width: min(270px, calc(100vw - 32px));
  max-height: 178px;
  padding: 15px;
  overflow: hidden;
  opacity: .52;
  border-radius: 18px;
  cursor: zoom-in;
}
.final-overlay.archive-peek .final-card:not(:hover):not(:focus-within) h2 { font-size: 24px; }
.final-overlay.archive-peek .final-card:not(:hover):not(:focus-within) .final-history-heading,
.final-overlay.archive-peek .final-card:not(:hover):not(:focus-within) .final-round-info,
.final-overlay.archive-peek .final-card:not(:hover):not(:focus-within) .final-ranking,
.final-overlay.archive-peek .final-card:not(:hover):not(:focus-within) .action-button { display: none; }
.final-overlay.archive-peek .final-card:not(:hover):not(:focus-within)::after {
  content: "滑鼠移入展開結算";
  display: block;
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}
.final-overlay.archive-peek .final-card:hover,
.final-overlay.archive-peek .final-card:focus-within {
  width: min(700px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  opacity: .97;
  cursor: default;
}
.final-round-tab:hover { background: #dde6ec; }
.final-round-tab.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.final-round-info { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(238,242,245,.92); color: var(--ink-3); font-size: 12px; font-weight: 800; line-height: 1.5; }
.final-ranking { display: grid; gap: 7px; margin: 14px 0 19px; }
.final-row { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px; border-radius: 13px; background: #eef2f5; text-align: left; }
.final-row.winner { background: #fff3c8; outline: 1px solid #e7bd38; }
.final-place { font-size: 19px; font-weight: 900; }

.toast { position: fixed; z-index: 300; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(520px, calc(100vw - 30px)); padding: 11px 16px; border-radius: 13px; color: #fff; background: rgba(24,36,50,.96); box-shadow: var(--shadow-soft); font-size: 13px; font-weight: 800; }

@media (max-width: 760px) {
  body { overflow: hidden; }
  .home-nav, .minimal-nav { height: 68px; padding: 0 16px; }
  .nav-chip { display: none; }
  .home-card { margin-top: 2vh; padding: 24px 18px; border-radius: 26px; }
  .hero-copy h1 { font-size: 38px; }
  .party-actions { grid-template-columns: 1fr; }
  .public-room-action { grid-column: auto; }
  .action-button { min-height: 68px; }
  .room-visibility-options { grid-template-columns: 1fr; }
  .room-visibility-options label > span { min-height: 66px; }
  .public-rooms-modal { padding: 18px; }
  .public-rooms-heading { align-items: flex-start; }
  .public-rooms-heading h2 { font-size: 27px; }
  .public-room-card { grid-template-columns: 1fr; gap: 10px; }
  .public-room-join { width: 100%; }
  .public-room-code { margin-left: 0; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { min-height: 220px; }
  .mode-card p { min-height: 0; }
  .settings-scroll { padding: 15px 20px; }
  .setting-row strong { font-size: 15px; }
  .lobby-layout { margin-top: 6px; grid-template-columns: 1fr; height: calc(100dvh - 82px); overflow: auto; padding-bottom: 20px; }
  .lobby-card { padding: 20px; border-radius: 22px; }
  .top-hud { left: 8px; right: 8px; top: 8px; gap: 5px; }
  .external-spectator-exit-button {
    top: 62px;
    right: max(8px, env(safe-area-inset-right));
    min-height: 42px;
    padding: 0 13px;
    border-radius: 13px;
    font-size: 12px;
  }
  .hud-brand span:last-child { display: none; }
  .round-chip { padding: 6px 10px; }
  .round-chip span { display: none; }
  .timer-chip { min-width: 75px; padding: 5px 9px; }
  .party-scoreboard { top: 68px; left: 8px; width: 230px; max-height: 180px; overflow: auto; }
  .street-view-quick-controls { right: 8px; bottom: 145px; gap: 6px; }
  .street-view-control { width: 42px; height: 42px; border-radius: 13px; font-size: 18px; }
  .street-view-control::before { display: none; }
  .party-chat { top: 162px; right: 8px; width: min(300px, calc(100vw - 16px)); }
  .party-chat.collapsed { width: 46px; }
  .party-chat.collapsed .party-chat-toggle { width: 46px; height: 46px; min-height: 46px; border-radius: 14px; }
  .party-chat-messages { height: min(260px, 36dvh); }
  .floating-map-button { left: 9px; bottom: 9px; min-height: 50px; }
  .guess-map-shell { left: 5px; bottom: 5px; --map-expanded-width: min(76vw, 360px); --map-expanded-height: min(42dvh, 320px); --map-collapsed-width: min(46vw, 210px); --map-collapsed-height: min(26dvh, 152px); border-radius: 16px; }
  .game-screen.public-viewer-mode .guess-map-shell {
    --map-expanded-width: calc(100vw - 16px);
    --map-expanded-height: min(56dvh, 460px);
  }
  .map-tool { width: 42px; height: 32px; }
  .submitted-banner { bottom: 8px; flex-direction: column; gap: 2px; }
  .round-result-status-hud {
    top: 7px;
    right: 7px;
    flex-direction: column;
    gap: 5px;
  }
  .round-result-status-item {
    min-width: 108px;
    padding: 7px 9px 8px;
    border-radius: 12px;
  }
  .round-result-status-item.multiplier { min-width: 108px; }
  .round-result-status-item span { margin-bottom: 3px; font-size: 9px; }
  .round-result-status-item strong { font-size: 15px; }
  .round-result-opponents {
    min-width: 138px;
    max-width: 164px;
    max-height: 174px;
    border-radius: 12px;
  }
  .round-result-opponents-title { padding: 7px 9px 6px; font-size: 9px; }
  .round-result-opponents-list { max-height: 140px; }
  .round-result-opponent-row { min-height: 29px; padding: 5px 9px; gap: 7px; }
  .round-result-opponent-name { font-size: 10px; }
  .round-result-opponent-score { font-size: 11px; }

  .result-card { left: 5px; right: 5px; bottom: 5px; max-height: 58dvh; padding: 9px; border-radius: 18px; }
  .result-card-head { min-height: 58px; padding: 0 68px 0 4px; }
  .result-score-block { gap: 7px; padding: 0 2px; }
  .result-score-line { gap: 8px; }
  .result-card h2 { font-size: 30px; }
  .round-streetview-button { top: 4px; right: 1px; min-width: 54px; min-height: 34px; padding: 5px 10px; }
  .round-geo-hero { padding: 7px 9px; }
  .round-geo-track { grid-template-columns: 1fr 1fr; }
  .round-geo-segment { padding: 8px; border-right: 1px solid rgba(211,220,228,.95); border-top: 1px solid rgba(211,220,228,.95); }
  .round-geo-meta-row { grid-template-columns: 40px minmax(0,1fr); gap: 5px; }
  .round-geo-segment:nth-child(2n) { border-right: 0; }
  .round-geo-segment:nth-child(-n+2) { border-top: 0; }
  .ranking-row { grid-template-columns: 25px minmax(0,1fr) auto; }
  .rank-distance { display: none; }
}

/* Geo Duel 生存制與等待室規則編輯 */
.duel-settings-wrap {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}
.duel-settings-note,
.duel-multiplier-preview {
  margin: 4px 8px 8px;
  padding: 11px 13px;
  border-radius: 13px;
  color: #526172;
  background: #eef3f6;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}
.duel-settings-note {
  color: #8f2132;
  background: #fff0f2;
  border: 1px solid #ffd6dc;
}
.settings-modal.is-editing-room #hostNameField {
  display: none;
}
.lobby-host-actions {
  display: grid;
  grid-template-columns: minmax(130px, .45fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: stretch;
}
.lobby-host-actions .action-button {
  width: 100%;
  min-height: 64px;
}
.lobby-edit-rules {
  min-height: 64px;
  font-size: 14px;
}
.final-party-status {
  margin: 10px 0 4px;
  padding: 11px 13px;
  border-radius: 13px;
  color: #5d6b79;
  background: #eef2f5;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.5;
  text-align: center;
}
@media (max-width: 760px) {
  .lobby-host-actions {
    grid-template-columns: 1fr;
  }
}

.public-room-card.watchable {
  opacity: 1;
}
.public-room-badge.viewers {
  color: #315a8a;
  background: #e3efff;
}


/* home_party_map_background_v41_marker */

.home-screen,
.party-screen,
.lobby-screen,
.party-lobby-screen,
.screen.home-screen,
.screen.party-screen,
.screen.lobby-screen,
.screen.party-lobby-screen {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(246, 250, 255, .72), rgba(246, 250, 255, .82)),
    url("https://maps.gstatic.com/tactile/basepage/pegman_sherlock.png");
  background-size: cover, 0 0;
}

/* 地圖風格背景層：不靠外部圖，直接用 SVG 畫一層淡色地圖感 */
.home-screen::before,
.party-screen::before,
.lobby-screen::before,
.party-lobby-screen::before,
.screen.home-screen::before,
.screen.party-screen::before,
.screen.lobby-screen::before,
.screen.party-lobby-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .78;
  background-image:
    linear-gradient(rgba(255,255,255,.14), rgba(255,255,255,.14)),
    url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='1000' viewBox='0 0 1600 1000'%3E%3Crect width='1600' height='1000' fill='%23bfe2de'/%3E%3Cg opacity='.95'%3E%3Cpath d='M0 220 C120 200 240 208 370 250 S630 340 760 305 S1020 180 1180 210 S1450 330 1600 280' fill='none' stroke='%2390bdb7' stroke-width='56' stroke-linecap='round'/%3E%3Cpath d='M-40 610 C120 560 250 548 420 590 S760 690 960 640 S1310 500 1640 560' fill='none' stroke='%2390bdb7' stroke-width='64' stroke-linecap='round'/%3E%3C/g%3E%3Cg opacity='.9'%3E%3Cpath d='M120 120 L420 180 L520 300 L380 470 L180 420 L80 250 Z' fill='%23d9efd2' stroke='%2396b8a7' stroke-width='5'/%3E%3Cpath d='M540 90 L860 120 L980 280 L880 480 L650 520 L500 360 Z' fill='%23d7edd1' stroke='%2396b8a7' stroke-width='5'/%3E%3Cpath d='M1040 120 L1340 180 L1450 390 L1260 580 L1030 430 L980 260 Z' fill='%23d5ebcf' stroke='%2396b8a7' stroke-width='5'/%3E%3Cpath d='M240 520 L540 500 L680 700 L560 900 L260 860 L160 690 Z' fill='%23d8eed2' stroke='%2396b8a7' stroke-width='5'/%3E%3Cpath d='M780 520 L1060 500 L1220 660 L1120 900 L830 880 L700 710 Z' fill='%23d4eacb' stroke='%2396b8a7' stroke-width='5'/%3E%3C/g%3E%3Cg opacity='.82' stroke='%2387aacf' stroke-width='7' stroke-linecap='round' fill='none'%3E%3Cpath d='M90 180 L310 250 L470 390 L590 465'/%3E%3Cpath d='M240 100 L270 340 L290 520 L320 820'/%3E%3Cpath d='M540 140 L700 250 L870 260 L1030 350 L1190 450'/%3E%3Cpath d='M580 410 L710 500 L820 610 L940 760 L1060 900'/%3E%3Cpath d='M960 130 L910 310 L930 520 L980 760'/%3E%3Cpath d='M1160 210 L1330 280 L1460 410'/%3E%3Cpath d='M1160 510 L1290 590 L1420 760'/%3E%3Cpath d='M90 680 L260 620 L420 660 L620 620'/%3E%3Cpath d='M400 250 L560 210 L740 180'/%3E%3C/g%3E%3Cg opacity='.72' fill='%23fff' stroke='%2387aacf' stroke-width='4'%3E%3Ccircle cx='272' cy='340' r='11'/%3E%3Ccircle cx='590' cy='465' r='11'/%3E%3Ccircle cx='870' cy='260' r='11'/%3E%3Ccircle cx='980' cy='760' r='11'/%3E%3Ccircle cx='1290' cy='590' r='11'/%3E%3Ccircle cx='420' cy='660' r='11'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  filter: saturate(.96) contrast(.98);
}

.home-screen > *,
.party-screen > *,
.lobby-screen > *,
.party-lobby-screen > *,
.screen.home-screen > *,
.screen.party-screen > *,
.screen.lobby-screen > *,
.screen.party-lobby-screen > * {
  position: relative;
  z-index: 1;
}




/* interactive_worldmap_background_v42 */
.home-screen,
.lobby-screen {
  background: #dbe9ef !important;
}

.home-screen::before,
.lobby-screen::before,
.screen.home-screen::before,
.screen.lobby-screen::before {
  content: none !important;
  display: none !important;
}

.screen-world-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,.24), transparent 38%),
    linear-gradient(180deg, #d8edf1 0%, #cde5ea 100%);
}

.screen-world-map-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.34), transparent 22%),
    linear-gradient(180deg, rgba(244,249,252,.18), rgba(244,249,252,.34));
}

.home-atmosphere,
.lobby-bg {
  z-index: 1;
  pointer-events: none;
}

.home-atmosphere {
  opacity: .42;
}

.lobby-bg {
  background-image:
    radial-gradient(circle at 15% 15%, rgba(255,255,255,.22), transparent 25%),
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: auto, 46px 46px, 46px 46px;
}

.home-nav,
.minimal-nav,
.home-card,
.lobby-layout {
  position: relative;
  z-index: 3;
}

.screen-world-map .gm-style,
.screen-world-map .gm-style > div {
  border: 0;
}

.screen-world-map .gm-style-cc,
.screen-world-map button,
.screen-world-map [role="button"] {
  transition: opacity .16s ease;
}

@media (max-width: 768px) {
  .screen-world-map-tint {
    background:
      radial-gradient(circle at 50% 0%, rgba(255,255,255,.26), transparent 28%),
      linear-gradient(180deg, rgba(244,249,252,.18), rgba(244,249,252,.40));
  }
}




/* interactive_worldmap_background_v43_fix */
.home-screen > .screen-world-map,
.lobby-screen > .screen-world-map,
.screen.home-screen > .screen-world-map,
.screen.lobby-screen > .screen-world-map {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
  display: block !important;
}

.home-screen > .screen-world-map-tint,
.lobby-screen > .screen-world-map-tint,
.screen.home-screen > .screen-world-map-tint,
.screen.lobby-screen > .screen-world-map-tint {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

.home-screen > .home-atmosphere,
.lobby-screen > .lobby-bg {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

.home-screen > .home-nav,
.home-screen > .home-card,
.lobby-screen > .minimal-nav,
.lobby-screen > .lobby-layout {
  position: relative !important;
  z-index: 3 !important;
}

/* 地圖可在卡片以外的空白區域直接拖曳、縮放 */
.home-screen,
.lobby-screen {
  isolation: isolate;
}




/* interactive_worldmap_background_v44_fullscreen_fix */
html,
body,
#app,
.app-shell {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
}

body {
  margin: 0 !important;
  overflow: hidden !important;
}

.app-shell,
.home-screen,
.lobby-screen {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
}

.home-screen > .screen-world-map,
.lobby-screen > .screen-world-map {
  right: 0 !important;
  bottom: 0 !important;
  min-width: 100vw !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
}

.screen-world-map > div,
.screen-world-map .gm-style,
.screen-world-map .gm-style > div:first-child {
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
}

.screen-world-map-tint {
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.18), transparent 22%),
    linear-gradient(180deg, rgba(244,249,252,.08), rgba(244,249,252,.18)) !important;
}




/* interactive_worldmap_background_v45_cleanup */
.lobby-screen > .lobby-bg,
.screen.lobby-screen > .lobby-bg {
  display: none !important;
  background: none !important;
}




/* interactive_worldmap_background_v46_remove_ink_blobs */
.home-atmosphere .island,
.home-atmosphere .island::before,
.home-atmosphere .island::after,
.island,
.island::before,
.island::after {
  display: none !important;
  content: none !important;
  background: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}




/* fixed_worldmap_background_v47 */
.home-screen,
.lobby-screen,
.screen.home-screen,
.screen.lobby-screen {
  background:
    linear-gradient(rgba(241, 248, 250, .10), rgba(241, 248, 250, .18)),
    url("/zzmap/fixed-world-map.png") center center / cover no-repeat !important;
  background-color: #78d6e3 !important;
}

.screen-world-map,
.screen-world-map-tint,
.home-atmosphere,
.lobby-bg {
  display: none !important;
}

.home-screen,
.lobby-screen {
  touch-action: auto;
}




/* blue_background_v48 */
.home-screen,
.lobby-screen,
.screen.home-screen,
.screen.lobby-screen {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, .34), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, .18), transparent 24%),
    linear-gradient(145deg, #63cad8 0%, #7bd5df 45%, #d7edf1 100%) !important;
  background-color: #72d1dd !important;
}

/* 不使用地圖背景，也保留先前移除墨水裝飾的結果 */
.screen-world-map,
.screen-world-map-tint,
.home-atmosphere,
.lobby-bg,
.home-atmosphere .island,
.home-atmosphere .island::before,
.home-atmosphere .island::after {
  display: none !important;
}




/* clean_text_ui_v49 */
.button-icon,
.mode-icon,
.party-chat-toggle-chevron {
  display: none !important;
}

.icon-button {
  width: auto !important;
  min-width: 58px;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
}

.loader-globe {
  min-width: 70px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,.12);
  font-size: 12px !important;
  font-weight: 900;
  animation: none !important;
}

.street-view-control {
  width: 64px !important;
  padding: 0 8px;
  font-size: 11px !important;
  font-weight: 900;
  white-space: nowrap;
}

.guess-map-shell .map-tool {
  width: auto !important;
  min-width: 56px !important;
  padding: 0 10px;
  font-size: 11px !important;
  white-space: nowrap;
}

.guess-map-shell:not(.expanded):not(.resizing):not(:focus-within) .map-tool {
  width: auto !important;
  min-width: 48px !important;
  padding: 0 8px;
  font-size: 10px !important;
}

.party-chat-minimize {
  width: auto !important;
  min-width: 48px;
  padding: 0 10px;
  font-size: 11px;
}

.host-label {
  display: inline-block;
  margin-left: 5px;
  border-radius: 999px;
  padding: 2px 6px;
  color: #795b00;
  background: #fff1b8;
  font-size: 9px;
  font-weight: 900;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .street-view-control {
    width: 58px !important;
    height: 42px !important;
    font-size: 10px !important;
  }

  .icon-button {
    min-width: 54px;
    padding: 0 10px;
  }
}




/* centered_home_text_v50 */
.home-card .action-button {
  justify-content: center !important;
  text-align: center !important;
}

.home-card .action-button > span {
  width: 100%;
  text-align: center !important;
}

.home-card .action-button strong,
.home-card .action-button small {
  text-align: center !important;
}

.home-card .section-divider,
.home-card .home-note {
  text-align: center !important;
}




/* player_marker_status_colors_v51 */
.score-player .mini-avatar.marker-state-empty {
  color: #5f4b00;
  background: #fff1a8;
  box-shadow: inset 0 0 0 1px rgba(145, 111, 0, .16);
}

.score-player .mini-avatar.marker-state-placed {
  color: #7a3d00;
  background: #ffd4a3;
  box-shadow: inset 0 0 0 1px rgba(174, 83, 0, .15);
}

.score-player .mini-avatar.marker-state-complete {
  color: #0e5f35;
  background: #c9f2d4;
  box-shadow: inset 0 0 0 1px rgba(20, 128, 72, .15);
}




/* player_row_status_colors_v52 */
.score-player {
  border: 1px solid transparent;
}

.score-player.me {
  outline: none !important;
  box-shadow: none !important;
}

.score-player.state-empty {
  background: #fff4c2 !important;
  border-color: #ead27a !important;
}

.score-player.state-placed {
  background: #ffdcb9 !important;
  border-color: #f2b26b !important;
}

.score-player.state-complete {
  background: #d7f3dc !important;
  border-color: #97d3a8 !important;
}

.score-player.state-empty .score-main strong,
.score-player.state-placed .score-main strong,
.score-player.state-complete .score-main strong,
.score-player.state-empty .score-value,
.score-player.state-placed .score-value,
.score-player.state-complete .score-value {
  color: #223043 !important;
}

.score-player.state-empty .score-main small,
.score-player.state-placed .score-main small,
.score-player.state-complete .score-main small {
  color: rgba(34, 48, 67, .72) !important;
}

.score-player.state-empty .mini-avatar,
.score-player.state-placed .mini-avatar,
.score-player.state-complete .mini-avatar {
  color: #ffffff !important;
  background: #2a3b50 !important;
  box-shadow: none !important;
}

.party-chat-form input,
.party-chat-form input:focus {
  border-color: rgba(255,255,255,.12) !important;
  box-shadow: none !important;
  outline: none !important;
}




/* player_number_brackets_v55 */
.player-identity { gap: 12px; }



/* brand_cat_icon_v56 */
.brand-mark::before {
  content: "";
}

.hud-brand .brand-mark {
  margin-right: 1px;
}



/* centered_start_party_button_v58 */
#startPartyBtn {
  justify-content: center !important;
  text-align: center !important;
}

#startPartyBtn > span {
  width: 100%;
  text-align: center !important;
}

#startPartyBtn strong,
#startPartyBtn small {
  text-align: center !important;
}




/* mobile_auto_reconnect_v62 */
.toast.toast-danger {
  color: #ffffff !important;
  background: #d92f45 !important;
  border: 1px solid rgba(255,255,255,.30);
  box-shadow:
    0 16px 38px rgba(135, 11, 31, .38),
    0 0 0 4px rgba(217, 47, 69, .14) !important;
  animation: zzmap-danger-toast-in .28s ease-out;
}

.toast.toast-success {
  color: #ffffff !important;
  background: #16875d !important;
  border: 1px solid rgba(255,255,255,.24);
}

@keyframes zzmap-danger-toast-in {
  0% { transform: translateX(-50%) translateY(14px) scale(.96); opacity: 0; }
  65% { transform: translateX(-50%) translateY(-2px) scale(1.015); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}




/* player_result_tabs_v288 */
.round-score-calculation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  margin: 6px 0;
  overflow: hidden;
  border: 1px solid #d7e0e9;
  border-radius: 15px;
  background: rgba(247, 250, 252, .98);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  text-align: left;
}

.round-score-calculation-title {
  grid-column: 1 / -1;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(203,212,221,.9);
  background: rgba(255,255,255,.84);
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
  letter-spacing: .025em;
}

.round-score-calculation-player {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 6px;
  min-width: 150px;
  padding: 10px 12px;
  border-right: 1px solid rgba(211,220,228,.95);
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.round-score-calculation-player span {
  color: var(--ink-3);
  font-size: 12px;
}

.round-score-calculation-body {
  display: grid;
  min-width: 0;
  padding: 5px 12px;
}

.round-score-calculation-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border-bottom: 1px dashed rgba(207,216,225,.82);
}

.round-score-calculation-row:last-child {
  border-bottom: 0;
}

.round-score-calculation-label {
  color: #6b7887;
  font-size: 12px;
  font-weight: 950;
}

.round-score-calculation-formula {
  min-width: 0;
  color: #526172;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.round-score-calculation-result {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}

.round-ranking {
  align-items: stretch;
}

.ranking-row {
  appearance: none;
  border: 1px solid transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition:
    transform .16s ease,
    border-color .16s ease,
    background .16s ease,
    box-shadow .16s ease;
}

.ranking-row:hover {
  transform: translateY(-1px);
  border-color: #aebdca;
  background: #e8eef3;
}

.ranking-row.active {
  border-color: #24384a;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(24,36,50,.13);
}

.ranking-row:focus-visible {
  outline: 2px solid #24384a;
  outline-offset: 2px;
}

.ranking-player-name {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.ranking-player-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-player-name small {
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 900;
}

.ranking-place {
  font-weight: 950;
}

@media (max-width: 760px) {
  .round-score-calculation {
    grid-template-columns: 1fr;
  }

  .round-score-calculation-player {
    min-width: 0;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(211,220,228,.95);
  }

  .round-score-calculation-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 5px 8px;
    padding: 5px 0;
  }

  .round-score-calculation-result {
    grid-column: 2;
    justify-self: start;
  }
}




/* compact_score_formula_v289 */
.round-score-calculation-body {
  align-content: center;
  justify-content: start;
  gap: 0;
  padding: 5px 10px;
}

.round-score-calculation-row {
  display: flex !important;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 4px 7px !important;
  width: fit-content;
  max-width: 100%;
  min-height: 32px;
  padding: 5px 0;
}

.round-score-calculation-label,
.round-score-calculation-formula,
.round-score-calculation-result,
.round-score-calculation-equals {
  flex: 0 0 auto;
}

.round-score-calculation-label {
  color: #526172;
  font-size: 13px;
}

.round-score-calculation-equals {
  color: #8a97a5;
  font-size: 14px;
  font-weight: 950;
}

.round-score-calculation-formula {
  max-width: min(100%, 720px);
}

.round-score-calculation-result {
  justify-self: auto !important;
  grid-column: auto !important;
}

@media (max-width: 760px) {
  .round-score-calculation-row {
    display: flex !important;
    gap: 3px 6px !important;
    width: 100%;
  }

  .round-score-calculation-formula {
    max-width: 100%;
  }

  .round-score-calculation-result {
    grid-column: auto !important;
    justify-self: auto !important;
  }
}




/* final_round_details_v290 */

/* 遊戲內收合聊天室按鈕固定在「回原點」上方 */
.party-chat.game-quick-position.collapsed {
  top: auto !important;
  right: 14px;
  bottom: calc(clamp(170px, 22dvh, 250px) + 168px);
}

.final-card {
  width: min(1180px, calc(100vw - 28px));
  max-width: 1180px;
}

.final-overlay.archive-peek .final-card:hover,
.final-overlay.archive-peek .final-card:focus-within {
  width: min(1180px, calc(100vw - 32px));
}

.final-overlay.archive-peek .final-card:not(:hover):not(:focus-within) .final-round-detail {
  display: none;
}

.final-round-detail {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(199, 210, 220, .94);
  border-radius: 16px;
  background: rgba(247, 250, 252, .96);
}

.final-round-detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 4px 4px 2px;
}

.final-round-detail-summary > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
}

.final-detail-round-label {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 950;
}

.final-detail-score {
  color: var(--ink);
  font-size: 27px;
  font-weight: 950;
}

.final-detail-distance {
  color: #627083;
  font-size: 12px;
  font-weight: 850;
}

.final-detail-player-tabs {
  display: flex;
  gap: 6px;
  max-width: 100%;
  padding: 1px 1px 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.final-detail-player-tab {
  flex: 0 0 min(300px, 78vw);
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid #d3dce4;
  border-radius: 11px;
  color: var(--ink);
  background: #edf2f5;
  text-align: left;
  cursor: pointer;
  transition:
    transform .15s ease,
    border-color .15s ease,
    background .15s ease,
    box-shadow .15s ease;
}

.final-detail-player-tab:hover {
  transform: translateY(-1px);
  border-color: #aebdca;
  background: #ffffff;
}

.final-detail-player-tab.active {
  border-color: #26394b;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(24, 36, 50, .13);
}

.final-detail-player-tab > span {
  font-weight: 950;
}

.final-detail-player-tab > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.final-detail-player-tab > small {
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 900;
}

.final-detail-player-tab > b {
  font-size: 11px;
  white-space: nowrap;
}

.final-detail-geo,
.final-detail-score {
  margin: 0;
}

@media (max-width: 760px) {
  .party-chat.game-quick-position.collapsed {
    top: auto !important;
    right: 8px;
    bottom: 289px;
  }

  .final-card {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100dvh - 16px);
    padding: 15px 10px;
  }

  .final-overlay.archive-peek .final-card:hover,
  .final-overlay.archive-peek .final-card:focus-within {
    width: calc(100vw - 16px);
  }

  .final-round-detail {
    padding: 8px;
  }

  .final-detail-score {
    font-size: 23px;
  }

  .final-detail-player-tab {
    flex-basis: min(280px, 82vw);
  }
}




/* party_status_f12_alerts_v291 */
.toast {
  z-index: 1200 !important;
}

.toast.toast-danger {
  border: 2px solid rgba(255,255,255,.72) !important;
  font-size: 14px;
  font-weight: 950;
}




/* consistent_player_numbers_v292 */
.ranking-place,
.final-detail-player-tab > span {
  font-variant-numeric: tabular-nums;
}

.ranking-place::before,
.final-detail-player-tab > span::before {
  content: "[";
}

.ranking-place::after,
.final-detail-player-tab > span::after {
  content: "]";
}



/* team_lobby_foundation_v294a */
.mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mode-card.team-mode-card {
  background: #fff;
}

.mode-card.team-mode-card.selected {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.lobby-layout.team-mode-layout {
  width: min(1380px, calc(100vw - 30px));
  grid-template-columns: minmax(360px, 1.05fr) minmax(280px, .7fr) minmax(360px, 1fr);
}
.team-lobby-status { display:grid; gap:4px; margin:14px 0; padding:10px 12px; border-radius:12px; font-size:12px; font-weight:850; }
.team-lobby-status.waiting { background:#fff5d8; color:#765300; }
.team-lobby-status.ready { background:#dff5e7; color:#11643a; }
.team-list { display:grid; gap:10px; max-height:52vh; overflow:auto; }
.team-card { --team-color:#7b4ce2; display:grid; gap:9px; padding:12px; border:2px solid var(--team-color); border-radius:16px; background:#fff; }
.team-card-head { display:grid; grid-template-columns:18px minmax(0,1fr) auto; gap:9px; align-items:center; }
.team-card-head strong,.team-card-head small { display:block; }
.team-card-head small { color:var(--ink-3); font-size:10px; }
.team-color-dot { width:14px; height:14px; border:4px solid var(--team-color); border-radius:50%; background:#fff; }
.team-member-list { display:grid; gap:5px; }
.team-member-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto auto auto auto; align-items:center; gap:5px; padding:6px 8px; border-radius:10px; background:#f3f6f8; font-size:10px; }
.team-member-row b.confirmed { color:#16875d; }
.team-member-row button,.team-mini-action,.team-request-row button { border:0; border-radius:7px; padding:5px 7px; font-size:9px; font-weight:900; cursor:pointer; }
.team-member-row button.danger,.team-mini-action.danger,.team-request-row button.danger { color:#a51c35; background:#ffe7ec; }
.team-captain-label { padding:2px 5px; border-radius:999px; background:#fff0bd; color:#765300; font-size:8px; font-weight:950; }
.team-requests { display:grid; gap:6px; padding:8px; border-radius:10px; background:#f7f1ff; }
.team-request-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:5px; align-items:center; }
.team-join-button { min-height:35px; border:0; border-radius:10px; color:#fff; background:var(--team-color); font-weight:900; cursor:pointer; }
.my-team-actions { display:grid; gap:8px; margin-top:13px; padding-top:12px; border-top:1px solid var(--line); }
.team-empty { padding:12px; border-radius:11px; background:#f1f4f6; color:var(--ink-3); text-align:center; }
.team-create-modal { width:min(520px, calc(100vw - 24px)); }
.team-color-picker { display:grid; gap:9px; margin:15px 0; }
.team-color-preview-row { display:flex; align-items:center; justify-content:space-between; gap:12px; font-weight:850; }
.team-color-preview { --preview-team-color:hsl(0 78% 46%); width:58px; height:58px; display:grid; place-items:center; border:6px solid var(--preview-team-color); border-radius:50%; background:#fff; font-weight:950; }
.team-spectrum { height:14px; border-radius:999px; background:linear-gradient(90deg,hsl(0 78% 46%),hsl(60 78% 46%),hsl(120 78% 46%),hsl(180 78% 46%),hsl(240 78% 46%),hsl(300 78% 46%),hsl(360 78% 46%)); }
.party-chat-channel-tabs { display:grid; grid-template-columns:1fr 1fr; gap:5px; padding:7px 9px 0; }
.party-chat-channel-tabs button { min-height:31px; border:0; border-radius:9px; background:rgba(255,255,255,.08); color:rgba(255,255,255,.68); font-size:10px; font-weight:950; }
.party-chat-channel-tabs button.active { color:#142230; background:#fff; }
@media (max-width:1080px) { .lobby-layout.team-mode-layout { grid-template-columns:1fr 1fr; } .team-mode-layout .teams-card { grid-column:1/-1; } }
@media (max-width:760px) { .mode-grid{grid-template-columns:1fr;} .lobby-layout.team-mode-layout{grid-template-columns:1fr;} .team-mode-layout .teams-card{grid-column:auto;} .team-list{max-height:none;} }


/* team_modes_complete_v294 */
.score-team { display:grid; gap:5px; padding:6px; border-left:3px solid var(--score-team-color); border-radius:11px; background:rgba(255,255,255,.055); }
.score-team-head { display:grid; grid-template-columns:14px minmax(0,1fr) auto; align-items:center; gap:7px; padding:2px 3px 5px; }
.score-team-dot { width:12px; height:12px; border:3px solid var(--score-team-color); border-radius:50%; background:#fff; }
.score-team-head strong,.score-team-head b { font-size:10px; }
.score-team .score-player { border-left:2px solid var(--score-team-color); }
.party-chat-channel-tabs button:disabled { opacity:.35; cursor:not-allowed; }
.team-result-summary { --team-color:#7b4ce2; display:grid; gap:2px; padding:8px 10px; margin:4px 0; border-left:4px solid var(--team-color); border-radius:9px; background:rgba(255,255,255,.72); color:var(--ink); }
.team-result-summary span { color:var(--ink-3); font-size:11px; }
.final-row[style*="--team-color"] { border-left:5px solid var(--team-color); }



/* team_create_plus_button_v296 */
.teams-card .card-heading {
  position: relative;
  min-height: 50px;
  padding-right: 46px;
}

.team-create-plus {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 7px 16px rgba(31, 43, 57, .18);
  font: inherit;
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition:
    transform .15s ease,
    filter .15s ease,
    box-shadow .15s ease;
}

.team-create-plus:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 9px 20px rgba(31, 43, 57, .23);
}

.team-create-plus:active {
  transform: translateY(0) scale(.96);
}

.team-create-plus:focus-visible {
  outline: 3px solid rgba(31, 43, 57, .22);
  outline-offset: 3px;
}

.team-create-plus:disabled {
  opacity: .45;
  cursor: not-allowed;
}




/* team_marker_unlock_result_roles_v298 */
.ranking-row.team-colored {
  border: 2px solid var(--result-team-color) !important;
}

.ranking-row.team-colored:hover {
  border-color: var(--result-team-color) !important;
  box-shadow: 0 5px 14px color-mix(
    in srgb,
    var(--result-team-color) 24%,
    rgba(24, 36, 50, .10)
  );
}

.ranking-row.team-colored.active {
  border-color: var(--result-team-color) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--result-team-color) 28%, transparent),
    0 6px 16px rgba(24, 36, 50, .14);
}

.final-detail-player-tab.team-colored {
  border: 2px solid var(--result-team-color) !important;
}

.final-detail-player-tab.team-colored:hover {
  border-color: var(--result-team-color) !important;
  box-shadow: 0 5px 14px color-mix(
    in srgb,
    var(--result-team-color) 24%,
    rgba(24, 36, 50, .10)
  );
}

.final-detail-player-tab.team-colored.active {
  border-color: var(--result-team-color) !important;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--result-team-color) 28%, transparent),
    0 6px 16px rgba(24, 36, 50, .14);
}

.ranking-player-name small,
.final-detail-player-tab > small {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}




/* auto_team_suffix_v299 */
.team-name-suffix-hint {
  display: block;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}




/* team_score_calculation_v300 */
.round-score-calculation-player span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .round-score-calculation-player {
    flex-wrap: wrap;
  }

  .round-score-calculation-player span {
    max-width: 100%;
  }
}




/* game_complete_team_consistency_v301 */
.final-team-row {
  border-left: 5px solid var(--team-color);
}

.final-team-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.final-team-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.final-team-main small {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.final-team-result {
  font-weight: 950;
  white-space: nowrap;
}

.final-detail-player-tab > b {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .final-team-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .final-team-result {
    grid-column: 2;
    justify-self: start;
  }

  .final-detail-player-tab > b {
    max-width: 120px;
  }
}



/* team_integrity_hardening_v303 */
.score-player.forfeited,
.score-team.forfeited {
  opacity: .58;
  filter: grayscale(.35);
}

.game-screen.eliminated-viewer-mode .guess-map-shell .guess-button {
  pointer-events: none;
}

.round-result-opponent-row {
  border-left: 3px solid var(--opponent-team-color, transparent);
}

.public-room-badge.duel {
  border-color: rgba(171, 63, 86, .34);
}

.team-create-modal #teamNameInput:invalid {
  border-color: #cf304e;
}


/* Mobile fix: make game mode selection modal fully tappable and scrollable */
@media (max-width: 820px) {
  .mode-select-modal,
  .game-mode-modal,
  .setup-game-mode-modal,
  .game-type-modal,
  .party-mode-modal {
    width: min(96vw, 560px) !important;
    max-height: min(92dvh, 92vh) !important;
    overflow: hidden !important;
  }

  .mode-select-modal .modal-body,
  .game-mode-modal .modal-body,
  .setup-game-mode-modal .modal-body,
  .game-type-modal .modal-body,
  .party-mode-modal .modal-body,
  .mode-select-modal .modal-content,
  .game-mode-modal .modal-content,
  .setup-game-mode-modal .modal-content,
  .game-type-modal .modal-content,
  .party-mode-modal .modal-content {
    max-height: min(92dvh, 92vh) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 20px !important;
  }

  .game-mode-grid,
  .mode-grid,
  .party-mode-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .game-mode-card,
  .mode-card,
  .party-mode-card {
    min-height: auto !important;
    padding: 20px 18px !important;
  }

  .game-mode-card h3,
  .mode-card h3,
  .party-mode-card h3 {
    font-size: 1.9rem !important;
    line-height: 1.15 !important;
    margin-bottom: 10px !important;
  }

  .game-mode-card .mode-subtitle,
  .mode-card .mode-subtitle,
  .party-mode-card .mode-subtitle {
    font-size: 1.15rem !important;
    line-height: 1.35 !important;
    margin-bottom: 10px !important;
  }

  .game-mode-card .mode-desc,
  .mode-card .mode-desc,
  .party-mode-card .mode-desc {
    font-size: 0.96rem !important;
    line-height: 1.55 !important;
    margin-bottom: 14px !important;
  }

  .game-mode-card .mode-rule,
  .mode-card .mode-rule,
  .party-mode-card .mode-rule {
    font-size: 1rem !important;
    line-height: 1.35 !important;
  }

  .game-mode-actions,
  .mode-actions,
  .party-mode-actions,
  .setup-actions {
    position: sticky !important;
    bottom: 0 !important;
    background: rgba(239, 241, 245, 0.98) !important;
    padding-top: 10px !important;
    margin-top: 10px !important;
    z-index: 2 !important;
  }

  .game-mode-actions button,
  .mode-actions button,
  .party-mode-actions button,
  .setup-actions button {
    min-height: 52px !important;
    font-size: 1.05rem !important;
  }
}


/* v314: compact, touch-safe mobile game mode modal */
@media (max-width: 760px) {
  #modeModal.modal-card {
    width: calc(100vw - 12px) !important;
    max-width: 520px !important;
    max-height: calc(100dvh - 12px) !important;
    padding: 12px !important;
    border-radius: 18px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }

  #modeModal > h2 {
    margin: 2px 0 10px !important;
    font-size: 22px !important;
    line-height: 1.15 !important;
    letter-spacing: -.02em !important;
  }

  #modeModal .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  #modeModal .mode-card {
    display: flex !important;
    min-width: 0 !important;
    min-height: 154px !important;
    height: auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    border-width: 1px !important;
    border-radius: 14px !important;
    padding: 12px 9px !important;
    text-align: center !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  #modeModal .mode-card:hover {
    transform: none !important;
  }

  #modeModal .mode-card h3 {
    margin: 0 0 6px !important;
    font-size: 18px !important;
    line-height: 1.15 !important;
  }

  #modeModal .mode-card strong {
    min-height: 30px !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  #modeModal .mode-card p {
    min-height: 0 !important;
    margin: 7px 0 !important;
    flex: 1 1 auto !important;
    font-size: 10px !important;
    line-height: 1.38 !important;
    overflow-wrap: anywhere !important;
  }

  #modeModal .mode-card small {
    display: block !important;
    margin-top: auto !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
    overflow-wrap: anywhere !important;
  }

  #modeModal .modal-actions {
    position: sticky !important;
    bottom: -1px !important;
    z-index: 3 !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 8px !important;
    margin-top: 9px !important;
    padding-top: 7px !important;
    padding-bottom: max(0px, env(safe-area-inset-bottom)) !important;
    background: linear-gradient(
      180deg,
      rgba(239, 241, 245, 0),
      rgba(239, 241, 245, .97) 28%,
      rgba(239, 241, 245, 1)
    ) !important;
  }

  #modeModal .modal-actions button {
    min-height: 42px !important;
    border-radius: 11px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    touch-action: manipulation !important;
  }

  /* Other mobile setup modals also use tighter spacing. */
  .settings-modal,
  .single-settings-modal,
  .team-create-modal,
  .join-modal,
  .public-rooms-modal {
    max-height: calc(100dvh - 12px) !important;
    border-radius: 18px !important;
  }

  .modal-title-row {
    grid-template-columns: 38px 1fr 38px !important;
    padding: 13px 14px 0 !important;
  }

  .modal-title-row h2,
  .public-rooms-heading h2 {
    font-size: 22px !important;
  }

  .settings-scroll {
    max-height: calc(100dvh - 132px) !important;
    padding: 10px 14px 6px !important;
  }

  .field-block input,
  .join-modal input,
  .public-rooms-modal input {
    min-height: 42px !important;
    font-size: 16px !important;
  }

  .setting-row {
    min-height: 58px !important;
    padding: 9px 0 !important;
  }

  .setting-row strong {
    font-size: 13px !important;
  }

  .setting-row small {
    font-size: 10px !important;
    line-height: 1.35 !important;
  }

  .settings-modal .modal-actions,
  .single-settings-modal .modal-actions,
  .team-create-modal .modal-actions,
  .join-modal .modal-actions {
    margin-top: 8px !important;
    padding: 9px 12px 12px !important;
  }

  .settings-modal .modal-actions button,
  .single-settings-modal .modal-actions button,
  .team-create-modal .modal-actions button,
  .join-modal .modal-actions button {
    min-height: 42px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 350px) {
  #modeModal .mode-card {
    min-height: 145px !important;
    padding: 10px 7px !important;
  }

  #modeModal .mode-card h3 {
    font-size: 16px !important;
  }

  #modeModal .mode-card strong,
  #modeModal .mode-card small {
    font-size: 9px !important;
  }

  #modeModal .mode-card p {
    font-size: 9px !important;
  }
}

@media (max-height: 560px) and (max-width: 900px) {
  #modeModal.modal-card {
    top: 6px !important;
    bottom: 6px !important;
    transform: translateX(-50%) !important;
    max-height: none !important;
  }

  #modeModal .mode-card {
    min-height: 130px !important;
  }

  #modeModal .mode-card p {
    margin: 4px 0 !important;
    line-height: 1.25 !important;
  }
}


/* v324 Creator Duel */
.mode-grid .creator-mode-card { grid-column: span 2; }
.creator-viewer-shield {
  position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; gap: 10px;
  padding: 28px; text-align: center; background: radial-gradient(circle at center, rgba(31,43,57,.88), rgba(12,18,27,.97)); color: #fff;
}
.creator-viewer-shield strong { font-size: clamp(24px, 4vw, 46px); }
.creator-viewer-shield span { color: #dbe4ec; font-weight: 700; }
.creator-observer-active .guess-map { outline: 3px solid rgba(255,190,65,.8); outline-offset:-3px; }
.creator-question-phase .guess-map-shell { --map-expanded-width: min(52vw, 720px); --map-expanded-height: min(56vh, 620px); }
.creator-question-phase .ring-toggle-placeholder { display:none; }
.creator-dashed-note { font-weight:800; color:#8b5d00; }
.creator-result-summary { display:grid; gap:5px; padding:11px 13px; border-radius:13px; background:#f4f7fa; border:1px solid #dce3ea; }
.creator-result-summary strong { color:#1f2b39; }
.creator-result-summary span { color:#5b6979; }
@media (max-width: 760px) {
  .mode-grid .creator-mode-card { grid-column: auto; }
}


.creator-question-phase .guess-map-shell {
  box-shadow: 0 18px 48px rgba(0,0,0,.34);
}


/* v327: Creator Duel result buttons use one unambiguous sentence. */
.ranking-row.creator-ranking-row {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  min-width: min(420px, 88vw);
}
.creator-ranking-copy,
.creator-final-tab-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.creator-ranking-copy strong,
.creator-final-tab-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.creator-ranking-copy small,
.creator-final-tab-copy small {
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.creator-ranking-result {
  font-weight: 950;
  white-space: nowrap;
}
.final-detail-player-tab.creator-final-player-tab {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  min-width: min(390px, 86vw);
}
.final-detail-player-tab.creator-final-player-tab > b {
  white-space: nowrap;
}


/* v332: Creator Duel uses the existing player list as its only status display. */
.party-scoreboard .score-player.state-empty,
.party-scoreboard .score-player.state-placed,
.party-scoreboard .score-player.state-complete {
  border: 1px solid transparent;
}


/* Round result player buttons: prevent duplicated/overlapping text. */
.round-ranking .ranking-row:not(.creator-ranking-row) {
  flex: 0 0 min(340px, 90vw);
  grid-template-columns: 24px minmax(72px, 1fr) max-content max-content;
  column-gap: 8px;
  overflow: hidden;
}

.round-ranking .ranking-row:not(.creator-ranking-row) .ranking-player-name {
  min-width: 0;
  overflow: hidden;
}

.round-ranking .ranking-row:not(.creator-ranking-row) .ranking-player-name strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-ranking .ranking-row:not(.creator-ranking-row) .rank-distance,
.round-ranking .ranking-row:not(.creator-ranking-row) .rank-score {
  min-width: max-content;
  white-space: nowrap;
}

.round-ranking .ranking-row:not(.creator-ranking-row) .rank-score {
  justify-self: end;
}

@media (max-width: 760px) {
  .round-ranking .ranking-row:not(.creator-ranking-row) {
    flex-basis: min(320px, 92vw);
    grid-template-columns: 24px minmax(0, 1fr) max-content;
  }

  .round-ranking .ranking-row:not(.creator-ranking-row) .rank-distance {
    display: none;
  }
}

/* page_resync_and_unified_settings_v300 */
.party-movement-tabs {
  margin-top: 2px;
}

.page-resync-button {
  touch-action: manipulation;
}

.result-card-head {
  padding-right: 180px;
  padding-left: 12px;
}

.result-head-actions {
  position: absolute;
  top: 6px;
  right: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.result-head-actions .round-streetview-button {
  position: static;
  top: auto;
  right: auto;
}

.final-resync-button {
  position: absolute;
  z-index: 4;
  top: 16px;
  right: 16px;
  min-height: 38px;
  border: 1px solid rgba(207,216,225,.96);
  border-radius: 12px;
  padding: 7px 13px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(246,249,251,.98), rgba(232,239,245,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.final-resync-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.final-resync-button:disabled,
.page-resync-button:disabled {
  opacity: .5;
  cursor: wait;
}

.page-resync-overlay {
  position: fixed !important;
  z-index: 2147483647 !important;
  inset: 0 !important;
  display: grid;
  place-items: center;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  padding: 20px;
  color: #fff;
  background: rgba(12, 22, 32, .58);
  backdrop-filter: blur(7px);
  pointer-events: auto;
  isolation: isolate;
}

.page-resync-card {
  min-width: min(300px, calc(100vw - 36px));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 18px 22px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  color: #fff;
  background: rgba(24,36,50,.96);
  box-shadow: 0 18px 54px rgba(0,0,0,.32);
  font-size: 16px;
  font-weight: 950;
  letter-spacing: .04em;
}

.page-resync-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 3px solid rgba(255,255,255,.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: zzmap-page-resync-spin .72s linear infinite;
}

@keyframes zzmap-page-resync-spin {
  to { transform: rotate(360deg); }
}

/* Four quick controls now exist; keep the collapsed chat above the stack. */
.party-chat.game-quick-position.collapsed {
  bottom: calc(clamp(170px, 22dvh, 250px) + 224px);
}

@media (max-width: 760px) {
  .result-card-head {
    padding: 0 122px 0 4px;
  }

  .result-head-actions {
    top: 4px;
    right: 1px;
    gap: 4px;
  }

  .result-head-actions .round-streetview-button {
    min-width: 54px;
    min-height: 34px;
    padding: 5px 8px;
    font-size: 10px;
  }

  .final-resync-button {
    top: 9px;
    right: 9px;
    min-height: 34px;
    padding: 6px 9px;
    font-size: 10px;
  }

  .party-chat.game-quick-position.collapsed {
    bottom: 337px;
  }
}



/* ===== 單人公開觀戰 ===== */
.single-public-name-field {
  margin-bottom: 4px;
}
.single-public-name-field small {
  color: var(--muted-text, #667085);
  line-height: 1.55;
}
.public-single-streams-section {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(24, 36, 50, .13);
}
.public-single-streams-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}
.public-single-streams-heading h3 {
  margin: 2px 0 0;
  font-size: 20px;
  color: #182432;
}
.public-single-streams-heading small {
  color: #667085;
  font-weight: 800;
}
.public-room-card.single-stream-card {
  border-color: rgba(45, 125, 240, .28);
  background: linear-gradient(135deg, rgba(239, 246, 255, .94), rgba(255, 255, 255, .98));
}
.public-room-card.single-stream-card.finished {
  border-color: rgba(16, 163, 111, .28);
  background: linear-gradient(135deg, rgba(236, 253, 245, .95), rgba(255, 255, 255, .98));
}
.public-room-card.single-stream-card.disconnected {
  border-color: rgba(239, 47, 54, .26);
  background: linear-gradient(135deg, rgba(255, 241, 242, .96), rgba(255, 255, 255, .98));
}
.public-room-badge.single-live {
  background: #eaf2ff;
  color: #1f65c4;
}
.public-room-badge.single-finished {
  background: #e9f9f1;
  color: #087a4e;
}
.public-room-badge.single-disconnected {
  background: #fff0f1;
  color: #c9232a;
}
.single-stream-status-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147482600;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 15, 25, .46);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.single-stream-status-overlay.hidden {
  display: none !important;
}
.single-stream-status-card {
  width: min(390px, calc(100vw - 34px));
  display: grid;
  gap: 8px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 18px;
  background: rgba(24, 36, 50, .96);
  color: #fff;
  text-align: center;
  box-shadow: 0 24px 72px rgba(0, 0, 0, .32);
}
.single-stream-status-card strong {
  font-size: 20px;
}
.single-stream-status-card span {
  color: rgba(255,255,255,.78);
  line-height: 1.55;
}
.game-screen.single-stream-viewer-mode #streetView,
.game-screen.single-stream-viewer-mode #guessMap,
.game-screen.single-stream-viewer-mode .map-toolbar,
.game-screen.single-stream-viewer-mode #streetViewQuickControls {
  pointer-events: none !important;
  user-select: none !important;
}
.game-screen.single-stream-viewer-mode .map-resize-dock,
.game-screen.single-stream-viewer-mode .map-resize-tool {
  pointer-events: auto !important;
  user-select: none !important;
  touch-action: none;
}
.game-screen.single-stream-viewer-mode #guessBtn,
.game-screen.single-stream-viewer-mode #exitGameBtn {
  pointer-events: auto;
}
.game-screen.single-stream-viewer-mode #guessBtn {
  opacity: .82;
}
.party-chat.single-stream-chat .party-chat-toggle-label::before {
  content: "";
}
@media (max-width: 720px) {
  .public-single-streams-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .single-stream-status-card {
    padding: 19px 18px;
  }
}

/* ===== Creator Duel 外部觀戰：只跟隨所選玩家 ===== */
.game-screen.creator-external-viewer-mode #streetView,
.game-screen.creator-external-viewer-mode #guessMap,
.game-screen.creator-external-viewer-mode .map-toolbar,
.game-screen.creator-external-viewer-mode #streetViewQuickControls {
  pointer-events: none !important;
  user-select: none !important;
}
.game-screen.creator-external-viewer-mode .map-resize-dock,
.game-screen.creator-external-viewer-mode .map-resize-tool {
  pointer-events: auto !important;
  user-select: none !important;
  touch-action: none;
}
.game-screen.creator-external-viewer-mode #guessBtn,
.game-screen.creator-external-viewer-mode #exitGameBtn,
.game-screen.creator-external-viewer-mode #partyScoreboard,
.game-screen.creator-external-viewer-mode #partyChat {
  pointer-events: auto;
}
.game-screen.public-viewer-mode.creator-external-viewer-mode .guess-map-shell {
  width: var(--map-collapsed-width);
  height: var(--map-collapsed-height);
  opacity: .58;
  background: rgba(220,230,231,.78);
  border-color: rgba(255,255,255,.58);
}
.game-screen.public-viewer-mode.creator-external-viewer-mode .guess-map-shell.expanded,
.game-screen.public-viewer-mode.creator-external-viewer-mode .guess-map-shell.resizing,
.game-screen.public-viewer-mode.creator-external-viewer-mode .guess-map-shell:focus-within {
  width: var(--map-expanded-width);
  height: var(--map-expanded-height);
  opacity: .98;
  background: #dce6e7;
  border-color: rgba(255,255,255,.78);
}
.score-player.creator-watch-option {
  cursor: pointer;
  position: relative;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.score-player.creator-watch-option:hover,
.score-player.creator-watch-option:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 7px 18px rgba(22, 34, 48, .18) !important;
}
.score-player.creator-watch-option.watch-selected {
  border-color: #2d7df0 !important;
  box-shadow: 0 0 0 3px rgba(45, 125, 240, .20) !important;
}
.score-player.creator-watch-option.watch-selected::after {
  content: "觀看中";
  position: absolute;
  right: 8px;
  top: -9px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: #2d7df0;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .04em;
}

/* ============================
   ZzMap MIDI 音樂播放器
   ============================ */
.party-chat {
  top: 18px;
}

.zz-music-player {
  position: fixed;
  z-index: 255;
  top: 132px;
  right: 14px;
  width: 50px;
  height: 50px;
  color: #fff;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,.24));
  transition: top .18s ease, opacity .18s ease, transform .18s ease;
}
.zz-music-player.ui-suspended {
  visibility: hidden;
  pointer-events: none;
}
/* 滑鼠從按鈕移向面板時，填住中間的空隙，避免 hover 瞬間中斷。 */
.zz-music-player::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -6px;
  right: 46px;
  width: 18px;
  height: 64px;
  background: transparent;
  pointer-events: auto;
}
.zz-music-toggle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 15px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(24,36,50,.95);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .04em;
}
.zz-music-toggle:hover,
.zz-music-toggle:focus-visible,
.zz-music-player.expanded .zz-music-toggle {
  border-color: rgba(255,255,255,.28);
  background: rgba(35,52,70,.98);
}
.zz-music-panel {
  position: absolute;
  top: 0;
  right: 56px;
  width: min(318px, calc(100vw - 84px));
  min-height: 50px;
  padding: 13px 14px 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  background: rgba(24,36,50,.97);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(12px) scale(.985);
  transform-origin: right top;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.zz-music-player:hover .zz-music-panel,
.zz-music-player:focus-within .zz-music-panel,
.zz-music-player.expanded .zz-music-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}
.zz-music-heading {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding-right: 2px;
}
.zz-music-heading span {
  color: rgba(255,255,255,.58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
}
.zz-music-heading strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zz-music-progress {
  width: 100%;
  height: 20px;
  margin: 8px 0 0;
  accent-color: #62d09b;
  cursor: pointer;
}
.zz-music-progress:disabled {
  cursor: default;
  opacity: .45;
}
.zz-music-time {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 5px;
  margin-top: -2px;
  color: rgba(255,255,255,.68);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 850;
}
.zz-music-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 7px;
  margin-top: 9px;
}
.zz-music-controls button {
  min-height: 34px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 0 8px;
  color: #fff;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.zz-music-controls button:hover:not(:disabled),
.zz-music-controls button:focus-visible:not(:disabled) {
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.14);
}
.zz-music-controls button.active,
.zz-music-controls button[aria-pressed="true"] {
  border-color: rgba(98,208,155,.65);
  background: rgba(39,139,94,.32);
  color: #d8ffed;
}
.zz-music-controls button:disabled {
  cursor: default;
  opacity: .45;
}
.zz-music-status {
  min-height: 0;
  margin-top: 7px;
  color: rgba(255,255,255,.66);
  font-size: 10px;
  line-height: 1.35;
}
.zz-music-status:empty {
  display: none;
}

@media (max-width: 820px) {
  .party-chat {
    top: 144px;
  }
  .zz-music-player {
    top: 198px;
    right: max(8px, env(safe-area-inset-right));
    width: 46px;
    height: 46px;
  }
  .zz-music-toggle {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 11px;
  }
  .zz-music-panel {
    right: 52px;
    width: min(310px, calc(100vw - 68px));
    padding: 12px;
  }
  .zz-music-controls {
    grid-template-columns: 1fr 1fr;
  }
  .zz-music-controls button:last-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zz-music-player,
  .zz-music-panel {
    transition: none;
  }
}

/* ============================
   右側浮動控制防碰撞
   矮視窗與手機橫向時，街景快捷鍵向左讓出聊天室／音樂按鈕欄。
   ============================ */
@media (max-height: 680px), (max-width: 920px) and (orientation: landscape) {
  .street-view-quick-controls {
    right: max(72px, calc(env(safe-area-inset-right) + 72px));
  }
}

@media (max-width: 520px) and (orientation: landscape) {
  .street-view-quick-controls {
    right: max(66px, calc(env(safe-area-inset-right) + 66px));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}


/* 桌面遊戲內：聊天室在上、音樂在下，整組位於街景快捷鍵上方。 */
@media (min-width: 821px) {
  .party-chat.game-quick-position.collapsed {
    bottom: calc(clamp(170px, 22dvh, 250px) + 282px) !important;
  }
}

/* ============================
   派對聊天室展開高度修正
   - 展開後隱藏重複的外層開關列
   - 縮短訊息區，內容改由內部捲動
   - 小螢幕保留音樂按鈕在聊天室下方的空間
   ============================ */
.party-chat:not(.collapsed) .party-chat-toggle {
  display: none;
}

.party-chat:not(.collapsed) .party-chat-panel {
  margin-top: 0;
  max-height: calc(100dvh - 84px);
}

.party-chat:not(.collapsed) .party-chat-heading {
  padding: 10px 11px 8px;
}

.party-chat:not(.collapsed) .party-chat-messages {
  height: min(190px, 24dvh);
  min-height: 86px;
}

.party-chat:not(.collapsed) .party-chat-form {
  padding: 8px;
}

.party-chat:not(.collapsed) .party-chat-form input {
  height: 36px;
}

@media (max-width: 820px) {
  .party-chat:not(.collapsed) .party-chat-panel {
    max-height: calc(100dvh - 206px);
  }

  .party-chat:not(.collapsed) .party-chat-messages {
    height: min(145px, 18dvh);
    min-height: 76px;
  }
}

/* ============================
   派對聊天室避開遊戲 HUD
   - 遊戲中桌面版固定從頂部 HUD 下方開始
   - 展開面板依實際安全頂距限制高度
   - 訊息區縮放，輸入列永遠保留
   ============================ */
.party-chat {
  --party-chat-safe-top: 18px;
}

.party-chat.game-quick-position {
  top: var(--party-chat-safe-top, 72px);
}

.party-chat:not(.collapsed) .party-chat-panel {
  display: flex;
  flex-direction: column;
  max-height: min(310px, calc(100dvh - var(--party-chat-safe-top, 18px) - 66px));
}

.party-chat:not(.collapsed) .party-chat-heading,
.party-chat:not(.collapsed) .party-chat-channel-tabs,
.party-chat:not(.collapsed) .party-chat-form {
  flex: 0 0 auto;
}

.party-chat:not(.collapsed) .party-chat-messages {
  flex: 1 1 auto;
  height: clamp(72px, 22dvh, 180px);
  min-height: 52px;
}

@media (max-width: 820px) {
  .party-chat {
    --party-chat-safe-top: 144px;
  }

  .party-chat:not(.collapsed) .party-chat-panel {
    max-height: min(270px, calc(100dvh - var(--party-chat-safe-top, 144px) - 58px));
  }

  .party-chat:not(.collapsed) .party-chat-messages {
    height: clamp(58px, 17dvh, 132px);
    min-height: 44px;
  }
}


/* v351: six-second animated round-result reveal. Visual design and final result data stay unchanged. */
.round-result-reveal-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}
.round-result-reveal-banner {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  width: min(520px, calc(100vw - 220px));
  min-width: 280px;
  transform: translate(-50%, -18px) scale(.97);
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 11px 18px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15,27,40,.94), rgba(31,49,67,.9));
  box-shadow: 0 18px 50px rgba(8,18,28,.28);
  backdrop-filter: blur(18px) saturate(1.18);
  opacity: 0;
  text-align: center;
  transition: opacity .42s ease, transform .62s cubic-bezier(.2,.9,.2,1);
}
.round-result-reveal-running .round-result-reveal-banner {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}
.round-result-reveal-banner.is-changing {
  animation: zz-round-reveal-banner-change .52s cubic-bezier(.2,.9,.2,1);
}
.round-result-reveal-eyebrow {
  color: #8fe6c5;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .17em;
}
.round-result-reveal-title {
  max-width: 100%;
  overflow: hidden;
  color: #fff;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 950;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.round-result-reveal-subtitle {
  max-width: 100%;
  overflow: hidden;
  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.round-result-reveal-skip {
  position: absolute;
  top: max(16px, calc(env(safe-area-inset-top) + 2px));
  left: max(16px, env(safe-area-inset-left));
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(15,27,40,.82);
  box-shadow: 0 8px 24px rgba(8,18,28,.2);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .25s ease, background .18s ease;
}
.round-result-reveal-can-skip .round-result-reveal-skip {
  opacity: .86;
  pointer-events: auto;
  transform: translateY(0);
}
.round-result-reveal-skip:hover { background: rgba(34,52,70,.96); opacity: 1; }

.round-result-reveal-running .result-map {
  filter: saturate(.76) brightness(.78) contrast(.96) blur(2px);
  transform: scale(1.025);
  transform-origin: center;
  transition: filter .95s ease, transform 1.35s cubic-bezier(.2,.8,.2,1);
}
.round-result-reveal-running.round-result-reveal-map-ready .result-map {
  filter: saturate(1) brightness(1) contrast(1) blur(0);
  transform: scale(1);
}
.round-result-reveal-running .result-card {
  opacity: 0;
  pointer-events: none;
  transform: translateY(38px) scale(.985);
  transition: opacity .62s ease, transform .84s cubic-bezier(.16,.9,.2,1);
}
.round-result-reveal-running.round-result-reveal-summary .result-card {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.round-result-reveal-running .round-result-status-hud {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .50s ease .14s, transform .70s cubic-bezier(.2,.9,.2,1) .14s;
}
.round-result-reveal-running.round-result-reveal-summary .round-result-status-hud {
  opacity: 1;
  transform: translateY(0);
}
.round-result-reveal-summary #resultScoreText {
  animation: zz-round-result-score-arrive .82s cubic-bezier(.16,1,.3,1);
}
.round-result-copy-reveal {
  animation: zz-round-result-copy-arrive .70s ease both;
}
.round-reveal-row {
  animation: zz-round-result-row-arrive .68s cubic-bezier(.16,.9,.2,1) both;
  animation-delay: calc(var(--round-reveal-index, 0) * 72ms + 130ms);
}
.round-reveal-best {
  position: relative;
  isolation: isolate;
  animation-name: zz-round-result-row-arrive, zz-round-result-best-glow;
  animation-duration: .68s, 1.8s;
  animation-delay: calc(var(--round-reveal-index, 0) * 72ms + 130ms), .56s;
  animation-timing-function: cubic-bezier(.16,.9,.2,1), ease-out;
  animation-fill-mode: both, both;
}
.round-reveal-damage {
  animation: zz-round-result-damage-arrive .92s cubic-bezier(.16,.9,.2,1) both;
}

.round-result-map-effect {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 1000;
  pointer-events: none;
  will-change: left, top;
}
.round-result-map-pulse .round-result-map-core,
.round-result-map-pulse .round-result-map-ring,
.round-result-truth-wave-ring,
.round-result-truth-wave-glow,
.round-result-route-head > span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
.round-result-map-pulse .round-result-map-core {
  width: 15px;
  height: 15px;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255,255,255,.18), 0 0 24px rgba(255,255,255,.78);
  opacity: 0;
}
.round-result-map-pulse.guess .round-result-map-core {
  width: 10px;
  height: 10px;
  background: #78e5bc;
  box-shadow: 0 0 0 4px rgba(120,229,188,.16), 0 0 20px rgba(120,229,188,.72);
}
.round-result-map-pulse.creator .round-result-map-core {
  background: #ffd36a;
  box-shadow: 0 0 0 5px rgba(255,211,106,.2), 0 0 28px rgba(255,211,106,.82);
}
.round-result-map-pulse .round-result-map-ring {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255,255,255,.9);
  opacity: 0;
}
.round-result-map-pulse.guess .round-result-map-ring { border-color: rgba(120,229,188,.9); }
.round-result-map-pulse.creator .round-result-map-ring { border-color: rgba(255,211,106,.92); }
.round-result-map-pulse.is-active .round-result-map-core {
  animation: zz-round-result-core-pop var(--round-result-core-duration, 700ms) cubic-bezier(.16,1,.3,1) both;
}
.round-result-map-pulse.is-active .round-result-map-ring {
  animation: zz-round-result-ring var(--round-result-ring-duration, 1450ms) cubic-bezier(.12,.75,.2,1) both;
  animation-delay: calc(var(--ring-index, 0) * var(--round-result-ring-stagger, 150ms));
}

.round-result-truth-wave-ring {
  width: var(--truth-wave-size, 900px);
  height: var(--truth-wave-size, 900px);
  border: 2px solid rgba(255,255,255,.76);
  box-shadow: inset 0 0 32px rgba(120,229,188,.1), 0 0 25px rgba(255,255,255,.18);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.015);
}
.round-result-truth-wave-glow {
  width: 42px;
  height: 42px;
  background: radial-gradient(circle, rgba(255,255,255,.88) 0 8%, rgba(120,229,188,.35) 22%, rgba(120,229,188,0) 72%);
  opacity: 0;
}
.round-result-truth-wave.is-active .round-result-truth-wave-ring {
  animation: zz-round-result-truth-wave var(--truth-wave-duration, 1050ms) cubic-bezier(.12,.74,.18,1) both;
}
.round-result-truth-wave.is-active .round-result-truth-wave-glow {
  animation: zz-round-result-truth-glow .86s ease-out both;
}

.round-result-route-head > span {
  width: 11px;
  height: 11px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.14), 0 0 24px rgba(120,229,188,.95);
}
.round-result-route-head.creator > span {
  background: #ffd36a;
  box-shadow: 0 0 0 4px rgba(255,211,106,.15), 0 0 24px rgba(255,211,106,.95);
}
.round-result-route-head.is-arrived > span {
  animation: zz-round-result-route-arrive .34s ease-out both;
}

@keyframes zz-round-reveal-banner-change {
  0% { opacity: .55; transform: translate(-50%, 4px) scale(.985); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes zz-round-result-score-arrive {
  0% { transform: translateY(12px) scale(.84); opacity: 0; filter: blur(5px); }
  72% { transform: translateY(-2px) scale(1.035); opacity: 1; filter: blur(0); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes zz-round-result-copy-arrive {
  0% { transform: translateY(7px); opacity: 0; filter: blur(3px); }
  100% { transform: translateY(0); opacity: 1; filter: blur(0); }
}
@keyframes zz-round-result-row-arrive {
  0% { transform: translateY(12px) scale(.97); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes zz-round-result-best-glow {
  0%, 100% { box-shadow: 0 5px 14px rgba(24,36,50,.13); }
  45% { box-shadow: 0 0 0 2px rgba(255,202,82,.76), 0 10px 28px rgba(255,190,40,.24); }
}
@keyframes zz-round-result-damage-arrive {
  0% { transform: scale(.94); opacity: 0; }
  58% { transform: scale(1.025); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes zz-round-result-core-pop {
  0% { transform: translate(-50%, -50%) scale(.25); opacity: 0; }
  55% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: .88; }
}
@keyframes zz-round-result-ring {
  0% { transform: translate(-50%, -50%) scale(.22); opacity: .9; }
  100% { transform: translate(-50%, -50%) scale(3.4); opacity: 0; }
}
@keyframes zz-round-result-truth-wave {
  0% { transform: translate(-50%, -50%) scale(.015); opacity: .88; }
  68% { opacity: .46; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
@keyframes zz-round-result-truth-glow {
  0% { transform: translate(-50%, -50%) scale(.25); opacity: 0; }
  40% { transform: translate(-50%, -50%) scale(1.35); opacity: .95; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}
@keyframes zz-round-result-route-arrive {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.8); opacity: 0; }
}

@media (max-width: 820px) {
  .round-result-reveal-banner {
    top: max(58px, calc(env(safe-area-inset-top) + 52px));
    width: min(92vw, 470px);
    min-width: 0;
    padding: 9px 12px 10px;
    border-radius: 15px;
  }
  .round-result-reveal-title { font-size: 18px; }
  .round-result-reveal-subtitle { font-size: 10px; }
  .round-result-reveal-skip {
    top: max(12px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
  }
}

@media (prefers-reduced-motion: reduce) {
  .round-result-reveal-banner,
  .round-result-reveal-skip,
  .round-result-reveal-running .result-map,
  .round-result-reveal-running .result-card,
  .round-result-reveal-running .round-result-status-hud,
  .round-reveal-row,
  .round-reveal-best,
  .round-reveal-damage,
  .round-result-copy-reveal,
  .round-result-reveal-summary #resultScoreText {
    animation: none !important;
    transition-duration: .01ms !important;
  }
  .round-result-map-effect { display: none !important; }
}

/* v352: administrative-boundary map reveal. The map carries the hierarchy; the banner only names the current level. */
.round-result-reveal-banner.admin-hit,
.round-result-reveal-banner.admin-miss,
.round-result-reveal-banner.admin-unknown {
  width: min(430px, calc(100vw - 230px));
  min-width: 250px;
  padding: 10px 16px 11px;
  border-width: 1px;
  background: linear-gradient(135deg, rgba(14,25,36,.90), rgba(25,40,54,.86));
  box-shadow: 0 14px 38px rgba(8,18,28,.24);
}
.round-result-reveal-banner.admin-hit {
  border-color: rgba(39,209,127,.78);
  box-shadow: 0 14px 38px rgba(8,18,28,.24), 0 0 28px rgba(39,209,127,.16);
}
.round-result-reveal-banner.admin-miss {
  border-color: rgba(255,79,104,.82);
  box-shadow: 0 14px 38px rgba(8,18,28,.24), 0 0 28px rgba(255,79,104,.16);
}
.round-result-reveal-banner.admin-unknown {
  border-color: rgba(240,182,79,.78);
  box-shadow: 0 14px 38px rgba(8,18,28,.24), 0 0 28px rgba(240,182,79,.14);
}
.round-result-reveal-banner.admin-hit .round-result-reveal-eyebrow { color: #62e6a5; }
.round-result-reveal-banner.admin-miss .round-result-reveal-eyebrow { color: #ff8799; }
.round-result-reveal-banner.admin-unknown .round-result-reveal-eyebrow { color: #f5c76e; }
.round-result-reveal-banner.admin-hit .round-result-reveal-subtitle { color: rgba(153,246,199,.86); }
.round-result-reveal-banner.admin-miss .round-result-reveal-subtitle { color: rgba(255,181,192,.88); }
.round-result-reveal-banner.admin-unknown .round-result-reveal-subtitle { color: rgba(255,221,154,.86); }

@media (max-width: 820px) {
  .round-result-reveal-banner.admin-hit,
  .round-result-reveal-banner.admin-miss,
  .round-result-reveal-banner.admin-unknown {
    width: min(88vw, 400px);
    min-width: 0;
    padding: 8px 11px 9px;
  }
}


/* v353: local administrative reveal. Country is text-only; camera movement begins at the answer region. */
.round-result-reveal-banner.admin-hit,
.round-result-reveal-banner.admin-miss,
.round-result-reveal-banner.admin-unknown {
  background: linear-gradient(135deg, rgba(13,24,34,.84), rgba(25,39,52,.79));
  box-shadow: 0 12px 30px rgba(8,18,28,.19);
  backdrop-filter: blur(15px) saturate(1.08);
  -webkit-backdrop-filter: blur(15px) saturate(1.08);
}
.round-result-reveal-banner.admin-hit { box-shadow: 0 12px 30px rgba(8,18,28,.19), 0 0 20px rgba(39,209,127,.10); }
.round-result-reveal-banner.admin-miss { box-shadow: 0 12px 30px rgba(8,18,28,.19), 0 0 20px rgba(255,79,104,.10); }
.round-result-reveal-banner.admin-unknown { box-shadow: 0 12px 30px rgba(8,18,28,.19), 0 0 20px rgba(240,182,79,.09); }
