/* Radar PFO — utilitarian monitoring UI */

:root {
  --bg-primary: #080c12;
  --bg-secondary: #10151d;
  --bg-card: #141a23;
  --bg-elevated: #1c232e;
  --border-color: #262f3b;
  --border-subtle: #1a212b;

  /* Status colors */
  --color-safe: #3fb950;
  --color-info: #58a6ff;
  --color-warning: #d29922;
  --color-danger: #f85149;
  --color-missile: #7d0a1f;

  /* Text */
  --text-main: #e6edf3;
  --text-muted: #8b949e;
  --text-subtle: #6e7681;

  /* Typography */
  --font-main: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font-main);
  --font-body: var(--font-main);

  /* Layout */
  --header-height: 48px;
  --nav-height: 56px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

.theme-light {
  --bg-primary: #f6f8fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f6f8fa;
  --border-color: #d0d7de;
  --border-subtle: #eaeef2;
  --text-main: #1f2328;
  --text-muted: #656d76;
  --text-subtle: #8c959f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  font-family: var(--font-main);
  color: var(--text-main);
  overflow: hidden;
  position: relative;
}

/* Legacy background elements — hidden until removed from HTML */
.cyber-grid,
.radar-sweep-effect,
.glass-bg-blobs {
  display: none;
}

/* Card system */
.glass {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.15s ease;
}

.glass-card:hover {
  border-color: #484f58;
}

.overlay-card {
  width: 90%;
  max-width: 400px;
  padding: 24px;
  border-radius: var(--radius-md);
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

/* App shell */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  background: var(--bg-primary);
}

/* Header */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  max-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.header-logo-glow {
  display: none;
}

.logo-text {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  color: var(--text-main);
  white-space: nowrap;
}

.radar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.status-text {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pulse.green {
  background-color: var(--color-safe);
}

.status-pulse.red {
  background-color: var(--color-danger);
}

/* Main content */
.app-main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + 16px);
}

.app-tab-panel {
  display: none;
}

.app-tab-panel.active {
  display: block;
}

/* Bottom navigation */
.app-navigation {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  z-index: 20;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  gap: 4px;
  cursor: pointer;
  flex: 1;
  height: 100%;
  transition: color 0.15s ease;
}

.nav-item.active {
  color: var(--color-info);
}

.nav-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform 0.15s ease;
}

.nav-item:active .nav-icon {
  transform: scale(0.92);
}

.nav-item span {
  font-size: 0.7rem;
  font-weight: 500;
}

/* Feed filters */
.feed-filters {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-box input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-box input:focus {
  border-color: var(--color-info);
}

.search-box input::placeholder {
  color: var(--text-subtle);
}

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip.active {
  background: var(--bg-elevated);
  color: var(--text-main);
  border-color: #484f58;
  font-weight: 600;
}

/* Alerts feed */
.alerts-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-card {
  border-left: 3px solid var(--color-info);
  position: relative;
}

.alert-card.danger,
.alert-card.uav-danger {
  border-left-color: var(--color-danger);
}

.alert-card.warning,
.alert-card.uav-warning {
  border-left-color: var(--color-warning);
}

.alert-card.info {
  border-left-color: var(--color-info);
}

.alert-card.cleared {
  border-left-color: var(--color-safe);
  opacity: 0.85;
}

.alert-card.missile-warning {
  border-left-color: var(--color-warning);
}

.alert-card.missile-danger {
  border-left-color: #a40e26;
}

.alert-card.cleared-card-dimmed {
  opacity: 0.7;
}

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.alert-level-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.danger .alert-level-badge,
.uav-danger .alert-level-badge {
  background: rgba(248, 81, 73, 0.12);
  color: var(--color-danger);
  border: 1px solid rgba(248, 81, 73, 0.25);
}

.warning .alert-level-badge,
.uav-warning .alert-level-badge {
  background: rgba(210, 153, 34, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(210, 153, 34, 0.25);
}

.info .alert-level-badge {
  background: rgba(88, 166, 255, 0.12);
  color: var(--color-info);
  border: 1px solid rgba(88, 166, 255, 0.25);
}

.cleared .alert-level-badge {
  background: rgba(63, 185, 80, 0.12);
  color: var(--color-safe);
  border: 1px solid rgba(63, 185, 80, 0.25);
}

.missile-warning .alert-level-badge {
  background: rgba(248, 81, 73, 0.12);
  color: var(--color-danger);
  border: 1px solid rgba(248, 81, 73, 0.25);
}

.missile-danger .alert-level-badge {
  background: rgba(164, 14, 38, 0.15);
  color: #ff7b72;
  border: 1px solid rgba(164, 14, 38, 0.35);
}

.alert-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.alert-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-main);
  margin-bottom: 10px;
}

