/* Shared interaction and accessibility layer for Raizenko Cloud projects. */

html {
  color-scheme: dark;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip;
}

button,
input,
select,
textarea,
a,
[role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(84, 214, 255, 0.2);
}

:where(button, input, select, textarea, a, [role="button"]):focus-visible {
  outline: 3px solid #54d6ff !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(84, 214, 255, 0.18) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
[id] {
  scroll-margin-top: 5rem;
}

input[type="range"] {
  min-height: 44px;
  cursor: pointer;
}

.leaflet-control-zoom a {
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 22px !important;
}

@media (pointer: coarse) {
  button,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    min-height: 44px;
  }

  button[aria-label] {
    min-width: 44px;
  }

  button:has(> svg:only-child),
  button:has(> span:only-child),
  [role="button"][aria-label] {
    min-width: 44px;
  }
}

/* Satellite deck: keep the telemetry card inside narrow viewports. */
body[data-rz-project="satellites"] .stats-panel {
  max-width: calc(100vw - 24px) !important;
}

body[data-rz-project="satellites"] .filter-panel {
  max-width: calc(100vw - 24px) !important;
}

body[data-rz-project="grid"] .panel h2 {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: normal;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  button,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    min-height: 44px;
  }

  button[aria-label] {
    min-width: 44px;
  }

  body[data-rz-project="home"] .ambient-orb,
  body[data-rz-project="home"] .ambient-orb-2 {
    animation: none !important;
    transform: none !important;
  }

  body[data-rz-project="satellites"] #ui-container {
    padding: 12px !important;
  }

  body[data-rz-project="satellites"] .header-section h1 {
    font-size: 1.65rem !important;
    letter-spacing: 2px !important;
  }

  body[data-rz-project="satellites"] .stats-panel {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    flex-wrap: wrap !important;
    gap: 10px 20px !important;
    padding: 12px 14px !important;
  }

  body[data-rz-project="satellites"] .stat-value {
    font-size: 1.25rem !important;
  }

  body[data-rz-project="satellites"] .filter-panel {
    width: auto !important;
    padding: 10px 14px !important;
  }

  body[data-rz-project="satellites"] .filter-label {
    min-height: 40px;
  }

  body[data-rz-project="satellites"] .filter-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  body[data-rz-project="weather-systems"] .shell {
    inset: auto !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    margin: 10px !important;
  }

  body[data-rz-project="blackhole"] #ui {
    right: 12px !important;
    bottom: 12px !important;
    left: 12px !important;
    font-size: 0.85rem;
  }

  body[data-rz-project="blackhole"] #ui h1 {
    margin-bottom: 8px;
    font-size: 1.25rem;
  }

  body[data-rz-project="blackhole"] .back-link {
    top: 12px;
    right: 12px;
  }

  body[data-rz-project="rocket-launch-countdown"] .hero > *,
  body[data-rz-project="rocket-launch-countdown"] .summary {
    min-width: 0;
  }

  body[data-rz-project="rocket-launch-countdown"] h1 {
    overflow-wrap: anywhere;
    font-size: clamp(2.25rem, 14vw, 3.5rem);
  }
}

@media (max-width: 760px) {
  body[data-rz-project="grid"] #app {
    height: 100dvh;
    flex-direction: column;
  }

  body[data-rz-project="grid"] #sidebar {
    width: 100%;
    min-width: 0;
    height: 50dvh;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border-glass);
  }

  body[data-rz-project="grid"] #canvas-container {
    min-height: 50dvh;
  }
}

.rz-concept-banner {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10000;
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(105, 220, 191, 0.35);
  background: #08110f;
  color: #d8fff3;
  font: 600 0.78rem/1.4 "IBM Plex Mono", ui-monospace, monospace;
  text-align: center;
  letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
