@font-face {
  font-family: 'Changa One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/changa-one-map.ttf') format('truetype');
}

/* SUNTWILL 勝手にグルメマップ — 3D night map */

:root {
  --font-ja: "Hiragino Kaku Gothic Pro", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-en: "Century Gothic Pro", "Century Gothic", sans-serif;
  /* Latin in Century Gothic, kana/kanji falling back to Hiragino */
  --font-mix: "Century Gothic Pro", "Century Gothic", "Hiragino Kaku Gothic Pro", "Hiragino Kaku Gothic ProN", sans-serif;

  --navy-950: #050916;
  --navy-900: #070d1f;
  --navy-800: #0d1428;
  --panel: rgba(12, 17, 33, 0.88);
  --panel-strong: rgba(12, 17, 33, 0.96);
  --line: rgba(214, 224, 255, 0.14);
  --line-strong: rgba(214, 224, 255, 0.28);
  --text: #f5f7ff;
  --text-dim: #b7c0da;
  --text-faint: #8f99b8;
  --peach: #ffb38a;
  --orange: #ff8a3d;
  --mint: #5fe3b8;

  --c-late: #ff7a6b;
  --c-ramen: #f5c04a;
  --c-lunch: #5fe3b8;
  --c-takeout: #b49cff;
  --c-standing: #5aa9ff;
  --c-staff: #e58bb4;

  --radius: 14px;
  --edge: 16px;
  --side-w: 340px;
  --detail-w: 380px;
  --footer-h: 78px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--navy-950);
  color: var(--text);
  font-family: var(--font-ja);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overscroll-behavior: none;
}

[hidden] {
  display: none !important;
}

button,
a {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--peach);
  outline-offset: 2px;
}

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

/* ---------- App & map ---------- */

.gn-app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 70% 10%, #10204a 0%, transparent 60%),
    var(--navy-950);
}

.gn-map {
  position: absolute;
  inset: 0;
  background: var(--navy-900);
}

.gn-map:focus-visible,
.gn-map .maplibregl-canvas:focus-visible {
  outline: 2px solid var(--peach);
  outline-offset: -4px;
}

.gn-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
}

/* Map loading / error status */
.gn-map-status {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: calc(50% + (var(--side-w) + var(--edge)) / 2);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(360px, calc(100% - 32px));
  padding: 20px 22px;
  text-align: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.gn-map-status[data-state="error"] {
  border-color: rgba(255, 179, 138, 0.45);
}

.gn-map-status[data-state="error"] .gn-spinner {
  display: none;
}

.gn-map-status-text {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.gn-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--peach);
  animation: gn-spin 0.9s linear infinite;
}

@keyframes gn-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Buttons ---------- */

.gn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background-color 0.2s, border-color 0.2s;
}

.gn-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.gn-btn-primary {
  color: #1b0f08;
  background: var(--peach);
  border-color: var(--peach);
}

.gn-btn-primary:hover {
  background: #ffc6a6;
}

/* ---------- Left column (desktop) ---------- */

.gn-side {
  position: absolute;
  z-index: 3;
  top: var(--edge);
  left: var(--edge);
  bottom: var(--edge);
  width: var(--side-w);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.gn-side > * {
  pointer-events: auto;
}

.gn-footer {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: calc(var(--footer-h) + env(safe-area-inset-bottom, 0px));
  padding: 10px 24px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #e96836;
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.gn-brand { display: flex; align-items: center; gap: 24px; min-width: 0; }
.gn-eyebrow { margin: 0; font: 400 20px/1 'Changa One', sans-serif; letter-spacing: 0.04em; }
.gn-title { margin: 0; font-weight: 700; }
.gn-heading-en { display: block; font: 400 32px/0.95 'Changa One', sans-serif; letter-spacing: -0.025em; white-space: nowrap; }
.gn-heading-ja { display: block; margin-top: 5px; font-size: 12px; line-height: 1.4; letter-spacing: 0.07em; }
.gn-sub { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 11px; line-height: 1.5; letter-spacing: 0.08em; white-space: nowrap; }
.gn-footer-mode { display: inline-flex; align-items: center; padding: 1px 6px; border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 4px; font: 400 12px/1.3 'Changa One', sans-serif; letter-spacing: 0.02em; }
.gn-footer-aside { flex: none; }

.gn-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1b0f08;
  background: linear-gradient(90deg, var(--peach), var(--orange));
  border-radius: 999px;
}

.gn-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s;
}

