/* =========================================
   points_list.html 専用 CSS
   テーマ: Cosmic Midnight + Globe Hero 7:3
   ========================================= */

/* -----------------------------------------
   [Tokens / 設定値]
   ----------------------------------------- */
:root{
  --wrap: 1200px;
  --gap: 16px;

  /* Space base */
  --bg-deep: #0B1020;
  --bg-grad: linear-gradient(180deg, #0B1020 0%, #060A14 60%, #04070F 100%);

  /* Surfaces */
  --surface-1: #0F172A;
  --surface-2: #111827;
  --glass: rgba(15, 23, 42, .55);

  /* Ink */
  --ink: #E8EEF6;
  --ink-sub: #9BA7BD;

  /* Lines & Shadow */
  --line: #223049;
  --line-strong: #395173;
  --shadow: 0 12px 30px rgba(0,0,0,.45);

  /* Accents */
  --accent: #4FF1E5;
  --accent-strong: #2AC6BB;
  --plasma: #9A6CFF;

  /* Etc */
  --badge: rgba(79,241,229,.16);
  --rad: 12px;

  /* 高さ系（ヒーローとMap） */
  --panel-h: clamp(520px, 68vh, 860px);
  --globe-h-pc: clamp(760px, 92dvh, 1120px);
  --globe-h-sp: 72dvh;
  --hero-list-h-sp: clamp(360px, 68dvh, 760px);

  /* モーション */
  --fade-ms: 220ms;

  /* Alt Chart（SP用 iframe の基準高さ）—短めに（必要ならここを調整） */
  --altchart-sp-h: 800px;

  --surfline-h: clamp(820px, 88vh, 1400px); /* Surfline埋め込み高さ */
}

/* -----------------------------------------
   [Base / Reset]
   ----------------------------------------- */
*{ box-sizing: border-box }
html,body{
  margin:0; padding:0;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: "Noto Sans JP", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  position: relative;
  min-height: 100%;
}
img{ max-width:100%; height:auto; display:block; }
[hidden]{ display:none !important; }
.page-wrap{ max-width: var(--wrap); margin: 0 auto; padding: 0 }

/* 宇宙背景レイヤー */
body::before,
body::after{ content:""; position:fixed; inset:0; pointer-events:none; z-index:-2; }
body::before{
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.20), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(255,255,255,.16), transparent 60%),
    radial-gradient(1px 1px at 26% 72%, rgba(255,255,255,.14), transparent 60%),
    radial-gradient(1px 1px at 62% 44%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(1px 1px at 88% 66%, rgba(255,255,255,.12), transparent 60%),
    var(--bg-grad);
  background-attachment: fixed;
  filter: saturate(105%);
}
body::after{
  background:
    radial-gradient(60vw 60vw at 20% 10%, rgba(154,108,255,.10), transparent 60%),
    radial-gradient(70vw 70vw at 80% 25%, rgba(77,232,252,.08), transparent 60%),
    radial-gradient(80vw 50vw at 50% 85%, rgba(79,241,229,.06), transparent 70%);
  mix-blend-mode: screen;
  z-index:-1;
}

/* -----------------------------------------
   [Header]
   ----------------------------------------- */
