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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #090D16;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #FFFFFF;
}

#player-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.screen-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: opacity 0.5s ease-in-out;
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Background animated mesh */
.mesh-background {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.15) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
              radial-gradient(circle at 50% 50%, #0F172A 0%, #090D16 100%);
  z-index: -1;
}

/* Header */
.player-header {
  padding: 28px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 240, 255, 0.25));
}

.header-clock {
  text-align: right;
}

#clock-time {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

#clock-date {
  font-size: 14px;
  color: #00F0FF;
  font-weight: 600;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* Main Status Display */
.player-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.status-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 240, 255, 0.15);
  border-radius: 24px;
  padding: 48px;
  max-width: 680px;
  width: 100%;
  text-align: center;
}

.status-indicator-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.status-dot-pulse {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00F0FF;
  box-shadow: 0 0 16px #00F0FF;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 16px rgba(0, 240, 255, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

.status-card h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #FFFFFF;
}

.status-card p {
  color: #94A3B8;
  font-size: 16px;
  margin-bottom: 32px;
}

.device-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.detail-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
}

.detail-label {
  display: block;
  font-size: 11px;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.detail-box strong {
  font-size: 14px;
  color: #F8FAFC;
  word-break: break-all;
}

/* Footer Ticker */
.player-footer {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  height: 54px;
  overflow: hidden;
}

.ticker-badge {
  background: linear-gradient(135deg, #00F0FF, #2563EB);
  color: #090D16;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 2;
}

.ticker-content {
  flex: 1;
  white-space: nowrap;
  animation: marquee 25s linear infinite;
  padding-left: 100%;
  font-size: 15px;
  color: #CBD5E1;
  font-weight: 500;
}

@keyframes marquee {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); }
}

/* Slide Viewport */
#media-viewport {
  position: absolute;
  inset: 0;
  background: #000000;
}

.slide {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slide.active {
  opacity: 1;
}

/* High-Precision Luxury Vector Chronometer Viewport */
.clock-slide-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, #0f172a 0%, #090d16 65%, #020617 100%);
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  pointer-events: none;
}

.clock-slide-view.active {
  opacity: 1;
  pointer-events: auto;
}

.analog-clock-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  max-width: 92vw;
  max-height: 92vh;
}

.analog-clock-svg {
  width: min(62vh, 62vw);
  height: min(62vh, 62vw);
  max-width: 530px;
  max-height: 530px;
  filter: drop-shadow(0 25px 60px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 35px rgba(0, 240, 255, 0.28));
  user-select: none;
}

.analog-clock-meta {
  text-align: center;
}

.analog-meta-time {
  font-size: clamp(24px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: 2px;
  color: #f8fafc;
  text-shadow: 0 4px 18px rgba(0, 240, 255, 0.35);
  font-variant-numeric: tabular-nums;
}

.analog-meta-date {
  font-size: clamp(13px, 1.6vw, 18px);
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* Floating HUD */
#player-hud {
  position: absolute;
  bottom: 16px;
  right: 20px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 9999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  z-index: 50;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

#player-hud:hover {
  opacity: 1;
}

.hud-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 6px #22C55E;
}

#fullscreen-btn {
  background: transparent;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  padding: 0;
  outline: none;
}

/* ============================================================
   EMERGENCY LIFE-SAFETY TAKEOVER OVERLAY
   ============================================================ */
.emergency-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #0D0202;
  background: radial-gradient(circle at center, #450A0A 0%, #230404 60%, #080101 100%);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  box-sizing: border-box;
  opacity: 1;
  pointer-events: auto;
}

.emergency-layer.hidden {
  display: none !important;
}

/* Pulsing Perimeter Strobe */
.emergency-strobe-border {
  position: absolute;
  inset: 0;
  border: 12px solid #EF4444;
  box-shadow: inset 0 0 50px rgba(239, 68, 68, 0.8), 0 0 60px rgba(239, 68, 68, 0.8);
  pointer-events: none;
  animation: strobePulse 1s infinite alternate;
}

@keyframes strobePulse {
  0% { border-color: #EF4444; box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.6); }
  100% { border-color: #F87171; box-shadow: inset 0 0 80px rgba(239, 68, 68, 1), 0 0 80px #EF4444; }
}

.emergency-container {
  max-width: 1100px;
  width: 100%;
  background: #0B0F19;
  border: 2px solid rgba(239, 68, 68, 0.6);
  border-radius: 28px;
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 60px rgba(239, 68, 68, 0.35);
  position: relative;
  z-index: 10;
}

.emergency-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.emergency-beacon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
}

.beacon-core {
  font-size: 52px;
  z-index: 2;
  animation: beaconShake 0.8s infinite;
}

@keyframes beaconShake {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
  100% { transform: rotate(0deg); }
}

.beacon-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.4);
  animation: beaconWave 1.4s infinite;
}

@keyframes beaconWave {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.9); opacity: 0; }
}

.emergency-headline h1 {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #FFFFFF;
  text-shadow: 0 2px 20px rgba(239, 68, 68, 0.8);
  margin-bottom: 8px;
}

.emergency-headline h2 {
  font-size: 26px;
  font-weight: 800;
  color: #FCA5A5;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  letter-spacing: 0;
}

/* Life Safety Directives Grid */
.emergency-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  margin-bottom: 28px;
}

.em-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 22px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.em-card.danger {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
}

.em-card.action {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
}

.em-card.guidance {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.12);
}

.em-icon {
  font-size: 42px;
}

.em-label {
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.em-label-ar {
  font-size: 13.5px;
  font-weight: 700;
  color: #CBD5E1;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

.emergency-instructions-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 14px;
  padding: 18px 24px;
  margin-bottom: 28px;
  width: 100%;
}

.emergency-instructions-box p {
  font-size: 16px;
  line-height: 1.6;
  color: #F1F5F9;
  margin-bottom: 8px;
}

.emergency-instructions-box p:last-child {
  margin-bottom: 0;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  color: #FCA5A5;
}

.emergency-actions-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-evac-map {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-evac-map:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 26px rgba(16, 185, 129, 0.6);
}

.btn-em-dismiss {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-em-dismiss:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #FFFFFF;
}

/* Simulation Button in HUD */
.hud-fire-btn {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #FCA5A5;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  outline: none;
}

.hud-fire-btn:hover {
  background: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

.hud-fire-btn.active-sim {
  background: #EF4444;
  color: #FFFFFF;
  animation: pulseSim 1s infinite alternate;
}

@keyframes pulseSim {
  0% { transform: scale(1); box-shadow: 0 0 8px #EF4444; }
  100% { transform: scale(1.08); box-shadow: 0 0 16px #EF4444; }
}