.gn-footer-link:hover { background: rgba(255, 255, 255, 0.14); border-color: #fff; }
.gn-footer-link:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- Category chips ---------- */

.gn-filters {
  flex: none;
}

.gn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gn-chip {
  --accent: var(--peach);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: color 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.gn-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.gn-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.gn-chip[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
  background: color-mix(in srgb, var(--accent) 20%, rgba(12, 17, 33, 0.92));
  box-shadow: 0 0 0 1px var(--accent) inset, 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
}

.gn-chip-all {
  --accent: #ffffff;
}

.gn-chip-all::before {
  display: none;
}

.gn-cat-late { --accent: var(--c-late); }
.gn-cat-ramen { --accent: var(--c-ramen); }
.gn-cat-lunch { --accent: var(--c-lunch); }
.gn-cat-takeout { --accent: var(--c-takeout); }
.gn-cat-standing { --accent: var(--c-standing); }

.gn-chip-count {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
}

.gn-chip-count:empty {
  display: none;
}

.gn-chip[aria-pressed="true"] .gn-chip-count {
  color: var(--text);
}

/* ---------- Venue list ---------- */

.gn-list {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gn-list:focus {
  outline: none;
}

.gn-list-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px 4px;
}

.gn-list-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.gn-count {
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--peach);
  text-shadow: 0 0 18px rgba(255, 138, 61, 0.45);
}

.gn-count-unit {
  font-size: 14px;
}

.gn-count-total {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
}

.gn-list-toggle {
  display: none;
}

.gn-note {
  flex: none;
  margin: 0;
  padding: 0 16px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
}

.gn-list-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.gn-list-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}

.gn-list-state-text {
  margin: 0;
  font-size: 16px;
  color: var(--text-dim);
}

.gn-list-state[data-state="error"] .gn-list-state-text {
  color: var(--text);
}

.gn-list-state[data-state="error"] {
  border-left: 3px solid var(--peach);
}

.gn-venues {
  margin: 0;
  padding: 6px;
  list-style: none;
}

.gn-venue {
  --accent: var(--peach);
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px 10px 10px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background-color 0.15s, border-color 0.15s;
}

.gn-venue:hover {
  background: rgba(255, 255, 255, 0.05);
}

.gn-venue.is-selected {
  background: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.gn-venue-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
}

.gn-venue-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.gn-venue-dot.is-muted {
  opacity: 0.25;
  box-shadow: none;
}

.gn-venue-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gn-venue-name {
  overflow: hidden;
  font-family: var(--font-mix);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gn-venue-meta {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-faint);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- Detail panel ---------- */

.gn-detail {
  --accent: var(--peach);
  position: absolute;
  z-index: 5;
  top: var(--edge);
  right: var(--edge);
  width: var(--detail-w);
  max-height: calc(100% - var(--edge) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel-strong);
  border-color: var(--line-strong);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  animation: gn-panel-in 0.28s ease-out;
}

@keyframes gn-panel-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

.gn-detail-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(5, 9, 22, 0.72);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.gn-detail-close::before,
.gn-detail-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.gn-detail-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.gn-detail-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.gn-detail-close:hover {
  border-color: var(--peach);
}

.gn-media {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--navy-800);
}

.gn-media-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gn-media-photo {
  aspect-ratio: 15 / 16;
}

.gn-photo-unavailable {
  height: 100%;
  aspect-ratio: auto;
}

.gn-photo-thumbnails {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  background: var(--panel-strong);
  border-top: 1px solid var(--line-strong);
  scrollbar-width: thin;
}

.gn-photo-thumbnail {
  flex: 0 0 52px;
  height: 64px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--navy-800);
  opacity: .65;
}

.gn-photo-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gn-photo-thumbnail[aria-pressed="true"] {
  border-color: var(--accent);
  opacity: 1;
}

.gn-photo-thumbnail:hover,
.gn-photo-thumbnail:focus-visible {
  opacity: 1;
  outline: 2px solid var(--peach);
  outline-offset: 2px;
}

