:root {
  --green: #0fbf94;
  --green-dark: #079471;
  --green-deep: #05664e;
  --self: #ff4d5e;
  --self-dark: #d92638;
  --ink: #1d2a26;
  --muted: #6b7a75;
  --bg: #f4f8f6;
  --card: #fff;
  --line: #dfe8e4;
  --select: #ffd23f;
  --overseas: #6c4cf1;
  --radius: 14px;
  --sheet-h: min(62vh, 460px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
}

body.sheet-open { padding-bottom: calc(var(--sheet-h) + 16px); }

a { color: var(--green-dark); }

/* ---------- header ---------- */
.site-header {
  background: var(--green);
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 16px 16px;
}
.site-header .event { margin: 0; font-size: 12px; opacity: .9; }
.site-header h1 { margin: 2px 0 6px; font-size: 22px; letter-spacing: .04em; }
.self-line {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0; padding: 4px 12px;
  background: var(--self); border-radius: 999px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 0 var(--self-dark);
}
.self-line strong { font-size: 15px; }

main { max-width: 1100px; margin: 0 auto; padding: 12px 12px 32px; }

/* ---------- map ---------- */
.map-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  scroll-margin-top: 8px;
}
.map-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hint { font-size: 12px; color: var(--muted); margin-left: auto; }