.alert-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.region-tag {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 6px;
  color: var(--text-muted);
}

.region-tag.highlight {
  background: rgba(88, 166, 255, 0.08);
  border-color: rgba(88, 166, 255, 0.25);
  color: var(--color-info);
}

/* Loading & empty states */
.loading-placeholder,
.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-color);
  border-top-color: var(--color-info);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Map */
.map-view-header {
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.75rem;
  text-align: center;
}

.map-legend {
  display: flex;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.color-dot.safe { background-color: var(--color-safe); }
.color-dot.info { background-color: var(--color-info); }
.color-dot.warning { background-color: var(--color-warning); }
.color-dot.danger { background-color: var(--color-danger); }

#tab-map {
  margin: -16px;
  height: calc(100vh - var(--header-height) - var(--nav-height) - 1px);
  position: relative;
  overflow: hidden;
  background-color: var(--bg-primary);
}

.map-body {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.map-canvas {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.radar-svg-map {
  max-width: 100%;
  max-height: 100%;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.map-region {
  stroke: var(--bg-primary);
  stroke-width: 1.2;
  cursor: pointer;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.map-canvas.panning .map-region {
  transition: none !important;
  animation: none !important;
}

.map-region.safe {
  fill: rgba(63, 185, 80, 0.1);
  stroke: rgba(63, 185, 80, 0.35);
}

.map-region.info {
  fill: rgba(88, 166, 255, 0.12);
  stroke: rgba(88, 166, 255, 0.4);
}

/* Внимание по БПЛА — жёлтый */
.map-region.uav-warning,
.map-region.warning {
  fill: rgba(210, 153, 34, 0.55);
  stroke: #d29922;
  stroke-width: 1.4;
}

/* Опасность по БПЛА — красный */
.map-region.uav-danger,
.map-region.danger {
  fill: rgba(248, 81, 73, 0.6);
  stroke: #f85149;
  stroke-width: 1.6;
}

/* Внимание по ракетной опасности — мигает */
.map-region.missile-warning {
  fill: rgba(248, 81, 73, 0.5);
  stroke: #ff6b6b;
  stroke-width: 1.6;
  animation: missileWarnBlink 1s steps(1, end) infinite;
}

/* Ракетная опасность — бордовый (залит) */
.map-region.missile-danger {
  fill: #7d0a1f;
  stroke: #ff4d4d;
  stroke-width: 1.8;
  animation: missileDangerPulse 1.6s ease-in-out infinite;
}

@keyframes missileWarnBlink {
  0%, 49% { fill: rgba(248, 81, 73, 0.55); }
  50%, 100% { fill: rgba(210, 153, 34, 0.35); }
}

@keyframes missileDangerPulse {
  0%, 100% { fill: #7d0a1f; }
  50% { fill: #a40e26; }
}

.map-airport-badge {
  transition: opacity 0.2s ease;
}

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

.map-region:hover {
  fill-opacity: 0.85;
}

.map-region.selected {
  stroke: var(--text-main) !important;
  stroke-width: 2 !important;
  fill-opacity: 0.9;
}

/* Map bottom sheet */
.region-detail-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 16px 16px;
  max-height: 80vh;
  overflow-y: auto;
}

.hidden,
.region-detail-card.hidden {
  display: none !important;
}

.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  margin: -8px auto 16px;
}

.btn-close-detail {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-close-detail:hover {
  background: var(--border-color);
  color: var(--text-main);
}

.region-detail-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px;
}

.region-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  margin: 4px 0 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
}

.region-active-threats {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  max-height: 140px;
  overflow-y: auto;
}

/* Settings */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-group h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.setting-item:last-of-type {
  border-bottom: none;
}

.setting-item-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.setting-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.setting-label span:first-child {
  font-size: 0.85rem;
  font-weight: 500;
}

.setting-label .desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tips-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  border-color: rgba(210, 153, 34, 0.25);
  background: var(--bg-card);
}

.tips-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: none;
  padding-bottom: 0;
}

.tips-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
  max-width: 90%;
}