.gn-media-photo figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 16px 10px;
  font-size: 12px;
  color: var(--text);
  background: linear-gradient(transparent, rgba(5, 9, 22, 0.85));
}

.gn-media-empty {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 18px 18px 16px;
  background:
    radial-gradient(80% 90% at 85% 15%, color-mix(in srgb, var(--accent) 38%, transparent) 0%, transparent 70%),
    radial-gradient(60% 60% at 10% 100%, rgba(90, 120, 255, 0.18) 0%, transparent 70%),
    linear-gradient(160deg, #111a36, #080e22);
  border-bottom: 1px solid var(--line);
}

.gn-media-en {
  font-family: var(--font-en);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 55%, transparent);
}

.gn-media-ja {
  overflow: hidden;
  font-family: var(--font-mix);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
}

.gn-media-note {
  font-size: 12px;
  color: var(--text-faint);
}

.gn-detail-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 20px;
}

.gn-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gn-tag {
  --accent: var(--peach);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 999px;
}

.gn-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.gn-detail-name {
  margin: 0;
  font-family: var(--font-mix);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.gn-detail-name:focus {
  outline: none;
}

.gn-detail-name:focus-visible {
  outline: 2px solid var(--peach);
  outline-offset: 4px;
}

.gn-detail-area {
  margin: -8px 0 0;
  font-size: 14px;
  color: var(--text-dim);
}

.gn-detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gn-detail-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.gn-detail-address,
.gn-detail-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.gn-detail-desc {
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  color: var(--text);
}

.gn-detail-neighbours {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gn-neighbour {
  --accent: var(--peach);
  min-height: 36px;
  padding: 0 12px;
  font-family: var(--font-mix);
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}

.gn-neighbour:hover {
  background: rgba(255, 255, 255, 0.1);
}

.gn-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background-color 0.2s, border-color 0.2s;
}

.gn-link::after {
  content: "↗";
  font-family: var(--font-en);
  font-size: 14px;
  color: var(--peach);
}

.gn-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.gn-link-primary {
  border-color: var(--peach);
  background: rgba(255, 179, 138, 0.12);
}

.gn-detail-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-faint);
}

.gn-detail-post {
  align-self: flex-start;
  font-size: 14px;
  color: var(--mint);
  text-decoration: none;
  border-bottom: 1px solid rgba(95, 227, 184, 0.45);
}

.gn-detail-post:hover {
  border-bottom-color: var(--mint);
}

/* ---------- Map tools ---------- */

.gn-tools {
  position: absolute;
  z-index: 4;
  top: var(--edge);
  right: var(--edge);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: right 0.28s ease-out;
}

.has-detail .gn-tools {
  right: calc(var(--detail-w) + var(--edge) * 2);
}

