
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 14px;
  background: #071426;
  color: #edf6ff;
  font-family: Arial, Helvetica, sans-serif;
}

.app {
  max-width: 1150px;
  margin: auto;
  padding: 18px;
  background: #101e34;
  border-radius: 18px;
}

h1 {
  text-align: center;
  font-size: 28px;
  margin: 0;
}

.subtitle {
  text-align: center;
  font-size: 18px;
  color: #bcd8ed;
  margin: 9px 0 20px;
}

.stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #37546a;
  border-radius: 15px;
  background: #061625;
}

#scene3d {
  width: 100%;
  height: min(65vw, 620px);
  min-height: 400px;
}

#scene3d canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hint {
  position: absolute;
  bottom: 14px;
  left: 16px;
  color: #a6c8db;
  font-size: 13px;
  pointer-events: none;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 18px 0;
}

button {
  padding: 12px 18px;
  border: 1px solid #5c7e9d;
  border-radius: 9px;
  background: #183d5c;
  color: white;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background: #265b80;
}

#measure {
  background: #c65308;
  border-color: #ff8b35;
}

#measure:hover {
  background: #dd650d;
}

.readout {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px;
  background: #071a2e;
  border: 1px solid #35536a;
  border-radius: 10px;
}

.calculation {
  margin-top: 13px;
  padding: 16px;
  border-radius: 10px;
  background: #122c43;
  color: #ffdc8d;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
}

.message {
  text-align: center;
  color: #c4d9e9;
  line-height: 1.5;
}

@media (max-width: 600px) {
  body {
    padding: 5px;
  }

  .app {
    padding: 10px;
  }

  h1 {
    font-size: 22px;
  }

  #scene3d {
    height: 440px;
    min-height: 440px;
  }

  button {
    padding: 10px 12px;
    font-size: 13px;
  }
}
