:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #08100f;
  color: #f7fbf8;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app {
  position: relative;
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 24%, rgba(87, 188, 181, 0.24), transparent 30%),
    radial-gradient(circle at 86% 72%, rgba(255, 159, 88, 0.18), transparent 34%),
    linear-gradient(135deg, #08100f 0%, #11151d 48%, #15100f 100%);
}

#field {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
  touch-action: none;
}

.panel {
  position: fixed;
  left: clamp(14px, 3vw, 34px);
  top: clamp(14px, 3vw, 34px);
  width: min(360px, calc(100vw - 28px));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 15, 17, 0.72);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

h1 {
  margin: 0 0 5px;
  font-size: clamp(1.55rem, 4vw, 2.3rem);
  font-weight: 780;
  line-height: 0.98;
}

p {
  margin: 0;
  max-width: 28ch;
  color: rgba(247, 251, 248, 0.72);
  font-size: 0.92rem;
  line-height: 1.35;
}

.icon-button,
button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  color: #f7fbf8;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.icon-button {
  aspect-ratio: 1;
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  padding: 0;
}

.icon-button span {
  display: block;
  transform: scaleX(0.7);
  font-weight: 800;
}

button:hover,
button:focus-visible {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.button-row,
.switch-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.preset,
.switch-row button {
  padding: 0 10px;
  white-space: nowrap;
}

.preset.is-active {
  color: #07100f;
  border-color: rgba(255, 255, 255, 0.72);
  background: linear-gradient(135deg, #8df4d2, #ffd27e);
}

.control {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  color: rgba(247, 251, 248, 0.82);
  font-size: 0.83rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

.switch-row {
  align-items: center;
  margin: 18px 0 0;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}

.switch input {
  width: 16px;
  height: 16px;
  accent-color: #ffd27e;
}

.hud {
  position: fixed;
  right: clamp(14px, 3vw, 34px);
  bottom: clamp(14px, 3vw, 34px);
  min-width: 118px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 15, 17, 0.58);
  text-align: right;
  backdrop-filter: blur(12px);
}

.hud strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.hud span {
  color: rgba(247, 251, 248, 0.64);
  font-size: 0.78rem;
  text-transform: uppercase;
}

@media (max-width: 680px) {
  .panel {
    top: 12px;
    padding: 14px;
  }

  .brand {
    margin-bottom: 12px;
  }

  p {
    max-width: 24ch;
  }

  .hud {
    display: none;
  }
}
