:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --border-color: rgba(56, 189, 248, 0.15);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --cyan: #22d3ee;
  --red-alert: #ef4444;
  --orange-alert: #f97316;
  --yellow-alert: #eab308;
  --green-safe: #22c55e;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'IBM Plex Mono', monospace;
  overflow-x: hidden;
  min-height: 100vh;
}

#root {
  min-height: 100vh;
}

/* Scanline overlay */
.scanlines::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* Alert banner animations */
@keyframes alertPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes alertFlash {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes bannerSlide {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.alert-banner-warning {
  background: linear-gradient(270deg, #dc2626, #ea580c, #dc2626);
  background-size: 200% 200%;
  animation: alertFlash 1.5s ease infinite, alertPulse 0.8s ease infinite;
}

.alert-banner-tsunami {
  background: linear-gradient(270deg, #7f1d1d, #991b1b, #7f1d1d);
  background-size: 200% 200%;
  animation: alertFlash 2s ease infinite;
}

/* Wave animations */
@keyframes expandRing {
  0% { r: 0; opacity: 0.8; }
  100% { opacity: 0; }
}

@keyframes stationPulse {
  0%, 100% { opacity: 0.6; r: 3; }
  50% { opacity: 1; r: 4.5; }
}

@keyframes epicenterPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

/* Screen shake */
@keyframes screenShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-8px, -6px) rotate(-1deg); }
  20% { transform: translate(6px, 8px) rotate(1deg); }
  30% { transform: translate(-10px, 4px) rotate(0deg); }
  40% { transform: translate(8px, -8px) rotate(1deg); }
  50% { transform: translate(-4px, 6px) rotate(-1deg); }
  60% { transform: translate(6px, -4px) rotate(0deg); }
  70% { transform: translate(-8px, 8px) rotate(-1deg); }
  80% { transform: translate(4px, -6px) rotate(1deg); }
  90% { transform: translate(-2px, 2px) rotate(0deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.screen-shake {
  animation: screenShake 0.6s ease-out;
}

/* Countdown styling */
@keyframes countdownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.countdown-urgent {
  animation: countdownPulse 0.5s ease infinite;
}

/* Wave pattern for tsunami */
@keyframes waveMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.wave-pattern {
  animation: waveMove 2s linear infinite;
}

/* Glassmorphism card */
.glass-card {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 12px;
}

/* Grid overlay for map */
.map-grid {
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Typing animation */
@keyframes typeReveal {
  from { width: 0; }
  to { width: 100%; }
}

/* Intensity scale colors */
.shindo-0 { background: #cccccc; color: #333; }
.shindo-1 { background: #80bfff; color: #1a1a2e; }
.shindo-2 { background: #33cc33; color: #1a1a2e; }
.shindo-3 { background: #ffcc00; color: #1a1a2e; }
.shindo-4 { background: #ff8c00; color: #fff; }
.shindo-5l { background: #ff4500; color: #fff; }
.shindo-5u { background: #e60000; color: #fff; }
.shindo-6l { background: #cc0000; color: #fff; }
.shindo-6u { background: #8b0000; color: #fff; }
.shindo-7 { background: #4a0080; color: #fff; }

/* Ambient noise background */
.ambient-bg {
  background:
    radial-gradient(ellipse at 20% 80%, rgba(56, 189, 248, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(34, 211, 238, 0.02) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(15, 23, 42, 1) 0%, var(--bg-primary) 100%);
}

/* Button styles */
.trigger-btn {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.2s ease;
}

.trigger-btn:hover {
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

.trigger-btn:active {
  transform: translateY(1px);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
}

.trigger-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.2);
  border-radius: 3px;
}

/* Mobile responsiveness */
@media (max-width: 1024px) {
  .main-layout {
    flex-direction: column !important;
  }
  .map-panel, .data-panel {
    width: 100% !important;
  }
}

/* Noto Sans JP for Japanese text */
.jp-text {
  font-family: 'Noto Sans JP', sans-serif;
}