.page-head{
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding: 12px 16px; margin: 14px 0 16px;
  background: linear-gradient(180deg, #121c34 0%, #0c1428 100%);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0,0,0,.38);
  position: relative;
  margin-top: 0;
}
.page-head::after{
  content:""; position:absolute; left:12px; right:12px; bottom:-1px; height:1px;
  background: linear-gradient(90deg, transparent, rgba(79,241,229,.7), transparent);
  filter: drop-shadow(0 0 3px rgba(79,241,229,.35));
}
.page-head a{ display:inline-flex; align-items:center }
.brand-logo img{ height:40px; width:auto; }
.point-name{
  color:#EAFBFF; font-weight:800; letter-spacing:.02em;
  text-shadow: 0 0 10px rgba(79,241,229,.25);
}

/* 検索 */
.head-search{ flex: 1 1 520px; max-width: 560px; margin: 0 8px; position: relative; display:flex; }
.head-input{
  width:100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(79,241,229,.25);
  background: linear-gradient(180deg, rgba(17,24,39,.75), rgba(17,24,39,.55));
  color: #EAF7FB; box-shadow: 0 6px 16px rgba(0,0,0,.35), 0 0 0 1px rgba(79,241,229,.08) inset;
  outline: none; padding-right: 40px;
}
.head-input::placeholder{ color:#9FB0C6 }
.head-input:focus{
  border-color: rgba(79,241,229,.55);
  box-shadow: 0 8px 18px rgba(0,0,0,.45), 0 0 0 3px rgba(79,241,229,.18);
}
.head-btn{
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  background: transparent; border: 0; box-shadow: none; color: #EAF7FB; cursor: pointer;
}
.head-btn svg{ width: 18px; height: 18px; fill: currentColor; }
.head-btn:hover{ color: #BDF9F4; }
.head-btn:active{ transform: translateY(-50%) scale(.96); }
.head-btn:focus-visible{ outline: 2px solid rgba(79,241,229,.45); outline-offset: 2px; border-radius: 8px; }

/* サジェスト */
.head-suggest{
  position:absolute; left:0; right:0; top: calc(100% + 6px);
  background: linear-gradient(180deg, rgba(17,24,39,.9), rgba(17,24,39,.78));
  border: 1px solid rgba(79,241,229,.22);
  border-radius: 10px; box-shadow: 0 14px 28px rgba(0,0,0,.45);
  padding: 6px; z-index: 30; max-height: 56vh; overflow:auto;
}
.sug-item{ display:flex; align-items:center; gap:10px; padding: 8px 10px; border-radius: 8px; cursor:pointer; }
.sug-item:hover, .sug-item.is-active{ background: rgba(79,241,229,.10); }
.sug-flag{ width:22px; height:22px; border-radius:50%; overflow:hidden; flex:0 0 auto; }
.sug-flag > span.flag-icon{ font-size:16px; display:block; }
.sug-label{ font-weight:700; color:#EAF2FF; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sug-type{ font-size:11px; color:#CFEFF1; padding:2px 6px; border-radius:999px; border:1px solid rgba(79,241,229,.22); margin-left:auto; }

@media (max-width: 720px){
  .page-head{ flex-wrap: wrap; gap:10px; }
  .head-search{ order: 3; flex: 1 0 100%; max-width: none; }
}

/* -----------------------------------------
   [Banner]
   ----------------------------------------- */
.banner-box{ margin: 8px 0 16px }
.banner-box img{
  width:100%; max-height:220px; object-fit:cover;
  border-radius: var(--rad);
  border: 1px solid rgba(79,241,229,.22);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}

/* ============================
   国リスト（横スクロール）
   ============================ */
.country-bar{
  margin: 10px 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, rgba(17,24,39,.55), rgba(17,24,39,.35));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  overflow-y: hidden;       /* 念のため縦は隠す */
  -ms-overflow-style: none; /* IE/旧Edge */
  scrollbar-width: none;    /* Firefox */
  -webkit-scrollbar{ display: none; }
}
.country-scroll{ display: flex; gap: 10px; padding: 8px 12px; min-width: max-content; }
.country-pill{
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px; font-weight: 700;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(17,24,39,.82), rgba(17,24,39,.68));
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s, color .2s;
}
.country-pill:hover{
  background: rgba(79,241,229,.14);
  border-color: var(--line-strong);
  color: #BDF9F4;
}
.country-pill:active{ transform: scale(.96); }
.country-pill .flag{ width: 18px; height: 18px; border-radius: 4px; overflow: hidden; display: grid; place-items: center; }
.country-pill .flag > span.flag-icon{ font-size: 14px; line-height: 1; display: block; }
.country-pill .cnt{
  margin-left: 6px; font-size: 11px; font-weight: 800; color: #9BDAD6;
  background: rgba(79,241,229,.14); border: 1px solid rgba(79,241,229,.32);
  padding: 2px 6px; border-radius: 999px;
}
.country-pill.is-active{
  background: linear-gradient(180deg, rgba(42,127,255,.22), rgba(42,127,255,.12));
  border-color: #3a6fd8; box-shadow: 0 0 0 4px rgba(79,241,229,.10);
}

/* -----------------------------------------
   [Pane]
   ----------------------------------------- */
.pane{
  background: linear-gradient(180deg, rgba(17,24,39,.72), rgba(17,24,39,.58));
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--rad);
  box-shadow: var(--shadow);
  padding: 12px 12px 14px;
  margin-bottom: 12px;
}
.box-title{ margin:0 0 10px; font-size: 15px; font-weight: 800; letter-spacing:.02em; color:#EAF2FF; }

/* =========================================
   [Hero 2カラム]
   ========================================= */
#hero-2col, .globe-hero{ display: grid; gap: 20px; margin: 12px 0 16px; }
@media (min-width: 992px){
  #hero-2col, .globe-hero{ grid-template-columns: 7fr 3fr; align-items: stretch; }
  #hero-2col .hero-left, #hero-2col .hero-right, .globe-hero .globe-side, .globe-hero .hero-list{
    height: var(--globe-h-pc); min-height: var(--globe-h-pc);
  }
}
@media (max-width: 991.98px){
  #hero-2col, .globe-hero{ grid-template-columns: 1fr; }
  .globe-side, #hero-2col .hero-left{ height: var(--globe-h-sp); }
  .hero-list, #hero-2col .hero-right{ height: var(--hero-list-h-sp, 42vh); }
}
/* ===== SP時：Globe/Mapセクションの左右ガターを10pxに ===== */
@media (max-width: 768px){
  /* 2カラムセクション全体に左右ガターを付与（Surflineと統一） */
  #hero-2col.globe-hero, 
  .globe-hero{
    padding-left: 10px;
    padding-right: 10px;
  }

  /* 左ペインの角丸＆はみ出し防止（見た目をSurflineに寄せる） */
  .left-switch{
    border-radius: 12px;
    overflow: hidden;
  }

  /* 念のため、内部の #globe / #map も角丸を合わせる */
  #globe, #map{
    border-radius: 12px;
  }
}

