/* 色：高速道路=緑、国道=青（道路標識の色）、温泉地=茶（観光案内標識の色） */
:root { --expwy:#1a7f45; --expwy-light:#e6f4ec; --kokudo:#1f6fd1; --kokudo-light:#e8f0fb; --onsen:#8b5a2b; --onsen-light:#f5ece3; }
body.expwy  { --accent:var(--expwy);  --accent-light:var(--expwy-light); }
body.kokudo { --accent:var(--kokudo); --accent-light:var(--kokudo-light); }
body.onsen  { --accent:var(--onsen);  --accent-light:var(--onsen-light); }

* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
html,body { margin:0; background:#f4f4f2; color:#111;
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Noto Sans JP",sans-serif; -webkit-text-size-adjust:100%; }

/* ヘッダー（常に上に表示） */
header { position:sticky; top:0; z-index:10; background:#fff; border-bottom:3px solid var(--accent); padding:10px 12px 10px; }
.head { display:flex; align-items:center; gap:10px; }
.head .titles { flex:1; min-width:0; }
h1 { font-size:23px; margin:0; line-height:1.25; }
.stamp { font-size:15px; color:#444; margin-top:2px; }
#reload { flex:none; width:64px; height:64px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  font:inherit; font-size:13px; font-weight:700; color:#fff; background:var(--accent); border:none; border-radius:14px; padding:0; }
#reload svg { width:28px; height:28px; }
#reload:active { filter:brightness(.9); }
#reload:disabled { opacity:.6; }
#reload:disabled svg { animation:spin 1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* 高速／国道の切り替えタブ（今いるページを塗りつぶし表示） */
.tabs { display:grid; grid-template-columns:1fr 1fr 1fr; gap:0; margin-top:10px; border-radius:12px; overflow:hidden; border:2px solid #cfd4da; }
.tabs a { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; min-height:56px; text-decoration:none;
  font-size:17px; font-weight:700; color:#555; background:#f1f2f4; line-height:1.15; }
.tabs a + a { border-left:2px solid #cfd4da; }
.tabs .badge { font-size:12px; font-weight:700; padding:2px 6px; border-radius:6px; color:#fff; }
.tabs a.expwy .badge { background:var(--expwy); }
.tabs a.kokudo .badge { background:var(--kokudo); }
.tabs a.onsen .badge { background:var(--onsen); }
.tabs a[aria-current="page"] { color:#fff; }
.tabs a.expwy[aria-current="page"] { background:var(--expwy); }
.tabs a.kokudo[aria-current="page"] { background:var(--kokudo); }
.tabs a.onsen[aria-current="page"] { background:var(--onsen); }
.tabs a[aria-current="page"] .badge { background:#fff; color:var(--accent); }
.tabs a[aria-current="page"] .badge::before { content:"✓ "; }

/* 今見ている区間 */
.where { margin-top:8px; font-size:16px; font-weight:700; color:var(--accent); background:var(--accent-light);
  border-radius:8px; padding:6px 10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

main { padding:12px 12px 30px; max-width:640px; margin:0 auto; }
h2 { font-size:21px; margin:26px 2px 10px; padding-left:10px; border-left:6px solid var(--accent); scroll-margin-top:200px; }

/* 区間へのジャンプボタン */
.jump-title { font-size:16px; color:#444; margin:4px 2px 8px; }
.jump { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:6px; }
.jump a { display:block; font-size:17px; font-weight:700; color:var(--accent); background:#fff; text-decoration:none;
  border:2px solid var(--accent); border-radius:12px; padding:10px 10px; line-height:1.3; }
.jump a small { display:block; font-size:14px; font-weight:400; color:#555; margin-top:2px; }
.jump a:active { background:var(--accent-light); }

/* 地図 */
.map { position:relative; overflow:hidden; border-radius:12px; border:2px solid #ccc; background:#fff; margin-bottom:6px; }
.map > img { position:absolute; }
.pin { position:absolute; width:26px; height:26px; margin:-13px 0 0 -13px; border-radius:50%; background:#e5484d; color:#fff;
  font:700 14px/26px sans-serif; text-align:center; text-decoration:none; border:2px solid #fff; box-shadow:0 1px 3px rgba(0,0,0,.6); }
.mapnote { font-size:15px; color:#444; margin:0 2px 12px; }

/* カメラ */
.cam { background:#fff; border:2px solid #ddd; border-radius:14px; overflow:hidden; margin-bottom:16px; scroll-margin-top:200px; }
.img { position:relative; aspect-ratio:4/3; background:#000; }
.img img { width:100%; height:100%; object-fit:contain; display:block; }
.img .err { position:absolute; inset:0; display:none; align-items:center; justify-content:center; color:#ccc; font-size:18px; }
.img.failed img { visibility:hidden; } .img.failed .err { display:flex; }
.info { padding:10px 14px 12px; }
.name { font-size:24px; font-weight:700; }
.no { display:inline-block; min-width:30px; height:30px; line-height:30px; padding:0 4px; margin-right:6px; border-radius:15px;
  background:#e5484d; color:#fff; font-size:17px; text-align:center; vertical-align:3px; }
.sub { font-size:17px; color:#444; margin-top:2px; }
.shot { font-size:19px; font-weight:700; color:var(--accent); margin-top:6px; }
.shot.old { color:#b45309; }

footer { font-size:15px; color:#555; line-height:1.6; padding:0 16px 100px; max-width:640px; margin:0 auto; }

/* 上へ戻るボタン */
#totop { position:fixed; right:14px; bottom:18px; z-index:40; width:64px; height:64px; border-radius:50%; border:none;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0;
  font:inherit; font-size:13px; font-weight:700; color:#fff; background:rgba(30,30,30,.85); box-shadow:0 3px 10px rgba(0,0,0,.3);
  opacity:0; pointer-events:none; transform:translateY(10px); transition:opacity .25s, transform .25s; }
#totop .arrow { font-size:22px; line-height:1; }
#totop.on { opacity:1; pointer-events:auto; transform:none; }

/* お知らせ（自動で消える） */
#toast { position:fixed; left:50%; bottom:96px; z-index:60; transform:translate(-50%, 20px); width:max-content; max-width:calc(100% - 32px);
  background:rgba(20,20,20,.92); color:#fff; font-size:19px; font-weight:700; text-align:center; line-height:1.4;
  padding:14px 22px; border-radius:14px; box-shadow:0 4px 16px rgba(0,0,0,.3);
  opacity:0; pointer-events:none; transition:opacity .3s, transform .3s; }
#toast.on { opacity:1; transform:translate(-50%, 0); }

/* 拡大表示 */
#viewer { position:fixed; inset:0; z-index:50; background:#000; display:none; flex-direction:column; align-items:center; justify-content:center; padding:16px; }
#viewer.on { display:flex; }
#viewer img { width:100%; max-height:70vh; object-fit:contain; }
#viewer .cap { color:#fff; font-size:22px; font-weight:700; margin-top:12px; text-align:center; }
#viewer button { margin-top:20px; font:inherit; font-size:20px; font-weight:700; color:#111; background:#fff; border:none; border-radius:12px; padding:12px 48px; }
