/* 秘め事の蜜会 案内マップ
   配置の考え方：上に検索とメニュー、中央に夜の街の地図、横（スマホでは下）に読みやすい一覧。
   配色は夜の街の一色構成（深い紫・ネイビー＋ピンクのネオン＋シアンの縁光＋暖かい窓明かり）。 */
:root {
  color-scheme: dark;
  --bg: #120a2a;
  --surface: #1c1242;
  --surface-2: #281b5a;
  --line: #43338a;
  --text: #f5efff;
  --muted: #bcb0df;
  --pink: #ff74b8;
  --cyan: #6ee7ff;
  --warm: #ffd9a0;
  --ink: #1b0b30;
  --font-body: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-display: "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --radius: 14px;
  --panel-w: 440px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h2, h3 { text-wrap: balance; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--pink); color: var(--ink); padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 8px; }

/* ---- 制作確認用の帯 ---- */
.preview-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 6px 16px; font-size: 13px; line-height: 1.5;
  background: #3a2a10; color: #ffe6b3; border-bottom: 1px solid #7a5a1c;
}
.preview-bar button { background: transparent; border: 1px solid #c79a3f; color: inherit; border-radius: 999px; padding: 3px 12px; font-size: 13px; }

/* ---- 上部 ---- */
.top {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #1f1349, #170d38);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 5;
}
.brand { font-size: 1rem; flex: none; }
.brand button { background: none; border: 0; padding: 4px 6px; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; text-align: left; }
.brand-main { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: .06em; color: #fff; text-shadow: 0 0 12px rgba(255, 116, 184, .75), 0 0 2px rgba(255, 116, 184, .9); }
.brand-sub { font-size: .72rem; color: var(--cyan); letter-spacing: .28em; }

.search { display: flex; flex: 1 1 260px; max-width: 520px; min-width: 0; gap: 0; }
.search input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  background: #0f0826; border: 1px solid var(--line); border-right: 0; border-radius: 999px 0 0 999px;
  color: var(--text);
}
.search input::placeholder { color: #9b8fc4; }
.search input:focus-visible { outline-offset: -2px; border-radius: 999px 0 0 999px; }
.search button { height: 44px; padding: 0 18px; border: 0; border-radius: 0 999px 999px 0; background: var(--pink); color: var(--ink); font-weight: 700; }

.tabs { display: flex; gap: 6px; margin-left: auto; }
.tab {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--text); font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { background: var(--surface-2); }
.tab[aria-current="true"] { border-color: var(--pink); background: rgba(255, 116, 184, .14); color: #fff; }
.tab .badge { font-size: .68rem; }

.chip-btn {
  min-height: 36px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  background: rgba(18, 10, 42, .78); border: 1px solid var(--line); color: var(--text); font-size: .86rem;
}
.chip-btn:hover { border-color: var(--cyan); }
.chip-btn[aria-pressed="true"] { border-color: var(--cyan); color: var(--cyan); }

/* ---- 本体 ---- */
main { flex: 1; min-height: 0; display: flex; position: relative; }
.map { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; background: #140b33; }
.map canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }

.map-label {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  max-width: 11.5em; padding: 5px 12px 6px; text-align: center; line-height: 1.3;
  background: rgba(20, 11, 51, .86); color: #fff;
  border: 1.5px solid var(--c, var(--pink)); border-radius: 12px;
  box-shadow: 0 0 14px -2px var(--c, var(--pink));
  font-weight: 700; font-size: .9rem;
  will-change: transform;
}
.map-label::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg); background: rgba(20, 11, 51, .86); border-right: 1.5px solid var(--c, var(--pink)); border-bottom: 1.5px solid var(--c, var(--pink)); }
.map-label-count { font-size: .7rem; font-weight: 500; color: var(--muted); }
.map-label.is-lite { font-size: .78rem; padding: 3px 9px 4px; }
.map-label:hover, .map-label.is-selected { background: var(--c, var(--pink)); color: var(--ink); }
.map-label:hover::after, .map-label.is-selected::after { background: var(--c, var(--pink)); }
.map-label:hover .map-label-count, .map-label.is-selected .map-label-count { color: var(--ink); }
.map-label.is-spot { pointer-events: none; border-style: dashed; border-color: #bfd4ff; box-shadow: none; font-size: .74rem; font-weight: 600; padding: 3px 8px 4px; }
.map-label.is-spot::after { border-color: #bfd4ff; border-style: dashed; }

.map-tools { position: absolute; left: 16px; top: 12px; display: flex; gap: 8px; z-index: 2; }
.map-hint {
  z-index: 2;
  position: absolute; left: 16px; bottom: 14px; max-width: min(30em, calc(100% - 150px));
  font-size: .8rem; line-height: 1.55; color: var(--muted);
  background: rgba(18, 10, 42, .72); padding: 6px 12px; border-radius: 10px;
}
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }
.map-fallback p { max-width: 26em; }

.himitsu-fab {
  position: absolute; right: 14px; bottom: 10px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  background: none; border: 0; padding: 4px;
}
.himitsu-fab img { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .55)); }
.himitsu-fab span {
  background: var(--pink); color: var(--ink); font-weight: 700; font-size: .8rem;
  padding: 3px 12px; border-radius: 999px; margin-top: -6px; white-space: nowrap;
}
.himitsu-fab:hover img { transform: translateY(-3px); }
.himitsu-fab img { transition: transform .2s; }

