/* びわ風 VER.001 — 「湖の夜明けの航海図」 */
:root {
  --ink-deep: #081625;
  --ink: #0d2237;
  --ink-raise: #12304b;
  --line: #1e4260;
  --text: #eaf3fa;
  --text-2: #a8c2d6;
  --text-3: #6d8ba3;
  --accent: #56cbe8;
  --accent-soft: rgba(86, 203, 232, .16);
  --lv0: #64b7ee;
  --lv1: #33a86f;
  --lv2: #dde65c;
  --lv3: #ee9d1f;
  --lv4: #dd4a41;
  --lv5: #c46cf7;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(2, 10, 20, .55);
  --font-ui: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-display: "Shippori Mincho", "Hiragino Mincho ProN", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--ink-deep);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.ver-badge {
  position: fixed; top: 16px; right: 20px; z-index: 1200;
  font-size: 10px; letter-spacing: .14em; color: #B0BAC4;
  pointer-events: none;
}

/* ---------- app bar ---------- */
.appbar {
  position: fixed; inset: 0 0 auto 0; height: 58px; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 96px 0 16px;
  background: linear-gradient(180deg, rgba(8, 22, 37, .96) 30%, rgba(8, 22, 37, .78) 75%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; color: var(--accent); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: .1em; }
.brand-sub { font-size: 9.5px; letter-spacing: .22em; color: var(--text-3); }
.appbar-right { display: flex; gap: 8px; align-items: center; }
.src-switch {
  /* flex-none を付けないと、狭い幅で縮められて3つ目(MSM)が overflow:hidden に切られる */
  display: flex; flex: none; border: 1px solid var(--line); border-radius: 17px; overflow: hidden;
  background: rgba(13, 34, 55, .85); height: 34px;
}
.src-btn {
  border: none; background: none; color: var(--text-3); cursor: pointer;
  font-family: var(--font-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  padding: 0 12px; height: 100%; white-space: nowrap;
  border-right: 1px solid var(--line);
}
.src-btn:last-child { border-right: none; }
.src-btn:hover { color: var(--text); }
.src-btn.on { background: var(--accent); color: #04202c; }
.src-note { font-size: 8.5px; font-weight: 500; opacity: .75; margin-left: 3px; }
.src-btn.loading { opacity: .5; cursor: progress; }
.about-sub { list-style: none; margin: 4px 0 0 4px; }
.about-sub li { font-size: 11px; color: var(--text-3); padding-left: 12px; }
.about-sub li::before { content: "・"; position: absolute; left: 0; color: var(--text-3); }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(13, 34, 55, .8); color: var(--text-2); font-family: var(--font-display);
  font-style: italic; font-size: 14px; cursor: pointer;
}
.chip-btn {
  height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line);
  background: rgba(13, 34, 55, .85); color: var(--text); font-family: var(--font-ui);
  font-size: 12.5px; font-weight: 700; cursor: pointer; letter-spacing: .04em;
}
.chip-btn:hover, .icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.board-count { color: var(--accent); margin-left: 5px; font-weight: 700; }

/* ---------- map & particles ---------- */
#stage { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; background: var(--ink-deep); }
/* 地理院淡色タイルを夜間航海図風に反転 */
#map .leaflet-tile-pane { filter: invert(1) hue-rotate(196deg) saturate(.42) brightness(.86) contrast(.92); }
#map .leaflet-control-attribution {
  background: rgba(8, 22, 37, .72); color: var(--text-3); font-size: 9.5px;
}
#map .leaflet-control-attribution a { color: var(--text-2); }
#particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 640; }