.tips-card .btn-primary {
  width: 90%;
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid rgba(210, 153, 34, 0.35);
  box-shadow: none;
}

.tips-card .btn-primary:hover {
  background: rgba(210, 153, 34, 0.1);
  border-color: rgba(210, 153, 34, 0.5);
}

/* Form controls */
.styled-select,
.styled-input {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-main);
  font-family: var(--font-main);
  outline: none;
  font-size: 0.8rem;
  transition: border-color 0.15s ease;
  max-width: 160px;
  flex-shrink: 0;
}

.styled-select:focus,
.styled-input:focus {
  border-color: var(--color-info);
}

.styled-input {
  width: 100%;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* Buttons */
.btn {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn-primary {
  background: var(--color-info);
  color: #0d1117;
  border-color: var(--color-info);
}

.btn-primary:hover {
  background: #79b8ff;
  border-color: #79b8ff;
}

.btn-primary:active {
  background: #4493f8;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
  border-color: #484f58;
}

.btn-disabled {
  background: var(--bg-primary) !important;
  color: var(--text-subtle) !important;
  border: 1px solid var(--border-subtle) !important;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  transition: 0.2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: rgba(88, 166, 255, 0.2);
  border-color: var(--color-info);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: var(--color-info);
}

/* Onboarding */
.onboarding-card {
  width: 90%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  box-sizing: border-box;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.92);
  display: none;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 20px 0;
  z-index: 100;
}

.modal-overlay.active {
  display: flex;
}

.onboarding-header {
  text-align: center;
}

.radar-logo-container {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.radar-glow-ring,
.radar-scanner {
  display: none;
}

.radar-logo-fallback {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-info);
  letter-spacing: 0.05em;
}

.radar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.onboarding-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  margin-bottom: 4px;
}

.onboarding-header .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.onboarding-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.onboarding-step h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-main);
}

.step-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.select-wrapper select {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  outline: none;
  font-family: var(--font-main);
  font-size: 0.875rem;
}

.permission-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.permission-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.permission-item .btn {
  width: 100%;
  box-sizing: border-box;
}

.permission-title {
  font-size: 0.85rem;
  font-weight: 500;
}

.permission-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.onboarding-notice {
  background: rgba(210, 153, 34, 0.08);
  border: 1px solid rgba(210, 153, 34, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--color-warning);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.onboarding-footer {
  text-align: center;
  margin-top: 8px;
}

.onboarding-footer .btn {
  width: 100%;
}

.about-card p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.about-tg-link {
  font-size: 0.8rem;
  margin-top: 12px;
}

.about-tg-link a {
  color: var(--color-info);
  text-decoration: none;
  font-weight: 500;
}

.about-tg-link a:hover {
  text-decoration: underline;
}

/* CSS icon: warning triangle */
.icon-warning {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid var(--color-warning);
  margin-top: 2px;
}

/* Emergency overlay */
.emergency-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.97);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 250;
}

.emergency-overlay.active {
  display: flex;
}

.emergency-container {
  width: 90%;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

.emergency-icon,
.emergency-icon-glow {
  width: 56px;
  height: 56px;
  position: relative;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}

.emergency-icon::before,
.emergency-icon-glow::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 8px auto 0;
  border-left: 28px solid transparent;
  border-right: 28px solid transparent;
  border-bottom: 48px solid var(--color-danger);
}

.emergency-icon::after,
.emergency-icon-glow::after {
  content: "!";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -35%);
  font-size: 1.4rem;
  font-weight: 700;
  color: #0d1117;
  line-height: 1;
}

.emergency-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-danger);
}

.emergency-region {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
}

