/* ==========================================================================
   MIZAR & ALCOR SIMULATOR - CORE STYLING (index.css)
   ========================================================================== */

:root {
  --font-display: 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --bg-deep: #020208;
  --panel-bg: rgba(8, 8, 24, 0.6);
  --panel-border: rgba(0, 240, 255, 0.15);
  --neon-cyan: #00f0ff;
  --text-primary: #ffffff;
  --text-muted: #8fa0b5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  font-family: var(--font-body);
  color: var(--text-primary);
  position: fixed;
  left: 0;
  top: 0;
  touch-action: none;
}

#space-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
}

/* HUDコンテナ (キャンバス上のオーバーレイ) */
.hud-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  pointer-events: none; /* 背後のキャンバスへのタッチ・クリックを阻害しない */
  box-sizing: border-box;
}

/* HUD内のガラスパネルはタッチ可能にする */
.hud-header,
.hud-footer {
  pointer-events: auto;
}

/* グラスモルフィズムパネル共通 */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 16px 24px;
  transition: all 0.3s ease;
}

/* 上部ヘッダー */
.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  align-self: center;
  width: 100%;
  max-width: 800px;
}

.title-group h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffffff;
}

.title-group .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* インジケーターグループ（ズーム + 回転） */
.readouts-group {
  display: flex;
  gap: 24px;
  align-items: flex-end;
}

.zoom-readout {
  text-align: right;
}

.zoom-readout .label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.zoom-readout .value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
  line-height: 1.1;
}

/* 下部フッター */
.hud-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  align-self: center;
  width: 100%;
  max-width: 800px;
}

/* プリセットボタングループ */
.presets-group {
  display: flex;
  gap: 16px;
  width: 100%;
}

.preset-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 1.0rem;
  font-weight: 500;
  padding: 12px 0;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.preset-btn:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
  color: #ffffff;
}

.preset-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
  font-weight: 700;
}

/* 望遠鏡UIのテキスト */
.telescope-ui {
  width: 100%;
  height: 100%;
  position: relative;
}

.telescope-text-overlay {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  color: var(--neon-cyan);
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  opacity: 0.7;
  text-shadow: 0 0 12px var(--neon-cyan);
  text-align: center;
}

.telescope-text-overlay .sub {
  font-size: 0.7rem;
  font-family: var(--font-body);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-top: 4px;
  text-shadow: none;
}

/* 望遠鏡フレームと暗転オーバーレイ */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.4s ease-in-out;
}

.telescope-frame {
  /* 丸い視野枠を表現 */
  background: radial-gradient(circle at center, transparent 35%, rgba(0,0,0,0.85) 45%, #000 55%);
  opacity: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.telescope-frame.hidden {
  opacity: 0;
}

.blackout-overlay {
  background-color: #000;
  opacity: 1;
  z-index: 6; /* フレームより上に配置 */
}

.blackout-overlay.hidden {
  opacity: 0;
}

/* タブレット・スマートフォン レスポンシブ設計 */
@media (max-width: 768px) {
  .hud-container {
    padding: 16px;
  }
  
  .hud-header,
  .hud-footer {
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
  }
  
  .title-group h1 {
    font-size: 1.5rem;
  }
  
  .title-group .subtitle {
    font-size: 0.8rem;
  }
  
  .readouts-group {
    justify-content: center;
  }
  
  .zoom-readout {
    text-align: center;
  }
  
  .zoom-readout .value {
    font-size: 2.0rem;
  }
  
  .hud-footer {
    padding: 16px;
  }
  
  .presets-group {
    width: 100%;
  }
  
  .preset-btn {
    flex: 1;
    font-size: 0.95rem;
    padding: 10px 14px;
  }
  
  .telescope-text-overlay {
    font-size: 1rem;
    top: 25%;
  }
}