/* spot pins */
.spot-pin { background: none; border: none; }
.spot-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transform: translateY(-4px); cursor: pointer;
}
.spot-dot {
  min-width: 30px; height: 30px; padding: 0 4px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #08131e;
  border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .5);
  transition: transform .15s;
}
.spot-chip:hover .spot-dot { transform: scale(1.18); }
.spot-name {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--text);
  background: rgba(8, 22, 37, .78); padding: 1px 7px; border-radius: 8px;
  white-space: nowrap; border: 1px solid rgba(86, 203, 232, .25);
}
#map.zoomed-out .spot-name { display: none; }
.obs-pin { background: none; border: none; }
.obs-arrow-wrap { display: flex; flex-direction: column; align-items: center; opacity: .95; }
.obs-arrow {
  font-size: 20px; color: #ffd76a; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .75));
}
.obs-arrow svg { display: block; }
.obs-calm { font-size: 13px; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.obs-val { font-size: 9.5px; color: #ffd76a; background: rgba(8,22,37,.75); padding: 0 5px; border-radius: 6px; white-space: nowrap; }

/* ---------- overlays ---------- */
.obs-badge {
  position: absolute; top: 70px; left: 14px; z-index: 800;
  font-size: 11px; color: var(--text-2); letter-spacing: .03em;
  background: rgba(8, 22, 37, .82); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 12px; max-width: 250px; line-height: 1.5;
}
.obs-badge b { color: #ffd76a; font-weight: 700; }
.badge-warn { color: #ee9d1f; font-size: 10px; }
.badge-refresh { color: var(--accent); font-size: 10px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.badge-refresh { animation: pulse 1.6s ease-in-out infinite; }

/* ---------- エリア切替 ---------- */
.areabar {
  position: absolute; left: 50%; top: 66px; transform: translateX(-50%); z-index: 810;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  max-width: calc(100vw - 28px);
}
.area-row { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.area-btn {
  height: 28px; padding: 0 13px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(10, 27, 44, .9); color: var(--text-2);
  font-family: var(--font-ui); font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  white-space: nowrap;
}
.area-btn:hover { color: var(--text); border-color: var(--accent); }
.area-btn.on { background: var(--accent); color: var(--onaccent, #04202c); border-color: transparent; }
.area-sub .area-btn { height: 25px; font-size: 10.5px; padding: 0 11px; background: rgba(10, 27, 44, .8); }
.area-sub:empty { display: none; }

/* ---------- 現在地の風 ---------- */
.here-card {
  position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%); z-index: 940;
  width: min(360px, calc(100vw - 28px));
  background: linear-gradient(180deg, var(--ink-raise), var(--ink));
  border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 14px;
  box-shadow: var(--shadow);
}
.here-close {
  position: absolute; top: 8px; right: 10px; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); background: none; color: var(--text-2); cursor: pointer; font-size: 14px;
}
.here-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 26px; }
.here-title { font-family: var(--font-display); font-size: 15px; font-weight: 800; letter-spacing: .06em; }
.here-sub { font-size: 10.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.here-level .big {
  width: 52px; height: 52px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #08131e; font-weight: 700;
  border: 3px solid rgba(255, 255, 255, .85);
}
.here-level .big b { font-size: 16px; line-height: 1; }
.here-level .big span { font-size: 8px; }
.here-cells { display: flex; gap: 16px; margin: 10px 0 12px; flex-wrap: wrap; }
.here-cells .k { font-size: 9.5px; color: var(--text-3); letter-spacing: .08em; }
.here-cells .v { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.here-cells .v small { font-size: 10px; color: var(--text-2); font-family: var(--font-ui); }
.here-post {
  width: 100%; height: 40px; border-radius: 20px; border: none; cursor: pointer;
  background: var(--accent); color: #04202c; font-family: var(--font-ui);
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
}
.here-pin { background: none; border: none; }
.here-dot {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent);
  border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(86, 203, 232, .28), 0 2px 8px rgba(0,0,0,.5);
}

.legend {
  position: absolute; right: 14px; top: 70px; z-index: 800;
  background: rgba(8, 22, 37, .85); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; width: 158px;
}
.legend-title { font-size: 10.5px; letter-spacing: .18em; color: var(--text-3); margin-bottom: 7px; }
.legend-row { display: flex; align-items: center; gap: 7px; font-size: 11px; padding: 2.5px 0; color: var(--text-2); white-space: nowrap; }
.legend-row i { width: 14px; height: 14px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 8.5px; font-weight: 700; color: #08131e; font-style: normal; }

/* ---------- time dock ---------- */
.timedock {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 900; width: min(680px, calc(100vw - 28px));
  display: flex; align-items: center; gap: 12px;
  background: rgba(10, 27, 44, .92); border: 1px solid var(--line);
  border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.play-btn, .now-btn {
  flex: none; cursor: pointer; font-family: var(--font-ui);
}
.play-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--accent); color: #04202c; font-size: 15px; font-weight: 700;
  box-shadow: 0 0 22px rgba(86, 203, 232, .45);
}
.now-btn {
  height: 32px; padding: 0 12px; border-radius: 16px; font-size: 11.5px; font-weight: 700;
  border: 1px solid var(--line); background: transparent; color: var(--text-2);
}
.now-btn:hover { color: var(--accent); border-color: var(--accent); }
.time-body { flex: 1; min-width: 0; }
.time-readout { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
#time-label { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: .05em; }
.time-tag { font-size: 10px; padding: 1px 8px; border-radius: 8px; font-weight: 700; letter-spacing: .1em; }
.time-tag.past { background: rgba(168, 194, 214, .18); color: var(--text-2); }
.time-tag.now { background: rgba(255, 215, 106, .2); color: #ffd76a; }
.time-tag.future { background: var(--accent-soft); color: var(--accent); }
input[type=range] {
  width: 100%; appearance: none; -webkit-appearance: none; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #35597a 0 25%, var(--accent) 25% 25.8%, #204a6b 25.8% 100%);
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 4px solid var(--accent); cursor: pointer;
  box-shadow: 0 0 12px rgba(86, 203, 232, .8);
}
.time-scale { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-3); margin-top: 3px; letter-spacing: .06em; }
.time-scale .now-mark { color: #ffd76a; }

/* ---------- bottom sheet ---------- */
.sheet {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 105%);
  z-index: 950; width: min(660px, 100vw); max-height: 72vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--ink-raise), var(--ink));
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 22px 22px 0 0; padding: 20px 22px 90px; box-shadow: var(--shadow);
  transition: transform .32s cubic-bezier(.2, .9, .25, 1);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-close {
  position: absolute; top: 12px; right: 14px; width: 30px; height: 30px;
  border-radius: 50%; border: 1px solid var(--line); background: transparent;
  color: var(--text-2); font-size: 15px; cursor: pointer; z-index: 2;
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-right: 34px; }
.sheet-spot { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: .06em; }
.sheet-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; letter-spacing: .04em; }
.sheet-level { text-align: center; flex: none; }
.sheet-level .big {
  width: 66px; height: 66px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #08131e; font-weight: 700;
  border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}
.sheet-level .big b { font-size: 20px; line-height: 1; }
.sheet-level .big span { font-size: 9px; letter-spacing: .05em; }
/* 「出られる時間帯」の一文 */
.sheet-window {
  margin-top: 12px; padding: 9px 12px; border-radius: 10px;
  background: rgba(51, 168, 111, .16); border: 1px solid rgba(51, 168, 111, .45);
  color: #cdebdc; font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
.sheet-window.bad { background: rgba(221, 74, 65, .14); border-color: rgba(221, 74, 65, .45); color: #f2cfcc; }
.sheet-window:empty { display: none; }

/* 現地からの投稿ピン */
.post-pin { background: none; border: none; }
.post-bubble {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(8, 22, 37, .92); border: 2px solid var(--accent);
  border-radius: 12px 12px 12px 3px; padding: 2px 7px 2px 3px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5); cursor: pointer;
}
.post-bubble-lv {
  width: 17px; height: 17px; border-radius: 50%; color: #08131e;
  font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.post-bubble-n { color: var(--text); font-size: 10px; font-weight: 700; }
.post-popup .leaflet-popup-content-wrapper {
  background: var(--ink-raise); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
}
.post-popup .leaflet-popup-tip { background: var(--ink-raise); border: 1px solid var(--line); }
.post-popup .leaflet-popup-content { margin: 12px 14px; }
.pp-head { font-family: var(--font-display); font-size: 13px; font-weight: 800; letter-spacing: .06em; margin-bottom: 8px; }
.pp-item { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.pp-item:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.pp-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.pp-top b { font-size: 11.5px; }
.pp-ago { color: var(--text-3); font-size: 9.5px; }
.pp-lv { margin-left: auto; color: #08131e; font-size: 9.5px; font-weight: 700; padding: 1px 7px; border-radius: 9px; }
.pp-body { font-size: 12px; line-height: 1.65; color: var(--text); }
.pp-photo { width: 100%; border-radius: 8px; margin-top: 6px; display: block; }
.pp-more { color: var(--text-3); font-size: 10px; margin-top: 8px; }

.sheet-now { display: flex; gap: 18px; margin: 14px 0 6px; flex-wrap: wrap; }
.now-cell { }
.now-cell .k { font-size: 10px; color: var(--text-3); letter-spacing: .1em; }
.now-cell .v { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.now-cell .v small { font-size: 11px; color: var(--text-2); font-family: var(--font-ui); }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 6px; }
.chart-title { font-size: 11.5px; color: var(--text-2); letter-spacing: .05em; }
.chart-legend { display: flex; align-items: center; gap: 12px; font-size: 10.5px; color: var(--text-2); }
.sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.sw-speed { background: var(--accent); }
.sw-gust { background: repeating-linear-gradient(90deg, #8fb8cc 0 3px, transparent 3px 6px); }
.table-toggle { border: 1px solid var(--line); background: none; color: var(--text-3); border-radius: 8px; font-size: 10px; padding: 2px 8px; cursor: pointer; }
.table-toggle:hover { color: var(--accent); border-color: var(--accent); }
.chart-wrap { position: relative; margin-top: 6px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-tip {
  position: absolute; pointer-events: none; background: rgba(8, 22, 37, .95);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px;
  font-size: 10.5px; color: var(--text); white-space: nowrap; display: none; z-index: 5;
  line-height: 1.6;
}
.chart-table { margin-top: 8px; overflow-x: auto; }
.chart-table table { border-collapse: collapse; font-size: 10.5px; width: 100%; }
.chart-table th, .chart-table td { border: 1px solid var(--line); padding: 3px 7px; text-align: right; color: var(--text-2); white-space: nowrap; }
.chart-table th { color: var(--text-3); font-weight: 500; text-align: center; }
.disclaimer { margin-top: 14px; font-size: 10px; color: var(--text-3); line-height: 1.7; }

/* ---------- board ---------- */
.board {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1100;
  width: min(400px, 100vw); transform: translateX(105%);
  background: var(--ink); border-left: 1px solid var(--line);
  transition: transform .3s cubic-bezier(.2, .9, .25, 1);
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.board.open { transform: translateX(0); }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 18px 8px; }
.board-head h2 { font-family: var(--font-display); font-size: 17px; letter-spacing: .08em; }
.board-head .sheet-close { position: static; }
.board-note { padding: 0 18px 12px; font-size: 11px; color: var(--text-3); line-height: 1.6; border-bottom: 1px solid var(--line); }
.board-note b { color: var(--accent); }
.board-empty { padding: 22px 18px; font-size: 12px; color: var(--text-3); text-align: center; }
.board-list { flex: 1; overflow-y: auto; padding: 12px 18px 90px; }
.post-card {
  background: var(--ink-raise); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px;
}
.post-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.post-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent);
}
.post-name { font-size: 12px; font-weight: 700; }
.post-meta { font-size: 9.5px; color: var(--text-3); }
.post-lv {
  margin-left: auto; flex: none; font-size: 10px; font-weight: 700; color: #08131e;
  padding: 2px 9px; border-radius: 10px;
}
.post-spot { font-size: 11px; color: var(--accent); font-weight: 700; margin-bottom: 3px; }
.post-body { font-size: 12.5px; line-height: 1.7; color: var(--text); }
.post-photo { margin-top: 8px; border-radius: 10px; overflow: hidden; }
.post-photo img { width: 100%; display: block; }
.post-sample { font-size: 9px; color: var(--text-3); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; margin-left: 6px; }
.fab {
  position: absolute; left: 18px; right: 18px; bottom: 18px;
  height: 46px; border-radius: 23px; border: none; cursor: pointer;
  background: var(--accent); color: #04202c; font-family: var(--font-ui);
  font-size: 13.5px; font-weight: 700; letter-spacing: .05em;
  box-shadow: 0 6px 24px rgba(86, 203, 232, .4);
}

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 1300; background: rgba(3, 10, 18, .7);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(3px);
}
.modal {
  width: min(420px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--ink-raise); border: 1px solid var(--line);
  border-radius: 18px; padding: 22px; box-shadow: var(--shadow);
}
.modal h3 { font-family: var(--font-display); font-size: 17px; letter-spacing: .08em; margin-bottom: 8px; }
.modal-note { font-size: 11px; color: var(--text-3); line-height: 1.7; margin-bottom: 12px; }
.login-btns { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.login-btn {
  height: 44px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer;
  background: var(--ink); color: var(--text); font-family: var(--font-ui); font-size: 13px;
  display: flex; align-items: center; gap: 10px; padding: 0 14px; font-weight: 500;
}
.login-btn.sel { border-color: var(--accent); background: var(--accent-soft); }
.lg { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.lg-g { background: #fff; color: #4285F4; }
.lg-a { background: #fff; color: #000; }
.lg-a::before { content: ""; font-size: 14px; }
.lg-x { background: #000; color: #fff; border: 1px solid #444; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 5px; letter-spacing: .05em; }
.field input[type=text], .field input:not([type]), .field input[maxlength], .field select, .field textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-family: var(--font-ui); font-size: 13px; padding: 10px 12px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field input[type=file] { color: var(--text-3); font-size: 11px; }
.level-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.lv-opt {
  flex: 1; min-width: 52px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer;
  background: var(--ink); color: var(--text-2); font-family: var(--font-ui); font-size: 10px;
  padding: 7px 2px; text-align: center; line-height: 1.4;
}
.lv-opt b { display: block; font-size: 13px; }
.lv-opt.sel { color: #08131e; border-color: transparent; font-weight: 700; }
.photo-preview { margin: -4px 0 12px; border-radius: 10px; overflow: hidden; }
.photo-preview img { width: 100%; display: block; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.btn-primary {
  height: 40px; padding: 0 22px; border-radius: 20px; border: none; cursor: pointer;
  background: var(--accent); color: #04202c; font-family: var(--font-ui); font-size: 13px; font-weight: 700;
}
.btn-primary:disabled { opacity: .4; cursor: default; }
.btn-ghost {
  height: 40px; padding: 0 16px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line); background: none; color: var(--text-2); font-family: var(--font-ui); font-size: 13px;
}
.about-list { list-style: none; margin: 0 0 12px; }
.about-list li { font-size: 11.5px; color: var(--text-2); line-height: 1.8; padding-left: 14px; position: relative; }
.about-list li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.about-list b { color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 1500;
  background: var(--accent); color: #04202c; font-size: 12.5px; font-weight: 700;
  padding: 10px 20px; border-radius: 20px; box-shadow: var(--shadow);
}

@media (max-width: 640px) {
  /* アプリバーは要素が詰まりやすいので、ロゴマークだけ残してテキストを畳む */
  .appbar { padding: 0 12px; gap: 8px; }
  .brand-text { display: none; }
  .ver-badge { display: none; }          /* 掲示板ボタンと重なるため隠す（版数はiで確認できる） */
  .appbar-right { gap: 6px; flex: 1; justify-content: flex-end; }
  .src-btn { padding: 0 9px; font-size: 10.5px; }
  .src-note { display: none; }
  .chip-btn { padding: 0 11px; font-size: 12px; }

  /* 凡例は消さずに、ドックの上へ1行の帯として出す（色の意味が分からなくなるため） */
  .legend {
    right: 10px; left: 10px; top: auto; bottom: 116px; width: auto;
    padding: 6px 8px; display: flex; align-items: center; gap: 6px;
  }
  .legend-title { display: none; }
  .legend-rows { display: flex; width: 100%; justify-content: space-between; gap: 2px; }
  .legend-row { flex-direction: column; gap: 2px; font-size: 8.5px; padding: 0; text-align: center; }
  .legend-row i { width: 15px; height: 15px; font-size: 9px; }
  .legend-row span { display: none; }

  /* ズームボタンがタイムドックの「現在」に重なるので上へ逃がす */
  /* 右下はSOSボタンの場所。ズームはその上へ逃がす（緊急時の誤タップを避ける）。
     ただし天気カードと重ならない高さにする */
  .leaflet-bottom.leaflet-right { bottom: 312px; }
  .leaflet-control-attribution { max-width: 58vw; }

  .timedock { padding: 10px 12px; gap: 8px; bottom: 12px; }
  #time-label { font-size: 13.5px; }
  .now-btn { padding: 0 9px; font-size: 11px; }
  .play-btn { width: 40px; height: 40px; }
  .sheet { max-height: 78vh; padding: 18px 16px 80px; }
  .sheet-now { gap: 12px; }
}

/* ---------- お気に入り／風アラート ---------- */
.sheet-fav {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 10px 0 2px;
}
.fav-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: #10283d; color: #cfe3f2; border: 1px solid #23425e;
  border-radius: 999px; padding: 7px 15px; font-size: 12px; cursor: pointer;
  font-family: inherit; transition: background .15s, border-color .15s, color .15s;
}
.fav-btn:hover { background: #16334c; }
.fav-btn.on { background: #2b2410; border-color: #7a6321; color: #f4d977; }
.fav-btn #fav-star { font-size: 14px; line-height: 1; }
.alert-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: #93b0c8; cursor: pointer; user-select: none;
}
.alert-toggle input { width: 15px; height: 15px; accent-color: #4fc3f7; cursor: pointer; }
.fav-mark { color: #f4d977; font-style: normal; margin-right: 2px; }

/* ---------- お気に入りパネル ---------- */
.fav-panel {
  /* 右上は凡例が占めているので左側（アメダス実況カードの下）に置く */
  position: absolute; top: 138px; left: 14px; z-index: 620;
  width: 340px; max-width: calc(100vw - 28px);
  background: rgba(9, 26, 43, 0.95); border: 1px solid #23425e; border-radius: 14px;
  padding: 14px 15px 12px; backdrop-filter: blur(7px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
}
.fav-panel-head { margin-bottom: 10px; padding-right: 22px; }
.fav-sun { font-size: 11px; color: #93b0c8; margin-top: 4px; }
.fav-sun b { color: #f4d977; font-weight: 700; }
.fav-left { margin-left: 8px; color: #6d8ba3; }
.fav-list { display: flex; flex-direction: column; gap: 7px; max-height: 52vh; overflow-y: auto; }
.fav-empty { font-size: 11.5px; color: #6d8ba3; line-height: 1.7; }
.fav-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  background: #0d2337; border: 1px solid #1d3a53; border-radius: 10px;
  padding: 9px 10px; cursor: pointer; font-family: inherit;
  transition: background .15s, border-color .15s;
}
.fav-item:hover { background: #133150; border-color: #2a4f70; }
.fav-lv {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-style: normal;
  font-size: 11.5px; font-weight: 700; color: #08131e;
}
.fav-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fav-name { color: #dbeaf6; font-size: 12.5px; font-weight: 700; }
.fav-bell {
  font-style: normal; font-size: 9px; color: #4fc3f7; margin-left: 6px;
  border: 1px solid #2b6c8f; border-radius: 4px; padding: 0 4px;
}
.fav-meta { color: #93b0c8; font-size: 10.5px; }
.fav-win { color: #8fd6ae; font-size: 10.5px; }
.fav-win.bad { color: #e9a49e; }
.fav-sunset {
  flex: none; text-align: right; color: #6d8ba3; font-size: 9.5px; line-height: 1.5;
  display: flex; flex-direction: column;
}
.fav-sunset b { display: block; color: #f4d977; font-size: 12px; font-weight: 700; }
.fav-sunset em { font-style: normal; }
@media (max-width: 700px) {
  .fav-panel { top: 126px; left: 12px; right: 12px; width: auto; }
}
.badge-water { color: #7fd8f0; font-weight: 700; }
.badge-water-sub { color: #6d8ba3; font-size: 9.5px; margin-left: 3px; }

/* ---------- 緊急通報 ---------- */
.sos-btn {
  position: absolute; right: 14px; bottom: 172px; z-index: 700;
  width: 62px; height: 62px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: #c62828; color: #fff; border: 2px solid #ff8a80;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 6px 20px rgba(198, 40, 40, .5), 0 0 0 6px rgba(198, 40, 40, .16);
  transition: transform .12s, background .15s;
}
.sos-btn:hover { background: #d32f2f; transform: scale(1.04); }
.sos-btn:active { transform: scale(.96); }
.sos-label { font-size: 16px; font-weight: 800; letter-spacing: 1px; line-height: 1; }
.sos-sub { font-size: 9px; opacity: .85; letter-spacing: 1px; }

/* 緊急通報は何よりも前に出す。900 だと .modal-back(1300) の下に潜って、
   掲示板を開いたままSOSを押した人にカードが見えなくなる */
.sos-back { z-index: 1600; }
.sos-modal { border-color: #7a2723; max-width: 460px; }
.sos-title { color: #ff8a80; }
.sos-lead { color: #93b0c8; font-size: 12px; margin: 0 0 12px; }
.sos-pos {
  background: #0d2337; border: 1px solid #23425e; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px;
}
.sos-pos-k { color: #6d8ba3; font-size: 10px; letter-spacing: 1px; margin-bottom: 4px; }
.sos-coord {
  color: #dbeaf6; font-size: 22px; font-weight: 700; letter-spacing: .5px;
  font-variant-numeric: tabular-nums; word-break: break-all;
}
.sos-near { color: #93b0c8; font-size: 11.5px; line-height: 1.7; margin-top: 5px; }
.sos-copy {
  margin-top: 9px; background: #16334c; color: #cfe3f2; border: 1px solid #2a4f70;
  border-radius: 8px; padding: 6px 12px; font-size: 11px; cursor: pointer; font-family: inherit;
}
.sos-copy:hover { background: #1c4160; }

.sos-calls { display: flex; gap: 10px; }
.sos-call {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 8px; border-radius: 12px; text-decoration: none;
  border: 1px solid transparent; transition: transform .12s, filter .15s;
}
.sos-call:active { transform: scale(.97); }
.sos-call b { font-size: 26px; font-weight: 800; letter-spacing: 1px; line-height: 1.1; }
.sos-call span { font-size: 10.5px; opacity: .9; }
.sos-110 { background: #c62828; border-color: #ff8a80; color: #fff; }
.sos-110:hover { filter: brightness(1.1); }
.sos-119 { background: #1b5e20; border-color: #81c784; color: #fff; }
.sos-119:hover { filter: brightness(1.1); }

.sos-note { margin: 14px 0 0; padding-left: 18px; }
.sos-note li { color: #93b0c8; font-size: 11px; line-height: 1.8; }
.sos-note b { color: #ffcc80; }

@media (max-width: 700px) {
  .sos-btn { bottom: 176px; width: 58px; height: 58px; }
  /* 現在地カードが出ている間は、その上へ逃がす（重なると押し間違える） */
  #here-card:not([hidden]) ~ .sos-btn { bottom: 330px; }
}

/* ---------- ログイン画面 ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 1200;
  display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(86,203,232,.10) 0%, transparent 60%), var(--ink-deep);
  overflow: hidden;
}
.login-bg { position: absolute; inset: 0; opacity: .5; }
.login-bg canvas { width: 100%; height: 100%; display: block; }
.login-inner {
  position: relative; z-index: 1;
  width: min(380px, calc(100vw - 40px));
  padding: 6vh 0;
  display: flex; flex-direction: column; align-items: stretch;
}
.login-brand { text-align: center; margin-bottom: 30px; }
.login-mark { width: 46px; height: 46px; margin: 0 auto 10px; color: var(--accent); }
.login-mark svg { width: 100%; height: 100%; }
.login-title {
  font-family: var(--font-display); font-size: 34px; font-weight: 800;
  color: var(--text); letter-spacing: 4px; line-height: 1.2;
}
.login-lead {
  margin-top: 12px; font-size: 12.5px; line-height: 2;
  color: var(--text-2);
}
.login-btns { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
.login-field { display: block; margin-bottom: 16px; }
.login-field span {
  display: block; font-size: 10.5px; letter-spacing: 1px;
  color: var(--text-3); margin-bottom: 6px;
}
.login-field input {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font-size: 14px; font-family: inherit;
}
.login-field input:focus { outline: none; border-color: var(--accent); }
.login-go {
  height: 50px; border-radius: 25px; border: none; cursor: pointer;
  background: var(--accent); color: #08131e; font-size: 14px; font-weight: 700;
  font-family: inherit; letter-spacing: 1px;
  transition: opacity .15s, transform .12s;
}
.login-go:disabled { opacity: .32; cursor: default; }
.login-go:not(:disabled):hover { transform: translateY(-1px); }
.login-skip {
  margin-top: 14px; background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 12.5px; font-family: inherit;
  text-decoration: underline; text-underline-offset: 4px;
}
.login-skip:hover { color: var(--text); }
.login-note {
  margin-top: 26px; font-size: 10.5px; line-height: 1.9;
  color: var(--text-3); text-align: center;
}

/* ---------- オープニング ---------- */
.opening {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px;
  background:
    radial-gradient(100% 70% at 50% 42%, rgba(86, 203, 232, .09) 0%, transparent 62%),
    var(--ink-deep);
  transition: opacity .5s ease, visibility .5s;
}
.opening.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.opening-stage {
  position: relative;
  width: min(300px, 62vw); aspect-ratio: 3 / 4;
}
/* 琵琶湖の輪郭。線がひと筆で描かれてから、内側が満ちる */
.opening-lake { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.opening-lake .lake-fill {
  fill: var(--accent);
  opacity: 0; animation: lakeFill .85s ease .75s forwards;
}
/* 風の筋が湖を走り、通ったところが抜けてロゴの形になる。
   色は地と同じ（オープニングの背景＝紺にわずかな光を重ねた色） */
.opening-lake .wind-cut path {
  fill: none; stroke: #0f2637; stroke-width: 3.8;
  stroke-dasharray: var(--cut, 200);
  stroke-dashoffset: var(--cut, 200);
  animation: windCut .72s cubic-bezier(.5, 0, .2, 1) forwards;
}
@keyframes windCut { to { stroke-dashoffset: 0; } }
.opening-lake .lake-line {
  fill: none; stroke: var(--accent); stroke-width: 0.9;
  stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: var(--len, 900); stroke-dashoffset: var(--len, 900);
  animation: lakeDraw 1.3s cubic-bezier(.6, .05, .25, 1) forwards,
             lineOut .5s ease 1.55s forwards;
  filter: drop-shadow(0 0 5px rgba(86, 203, 232, .5));
}
@keyframes lakeDraw { to { stroke-dashoffset: 0; } }
@keyframes lakeFill { to { opacity: 1; } }
@keyframes lineOut { to { opacity: .35; } }

/* 湖の内側だけを風が吹き抜ける */
.opening-wind {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; animation: windIn .6s ease .95s forwards;
}
@keyframes windIn { to { opacity: 1; } }

.opening-brand { text-align: center; opacity: 0; animation: brandIn .9s ease .95s forwards; }
@keyframes brandIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.opening-title {
  font-family: var(--font-display); font-size: 40px; font-weight: 800;
  color: var(--text); letter-spacing: 8px; line-height: 1.1; text-indent: 8px;
}
.opening-sub {
  margin-top: 9px; font-size: 10px; letter-spacing: 6px;
  color: var(--accent); text-indent: 6px;
}
.opening-tag {
  margin-top: 7px; font-size: 11.5px; letter-spacing: 2px; color: var(--text-3);
}
.opening-status {
  position: absolute; bottom: 8vh;
  font-size: 11px; letter-spacing: 1px; color: var(--text-3);
  opacity: 0; animation: brandIn .8s ease 1.5s forwards;
}
@media (max-width: 700px) {
  .opening-title { font-size: 34px; letter-spacing: 6px; }
  .opening { gap: 22px; }
}
/* 島は線でなく塗りと細線で見せる（外周の描き出しと混ぜない） */
.opening-lake .lake-isles {
  fill: var(--accent); stroke: none;
  opacity: 0; animation: lakeFill .85s ease .75s forwards;
}

/* 陸にいる間は静かに。湖に出たら赤く前に出る（場所は変えない＝いざという時に迷わない） */
.sos-btn.quiet {
  width: 46px; height: 46px;
  background: rgba(13, 34, 55, .85); border-color: #5a2b28;
  box-shadow: none;
}
.sos-btn.quiet .sos-label { font-size: 11px; color: #c2726d; letter-spacing: .5px; }
.sos-btn.quiet .sos-sub { display: none; }

/* いまいる場所がこれから荒れるときの帯 */
.risk-bar {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 176px; z-index: 690;
  width: min(460px, calc(100vw - 28px));
  display: flex; align-items: center; gap: 10px;
  background: rgba(70, 22, 18, .94); border: 1px solid #a3453c;
  border-radius: 12px; padding: 11px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.risk-bar i {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-style: normal;
  font-size: 11px; font-weight: 700; color: #08131e;
}
.risk-bar span { color: #ffd9d5; font-size: 12.5px; font-weight: 700; line-height: 1.5; }
@media (max-width: 700px) {
  /* 帰属表示とタイムドックを避けて、警告文が必ず読める高さに置く */
  .risk-bar { bottom: 252px; }
}

@media (max-width: 700px) {
  /* エリアバーが2段になると実況カードと重なるので、カードをその下へ送る */
  .obs-badge { top: 128px; max-width: calc(100vw - 28px); }
  .areabar { top: 60px; }
  .fav-panel { top: 196px; }
}

/* ---------- 天気予報（風が主役なので、押されたときだけ開く） ---------- */
.weather-pill {
  position: absolute; top: 252px; left: 14px; z-index: 640;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(8, 22, 37, .9); border: 1px solid var(--line);
  color: var(--text); cursor: pointer; font-family: var(--font-ui);
}
.weather-pill:hover { border-color: var(--accent); }
.weather-pill .wx-ico { width: 18px; height: 18px; display: block; }
.wx-pill-temp { font-size: 13.5px; font-weight: 700; }
.wx-pill-temp i { font-size: 9px; color: var(--text-3); font-style: normal; }
@media (max-width: 700px) { .weather-pill { top: 220px; left: 14px; } }

.wx-modal { max-width: 360px; }
.wx-head { display: flex; align-items: center; margin-bottom: 14px; }
.wx-head h3 { flex: 1; margin: 0; }
.wx-close {
  width: 28px; height: 28px; border: none; background: none;
  color: var(--text-3); font-size: 20px; line-height: 1; cursor: pointer;
}
.wx-close:hover { color: var(--text); }

/* ---------- 天気予報の中身 ---------- */
.weather-card {
  /* 天気は副次的な情報なので、危険バー(690)より必ず後ろに置く。
     800 のままだと、白波の警告が天気カードに隠れる */
  position: absolute; top: 252px; right: 14px; z-index: 640;
  width: 186px; padding: 11px 12px;
  background: rgba(8, 22, 37, .88); border: 1px solid var(--line);
  border-radius: 12px; backdrop-filter: blur(6px);
}
.wx-row { display: flex; align-items: center; gap: 7px; }
.wx-area {
  flex: none; width: 17px; height: 17px; border-radius: 5px;
  background: var(--ink-raise); border: 1px solid var(--line);
  font-size: 9.5px; color: var(--text-2); display: grid; place-items: center;
}
.wx-ico { flex: none; width: 22px; height: 22px; display: block; }
.wx-ico svg { width: 100%; height: 100%; }
.wx-name { flex: 1; min-width: 0; font-size: 11.5px; color: var(--text); font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-temp { flex: none; font-size: 15px; font-weight: 700; color: var(--text); }
.wx-temp small { font-size: 9px; color: var(--text-3); margin-left: 1px; }
.wx-pops { display: flex; gap: 3px; margin-top: 5px; padding-left: 24px; }
.wx-pops span { flex: 1; text-align: center; font-size: 10px; color: var(--accent); font-weight: 700; }
.wx-pops i { display: block; font-style: normal; font-size: 8px; color: var(--text-3); font-weight: 400; }
.wx-sep { height: 1px; background: var(--line); margin: 9px 0; }
.wx-src { margin-top: 9px; font-size: 8.5px; color: var(--text-3); text-align: right; }

@media (max-width: 700px) {
  /* 画面下は危険バー・ズーム・帰属表示・SOSで埋まっている。
     天気は副次的な情報なので、上の空きへ移して安全の表示に場所を譲る */
  .weather-card { top: 220px; bottom: auto; right: 10px; width: 168px; }
}

/* 通報・非表示・削除 */
.post-acts { display: flex; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.post-act {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 10px; font-size: 10.5px; color: var(--text-3);
  cursor: pointer; font-family: inherit; transition: color .15s, border-color .15s;
}
.post-act:hover { color: var(--text-2); border-color: #2a4f70; }

/* 規約への同意 */
.terms-list { margin: 0 0 14px 18px; }
.terms-list li { font-size: 12px; color: var(--text-2); line-height: 1.9; margin-bottom: 3px; }
.terms-strong { color: #ffcc80 !important; }

/* このアプリについて：リンク・連絡先・削除 */
.about-links { display: flex; gap: 16px; margin: 16px 0 12px; }
.about-links a { font-size: 12px; color: var(--accent); }
.about-contact {
  background: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 11.5px; color: var(--text-2); line-height: 1.9;
}
.about-contact-k { font-size: 9.5px; color: var(--text-3); letter-spacing: 1px; margin-bottom: 4px; }
.about-contact-s { display: block; margin-top: 6px; font-size: 10.5px; color: var(--text-3); }
.about-del {
  width: 100%; margin-top: 14px; padding: 11px;
  background: none; border: 1px solid #5a2b28; border-radius: 10px;
  color: #c2726d; font-size: 12px; cursor: pointer; font-family: inherit;
}
.about-del:hover { background: rgba(90, 43, 40, .2); }