.emergency-badge {
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(248, 81, 73, 0.15);
  color: var(--color-danger);
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(248, 81, 73, 0.3);
  letter-spacing: 0.02em;
}

.emergency-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  padding: 0 8px;
}

.emergency-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.btn-emergency {
  background: var(--color-danger);
  color: #fff;
  font-size: 0.9rem;
  padding: 12px 24px;
  border: 1px solid var(--color-danger);
}

.btn-emergency:active {
  background: #da3633;
}

.btn-emergency-soft {
  background: rgba(210, 153, 34, 0.18);
  color: var(--color-warning);
  font-size: 0.9rem;
  padding: 12px 24px;
  border: 1px solid rgba(210, 153, 34, 0.4);
}

.btn-emergency-soft:active {
  background: rgba(210, 153, 34, 0.3);
}

/* Toasts */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  max-width: 400px;
  pointer-events: none;
}

.custom-toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-main);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}

.custom-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.custom-toast.uav-danger,
.custom-toast.missile-danger {
  border-left: 3px solid var(--color-danger);
}

.custom-toast.uav-warning,
.custom-toast.missile-warning {
  border-left: 3px solid var(--color-warning);
}

.custom-toast.cleared {
  border-left: 3px solid var(--color-safe);
}

.toast-icon {
  flex-shrink: 0;
  width: 4px;
  min-height: 36px;
  align-self: stretch;
  border-radius: 2px;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  color: transparent;
  background: var(--color-info);
}

.custom-toast.uav-danger .toast-icon,
.custom-toast.missile-danger .toast-icon {
  background: var(--color-danger);
}

.custom-toast.uav-warning .toast-icon,
.custom-toast.missile-warning .toast-icon {
  background: var(--color-warning);
}

.custom-toast.cleared .toast-icon {
  background: var(--color-safe);
}

.toast-indicator {
  flex-shrink: 0;
  width: 4px;
  min-height: 36px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--color-info);
}

.custom-toast.uav-danger .toast-indicator,
.custom-toast.missile-danger .toast-indicator {
  background: var(--color-danger);
}

.custom-toast.uav-warning .toast-indicator,
.custom-toast.missile-warning .toast-indicator {
  background: var(--color-warning);
}

.custom-toast.cleared .toast-indicator {
  background: var(--color-safe);
}

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-main);
}

.toast-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Admin controls (legacy — hidden by default in user builds) */
.admin-controls-section h4 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.danger-btn {
  background: rgba(248, 81, 73, 0.15) !important;
  color: var(--color-danger) !important;
  border: 1px solid rgba(248, 81, 73, 0.3) !important;
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseRing {
  0% { r: 14; opacity: 0.7; }
  100% { r: 20; opacity: 0; }
}

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

.animate-fade-up {
  animation: fadeUp 0.4s ease-out both;
}

.status-pulse.green,
.status-pulse.red {
  animation: statusPulse 2s ease-in-out infinite;
}

/* Auth overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  padding: 20px;
  transition: opacity 0.3s ease;
}

.auth-overlay.hidden {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
}

.auth-logo-wrap {
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.auth-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-title-danger {
  color: var(--color-danger);
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.auth-note {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 16px;
}

.auth-error {
  color: var(--color-danger);
  font-size: 0.8rem;
  margin-top: 12px;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: #fff;
  color: #1f2328;
  border: 1px solid #d0d7de;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-google:active {
  transform: scale(0.98);
}

.btn-google:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.google-btn-host {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
}

.google-btn-host.hidden {
  display: none;
}

.auth-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.auth-actions .btn-google {
  flex: 1 1 0;
  min-width: 0;
}

.auth-actions .btn-device-continue {
  flex: 1 1 0;
  min-width: 0;
  margin-top: 0;
}

.btn-device-continue {
  padding: 14px 20px;
  background: var(--color-info);
  color: #06131f;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
}

.btn-device-continue:hover {
  filter: brightness(1.08);
}

.btn-device-continue:active {
  transform: scale(0.98);
}

.btn-device-continue:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.blocked-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(248, 81, 73, 0.15);
  border: 2px solid var(--color-danger);
  position: relative;
}

.blocked-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 2px;
  background: var(--color-danger);
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Account card */
.account-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-info);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.account-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.account-email {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Tips card */
.tips-card {
  text-align: center;
}

.tips-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.btn-accent {
  display: inline-block;
  width: 100%;
  padding: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-accent:active {
  background: var(--border-color);
}

/* Map toolbar */
.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.map-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.safe { background: var(--color-safe); }
.legend-dot.warning { background: var(--color-warning); }
.legend-dot.danger { background: var(--color-danger); }

.map-controls {
  display: flex;
  gap: 4px;
}

.map-ctrl-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.map-ctrl-btn:active {
  background: var(--border-color);
}

.map-body {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
}

#tab-map {
  display: none;
  flex-direction: column;
  height: 100%;
}

#tab-map.active {
  display: flex;
}