/* ---- 案内パネル ---- */
.panel {
  flex: none; width: var(--panel-w); max-width: 100%;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-left: 1px solid var(--line);
}
.panel:focus { outline: none; }
.panel-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.panel-head h2 { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 1.08rem; line-height: 1.4; }
.panel-head h2:focus { outline: none; }
.ghost-btn { flex: none; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; font-size: .84rem; white-space: nowrap; }
.ghost-btn:hover { border-color: var(--cyan); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 28px; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
body.panel-full .panel { width: min(600px, 46vw); }

.sec-title { font-size: .95rem; color: var(--cyan); font-weight: 700; letter-spacing: .04em; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.count { font-size: .8rem; color: var(--muted); font-weight: 500; }
.note { font-size: .8rem; color: var(--muted); line-height: 1.6; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--warm); color: var(--warm); white-space: nowrap; vertical-align: middle; }
.badge.kind { border-color: var(--cyan); color: var(--cyan); }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 700; font-size: .92rem; line-height: 1.35; text-align: center;
}
.btn:hover { border-color: var(--cyan); }
.btn-go { background: var(--pink); color: var(--ink); border-color: var(--pink); }
.btn-go:hover { background: #ff93c8; border-color: #ff93c8; }
.btn-go .sub { display: block; font-size: .72rem; font-weight: 500; }
.btn-col { flex-direction: column; gap: 0; }
.btn-wide { width: 100%; }
.ext { font-size: .85em; }

/* 一覧の行 */
.items { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item.is-hit { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(110, 231, 255, .3); }
.item-row { display: flex; align-items: stretch; gap: 0; }
.item-toggle {
  flex: 1; min-width: 0; min-height: 52px; padding: 10px 12px; text-align: left; background: none; border: 0;
  display: flex; align-items: center; gap: 8px; font-weight: 700; line-height: 1.45;
}
.item-toggle .caret { flex: none; width: .7em; color: var(--muted); transition: transform .15s; }
.item-toggle[aria-expanded="true"] .caret { transform: rotate(90deg); }
.item-name { flex: 1; min-width: 0; }
.item-open {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 76px; padding: 0 12px;
  background: var(--pink); color: var(--ink); font-weight: 700; font-size: .86rem; text-decoration: none;
}
.item-open:hover { background: #ff93c8; }
.item-body { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--line); }
.desc { white-space: pre-line; font-size: .92rem; max-width: 34em; }
.children { margin: 0 8px 10px 26px; display: flex; flex-direction: column; gap: 6px; }
.children .item { background: #21154c; }
.children-title { margin: 0 8px 0 26px; font-size: .76rem; color: var(--muted); }

/* カード（検索結果・ナビの行き先） */
.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.card h3, .card h4 { font-size: 1rem; line-height: 1.45; }
.card .meta { font-size: .78rem; color: var(--muted); }

/* 施設の案内 */
.facility { border: 1px solid var(--pink); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, rgba(255, 116, 184, .1), rgba(255, 116, 184, .02)); }
.facility h3 { font-size: 1.02rem; }
.facility .tag { font-size: .8rem; color: var(--warm); font-weight: 700; }
.facility .lead { font-size: .9rem; white-space: pre-line; max-width: 34em; }
.facility .row .btn { flex: 1 1 8.5em; }
details.guide { border-top: 1px dashed var(--line); padding-top: 8px; }
details.guide summary { cursor: pointer; font-size: .86rem; color: var(--cyan); font-weight: 700; min-height: 32px; display: flex; align-items: center; }
details.guide dl { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
details.guide dt { font-size: .78rem; color: var(--warm); font-weight: 700; }
details.guide dd { font-size: .88rem; max-width: 34em; }

/* ひみつちゃんの吹き出し */
.guide-say { display: flex; align-items: flex-end; gap: 10px; }
.guide-say .pic { position: relative; flex: none; width: 104px; height: 104px; }
.guide-say .pic img { width: 100%; height: 100%; object-fit: contain; }
.bubble { position: relative; flex: 1; min-width: 0; background: #fff; color: #2a1746; border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-weight: 700; line-height: 1.6; margin-bottom: 14px; }
.bubble .who { display: block; font-size: .72rem; color: #a03a76; font-weight: 700; }
.bubble .badge { border-color: #a0671c; color: #8a5510; margin-left: 6px; }
.bubble .n { font-variant-numeric: tabular-nums; }
.fx { position: absolute; font-size: 1rem; opacity: 0; animation: fx 1.6s ease-out forwards; pointer-events: none; }
@keyframes fx { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-34px) scale(1.2); } }
.pop { animation: pop .28s ease-out; }
@keyframes pop { from { transform: translateY(6px); } to { transform: none; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: .88rem; }
.chip:hover { border-color: var(--pink); }

.alert { border-left: 4px solid var(--warm); background: rgba(255, 217, 160, .08); padding: 10px 12px; border-radius: 0 10px 10px 0; font-size: .88rem; }

/* ナビ・診断 */
.question { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.5; font-weight: 800; white-space: pre-line; text-wrap: balance; }
.step { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  min-height: 56px; padding: 10px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2);
  font-weight: 700; font-size: 1rem; text-align: left; line-height: 1.5;
}
.opt:hover { border-color: var(--pink); background: #32226e; }
.opt.yes { border-color: var(--pink); }
.opt .hint { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.lead-quote { border-left: 4px solid var(--pink); padding: 4px 0 4px 12px; white-space: pre-line; font-size: .95rem; max-width: 34em; }
.lead-quote .src { display: block; font-size: .72rem; color: var(--muted); margin-top: 4px; }
.result-symbol {
  font-family: var(--font-display); font-weight: 900; line-height: 1.1; font-size: clamp(2.6rem, 9vw, 4.2rem); color: #fff;
  text-shadow: 0 0 18px rgba(255, 116, 184, .9), 0 0 4px rgba(255, 116, 184, 1);
}
.result-symbol.is-word { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.result-name { font-size: 1.25rem; font-weight: 800; }
.result-text { white-space: pre-line; font-size: 1.05rem; font-weight: 700; }
.result-card-img { display: block; width: 100%; height: auto; margin-top: 8px; border-radius: 12px; border: 1px solid var(--line); }
.type-card { background: var(--surface-2); border: 1px solid var(--pink); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.type-degree { font-weight: 700; font-size: .95rem; }
.type-degree .stars { letter-spacing: .08em; color: var(--warm); }
.type-catch { font-size: 1.12rem; line-height: 1.65; max-width: 30em; }
.type-catch em { font-style: normal; font-weight: 800; color: #ff8fa3; text-decoration: underline; text-underline-offset: 4px; }
.type-head { font-size: .88rem; color: var(--cyan); margin-top: 6px; }
.type-features { display: flex; flex-direction: column; gap: 4px; font-size: .95rem; }
.type-features li { padding-left: 1.2em; position: relative; }
.type-features li::before { content: "●"; position: absolute; left: 0; color: var(--pink); font-size: .7em; top: .35em; }
.type-compat { font-weight: 700; }
.center { text-align: center; align-items: center; }
.credits { font-size: .78rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }

.noscript { padding: 24px; text-align: center; }

/* ---- スマホ・狭い画面 ---- */
@media (max-width: 820px) {
  body { font-size: 15.5px; }
  .top { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .brand { order: 1; }
  #motionBtn { order: 2; margin-left: auto; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; gap: 0;
    background: #170d38; border-top: 1px solid var(--line);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .tab { flex: 1; justify-content: center; min-height: 52px; padding: 0 4px; border-radius: 12px; font-size: .86rem; flex-direction: column; gap: 0; }
  main { flex-direction: column; padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  .panel { width: 100%; border-left: 0; border-top: 1px solid var(--line); height: 62%; flex: none; }
  body.panel-full .panel { width: 100%; height: auto; flex: 1; }
  body.panel-full .map { display: none; }
  .map-hint { display: none; }
  body:not(.panel-open) .map-hint { display: block; max-width: calc(100% - 140px); bottom: 10px; }
  .himitsu-fab img { width: 76px; height: 76px; }
  .map-label { font-size: .76rem; max-width: 9em; padding: 3px 8px 4px; border-radius: 10px; }
  .map-label.is-lite, .map-label.is-spot { font-size: .68rem; max-width: 8.5em; padding: 2px 7px 3px; }
  .map-label .map-label-count { font-size: .64rem; }
  .map-label.is-lite .map-label-count { display: none; }
  .preview-bar { font-size: 12px; padding: 4px 12px; }
  body.panel-open .himitsu-fab { display: none; }
  .panel-head { padding: 8px 10px; }
  .ghost-btn { padding: 0 9px; font-size: .8rem; }
  .panel-body { padding: 14px 12px 24px; }
}
@media (max-width: 400px) {
  .item-open { min-width: 64px; padding: 0 8px; }
  .guide-say .pic { width: 84px; height: 84px; }
}

/* ---- 演出を減らす ---- */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; }
body.reduce-motion .fx { display: none; }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
