*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;overflow:hidden}
body{font-family:'Noto Sans JP',sans-serif;display:flex;flex-direction:column;background:#0a1628;color:#e8eef6}
#header{display:flex;align-items:center;justify-content:space-between;height:44px;padding:0 12px;background:linear-gradient(135deg,#0d1f3c,#152a4a);border-bottom:1px solid rgba(255,255,255,0.1);z-index:100;flex-shrink:0}
#header-left{display:flex;align-items:center;gap:10px}
#site-title{font-size:15px;font-weight:900;color:#4fc3f7;white-space:nowrap}
#clock{font-size:13px;color:#c0d0e0;font-weight:500;white-space:nowrap;line-height:1}
#time-block{display:flex;align-items:center;gap:8px}
#beat-time{font-size:14px;color:#4fc3f7;font-weight:500;font-family:'Courier New',monospace;white-space:nowrap;line-height:1}
#weather-bar{display:flex;align-items:center;gap:2px;overflow-x:auto;white-space:nowrap;flex-shrink:1;min-width:0}
.weather-hour{display:flex;flex-direction:column;align-items:center;padding:2px 5px;min-width:38px;border-radius:6px}
.weather-hour.now{background:rgba(79,195,247,0.15);color:#4fc3f7}
.weather-icon{font-size:15px;line-height:1}
.weather-temp{font-weight:700;font-size:12px;color:#fff}
.weather-time{font-size:9px;color:#8aaccc}
#banner-link{display:block;text-decoration:none;flex-shrink:0;z-index:99}
#banner{width:100%;height:50px;background:linear-gradient(135deg,#e8f4f8,#d4edda);border-bottom:2px solid #3aafa9;display:flex;align-items:center;position:relative;overflow:visible}
@media(min-width:769px){#banner{height:72px}}
#map{flex:1;position:relative}
.maplibregl-canvas{outline:none}
.maplibregl-ctrl-top-right{top:8px!important;right:8px!important}
#map-controls{position:absolute;right:10px;bottom:90px;display:flex;flex-direction:column;gap:5px;z-index:50}
#map-controls button{width:38px;height:38px;background:rgba(13,31,60,0.92);color:#e0ecf6;border:1px solid rgba(255,255,255,0.15);border-radius:10px;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:700;backdrop-filter:blur(8px);box-shadow:0 2px 8px rgba(0,0,0,0.3)}
#map-controls button:hover{background:rgba(30,60,100,0.95)}
#map-controls button.active{background:#1a73e8;color:#fff;border-color:#4fc3f7}
#layer-toggle{position:absolute;left:10px;bottom:90px;display:flex;flex-direction:column;gap:4px;z-index:50}
.layer-btn{display:flex;align-items:center;gap:6px;padding:6px 10px;background:rgba(13,31,60,0.92);color:#e0ecf6;border:1px solid rgba(255,255,255,0.15);border-radius:10px;cursor:pointer;font-size:11px;font-weight:500;backdrop-filter:blur(8px);box-shadow:0 2px 8px rgba(0,0,0,0.3)}
.layer-btn.active{border-color:#4fc3f7;color:#4fc3f7}
.layer-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}
#follow-controls{position:absolute;right:10px;bottom:45px;display:flex;gap:5px;z-index:50}
#follow-controls button{width:38px;height:38px;background:rgba(13,31,60,0.92);color:#e0ecf6;border:1px solid rgba(255,255,255,0.15);border-radius:10px;cursor:pointer;font-size:16px;backdrop-filter:blur(8px)}
#follow-controls button.active{background:#1a73e8;border-color:#4fc3f7;color:#fff}
#info-panel{position:absolute;bottom:0;left:0;right:0;max-height:45vh;background:rgba(10,22,40,0.97);border-top:1px solid rgba(255,255,255,0.1);border-radius:16px 16px 0 0;z-index:80;overflow-y:auto;backdrop-filter:blur(12px)}
#info-panel.hidden{transform:translateY(100%)}
#panel-handle{width:40px;height:4px;background:rgba(255,255,255,0.2);border-radius:2px;margin:10px auto 6px;cursor:pointer}
#panel-content{padding:0 16px 16px}
#adsense-container{flex-shrink:0;min-height:50px;background:rgba(10,22,40,0.5);display:flex;align-items:center;justify-content:center}
#footer{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;padding:4px 10px;font-size:9px;color:#6080a0;background:#0a1628;border-top:1px solid rgba(255,255,255,0.05);flex-shrink:0}
.hidden{display:none!important}
.maplibregl-popup-content{background:rgba(10,22,40,0.97)!important;color:#fff!important;border:1px solid rgba(79,195,247,0.3)!important;border-radius:12px!important;padding:14px 18px!important;backdrop-filter:blur(12px)!important;box-shadow:0 4px 20px rgba(0,0,0,0.4)!important;font-family:'Noto Sans JP',sans-serif!important;font-size:13px!important;line-height:1.6!important}
.maplibregl-popup-content b{color:#4fc3f7;font-size:15px}
.maplibregl-popup-close-button{font-size:18px;color:#8aaccc!important;right:6px!important;top:4px!important}
.maplibregl-popup-tip{border-top-color:rgba(10,22,40,0.97)!important}
.ad-row{margin:8px 4px;padding:6px;background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.06);border-radius:6px;overflow:hidden}
.ad-label{font-size:10px;color:#8aaccc;margin-bottom:4px;text-align:right;padding-right:4px;letter-spacing:0.5px}
.ad-row ins.adsbygoogle{display:block;min-height:60px;background:rgba(255,255,255,0.02)}
@media(max-width:768px){#header{height:40px;padding:0 8px}#site-title{font-size:13px}#clock{font-size:11px}#beat-time{font-size:10px}#time-block{flex-direction:column;align-items:flex-end;gap:0;line-height:1.25}#banner{height:44px}#map-controls{right:8px;bottom:70px}#map-controls button{width:34px;height:34px;font-size:14px}#layer-toggle{left:8px;bottom:70px}#follow-controls{right:8px;bottom:35px}#follow-controls button{width:34px;height:34px;font-size:14px}#footer{font-size:8px;padding:3px 6px}}

/* ==========================================
   スマホ表示時のフッター隠れ防止 & ボタン重なり対策
   ========================================== */
@media (max-width: 768px) {
    /* フッター要素（またはSEO説明欄等）のコンパクト化と隠れ防止 */
    footer, .site-footer, #footer-container {
        font-size: 11px !important;
        padding: 6px 10px !important;
        line-height: 1.3 !important;
        max-height: 75px !important; /* 高さを強制的に制限 */
        overflow-y: auto !important;  /* 万が一文章が多くても内部スクロールさせる */
        box-sizing: border-box;
    }

    /* 地図の右下・左下などの操作ボタンがフッターと重ならないように底上げ */
    #map-controls, #follow-controls, #timebar {
        bottom: 85px !important; /* フッターの高さ分だけ上に持ち上げる */
    }
}

/* ==========================================
   ウェルカム＆ガイドモーダル用スタイル
   ========================================== */
.welcome-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  box-sizing: border-box;
  backdrop-filter: blur(2px);
}

.welcome-modal-overlay.hidden {
  display: none !important;
}

.welcome-modal-content {
  background: #ffffff;
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: welcomeModalFadeIn 0.25s ease-out;
}

@keyframes welcomeModalFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-modal-header {
  padding: 16px 20px;
  background: #1a73e8;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.welcome-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.modal-close-x {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}

.welcome-modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #333333;
}

.welcome-section {
  margin-bottom: 18px;
}

.welcome-section h3 {
  font-size: 0.95rem;
  margin: 0 0 6px 0;
  color: #1a73e8;
  border-bottom: 2px solid #e8f0fe;
  padding-bottom: 4px;
}

.welcome-section p {
  margin: 0;
}

.welcome-section ul, .welcome-section ol {
  margin: 0;
  padding-left: 20px;
}

.welcome-section li {
  margin-bottom: 4px;
}

.operator-list {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #555555;
  border: 1px solid #e0e0e0;
  line-height: 1.7;
}

.welcome-modal-footer {
  padding: 14px 20px;
  background: #f1f3f4;
  border-top: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-links {
  font-size: 0.8rem;
  color: #666666;
}

.footer-links a {
  color: #1a73e8;
  text-decoration: none;
}

.welcome-btn-primary {
  width: 100%;
  max-width: 260px;
  padding: 10px 20px;
  background-color: #1a73e8;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s;
  box-shadow: 0 2px 6px rgba(26, 115, 232, 0.4);
}

.welcome-btn-primary:hover {
  background-color: #1557b0;
}

/* クレジット（フッター）を常に最前面に固定 */
#footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    display: flex !important; /* 常に表示 */
    z-index: 1100 !important;  /* 地図やコントロールより上、モーダルより下 */
    background: rgba(10, 22, 40, 0.95); /* 背景を少し透過させて地図に馴染ませる */
    padding: 6px 10px;
    justify-content: center;
    gap: 15px;
    pointer-events: auto;      /* クリックを透過させない */
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* モーダル表示時の暗転がフッターに干渉しないよう設定 */
#info-modal {
    z-index: 2000 !important;
}

/* スターリンクボタンのON/OFF視認性向上 */
#btn-starlink {
  transition: all 0.2s ease;
}
#btn-starlink:not(.active) {
  background: rgba(20, 30, 45, 0.6) !important;
  color: #556688 !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  opacity: 0.5;
}
#btn-starlink.active {
  background: #1a73e8 !important;
  color: #ffffff !important;
  border-color: #4fc3f7 !important;
  box-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}