.map-region-label {
  font-size: 5px;
  font-weight: 600;
  fill: #e6edf3;
  stroke: none;
  opacity: 0.95;
  pointer-events: none;
  letter-spacing: 0;
  font-family: var(--font-main);
  text-rendering: geometricPrecision;
}

.map-region.uav-danger,
.map-region.danger {
  animation: regionPulse 2.5s ease-in-out infinite;
}

.map-region.uav-warning,
.map-region.warning {
  animation: regionPulse 3s ease-in-out infinite;
}

@keyframes regionPulse {
  0%, 100% { fill-opacity: 1; }
  50% { fill-opacity: 0.7; }
}

.map-uav-badge .uav-pulse-ring {
  animation: uavRingPulse 2s ease-out infinite;
}

@keyframes uavRingPulse {
  0% { r: 14; opacity: 0.6; }
  100% { r: 22; opacity: 0; }
}

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

.airport-status {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.airport-status.closed {
  color: var(--color-danger);
  background: rgba(248, 81, 73, 0.1);
}

.airport-status.open {
  color: var(--color-safe);
  background: rgba(63, 185, 80, 0.1);
}

.uav-fixed-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-warning);
  background: rgba(210, 153, 34, 0.1);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.threat-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 8px;
}

.connection-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.connection-error p {
  font-size: 1rem;
  margin: 12px 0 4px;
}

.connection-error span {
  font-size: 0.82rem;
}

.notice-box {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: rgba(210, 153, 34, 0.08);
  border: 1px solid rgba(210, 153, 34, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: 12px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-warning);
}

.onboarding-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.onboarding-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.onboarding-step {
  position: relative;
}

.onboarding-step-num {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--color-info);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-card {
  animation: fadeUp 0.3s ease-out both;
}

.nav-item {
  transition: color 0.2s ease, background 0.2s ease;
}

.chip {
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ============ Design polish ============ */
.app-header {
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.98), rgba(13, 17, 23, 0.9));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}

.logo-text {
  font-size: 1rem;
  background: linear-gradient(90deg, #e6edf3, #58a6ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-pulse.green { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.6); animation: pulseGreen 2.4s ease-out infinite; }
.status-pulse.red { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.7); animation: pulseRed 1.3s ease-out infinite; }

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}
@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(248, 81, 73, 0); }
  100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0); }
}

/* Active nav gets a top accent bar */
.nav-item {
  position: relative;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--color-info);
}

