* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #050507;
  color: #f4f0e8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: grab;
}

canvas:active {
  cursor: grabbing;
}

.iap-logo {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 3;
  display: block;
  width: clamp(78px, 9vw, 126px);
  opacity: 0.58;
  transition: opacity 140ms ease;
}

.iap-logo:hover,
.iap-logo:focus-visible {
  opacity: 0.92;
}

.iap-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.panel {
  position: fixed;
  top: 16px;
  left: 16px;
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 12, 15, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.title-row h1 {
  margin: 0;
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
  border-color: rgba(255, 255, 255, 0.18);
  background: #141a20;
  color: #dff5ff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.panel.compact {
  width: auto;
  min-width: min(260px, calc(100vw - 32px));
}

.panel.compact #status,
.panel.compact .controls-body {
  display: none;
}

.audio-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
  border-color: rgba(88, 199, 255, 0.34);
  background: #111827;
}

.audio-button.toggle-on {
  border-color: rgba(118, 226, 169, 0.72);
  background: #065f46;
}

.audio-icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #ffffff;
}

.audio-button.toggle-on .audio-icon {
  width: 12px;
  height: 12px;
  margin-left: 0;
  border: 0;
  border-radius: 1px;
  background: #ffffff;
}

.utc-date-time {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 4;
  transform: translateX(-50%);
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  background: rgba(10, 12, 15, 0.62);
  color: rgba(244, 248, 252, 0.9);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 5px #000;
  white-space: nowrap;
  pointer-events: none;
}

#status {
  min-height: 18px;
  margin-bottom: 14px;
  color: #b7c2cc;
  font-size: 12px;
  line-height: 1.4;
}

label {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: #d8dde2;
  font-size: 12px;
  font-weight: 650;
}

.control-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.control-value {
  color: #aeb8c2;
  font-weight: 550;
  text-align: right;
}

.source-link {
  color: #8bdcff;
  text-decoration: none;
}

.source-link:hover,
.source-link:focus-visible {
  color: #dff5ff;
  text-decoration: underline;
}

select,
button {
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: #141a20;
  color: #f5f7f9;
  font: inherit;
}

select {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
}

button {
  padding: 0 12px;
  cursor: pointer;
}

button:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.34);
}

input[type="range"] {
  width: 100%;
  accent-color: #58c7ff;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: #58c7ff;
}

.filters {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.section-title {
  margin-bottom: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 750;
}

.filter {
  margin: 10px 0;
}

.filter-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #d8dde2;
  font-size: 12px;
  font-weight: 650;
}

.filter-value {
  color: #aeb8c2;
  font-weight: 550;
  text-align: right;
}

.filter-sliders {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.filter-slider-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 6px;
}

.filter-slider-row span {
  color: #8794a0;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

dl {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

dt {
  color: #aab4bd;
}

dd {
  margin: 0;
  color: #ffffff;
  text-align: right;
}

.audio-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #d8dde2;
  font-size: 12px;
  font-weight: 650;
}

.legend {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: auto 180px auto;
  align-items: center;
  gap: 10px;
  color: #e7edf3;
  font-size: 12px;
  text-shadow: 0 1px 4px #000;
}

.ramp {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b1b8f, #1464d2, #15b8a6, #f3d33c, #ef3b2c);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.credits {
  position: fixed;
  left: 50%;
  bottom: 18px;
  max-width: min(520px, calc(100vw - 36px));
  transform: translateX(-50%);
  color: rgba(232, 238, 244, 0.58);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 5px #000;
  pointer-events: none;
}

@media (max-width: 720px) {
  .iap-logo {
    top: 12px;
    right: 12px;
  }

  .utc-date-time {
    top: 12px;
    max-width: calc(100vw - 220px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .panel {
    top: 44px;
    left: 10px;
    padding: 12px;
  }

  .legend {
    right: 12px;
    bottom: 12px;
    grid-template-columns: auto 110px auto;
  }

  .credits {
    bottom: 42px;
    font-size: 10px;
  }
}
