/* カラオケ料金マップ — スマホ縦画面前提のレイアウト -----------------------
   落ち着いた実用系の配色。装飾より情報の読み取りやすさを優先する。
--------------------------------------------------------------------------*/

:root {
  --bg: #f3f2ee;
  --panel: #ffffff;
  --border: #ddd9d0;
  --border-strong: #c7c2b6;
  --text: #201d18;
  --text-muted: #6f6a5f;
  --text-faint: #9a958a;
  --accent: #c1441f;
  --accent-soft: #fbe9e2;
  --ink: #1c1a16;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(30, 26, 18, 0.14);
  --shadow-md: 0 6px 20px rgba(30, 26, 18, 0.18);
  --topbar-h: 48px;
  --filters-h: 50px;
  --bottom-bar-h: 50px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic Medium", "Meiryo", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* 画面全体を縦に積む。ビューポート単位は iOS のアドレスバー対策で dvh を使う */
.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-top: env(safe-area-inset-top);
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  flex: none;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  background: var(--ink);
  color: #f4f1ea;
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.icon-btn-text {
  width: auto;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ----------------------------------------------------------------- filters */

.filters {
  flex: none;
  height: var(--filters-h);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.filter-scroll {
  display: flex;
  gap: 8px;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  width: 100%;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  background: var(--panel);
  white-space: nowrap;
  color: var(--text);
}

.chip::after {
  content: " ▾";
  color: var(--text-faint);
  font-size: 10px;
}

.chip-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.chip-primary::after {
  color: rgba(255, 255, 255, 0.75);
}

/* トグル式チップ（学割など）：ドロップダウンではないので矢印は出さない */
.chip-toggle::after {
  content: none;
}

.chip-toggle.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* --------------------------------------------------------------- disclaimer */

.disclaimer-bar {
  flex: none;
  padding: 4px 12px;
  font-size: 10px;
  color: var(--text-faint);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

/* --------------------------------------------------------------------- map */

.map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

#map {
  position: absolute;
  inset: 0;
}

.leaflet-container {
  font-family: var(--font);
  background: #eae7df;
}

/* Leaflet 既定のコントロールはスマホでは邪魔なので隠す */
.leaflet-control-zoom {
  display: none;
}

.leaflet-control-attribution {
  font-size: 9px;
}

/* ------------------------------------------------------------------ 広告 */

.ad-slot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 50px;
  padding: 2px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.ad-label {
  flex: none;
  font-size: 9px;
  color: var(--text-faint);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.4;
}

.ad-slot-bottom {
  min-height: var(--bottom-bar-h);
  border-bottom: none;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

/* 料金ピン ---------------------------------------------------------------- */

.price-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 3px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  position: relative;
}

.price-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #fff;
}

.price-pin .mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.03em;
  flex: none;
}

.price-pin.freetime .amount::after {
  content: "F";
  color: var(--accent);
  font-size: 9px;
  margin-left: 2px;
  vertical-align: super;
}

/* 料金が無い（画像/PDF 公開）チェーンのピンは控えめに */
.price-pin.no-price {
  background: #f7f5f1;
  border-style: dashed;
  font-weight: 600;
  color: var(--text-muted);
}

.price-pin.no-price::after {
  border-top-color: #f7f5f1;
}

.user-dot {
  width: 14px;
  height: 14px;
  margin: 1px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.55), 0 1px 4px rgba(0, 0, 0, 0.35);
}

.cluster-pin {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
}

/* ズーム警告 -------------------------------------------------------------- */

.zoom-notice {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(88%, 340px);
  background: rgba(28, 26, 22, 0.92);
  color: #f4f1ea;
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: center;
  box-shadow: var(--shadow-md);
  z-index: 600;
  pointer-events: none;
}

.zoom-notice-title {
  font-size: 14px;
  font-weight: 700;
}

.zoom-notice-sub {
  font-size: 12px;
  color: #c9c3b6;
  margin-top: 4px;
}

