
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #051323;
  color: #eaf5ff;
  font-family: Arial, Helvetica, sans-serif;
}

.sonar-app {
  max-width: 1050px;
  margin: 0 auto;
  padding: 12px 18px 24px;
}

/* Heading */
.sonar-header h1 {
  font-size: clamp(24px, 3.5vw, 32px);
  margin: 0 0 7px;
  color: #ffffff;
}

.sonar-header p {
  color: #bad7e7;
  margin: 0 0 13px;
  font-size: 16px;
}

/* Animation controls */
.sonar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sonar-controls button {
  background: #173d5b;
  border: 1px solid #477e99;
  color: #ffffff;
  padding: 10px 15px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.sonar-controls button:first-child {
  background: #00b8d0;
  border-color: #00b8d0;
  color: #062438;
}

.sonar-controls button:hover {
  filter: brightness(1.15);
}

.sonar-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Compact animation */
.sonar-scene {
  border: 1px solid #285572;
  border-radius: 15px;
  overflow: hidden;
  background: #07192d;
}

.sonar-scene svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Echo time and speed */
.sonar-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.data-box {
  background: #102d45;
  border: 1px solid #26536e;
  border-radius: 10px;
  padding: 10px 14px;
}

.data-box span {
  display: block;
  color: #a5c8dc;
  font-size: 13px;
}

.data-box strong {
  display: block;
  margin-top: 4px;
  color: #ffffff;
  font-size: 20px;
}

/* Explanation and calculation */
.sonar-explanation {
  background: #102d45;
  border-left: 5px solid #15cce4;
  border-radius: 10px;
  padding: 12px 16px;
  line-height: 1.5;
}

.sonar-explanation p {
  margin: 4px 0;
}

.calculation-line {
  padding: 4px 0;
  font-size: 18px;
}

.calculation-line b {
  color: #76f0d1;
}

.sonar-note {
  color: #f5d995;
  margin-top: 10px !important;
}

.sonar-footer {
  color: #8fb1c6;
  font-size: 12px;
  margin-top: 12px;
}

/* Smaller screens */
@media (max-width: 650px) {
  .sonar-app {
    padding: 10px;
  }

  .sonar-header h1 {
    font-size: 24px;
  }

  .sonar-header p {
    font-size: 14px;
  }

  .sonar-controls button {
    padding: 9px 11px;
    font-size: 13px;
  }

  .sonar-data {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .data-box {
    padding: 9px;
  }

  .data-box strong {
    font-size: 17px;
  }

  .calculation-line {
    font-size: 16px;
  }
}