.gn-tool-group {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.gn-tool {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  transition: background-color 0.15s, color 0.15s;
}

.gn-tool + .gn-tool {
  border-top: 1px solid var(--line);
}

.gn-tool:hover {
  background: rgba(255, 255, 255, 0.08);
}

.gn-tool:focus-visible {
  outline-offset: -3px;
}

.gn-tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gn-tool-text {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.gn-tool-text[aria-pressed="true"] {
  color: #1b0f08;
  background: var(--peach);
}

.gn-compass-needle {
  position: relative;
  width: 8px;
  height: 24px;
}

.gn-compass-needle::before,
.gn-compass-needle::after {
  content: "";
  position: absolute;
  left: 0;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.gn-compass-needle::before {
  top: 0;
  border-bottom: 12px solid var(--orange);
}

.gn-compass-needle::after {
  bottom: 0;
  border-top: 12px solid rgba(255, 255, 255, 0.55);
}

/* ---------- Toast ---------- */

.gn-toast {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: calc(44px + var(--bottom-ui, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 8px 8px 8px 16px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 179, 138, 0.45);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.gn-toast-text {
  margin: 0;
  font-size: 14px;
}

.gn-toast .gn-btn {
  min-height: 34px;
  flex: none;
}

.gn-toast-close {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--text-dim);
  background: transparent;
  border: 0;
  border-radius: 50%;
}

/* ---------- Map markers ---------- */

.gn-marker,
.gn-suntwill,
.gn-station {
  width: 0;
  height: 0;
}

.gn-marker {
  --accent: var(--peach);
  z-index: 2;
}

.gn-marker.is-selected {
  z-index: 4;
}

.gn-marker:hover,
.gn-marker:focus-within {
  z-index: 5;
}

.gn-mdot {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(5, 9, 22, 0.9), 0 0 14px 3px var(--accent);
  pointer-events: none;
}

.gn-marker.is-selected .gn-mdot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: gn-ping 1.6s ease-out 3;
}

@keyframes gn-ping {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.1); opacity: 0; }
}

.gn-mlabels {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: max-content;
}

.gn-marker.is-right .gn-mlabels { top: 0; left: 12px; transform: translateY(-50%); }
.gn-marker.is-left .gn-mlabels { top: 0; right: 12px; align-items: flex-end; transform: translateY(-50%); }
.gn-marker.is-bottom .gn-mlabels { top: 12px; left: 0; align-items: center; transform: translateX(-50%); }
.gn-marker.is-top .gn-mlabels { bottom: 12px; left: 0; align-items: center; transform: translateX(-50%); }

.gn-mlabel {
  --accent: var(--peach);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 210px;
  min-height: 30px;
  padding: 4px 11px 4px 9px;
  font-family: var(--font-mix);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  background: rgba(9, 13, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.gn-mlabel::before {
  content: "";
  flex: none;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.gn-mlabel-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gn-mlabel:hover {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
}

.gn-mlabel.is-selected {
  background: color-mix(in srgb, var(--accent) 22%, rgba(9, 13, 28, 0.95));
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 20px color-mix(in srgb, var(--accent) 45%, transparent);
}

.gn-map.is-far .gn-mlabels {
  visibility: hidden;
}

/* SUNTWILL anchor */
.gn-suntwill {
  z-index: 3;
}

.gn-suntwill-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 2px solid var(--peach);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 179, 138, 0.7), inset 0 0 10px rgba(255, 179, 138, 0.4);
  pointer-events: none;
}

.gn-suntwill-btn {
  position: absolute;
  left: 0;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 10px;
}

.gn-suntwill-btn::after {
  content: "";
  width: 2px;
  height: 8px;
  background: linear-gradient(var(--peach), transparent);
}

.gn-suntwill-btn img {
  display: block;
  width: 46px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(255, 179, 138, 0.55)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease-out;
}

.gn-suntwill-btn:hover img {
  transform: translateY(-2px);
}

.gn-suntwill-name {
  padding: 2px 9px;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #1b0f08;
  background: linear-gradient(90deg, var(--peach), var(--orange));
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(255, 138, 61, 0.55);
}

/* Stations (reference only) */
.gn-station {
  z-index: 1;
  pointer-events: none;
}

.gn-station-mark {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--navy-900);
  border: 2px solid #ffffff;
  border-radius: 2px;
}

.gn-station-name {
  position: absolute;
  top: 8px;
  left: 0;
  transform: translateX(-50%);
  padding: 2px 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: #e9edff;
  background: rgba(28, 36, 68, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
}

/* ---------- MapLibre attribution (dark) ---------- */

.gn-map .maplibregl-ctrl-bottom-right,
.gn-map .maplibregl-ctrl-bottom-left {
  z-index: 3;
}

.gn-map .maplibregl-ctrl-attrib:not(.maplibregl-compact) {
  margin: 0;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(7, 12, 28, 0.78);
  border-top-left-radius: 8px;
}

.gn-map .maplibregl-ctrl-attrib a {
  color: #dbe2fa;
}

.gn-map .maplibregl-ctrl-attrib.maplibregl-compact {
  margin: 8px;
  color: #10162c;
}

.gn-map .maplibregl-ctrl-attrib.maplibregl-compact-show {
  font-size: 12px;
}

/* ---------- Narrow desktop / tablet ---------- */

@media (max-width: 1100px) and (min-width: 761px) {
  :root {
    --side-w: 300px;
    --detail-w: 340px;
  }

  .gn-heading-en { font-size: 37px; }
}

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
  :root {
    --edge: 10px;
    --footer-h: 96px;
  }

  .gn-side {
    display: contents;
  }

  .gn-footer { gap: 12px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .gn-brand { display: block; }
  .gn-eyebrow { margin-bottom: 4px; font-size: 12px; }
  .gn-heading-en { font-size: 24px; }
  .gn-heading-ja { margin-top: 3px; font-size: 11px; }
  .gn-sub { margin-top: 4px; font-size: 9px; gap: 8px; }
  .gn-footer-mode { font-size: 10px; padding: 0 5px; }

  .gn-badge {
    height: 22px;
    padding: 0 8px;
  }

  .gn-filters {
    position: absolute;
    z-index: 4;
    top: calc(var(--safe-top) + var(--edge));
    left: 0;
    right: 0;
  }

  .gn-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px var(--edge) 6px;
    scrollbar-width: none;
    scroll-padding-inline: var(--edge);
  }

  .gn-chips::-webkit-scrollbar {
    display: none;
  }

  .gn-chip {
    flex: none;
  }

  .gn-list {
    position: absolute;
    z-index: 4;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: calc(100% - var(--safe-top) - 150px);
    padding-bottom: var(--safe-bottom);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }

  .gn-list-head {
    padding: 10px 14px 2px;
  }

  .gn-count {
    font-size: 24px;
  }

  .gn-list-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
  }

  .gn-note {
    padding: 0 14px 8px;
  }

  .gn-list:not(.is-expanded) .gn-note {
    border-bottom: 0;
  }

  .gn-list:not(.is-expanded) .gn-list-body {
    display: none;
  }

  .gn-list.is-expanded .gn-list-body {
    max-height: 42dvh;
  }

  .gn-detail {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: min(68dvh, calc(100% - var(--safe-top) - 130px));
    padding-bottom: var(--safe-bottom);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    animation-name: gn-sheet-in;
  }

  @keyframes gn-sheet-in {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
  }

  .gn-media {
    aspect-ratio: 21 / 9;
    border-radius: 18px 18px 0 0;
  }

  .gn-media-photo {
    /* 70% of the former width * 16/15 height. Leave the name visible on short screens. */
    width: 100%;
    aspect-ratio: 75 / 56;
    max-height: calc(min(68dvh, calc(100dvh - var(--footer-h) - env(safe-area-inset-bottom, 0px) - var(--safe-top) - 130px)) - 170px);
  }

  .gn-media-en {
    font-size: 24px;
  }

  .gn-detail-name {
    font-size: 21px;
  }

  .gn-tools {
    top: calc(var(--safe-top) + var(--edge) + 60px);
    right: var(--edge);
  }

  .has-detail .gn-tools {
    right: var(--edge);
    visibility: hidden;
  }

  .gn-tool-zoom,
  .gn-tool-rotate .gn-tool:not(.gn-compass) {
    display: none;
  }

  .gn-tool-rotate .gn-compass {
    border-top: 0;
  }

  .gn-tool {
    width: 40px;
    height: 40px;
  }

  .gn-map-status {
    left: 50%;
  }

  /* Keep MapLibre attribution visible above the bottom drawer / sheet */
  .gn-map .maplibregl-ctrl-bottom-right,
  .gn-map .maplibregl-ctrl-bottom-left {
    bottom: var(--bottom-ui, 0px);
    transition: bottom 0.2s ease-out;
  }

  .gn-toast {
    bottom: calc(var(--bottom-ui, 0px) + 48px);
    border-radius: 14px;
  }

  .gn-mlabel {
    max-width: 170px;
  }
}

/* ---------- Motion & visibility ---------- */

.is-page-hidden *,
.is-page-hidden *::before,
.is-page-hidden *::after {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .gn-spinner {
    border-top-color: var(--peach);
    border-right-color: var(--peach);
  }
}

/* Keep attribution readable against the night palette on mobile and desktop. */
.gn-map .maplibregl-ctrl-attrib{background:rgba(7,13,31,.92);color:#c8d1ed}.gn-map .maplibregl-ctrl-attrib a{color:#dce4fa}.gn-map .maplibregl-ctrl-attrib-button{background-color:transparent;filter:invert(1)}

/* Reserve the footer outside the map and its drawers, including iPhone safe area. */
.gn-app { bottom: calc(var(--footer-h) + env(safe-area-inset-bottom, 0px)); --safe-bottom: 0px; }

.gn-cat-staff { --accent: var(--c-staff); }
