* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #080b16;
  color: #f5f7fb;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

canvas#scene {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  background: #080b16;
}

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  z-index: 10;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 16px;
  border: 1px solid rgba(217, 164, 65, 0.35);
  border-radius: 4px;
  background: rgba(13, 18, 36, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.brand-title {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(17px, 3vw, 23px);
  letter-spacing: 0.16em;
  color: #f0d9a8;
  line-height: 1;
}

.brand-sub {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: #9db4d0;
}

.readout {
  pointer-events: none;
  font-family: "SFMono-Regular", "Consolas", "Menlo", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #9db4d0;
  padding: 11px 14px;
  border: 1px solid rgba(157, 180, 208, 0.22);
  border-radius: 4px;
  background: rgba(13, 18, 36, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  white-space: nowrap;
}

.hint {
  position: fixed;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-size: clamp(12.5px, 2.1vw, 15px);
  letter-spacing: 0.03em;
  color: #9db4d0;
  text-align: center;
  opacity: 1;
  transition: opacity 1.2s ease;
  max-width: 70vw;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.hint.hidden {
  opacity: 0;
}

.toolbar {
  pointer-events: auto;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 30px 25px 30px;
  border-radius: 999px;
  border: 1px solid rgba(217, 164, 65, 0.3);
  background: rgba(13, 18, 36, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-wrap: wrap;
  justify-content: center;
  max-width: 94vw;
}

.dial {
  pointer-events: auto;
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(217, 164, 65, 0.4);
  background: radial-gradient(circle at 35% 30%, rgba(217, 164, 65, 0.16), rgba(8, 11, 22, 0.9));
  color: #9db4d0;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.dial::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 2px;
  height: 6px;
  background: #d9a441;
  transform: translateX(-50%);
  border-radius: 2px;
  opacity: 0.55;
}

.dial .label {
  position: absolute;
  bottom: -18px;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: #6d84a6;
  white-space: nowrap;
  text-transform: uppercase;
}

.dial .icon {
  line-height: 1;
}

.dial:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(217, 164, 65, 0.16);
}

.dial:active {
  transform: translateY(0) scale(0.94);
}

.dial.active,
.dial.featured {
  border-color: #e3bb6c;
  color: #f0d9a8;
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.1);
}

.dial:focus-visible {
  outline: 2px solid #f0d9a8;
  outline-offset: 3px;
}

input[type="range"] {
  pointer-events: auto;
  width: 88px;
  accent-color: #d9a441;
  height: 4px;
  cursor: pointer;
}

input[type="range"]:focus-visible {
  outline: 2px solid #f0d9a8;
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .toolbar {
    gap: 10px;
    padding: 8px 14px;
  }

  .dial {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }

  .dial .label {
    display: none;
  }

  .brand {
    padding: 8px 12px;
  }

  .readout {
    padding: 8px 10px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hint {
    transition: none;
  }

  .dial {
    transition: none;
  }
}