.locate-btn {
  position: absolute;
  right: 12px;
  bottom: 14px;
  z-index: 500;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-badge {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
}

/* ------------------------------------------------------------------ popup */

.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
}

.leaflet-popup-content {
  margin: 0;
  width: 250px !important;
}

.popup-head {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}

.popup-head .store-badge {
  width: 30px;
  height: 30px;
  font-size: 9px;
}

.popup-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
}

.popup-addr {
  font-size: 11px;
  color: var(--text-muted);
}

.popup-body {
  padding: 9px 12px;
}

.popup-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.popup-price-row .label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.popup-price-row .value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.popup-note {
  font-size: 10.5px;
  color: var(--text-faint);
  margin-top: 4px;
  line-height: 1.45;
}

.popup-actions {
  padding: 0 12px 12px;
}

.popup-actions a {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.popup-actions a + a {
  margin-top: 6px;
}

.popup-actions .btn-route {
  background: var(--panel);
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ------------------------------------------------------------------ modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.45);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal {
  background: var(--panel);
  width: 100%;
  max-width: 520px;
  border-radius: 14px 14px 0 0;
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

.modal-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
}

.modal .icon-btn {
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.modal-body {
  overflow-y: auto;
  padding: 12px 14px 20px;
}

/* モーダル内の選択肢 */
.opt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.opt {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 11px 6px;
  font-size: 13px;
  text-align: center;
  background: var(--panel);
}

.opt.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.opt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  text-align: left;
}

.opt-row .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

.opt-row .check {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
  opacity: 0;
}

.opt-row.on .check {
  opacity: 1;
}

.opt-row .sub {
  font-size: 10.5px;
  color: var(--text-faint);
}

.modal-note {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-note h4 {
  margin: 14px 0 4px;
  font-size: 12.5px;
  color: var(--text);
}

.modal-note ul {
  margin: 4px 0;
  padding-left: 18px;
}

.time-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.time-field input {
  flex: 1;
  font: inherit;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}

.btn-plain {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.form-field {
  margin-bottom: 12px;
}

.form-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-field select,
.form-field textarea {
  width: 100%;
  font: inherit;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  resize: vertical;
}

.btn-submit {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 11px;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
}

.btn-submit:disabled {
  opacity: 0.6;
}

/* 検索 -------------------------------------------------------------------- */

.search-input {
  width: 100%;
  font: inherit;
  font-size: 15px; /* iOS で入力時に画面が拡大されないよう 16px 近くにする */
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.search-results {
  margin-top: 10px;
}

.search-head {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  padding: 10px 2px 4px;
  border-bottom: 1px solid var(--border);
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 2px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.search-row:active {
  background: #f7f2ea;
}

.search-row .store-badge {
  width: 30px;
  height: 30px;
  font-size: 9px;
}

.search-pin {
  width: 30px;
  text-align: center;
  font-size: 15px;
  flex: none;
}

.search-main {
  flex: 1;
  min-width: 0;
}

.search-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dist {
  flex: none;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}

.search-empty {
  padding: 22px 8px;
  color: var(--text-muted);
  font-size: 12.5px;
  text-align: center;
}

.memo-chain-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 12px;
}

.memo-chain-grid .opt {
  padding: 8px 4px;
  font-size: 12px;
}

.memo-textarea {
  width: 100%;
  font: inherit;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  resize: vertical;
  line-height: 1.6;
}

.memo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.memo-saved {
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-bar-h) + 18px);
  transform: translateX(-50%);
  background: var(--ink);
  color: #f4f1ea;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12px;
  z-index: 900;
  box-shadow: var(--shadow-md);
  max-width: 90vw;
  text-align: center;
}

.toast.hidden {
  display: none;
}

/* --------------------------------------------- 横長・大画面でも破綻させない */

@media (min-width: 700px) {
  .app {
    max-width: 460px;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.12);
  }
}