/* Alert cards: colored left accent + depth */
.alert-card {
  border-left: 3px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.alert-card.uav-warning { border-left-color: var(--color-warning); }
.alert-card.uav-danger { border-left-color: var(--color-danger); }
.alert-card.missile-warning { border-left-color: #ff6b6b; }
.alert-card.missile-danger { border-left-color: #7d0a1f; }
.alert-card.cleared { border-left-color: var(--color-safe); }

/* Map toolbar as floating pill */
.map-toolbar {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.map-ctrl-btn {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Region detail bottom sheet polish */
.region-detail-card {
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.4);
}

/* Filter chips active */
.chip.active {
  background: var(--color-info);
  color: #06131f;
  border-color: var(--color-info);
  font-weight: 700;
}

/* ============ v1.4 redesign layer ============ */

.header-logo-icon {
  color: var(--color-info);
  filter: drop-shadow(0 0 4px rgba(88, 166, 255, 0.4));
}

/* Threat status strip below header */
.threat-strip {
  height: 3px;
  width: 100%;
  flex-shrink: 0;
  background: var(--color-safe);
  transition: background 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 0 8px rgba(63, 185, 80, 0.5);
}
.threat-strip.safe {
  background: var(--color-safe);
  box-shadow: 0 0 8px rgba(63, 185, 80, 0.5);
}
.threat-strip.warning {
  background: var(--color-warning);
  box-shadow: 0 0 10px rgba(210, 153, 34, 0.6);
}
.threat-strip.danger {
  background: var(--color-danger);
  box-shadow: 0 0 12px rgba(248, 81, 73, 0.7);
}
.threat-strip.missile {
  background: linear-gradient(90deg, #7d0a1f, #f85149, #7d0a1f);
  background-size: 200% 100%;
  box-shadow: 0 0 16px rgba(164, 14, 38, 0.9);
  animation: stripSlide 1.4s linear infinite;
}
@keyframes stripSlide {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* Glass cards get a subtle matte blur + depth */
.glass-card {
  background: linear-gradient(160deg, rgba(28, 35, 46, 0.7), rgba(20, 26, 35, 0.85));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Alert card: icon slot on the left */
.alert-card {
  display: block;
}
.alert-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-type-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  background: rgba(88, 166, 255, 0.12);
}
.alert-card.uav-warning .alert-type-icon,
.alert-card.warning .alert-type-icon { background: rgba(210, 153, 34, 0.16); }
.alert-card.uav-danger .alert-type-icon,
.alert-card.danger .alert-type-icon { background: rgba(248, 81, 73, 0.16); }
.alert-card.missile-warning .alert-type-icon { background: rgba(255, 107, 107, 0.18); }
.alert-card.missile-danger .alert-type-icon { background: rgba(164, 14, 38, 0.28); }
.alert-card.cleared .alert-type-icon { background: rgba(63, 185, 80, 0.16); }

.alert-time-ago {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-subtle);
}
.alert-time-ago::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.4px solid currentColor;
  position: relative;
  display: inline-block;
}

/* Emergency overlay: pulsing red glow */
.emergency-overlay {
  background: radial-gradient(circle at 50% 40%, rgba(60, 6, 12, 0.96), rgba(8, 12, 18, 0.99));
}
.emergency-pulse-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 120px 20px rgba(248, 81, 73, 0.35);
  animation: emergencyGlow 1.4s ease-in-out infinite;
}
@keyframes emergencyGlow {
  0%, 100% { box-shadow: inset 0 0 100px 10px rgba(248, 81, 73, 0.25); }
  50% { box-shadow: inset 0 0 160px 40px rgba(248, 81, 73, 0.55); }
}
.emergency-container {
  position: relative;
  z-index: 1;
}
.emergency-region {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ============ Drone mini-game ============ */
.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  flex-direction: column;
  background: #0a1018;
}
.game-overlay.active { display: flex; }

.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(16,21,29,0.95), rgba(10,16,24,0.6));
  border-bottom: 1px solid var(--border-color);
  z-index: 2;
}
.game-hud-left { display: flex; gap: 16px; }
.game-hud-right { display: flex; align-items: center; gap: 14px; }
.game-stat { font-size: 0.85rem; color: var(--text-muted); }
.game-stat b { color: var(--text-main); font-variant-numeric: tabular-nums; }
.game-lives { color: var(--color-danger); letter-spacing: 2px; font-size: 0.95rem; }
.game-mult {
  font-size: 0.9rem;
  font-weight: 800;
  color: #56d364;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-shadow: 0 0 10px rgba(86,211,100,0.6);
}
.game-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
}
.game-close:active { background: var(--bg-elevated); }