/* =========================================
   [Globe枠 / Canvas]
   ========================================= */
.globe-wrap{ background: transparent; border: none; box-shadow: none; padding: 0; margin: 0 0 18px 0; opacity: 1; transition: opacity var(--fade-ms) ease, visibility var(--fade-ms) ease; }
.globe-wrap.is-hidden{ opacity:0; visibility:hidden; }
.globe-canvas{
  position: relative; width: 100%; height: 100%; min-height: 400px;
  border-radius: 12px; background: transparent; box-shadow: none; overflow: hidden;
}
.globe-canvas > canvas{
  position:absolute; inset:0; display:block; width:100% !important; height:100% !important;
  z-index: 1;
}

/* ==== Globe: 旗 + 国名ラベル ==== */
#globe .globe-flag,
.globe-flag{
  display: inline-flex; align-items: center; gap: 8px;
  width: auto; height: auto; min-height: 22px;
  overflow: visible; position: relative; z-index: 3;
  padding: 4px 8px;
  border-radius: var(--rad);
  background: linear-gradient(180deg, rgba(17,24,39,.85), rgba(17,24,39,.65));
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(0,0,0,.45), 0 0 0 1px rgba(79,241,229,.10) inset;
  color: #EAF7FB;
  transform: translateZ(0);
  will-change: transform, box-shadow;
  pointer-events: auto;
}
#globe .globe-flag:hover,
.globe-flag:hover{
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 16px rgba(0,0,0,.35), 0 0 12px rgba(79,241,229,.25);
  transition: transform .12s ease, box-shadow .12s ease;
}
#globe .globe-flag img,
.globe-flag img{
  width: 28px; height: 20px;
  border-radius: 4px; display:block; object-fit: cover; flex:0 0 auto;
}
#globe .globe-flag-label,
.globe-flag-label{
  font-size: 12px; font-weight:700; letter-spacing:.2px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
  white-space: nowrap;
}

