/* Main HUD Container */
#hud-container {
  display: grid;
  grid-template-columns: 250px 1fr 220px;
  grid-template-rows: 60px 1fr 80px;
  gap: 12px;
  padding: 12px;
  height: 100vh;
  font-family: 'Press Start 2P', cursive;
  color: #00f2ff;
  background: rgba(5, 5, 20, 0.85);
  pointer-events: none;
}

#hud-container > * {
  pointer-events: auto;
}

/* Header Zone */
#hud-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  border: 3px solid #ff00ff;
  box-shadow: 0 0 15px #ff00ff66;
  padding: 10px 18px;
  font-size: 0.75rem;
  border-radius: 6px;
  letter-spacing: 1px;
}

#case-timer {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  color: #00f2ff;
  text-shadow: 0 0 10px #00f2ff;
  padding: 0 15px;
}

/* Left Sidebar (Evidence) */
#evidence-sidebar {
  grid-column: 1;
  grid-row: 2;
  background: rgba(10, 10, 30, 0.85);
  border: 3px solid #00f2ff;
  box-shadow: 0 0 15px #00f2ff44;
  border-radius: 6px;
  padding: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

#evidence-table-body tr {
  animation: evTagIn 0.25s ease-out;
}

@keyframes evTagIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Center Canvas */
#game-canvas {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto !important;
}

/* Right Mini-map (Simplified as placeholder) */
#minimap {
  grid-column: 3;
  grid-row: 2;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #ff00ff;
  border-radius: 4px;
  position: relative;
  min-height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.7rem;
  color: #ff00ff;
}

/* Footer (Health + Log) */
#hud-footer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #00f2ff;
  padding: 8px;
  border-radius: 4px;
}

/* Health Bar */
#health-container {
  height: 20px;
  background: #1a1a2e;
  border: 1px solid #7700ff;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

#health-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff0055, #ffdd00, #39ff14);
  background-size: 200% 100%;
  transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 100%;
}

#health-label {
    position: absolute;
    right: 5px;
    top: 0;
    font-size: 0.7rem;
    color: white;
    z-index: 1;
    line-height: 20px;
}

/* Log Content */
#log-content {
  font-size: 0.65rem;
  color: #ffff00;
  text-shadow: 0 0 5px #ffaa00;
  word-wrap: break-word;
  padding: 6px;
  text-align: right;
  font-family: 'Press Start 2P', cursive;
  line-height: 1.6;
}

/* Warning Banner */
.warning-banner {
  position: fixed;
  top: 30%;
  left: 0;
  width: 100%;
  background: rgba(255, 0, 85, 0.8);
  border-top: 4px solid #fff;
  border-bottom: 4px solid #fff;
  transform: rotate(-2deg);
  overflow: hidden;
  z-index: 4000;
  padding: 15px 0;
  box-shadow: 0 0 40px rgba(255, 0, 85, 0.6);
}

.warning-text {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  color: #fff;
  white-space: nowrap;
  animation: warningScroll 6s linear infinite;
  text-shadow: 2px 2px #000;
}

@keyframes warningScroll {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

@keyframes scaleIn {
  0% { transform: scale(0.2); opacity: 0; }
  70% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Low Health Flash */
.low-health-warning {
  animation: bgFlashRed 1s infinite alternate;
}

@keyframes bgFlashRed {
  from { box-shadow: inset 0 0 0px rgba(255, 0, 85, 0); }
  to { box-shadow: inset 0 0 100px rgba(255, 0, 85, 0.4); }
}

/* Float Score */
@keyframes floatScoreUp {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-50px); opacity: 0; }
}

/* Wave Announcement */
.wave-announcement {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', cursive;
  font-size: 2rem;
  color: #ff00ff;
  text-shadow: 0 0 20px #ff00ff;
  z-index: 1000;
  pointer-events: none;
  animation: wavePop 2.5s ease-in-out forwards;
  text-align: center;
}

@keyframes wavePop {
  0% { opacity: 0; transform: translate(-50%, -60%) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
}

/* Audit Dashboard Styles */
.audit-metric {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 242, 255, 0.2);
  padding: 10px;
  border-radius: 6px;
  text-align: center;
}

.audit-metric-label {
  font-size: 0.6rem;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.audit-metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #00f2ff;
}

.audit-category-row {
  margin-bottom: 12px;
}

.audit-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.audit-bar-fill {
  height: 100%;
  transition: width 1s cubic-bezier(0.2, 0, 0.2, 1);
}

.clinical-explanation-modal {
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

#mode-selector {
  width: 100%;
  background: #0a0a0a;
  color: #ff00ff;
  border: 1px solid #ff00ff;
  padding: 8px;
  font-family: monospace;
  outline: none;
  cursor: pointer;
  margin-top: 5px;
}

/* Low health pulse */
.low-health-warning {
  box-shadow: inset 0 0 100px rgba(255, 0, 85, 0.4);
  animation: pulseHealth 1.5s infinite;
}

@keyframes pulseHealth {
  0% { box-shadow: inset 0 0 100px rgba(255, 0, 85, 0.2); }
  50% { box-shadow: inset 0 0 150px rgba(255, 0, 85, 0.6); }
  100% { box-shadow: inset 0 0 100px rgba(255, 0, 85, 0.2); }
}

#diagnostic-combo {
  position: fixed;
  right: 220px;
  bottom: 100px;
  font-family: 'Press Start 2P', cursive;
  color: #ffd166;
  text-shadow: 0 0 10px #ffd166;
  font-size: 1.2rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#diagnostic-combo.show {
  opacity: 1;
  animation: comboPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes comboPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