.chip {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  min-height: 36px;
}
.chip:active { transform: translateY(1px); }
.chip-self { background: var(--self); border-color: var(--self); color: #fff; }
.chip[aria-pressed="true"] { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.chip-overseas { border-color: var(--overseas); color: var(--overseas); }
.chip-overseas[aria-pressed="true"] { background: var(--overseas); border-color: var(--overseas); color: #fff; }

.map-wrap {
  max-width: 680px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}
#map { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
body.map-zoomed #map { width: 180%; max-width: none; }
@media (min-width: 700px) {
  body.map-zoomed #map { width: 130%; }
}

/* svg background */
.zone-other { fill: #f7a3a8; opacity: .3; }
.floor { fill: var(--green); }
.island-base { fill: rgba(255,255,255,.12); }
.pillar { fill: #1d1d1d; }
.aisle-label {
  fill: rgba(255,255,255,.75); font-size: 13px; font-weight: 700;
  text-anchor: middle; writing-mode: vertical-rl; letter-spacing: .3em;
}
.compass path { fill: var(--green-deep); }
.compass text { fill: var(--green-deep); font-size: 12px; font-weight: 700; text-anchor: middle; }

/* svg cells */
.cell { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.cell-bg { stroke: rgba(255,255,255,.85); stroke-width: 1.5; transition: fill .15s, stroke .15s; }
.cell-num {
  text-anchor: middle; dominant-baseline: central;
  font-size: 22px; font-weight: 600; pointer-events: none;
  font-feature-settings: "palt";
}

.cell-empty .cell-bg { fill: transparent; stroke: rgba(255,255,255,.5); }
.cell-empty .cell-num { fill: rgba(255,255,255,.7); }

.cell-unconfirmed .cell-bg { fill: rgba(255,255,255,.18); stroke-dasharray: 4 3; }
.cell-unconfirmed .cell-num { fill: #fff; }

.cell-info .cell-bg { fill: #fff; stroke: #fff; }
.cell-info .cell-num { fill: var(--green-deep); font-weight: 800; }
.cell-dot { fill: #ff9f1c; pointer-events: none; }

.cell-overseas .cell-bg { stroke: var(--overseas); stroke-width: 3; }
.cell-overseas .cell-num { font-size: 18px; }
.cell-flag {
  text-anchor: middle; dominant-baseline: central;
  font-size: 15px; pointer-events: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

body.filter-overseas .cell:not(.cell-overseas):not(.cell-self) { opacity: .2; }
body.filter-overseas .cell-overseas .cell-bg { animation: overseas-blink 1.6s ease-in-out infinite; }
@keyframes overseas-blink {
  50% { stroke: var(--select); }
}
@media (prefers-reduced-motion: reduce) { body.filter-overseas .cell-overseas .cell-bg { animation: none; } }
body.filter-overseas .booth-list li:not(.is-overseas):not(.is-self-item) { display: none; }
body.filter-overseas #elsewhere-block:not(.has-overseas) { display: none; }

.cell-self .cell-bg { fill: var(--self); stroke: #fff; stroke-width: 2; }
.cell-self .cell-num { fill: #fff; font-weight: 800; font-size: 24px; }

@media (hover: hover) {
  .cell:hover .cell-bg { stroke: var(--select); stroke-width: 3; }
}
.cell:focus-visible .cell-bg { stroke: var(--select); stroke-width: 3; }
.cell.is-selected .cell-bg { fill: var(--select); stroke: #fff; stroke-width: 3; }
.cell.is-selected .cell-num { fill: var(--ink); }
.cell-self.is-selected .cell-bg { fill: var(--self-dark); }
.cell-self.is-selected .cell-num { fill: #fff; }

.self-marker { pointer-events: none; }
.self-frame { fill: none; stroke: var(--self-dark); stroke-width: 4; }
.self-pulse {
  fill: none; stroke: var(--self); stroke-width: 4;
  transform-box: fill-box; transform-origin: center;
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { opacity: .9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35); }
}
@media (prefers-reduced-motion: reduce) { .self-pulse { animation: none; opacity: 0; } }
.self-badge rect, .self-badge path { fill: var(--self); }
.self-badge rect { stroke: #fff; stroke-width: 2; }
.self-badge text { fill: #fff; text-anchor: middle; font-weight: 800; }
.self-badge .b1 { font-size: 18px; }
.self-badge .b2 { font-size: 13px; }

.legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  list-style: none; margin: 10px 2px 2px; padding: 0;
  font-size: 12px; color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 18px; height: 14px; border-radius: 4px; display: inline-block; border: 1.5px solid var(--green); }
.sw-self { background: var(--self); border-color: var(--self-dark); }
.sw-info { background: #fff; border-color: var(--green-dark); box-shadow: inset 0 0 0 2px var(--green); }
.sw-overseas {
  background: #fff; border: 2.5px solid var(--overseas);
  width: 24px; height: 18px; font-size: 11px; line-height: 13px; text-align: center;
}
.sw-unconfirmed { background: #8fdcc6; border-style: dashed; border-color: #fff; outline: 1px solid var(--green); }
.sw-empty { background: var(--green); }

/* ---------- list ---------- */
.list-section { margin-top: 20px; }
.list-section h2 { font-size: 17px; margin: 0 4px 4px; }
.list-section h2.sub { margin-top: 24px; }
.list-note { font-size: 11px; color: var(--muted); margin: 0 4px 10px; }

.booth-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 700px) { .booth-list { grid-template-columns: 1fr 1fr; } }

.booth-item {
  appearance: none; width: 100%; text-align: left; font: inherit; color: inherit;
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1.5px solid transparent; border-radius: 12px;
  padding: 10px 12px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  min-height: 56px;
}
.booth-item:active { background: #f0f5f3; }
.booth-item.is-selected { border-color: var(--select); background: #fffbe6; }
.booth-item.is-self { background: #fff0f1; border-color: var(--self); }

.bi-booth {
  flex: none; min-width: 64px; text-align: center;
  font-weight: 800; font-size: 13px; color: #fff;
  background: var(--green-dark); border-radius: 8px; padding: 4px 6px;
}
.is-self .bi-booth { background: var(--self); }
.bi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bi-name { font-weight: 700; font-size: 15px; line-height: 1.4; }
.bi-desc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bi-self { font-size: 11px; color: #fff; background: var(--self); padding: 1px 6px; border-radius: 4px; vertical-align: 2px; }
.bi-flag { margin-right: 4px; }
.bi-country { font-size: 11px; font-weight: 700; color: var(--overseas); }
.bi-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.bi-off { font-size: 10px; color: var(--muted); white-space: nowrap; }

.conf { font-weight: 800; font-size: 16px; }
.conf-official { color: #c98a00; }
.conf-high { color: #0a9e5c; }
.conf-medium { color: #2f7de1; }
.conf-low { color: #e08a00; }

.updated { font-size: 12px; color: var(--muted); text-align: right; margin: 18px 4px 0; }
.error { padding: 24px; text-align: center; }

/* ---------- detail sheet (mobile: bottom sheet) ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  max-height: var(--sheet-h);
  overflow-y: auto; overscroll-behavior: contain;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 24px rgba(0,0,0,.18);
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform .25s ease;
  visibility: hidden;
}
.sheet::before {
  content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px;
  margin-left: -20px; border-radius: 2px; background: #d4dcd9;
}
.sheet.is-open { transform: none; visibility: visible; }

.sheet-close {
  position: absolute; top: 10px; right: 10px;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: #eef3f1; color: var(--ink);
  font-size: 22px; line-height: 1; cursor: pointer;
}

.s-booth {
  display: inline-block; margin: 0 0 6px;
  font-weight: 800; font-size: 14px; color: #fff;
  background: var(--green-dark); padding: 2px 10px; border-radius: 6px;
}
.s-booth-self { background: var(--self); }
.s-tag { font-size: 11px; background: rgba(255,255,255,.25); padding: 0 6px; border-radius: 4px; margin-left: 4px; }
.s-name { margin: 0 44px 6px 0; font-size: 21px; line-height: 1.35; }
.s-name-muted { color: var(--muted); }
.s-self { margin: 0 0 8px; color: var(--self-dark); font-weight: 700; }
.s-desc { margin: 0 0 10px; font-size: 15px; }
.s-meta { margin: 0; font-size: 14px; color: var(--muted); }
.s-muted { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

.s-meta-list { margin: 0 0 12px; display: grid; gap: 4px; font-size: 14px; }
.s-meta-list div { display: flex; gap: 10px; }
.s-meta-list dt { flex: none; width: 4em; color: var(--muted); }
.s-meta-list dd { margin: 0; }

.s-links { display: flex; flex-wrap: wrap; gap: 8px; }
.s-links a {
  display: inline-flex; align-items: center; min-height: 42px;
  padding: 8px 14px; border-radius: 10px;
  background: var(--ink); color: #fff; text-decoration: none;
  font-size: 14px; font-weight: 700; word-break: break-all;
}
.s-links a[href*="instagram"] { background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af); }
.s-links a.s-official { background: #fff; color: var(--green-deep); border: 1.5px solid var(--green-dark); }

.s-overseas {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 6px 8px; padding: 2px 10px;
  border-radius: 999px; background: #efeaff; color: var(--overseas);
  font-size: 13px; font-weight: 700;
}
.s-flag { font-size: 16px; }

.s-sources { margin-top: 14px; font-size: 13px; }
.s-sources summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.s-sources ul { margin: 6px 0 0; padding-left: 18px; }
.s-sources li { word-break: break-all; margin-bottom: 4px; }

/* ---------- desktop: side panel ---------- */
@media (min-width: 1000px) {
  :root { --panel-w: 340px; }
  main { max-width: calc(1000px + var(--panel-w)); margin: 0; padding-right: calc(var(--panel-w) + 28px); }
  body.sheet-open { padding-bottom: 0; }
  .site-header { padding-right: calc(var(--panel-w) + 28px); }
  .sheet {
    left: auto; right: 16px; top: 16px; bottom: auto;
    width: var(--panel-w); max-height: calc(100vh - 32px);
    border-radius: var(--radius);
    box-shadow: 0 6px 24px rgba(0,0,0,.14);
    transform: translateX(calc(100% + 24px));
  }
  .sheet::before { display: none; }
}