/* =========================================
   [メイン2カラム：左=Globe/Map / 右=一覧]
   ========================================= */
.view-2col{ display:grid; gap:20px; margin:12px 0 16px; }
@media (min-width:991.98px){ .view-2col{ grid-template-columns:7fr 3fr; align-items:stretch; } }
@media (max-width:991.98px){ .view-2col{ grid-template-columns:1fr; } }

.left-switch{
  position:relative; height:var(--globe-h-pc); min-height:400px;
  border-radius:var(--rad); overflow:hidden;
}
@media (max-width:991.98px){ .left-switch{ height:var(--globe-h-sp); } }

#globe, #map{
  position: absolute; inset: 0; display: block; border-radius: var(--rad); z-index: 1;
}
#globe:not(.is-hidden){ z-index: 2; }
#map:not(.is-hidden){   z-index: 2; }
#map{
  background:#0f1626; border:1px solid rgba(34,48,73,.8);
  box-shadow:0 10px 26px rgba(0,0,0,.45); overflow:hidden;
}
.is-hidden{ opacity:0; visibility:hidden; pointer-events:none; transition:opacity var(--fade-ms) ease, visibility var(--fade-ms) ease; }
#globe{ min-height:400px; }
#globe > canvas{ position:absolute; inset:0; width:100% !important; height:100% !important; display:block; }

/* =========================================
   [左ペイン オーバーレイ：地域ラベル & 戻る]
   ========================================= */
.viewbar{
  position:absolute; left:12px; right:12px; top:10px;
  z-index: 5000;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  pointer-events:none;
}
#map-region-label{
  display:none;
  pointer-events:auto;
  align-items:center; gap:8px;
  padding:8px 12px;
  background: linear-gradient(180deg, rgba(17,24,39,.85), rgba(17,24,39,.65));
  color:#EAF7FB;
  border:1px solid var(--line);
  border-radius: var(--rad);
  box-shadow: 0 6px 16px rgba(0,0,0,.45), 0 0 0 1px rgba(79,241,229,.10) inset;
  font-weight:700; line-height:1; font-size:13px;
  white-space:nowrap;
}
.left-switch.map-mode #map-region-label{ display:inline-flex }
#map-region-label .flag-icon{ font-size:18px; border-radius:4px }
.back-pill{
  display:none;
  align-items:center; gap:8px;
  padding:8px 12px;
  border-radius: var(--rad);
  background: linear-gradient(180deg, rgba(17,24,39,.85), rgba(17,24,39,.65));
  color:#EAF7FB; border:1px solid var(--line);
  box-shadow: 0 6px 16px rgba(0,0,0,.45), 0 0 0 1px rgba(79,241,229,.10) inset;
  cursor:pointer; pointer-events:auto;
}
.back-pill:hover{
  background: linear-gradient(180deg, rgba(17,24,39,.95), rgba(17,24,39,.75));
  border-color: var(--line-strong);
}
.left-switch.map-mode .back-pill{ display:inline-flex }

/* =========================================
   [右側：ポイント一覧]
   ========================================= */
.right-list{ height: var(--globe-h-pc); display:flex; flex-direction:column; }
.right-list .pane{ height:100%; display:flex; flex-direction:column; position: relative; }
.right-list .results, #results{ flex:1 1 auto; min-height:0; overflow:auto; padding-right:4px; }
@media (max-width: 991.98px){ .right-list{ height: var(--hero-list-h-sp, 42vh); } }
.right-list .results::-webkit-scrollbar, #results::-webkit-scrollbar{ width:10px; }
.right-list .results::-webkit-scrollbar-thumb, #results::-webkit-scrollbar-thumb{ background: rgba(79,241,229,.25); border-radius:999px; }

/* 見出し非表示（A11y維持） */
#ttl-map-view, .map-viewbar h2{
  position: absolute !important; width:1px; height:1px; margin:-1px; padding:0; border:0;
  overflow:hidden; clip: rect(0 0 0 0); white-space:nowrap;
}

/* =========================================
   [検索結果カード]
   ========================================= */
