* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #0b0e14;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
}

/* =========================================
   RUHEPHASE (SLIDESHOW)
   ========================================= */
#idle-view {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: #000;
}

.slide-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  height: calc(100vh - 48px);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-in-out;
}

.slide.active {
  opacity: 1;
  visibility: visible;
}

.slide iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #111;
}

.idle-bar {
  height: 48px;
  background: rgba(13, 17, 23, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  font-size: 1.1rem;
  font-weight: 500;
  z-index: 10;
}

.badge-ok {
  color: #00e676;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-ok::before {
  content: '';
  width: 10px;
  height: 10px;
  background: #00e676;
  border-radius: 50%;
  box-shadow: 0 0 10px #00e676;
}

/* =========================================
   ALARMANZEIGE
   ========================================= */
#alarm-view {
  display: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 10%, rgba(220, 20, 60, 0.25) 0%, #0b0e14 90%);
  padding: 2.5rem 3rem;
  flex-direction: column;
  justify-content: space-between;
  z-index: 9999;
  border: 8px solid rgba(255, 23, 68, 0.6);
  box-shadow: inset 0 0 50px rgba(255, 23, 68, 0.5);
  animation: alertPulse 2s infinite alternate;
}

@keyframes alertPulse {
  0%   { border-color: rgba(255, 23, 68, 0.5); }
  100% { border-color: rgba(255, 23, 68, 0.95); }
}

.alarm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* TIMER CONTAINER */
.timer-container {
  border-radius: 14px;
  padding: 0.5rem 2.2rem;
  text-align: center;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  transition: background-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
  min-width: 320px;
}

.timer-stage-green {
  background-color: #00c853;
  color: #0a1f0d;
  box-shadow: 0 0 35px rgba(0, 200, 83, 0.55);
}
.timer-stage-green .timer-label { color: rgba(10, 31, 13, 0.75); }

.timer-stage-yellow {
  background-color: #ffd600;
  color: #211b00;
  box-shadow: 0 0 35px rgba(255, 214, 0, 0.55);
}
.timer-stage-yellow .timer-label { color: rgba(33, 27, 0, 0.75); }

.timer-stage-red {
  background-color: #d50000;
  color: #ffffff;
  box-shadow: 0 0 45px rgba(213, 0, 0, 0.8);
  animation: timerAlertPulse 1s infinite alternate;
}
.timer-stage-red .timer-label { color: rgba(255, 255, 255, 0.85); }

@keyframes timerAlertPulse {
  0%   { transform: scale(1); }
  100% { transform: scale(1.02); }
}

.alarm-timer {
  font-size: 5.5rem;
  font-weight: 900;
  font-family: 'Courier New', Consolas, monospace;
  line-height: 1;
  letter-spacing: 2px;
}

.timer-label {
  font-size: 0.95rem;
  letter-spacing: 3px;
  margin-top: 4px;
  text-transform: uppercase;
  font-weight: 800;
}

.alarm-clock {
  font-size: 2.2rem;
  color: #a0aec0;
  font-weight: 600;
  text-align: right;
}

.priority-banner {
  background: linear-gradient(90deg, #d32f2f, #ff1744);
  color: #fff;
  font-size: 2.4rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  padding: 1rem;
  border-radius: 10px;
  border: 2px solid #ffeb3b;
  box-shadow: 0 0 25px rgba(255, 23, 68, 0.7);
  margin-bottom: 2rem;
}

.priority-banner.nosiren {
  background: linear-gradient(90deg, #1565c0, #1e88e5);
  border-color: #64b5f6;
  box-shadow: 0 0 25px rgba(30, 136, 229, 0.5);
}

.alarm-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 2.5rem;
  flex: 1;
}

.data-panel {
  background: rgba(18, 22, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2.2rem;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.field-tag {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #718096;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.field-keyword {
  font-size: 3.4rem;
  font-weight: 900;
  color: #ff3d00;
  line-height: 1.15;
  text-shadow: 0 0 15px rgba(255, 61, 0, 0.4);
  margin-bottom: 1.2rem;
}

.field-meldebild {
  font-size: 2.3rem;
  color: #e2e8f0;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 2rem;
}

.field-destination {
  font-size: 3.4rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.field-destination span { color: #ffeb3b; }

.units-panel {
  background: rgba(18, 22, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.8rem;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
}

/* FAHRZEUG-KACHELN MIT KATEGORIE-STYLING */
.unit-pill {
  border-radius: 10px;
  padding: 0.9rem 1.2rem;
  font-size: 1.9rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  letter-spacing: 1px;
}

/* Rettungswagen (RTW / 83) */
.unit-pill.rd-rtw {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.25), rgba(33, 150, 243, 0.08));
  border: 2px solid #2196f3;
  color: #90caf9;
  text-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
}

/* Notarzt (NEF / 82) */
.unit-pill.rd-nef {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.25), rgba(244, 67, 54, 0.08));
  border: 2px solid #f44336;
  color: #ff8a80;
  text-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

/* Feuerwehr (Florian / FL) */
.unit-pill.fw-unit {
  background: linear-gradient(135deg, rgba(255, 87, 34, 0.28), rgba(213, 0, 0, 0.1));
  border: 2px solid #ff5722;
  color: #ffccbc;
  text-shadow: 0 0 10px rgba(255, 87, 34, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

/* DEBUG STEUERUNG */
.debug-controls {
  position: fixed;
  bottom: 60px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10000;
  opacity: 0.15;
  transition: opacity 0.2s;
}
.debug-controls:hover { opacity: 1; }
.debug-btn {
  background: #333;
  color: #fff;
  border: 1px solid #777;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* SMARTPHONE & TABLET RESPONSIVE ADAPTIONS */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
  }
  #alarm-view {
    padding: 1rem;
    position: relative;
    min-height: 100vh;
  }
  .alarm-header {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  .alarm-clock {
    text-align: center;
    font-size: 1.4rem;
  }
  .timer-container {
    min-width: 100%;
  }
  .alarm-timer {
    font-size: 3.5rem;
  }
  .priority-banner {
    font-size: 1.4rem;
    padding: 0.6rem;
    margin-bottom: 1rem;
  }
  .alarm-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .field-keyword {
    font-size: 2.2rem;
  }
  .field-meldebild {
    font-size: 1.4rem;
  }
  .field-destination {
    font-size: 2.2rem;
  }
  .unit-pill {
    font-size: 1.2rem;
    padding: 0.6rem;
  }
}