#drone-game-canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.game-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(12,20,30,0.78), rgba(8,12,18,0.94));
  backdrop-filter: blur(4px);
}
.game-panel.hidden { display: none; }
.game-title {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(90deg, #e6edf3, #58a6ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.game-sub { color: var(--text-muted); max-width: 320px; line-height: 1.5; }
.game-sub b { color: var(--text-main); }
.game-big-btn {
  margin-top: 8px;
  min-width: 180px;
  font-size: 1rem;
  padding: 14px 28px;
}

/* ============ v1.4 design polish layer ============ */

/* Buttons: gradients, depth, tactile press */
.btn { transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease; }
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: linear-gradient(180deg, #6cb0ff, #3b82f6);
  border-color: #3b82f6;
  color: #06131f;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover { background: linear-gradient(180deg, #7cbcff, #4a8ef8); }

.btn-accent {
  box-shadow: 0 4px 14px rgba(63, 185, 80, 0.28);
}

.btn-emergency { box-shadow: 0 6px 20px rgba(248, 81, 73, 0.45); }

/* Bottom nav: active gets an elevated pill */
.app-navigation {
  background: linear-gradient(0deg, rgba(16,21,29,0.98), rgba(12,17,24,0.9));
  backdrop-filter: blur(10px);
}
.nav-item {
  border-radius: 12px;
  margin: 6px 4px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.nav-item.active {
  background: rgba(88, 166, 255, 0.12);
}
.nav-item:active { transform: scale(0.94); }

/* Cards: gentle lift on press for tactile feel */
.glass-card { transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease; }
.glass-card:active { transform: translateY(1px); }

/* Settings section headers get an accent bar */
.settings-group h3 {
  position: relative;
  padding-left: 12px;
}
.settings-group h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(180deg, #58a6ff, #3b82f6);
}
.game-card h3::before { background: linear-gradient(180deg, #56d364, #2ea043); }
.tips-card h3::before { background: linear-gradient(180deg, #f0b429, #d29922); }

/* Map controls: larger, floating, with shadow */
.map-ctrl-btn {
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Region detail bottom sheet slides up */
.region-detail-card { animation: sheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Spinner accent color */
.spinner { border-top-color: var(--color-info) !important; }

/* Emergency actions: bigger tap targets */
.emergency-actions .btn { padding: 14px 24px; font-size: 0.95rem; }

.ios-install-hint {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(56, 139, 253, 0.95);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.ios-install-hint p { margin: 0; }

/* Auth + onboarding cards get depth */
.auth-card, .onboarding-card {
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}

/* Filter chips: smoother active */
.chip { transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.12s ease; }
.chip:active { transform: scale(0.96); }

/* ==================================================================
   v1.5 — Premium visual layer
   ================================================================== */

/* Ambient depth: soft radial glows behind the whole app */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -8%, rgba(88,166,255,0.10), transparent 60%),
    radial-gradient(800px 520px at 110% 8%, rgba(63,185,80,0.06), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(88,166,255,0.05), transparent 60%);
}
.app-container { z-index: 1; background: transparent; }

/* Header: glassy, luminous logo with a slow radar sweep ring */
.app-header {
  background: linear-gradient(180deg, rgba(20,26,35,0.92), rgba(10,14,20,0.72));
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.03), 0 6px 20px rgba(0,0,0,0.25);
}
.header-logo { position: relative; }
.header-logo-icon {
  filter: drop-shadow(0 0 6px rgba(88,166,255,0.55));
}
.header-logo::after {
  content: "";
  position: absolute;
  left: -3px; top: 50%;
  width: 28px; height: 28px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(88,166,255,0.35), transparent 55%);
  -webkit-mask: radial-gradient(circle, transparent 6px, #000 7px, #000 13px, transparent 14px);
  mask: radial-gradient(circle, transparent 6px, #000 7px, #000 13px, transparent 14px);
  animation: radarSweep 3.4s linear infinite;
  pointer-events: none;
}
@keyframes radarSweep { to { transform: translateY(-50%) rotate(360deg); } }
.logo-text {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

/* Status pill: crisp glass chip */
.radar-status {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(6px);
}

/* Content: comfortable rhythm */
.app-main-content { position: relative; z-index: 1; }

/* Feed filter bar becomes a floating glass panel */
.feed-filters {
  background: linear-gradient(160deg, rgba(28,35,46,0.55), rgba(18,24,32,0.72));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 22px rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
}
.search-box input {
  background: rgba(8,12,18,0.7);
  border: 1px solid rgba(255,255,255,0.07);
}

/* Premium alert cards: gradient tint + colored glow strip */
.alert-card {
  border: 1px solid rgba(255,255,255,0.06);
  border-left-width: 3px;
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(30,37,48,0.7), rgba(18,23,31,0.86));
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  overflow: hidden;
}
.alert-card.uav-warning { box-shadow: 0 6px 20px rgba(0,0,0,0.28), inset 3px 0 0 -1px rgba(210,153,34,0.5); }
.alert-card.uav-danger  { box-shadow: 0 6px 20px rgba(0,0,0,0.28), inset 3px 0 0 -1px rgba(248,81,73,0.5); }
.alert-card.missile-danger {
  background: linear-gradient(150deg, rgba(80,12,24,0.55), rgba(20,14,18,0.9));
}
.alert-type-icon {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.alert-card.missile-danger .alert-type-icon { animation: iconThrob 1.3s ease-in-out infinite; }
@keyframes iconThrob { 0%,100%{ transform: scale(1);} 50%{ transform: scale(1.12);} }

.alert-level-badge { letter-spacing: 0.04em; }
.region-tag {
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.region-tag.highlight {
  background: rgba(88,166,255,0.16);
  border-color: rgba(88,166,255,0.4);
  color: #cfe4ff;
}

/* Bottom nav: elevated glass bar + glowing active icon */
.app-navigation {
  background: linear-gradient(0deg, rgba(14,19,27,0.98), rgba(12,17,24,0.82));
  border-top: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.35);
}
.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 6px rgba(88,166,255,0.7));
  transform: translateY(-1px) scale(1.05);
}
.nav-item.active::before {
  box-shadow: 0 0 8px rgba(88,166,255,0.8);
}

/* Settings cards: refined glass with hairline top highlight */
.settings-group {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(28,35,46,0.62), rgba(18,23,31,0.85));
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  position: relative;
}
.settings-group::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}
.settings-group h3 { font-weight: 700; letter-spacing: -0.01em; }

/* Support / game buttons pop */
.btn-accent {
  background: linear-gradient(180deg, #56d364, #2ea043);
  border-color: #2ea043;
  color: #05210f;
  font-weight: 700;
}
.btn-accent:hover { background: linear-gradient(180deg, #62df70, #35b34c); }

/* Toggle switches: nicer knob + accent track */
.switch input:checked + .slider {
  background: linear-gradient(90deg, #3b82f6, #58a6ff);
  box-shadow: 0 0 10px rgba(88,166,255,0.4);
}

/* Map: framed canvas + glassy legend */
.map-canvas {
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 8px 26px rgba(0,0,0,0.3);
  overflow: hidden;
}
.map-toolbar, .map-legend {
  background: rgba(14,19,27,0.7);
  border: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
  border-radius: 12px;
}
.map-ctrl-btn {
  background: rgba(20,26,35,0.9);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-main);
}
.map-ctrl-btn:active { background: rgba(88,166,255,0.2); }

/* Region detail sheet: premium glass */
.region-detail-card {
  background: linear-gradient(180deg, rgba(24,30,40,0.94), rgba(14,19,27,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 34px rgba(0,0,0,0.5);
}
.bottom-sheet-handle {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

/* Emergency screen: cinematic */
.emergency-title {
  text-shadow: 0 0 24px rgba(248,81,73,0.6);
  letter-spacing: -0.01em;
}
.emergency-badge {
  background: rgba(248,81,73,0.16);
  border: 1px solid rgba(248,81,73,0.5);
  box-shadow: 0 0 18px rgba(248,81,73,0.35);
}
.emergency-icon::before, .emergency-icon-glow::before {
  filter: drop-shadow(0 0 12px rgba(248,81,73,0.8));
}

/* Onboarding step numbers glow */
.onboarding-step-num {
  background: linear-gradient(180deg, #3b82f6, #58a6ff);
  color: #06131f;
  box-shadow: 0 0 12px rgba(88,166,255,0.5);
}

/* Smooth fade-in for tab panels */
.app-tab-panel.active { animation: tabFade 0.28s ease both; }
@keyframes tabFade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none;} }

/* Custom scrollbar */
.app-main-content::-webkit-scrollbar { width: 8px; }
.app-main-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
}