.result-item{
  position: relative;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:var(--rad);
  padding:12px;
  display:flex; align-items:center; gap:10px;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(0,0,0,.35);
  transition:transform .15s, box-shadow .15s, border-color .15s, background .15s, opacity .15s;
}
.result-item:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 24px rgba(0,0,0,.45), 0 0 0 6px var(--badge);
  border-color:var(--line-strong);
}
.result-item .name{
  font-weight:700; color:#F1F7FF; letter-spacing:.01em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.result-item.is-active{
  background: linear-gradient(180deg, rgba(17,24,39,.88), rgba(17,24,39,.68));
  border-color: var(--accent-strong);
  box-shadow: 0 14px 28px rgba(0,0,0,.55), 0 0 0 6px var(--badge);
  transform: translateY(-2px);
}
.result-item.is-active::before{
  content:"";
  position:absolute; left:-1px; top:-1px; bottom:-1px;
  width:5px; border-radius: var(--rad) 0 0 var(--rad);
  background: linear-gradient(180deg, var(--accent), #2a7fff);
  box-shadow: 0 0 12px rgba(79,241,229,.55);
}
.result-item.is-active .surf-range{
  color:#EAF7FB; font-weight:700;
}
#results.has-active .result-item:not(.is-active),
#results-hero.has-active .result-item:not(.is-active){
  opacity:.72; filter:saturate(.9);
}

/* =========================================
   Graph/Guide（通常フロー）
   ========================================= */
