* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  color: #0ff;
}

.cockpit {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(to bottom, #020408 0%, #040810 50%, #020406 100%);
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  grid-template-rows: 1fr 50px;
  gap: 15px;
  padding: 15px;
  position: relative;
}

/* パネル */
.panel {
  background: rgba(0, 20, 30, 0.8);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 5px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* ゲージ */
.gauge {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 3px;
  padding: 8px;
}

.gauge-label {
  font-size: 12px;
  color: rgba(0, 255, 255, 0.5);
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.gauge-value {
  font-size: 28px;
  color: #0ff;
  text-shadow: 0 0 10px #0ff;
  font-weight: bold;
}

.gauge-value.small {
  font-size: 18px;
}

.gauge-bar {
  margin-top: 8px;
  height: 6px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  background: linear-gradient(to right, #0ff, #f0f);
  box-shadow: 0 0 10px #0ff;
  transition: width 1s ease-out;
}

/* ビューポート */
.viewport-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

#game {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ビューポートオーバーレイ */
.viewport-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  border-radius: 10px;
}

/* ミニマップ */
.minimap-container {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 3px;
  padding: 4px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#minimap {
  width: 100%;
  height: auto;
  max-height: 120px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* インジケーター */
.indicator-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: auto;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(100, 100, 100, 0.3);
  border: 1px solid rgba(100, 100, 100, 0.5);
}

.indicator.active {
  background: #0f0;
  box-shadow: 0 0 10px #0f0;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ステータスバー */
.status-bar {
  grid-column: 1 / -1;
  background: rgba(0, 20, 30, 0.8);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  font-size: 14px;
  letter-spacing: 2px;
}

.status-item {
  color: rgba(0, 255, 255, 0.7);
}

/* スキャンライン */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.05) 2px,
    rgba(0, 0, 0, 0.05) 4px
  );
  pointer-events: none;
  z-index: 100;
}

/* フレーム */
.frame {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 10px solid #0a0a0a;
  border-radius: 8px;
  pointer-events: none;
  z-index: 50;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.7);
}

/* 墓標ポップアップ */
.tombstone-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ff00ff;
  font-size: 48px;
  text-shadow: 0 0 20px #ff00ff, 0 0 40px #ff00ff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 20;
}

.tombstone-popup.show {
  opacity: 1;
  animation: tombstone-appear 2s ease-out forwards;
}

@keyframes tombstone-appear {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70%);
  }
}

/* 墓碑銘 */
.epitaph {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 0, 255, 0.7);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
  text-shadow: 0 0 10px #ff00ff;
  z-index: 20;
}

.epitaph.show {
  opacity: 1;
}

/* おばけ */
.ghost-popup {
  position: absolute;
  font-size: 48px;
  pointer-events: none;
  opacity: 0;
  z-index: 15;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

.ghost-popup.show {
  animation: ghost-float 3s ease-out forwards;
}

@keyframes ghost-float {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.5);
  }
  20% {
    opacity: 0.9;
    transform: translate(-50%, -10px) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translate(-60%, -30px) scale(1);
  }
  80% {
    opacity: 0.5;
    transform: translate(-40%, -60px) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -100px) scale(0.7);
  }
}

/* 忘却の「忘」 */
.forget-popup {
  position: absolute;
  font-family: "Yu Mincho", "游明朝", "Hiragino Mincho ProN", "HGS明朝E", serif;
  font-size: 72px;
  font-weight: 900;
  color: #aa0000;
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 0 10px #ff0000;
  pointer-events: none;
  opacity: 0;
  z-index: 30;
}

.forget-popup.show {
  animation: forget-appear 2s ease-out forwards;
}

@keyframes forget-appear {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}