#graph-panel{
  position: static !important; inset: auto !important; z-index: auto !important;
  display: block !important; grid-template-rows: none !important;
  backdrop-filter: none; border-radius: var(--rad, 12px);
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(11,20,36,.96);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  margin: 20px auto; width: 100%; max-width: min(1300px, 96vw);
}
#graph-panel.is-open { display: block; }
.right-list .pane:has(#graph-panel.is-open) #results,
.right-list .pane:has(#graph-panel.is-open) .result-item,
.right-list .pane:has(#graph-panel.is-open) > .box-title,
.right-list .pane.panel-open #results,
.right-list .pane.panel-open .result-item,
.right-list .pane.panel-open > .box-title{
  overflow: visible !important; pointer-events: auto !important; visibility: visible !important;
}
.gp-head{
  display:flex; align-items:center; gap:12px;
  padding:12px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
}
.gp-title{ display:flex; align-items:center; gap:10px; font-weight:700; font-size:18px; color:#e6f0ff; }
.gp-title .gp-flag{ font-size:20px; line-height:1; border-radius:4px; }
.gp-tabs{ display:flex; gap:8px; margin-left:auto; }
.gp-tab{
  appearance:none; border:0; cursor:pointer; padding:6px 10px; border-radius:10px;
  background: rgba(255,255,255,.10); color:#e6f0ff; font-weight:600;
}
.gp-tab.is-active{ background:#2a7fff; color:#fff; }
.gp-body{ padding:12px 16px; overflow:visible; }
.gp-view{ display:none; width:100%; overflow:visible; }
.gp-view.is-active{ display:block; }
#graph-panel{ width:100%; max-width:none; margin:20px 0; }
#graph-frame{
  width:100%; max-width:100%; display:block; border:0;
  min-height:650px; height:65vh;
}
#guide-body{ padding:14px; line-height:1.7; color:#e6f0ff; white-space:pre-wrap; }
@media (max-width: 1024px){
  #graph-frame{ min-height:670px; height:65vh; }
}
@media (max-width: 768px){
  #graph-panel{ margin:16px 0; border-radius:10px; }
  .gp-head{ padding:10px 12px; }
  .gp-body{ padding:10px 12px; }
  #graph-frame{ min-height:670px; height:58vh; }
}

/* -----------------------------------------
   [Leaflet 調整（暗色UI）]
   ----------------------------------------- */
.leaflet-container{ background: #0c1322 }
.leaflet-control-attribution{
  background: rgba(17,24,39,.85); color: #9FB0C6;
  border-radius: 8px; padding: 2px 6px; border: 1px solid var(--line);
}
.leaflet-control-attribution a{ color: #CFEFF1 }
.leaflet-tooltip.marker-tooltip{
  background:#0e2236; color:#e9f6ff;
  border:1px solid #2a4b6e; border-radius:8px; padding:6px 8px; font-size:12px;
  box-shadow:0 6px 18px rgba(0,0,0,.45); pointer-events: none; transform: translateY(-2px);
}
.leaflet-tooltip.marker-tooltip:before{ display:none; }

/* クラスターバッジ */
.cl-wrap{ background: transparent !important; border:none !important; }
.cl-badge{
  display:grid; place-items:center;
  background: radial-gradient(120% 120% at 30% 30%, #2b82a0, #1c3b58);
  color:#eaffff; border: 2px solid rgba(255,255,255,.85);
  border-radius: 999px; width: 40px; height: 40px;
  box-shadow: 0 4px 12px rgba(0,0,0,.5), 0 0 16px rgba(79,241,229,.25);
  font-weight: 800;
}
.cl-badge.sm{ width:34px; height:34px }
.cl-badge.md{ width:40px; height:40px }
.cl-badge.lg{ width:48px; height:48px }

/* Map側の旗ピン */
.flag-pin{ background: transparent !important }
.flag-badge{
  display:inline-grid; place-items:center;
  background:#0b0f1a; border:1px solid var(--line);
  width:34px; height:34px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.45), 0 0 10px rgba(79,241,229,.20);
}

/* -----------------------------------------
   [Controls / Buttons]
   ----------------------------------------- */
.ctrl-btn{
  background: linear-gradient(180deg, rgba(17,24,39,.85), rgba(17,24,39,.65));
  color:#EAF7FB;
  border:1px solid var(--line);
  border-radius:10px; padding:8px 10px;
  box-shadow: 0 6px 16px rgba(0,0,0,.45), 0 0 0 1px rgba(79,241,229,.10) inset;
  cursor:pointer;
}
.ctrl-btn:hover{
  background: linear-gradient(180deg, rgba(17,24,39,.95), rgba(17,24,39,.75));
  border-color: var(--line-strong);
  box-shadow: 0 10px 22px rgba(0,0,0,.55), 0 0 0 6px var(--badge);
}
.ctrl-btn:focus-visible{ outline: 3px solid rgba(79,241,229,.35); outline-offset: 2px; }

/* 右側のコントロール縦並び */
#map-tools{
  position:absolute; right:12px; z-index:1600;
  display:flex; flex-direction:column; gap:10px; pointer-events:none;
}
#map-tools .tools-group{ display:flex; flex-direction:column; gap:10px; pointer-events:auto; align-items:flex-end; }
#map-tools .ctrl-btn{ width:44px; height:44px; border-radius: var(--rad); display:flex; align-items:center; justify-content:center; }

/* 右上のスケールピル（必要なら見せる） */
.scale-pill{
  position:absolute; right:12px; top:56px; display:none;
  background: linear-gradient(180deg, rgba(17,24,39,.85), rgba(17,24,39,.65));
  padding:6px 10px; border-radius:999px;
  border:1px solid var(--line); color:#CFEFF1;
  box-shadow: 0 6px 16px rgba(0,0,0,.45);
}

/* -----------------------------------------
   [Utilities]
   ----------------------------------------- */
.is-hidden{ opacity:0; visibility:hidden; pointer-events:none; }
.fade-in{ animation: fadeIn var(--fade-ms) ease both; }
.fade-out{ animation: fadeOut var(--fade-ms) ease both; }
@keyframes fadeIn{ from{ opacity:0 } to{ opacity:1 } }
@keyframes fadeOut{ from{ opacity:1 } to{ opacity:0 } }
@media (prefers-reduced-motion: reduce){
  .globe-wrap, .map-wrap{ transition: none !important; }
  .fade-in, .fade-out{ animation: none !important; }
}

/* -----------------------------------------
   [“見えない”対策]
   ----------------------------------------- */
.page-wrap{ position: relative; z-index: 0; }
.globe-wrap, .globe-canvas{ isolation: isolate; }

/* -----------------------------------------
   [Surflineチャート]
   ----------------------------------------- */
.surfline-pane{
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0 0 12px;
}

/* コンテナ：高さは常に変数を参照（競合対策で !important） */
#surfline-chart{
  width: 100%;
  height: var(--surfline-h);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

/* iframe は親にフィット（競合対策で !important） */
.surfline-pane .chart-iframe{
  width: 100%;
  height: 100% !important;
  border: 0;
  display: block;
  border-radius: 0;
  background: #0c1322;
}

/* -----------------------------
   SP最適化
   ----------------------------- */
@media (max-width: 768px){
  /* 高さはSPで固定（ご要望：1000px） */
  :root{ --surfline-h: 600px; }

  /* スクロールしづらさ回避のため左右に余白 */
  .surfline-pane{
    padding-left: 10px;
    padding-right: 10px;
  }

  /* 角丸で囲って見切れを防ぐ */
  #surfline-chart{
    border-radius: 12px;
    overflow: hidden;
    height: var(--surfline-h);
  }
}
/* -----------------------------------------
   [Alt Chart（PC=chart_iframe.html / SP=chart-sp）]
   ----------------------------------------- */
.alt-chart-pane #chart-host{ width:100%; }
.chart-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; padding:12px 16px; border:1px solid var(--line,#1e2630);
  background: var(--panel,#0f141b); border-radius:12px; margin-bottom:12px;
}
.chart-head-left{ display:flex; align-items:center; gap:10px; min-width:0; }
.chart-title{ margin:0; font-size:16px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#chart-flag .flag-icon{ display:inline-block; }
.ch-btn{
  border:1px solid var(--line,#1e2630); background:transparent; color:inherit;
  padding:8px 12px; border-radius:10px; font-size:14px; cursor:pointer;
}
.ch-btn:hover{ border-color: var(--accent,#35c6ff); }

/* PC: chart_iframe.html を表示 */
#chart-pc{
  display:block;
  width:100%;
  height: clamp(880px, 100vh, 1700px);
  border:0;
}

/* SP: 指定URL（短めベース＆padding 0） */
#chart-sp{
  display:none;
  width:100%;
  height: var(--altchart-sp-h);
  border:0;
  padding:0 !important;
  background: transparent;
}

/* 768px以下をSP扱い（SPでのみ chart-sp を表示） */
@media (max-width: 768px){
  #chart-pc{ display:none; }
  #chart-sp{ display:block; }

  /* セクションの余白はSP時だけ0（chart-sp専用エリア） */
  .pane.alt-chart-pane{
    padding: 0 !important;
    border-radius: var(--rad);
  }
  .pane.alt-chart-pane #chart-host{
    border-radius: var(--rad);
  }

  /* 親の高さ制限を完全解除（数値変更が即反映されるように） */
  .pane.alt-chart-pane,
  .pane.alt-chart-pane #chart-host{
    height:auto !important; max-height:none !important; min-height:0 !important; overflow:visible !important;
  }

  /* 本体 iframe：ビューポート倍率でも少しだけ底上げ（Safari対策） */
  #chart-sp{
    /* ▼ 基本は 1200px。足りなければ :root の --altchart-sp-h を上げればOK */
    height: max(var(--altchart-sp-h), 60vh) !important;
    height: max(var(--altchart-sp-h), 60dvh) !important;
    min-height: var(--altchart-sp-h) !important;
  }
}

/* 小さめ端末で少しだけ底上げ（必要に応じて調整） */
@media (max-width: 480px){
  :root{ --altchart-sp-h: 800px; }
  #chart-sp{
    height: max(var(--altchart-sp-h), 70dvh) !important;
    min-height: var(--altchart-sp-h) !important;
  }
}
@media (max-width: 380px){
  :root{ --altchart-sp-h: 800px; }
  #chart-sp{
    height: max(var(--altchart-sp-h), 80dvh) !important;
    min-height: var(--altchart-sp-h) !important;
  }
}

/* -----------------------------------------
   [AdSense Placeholder]
   ----------------------------------------- */
.adsense-box{ margin-top: 12px; min-height: 120px }
