:root {
  --cyan: #4df8ff;
  --magenta: #ff4fea;
  --lime: #8cff6a;
  --amber: #ffd166;
  --ink: #06101f;
  --panel: rgba(7, 18, 36, 0.74);
}

* {
  box-sizing: border-box;
}

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

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  background:
    radial-gradient(circle at 22% 18%, rgba(77, 248, 255, 0.34), transparent 22%),
    radial-gradient(circle at 78% 12%, rgba(255, 79, 234, 0.3), transparent 20%),
    radial-gradient(circle at 50% 92%, rgba(140, 255, 106, 0.14), transparent 26%),
    linear-gradient(135deg, #030715 0%, #08152b 42%, #160829 72%, #020711 100%);
}

body::after {
  opacity: 0.46;
  background-image:
    linear-gradient(rgba(77, 248, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 79, 234, 0.09) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(520px) rotateX(62deg) translateY(18%);
  transform-origin: bottom center;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  width: min(100vw, 1180px);
  height: 100dvh;
  margin: 0 auto;
  padding: 14px;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid rgba(77, 248, 255, 0.28);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 0 26px rgba(77, 248, 255, 0.12), inset 0 0 18px rgba(255, 79, 234, 0.08);
  backdrop-filter: blur(14px);
}

.brand,
.stats {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.brand {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-mark {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan), 0 0 22px var(--magenta);
}

.stats {
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 14px;
  color: rgba(234, 252, 255, 0.78);
}

.stats strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.icon-button {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}

.arena-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(77, 248, 255, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(5, 12, 28, 0.58), rgba(3, 6, 14, 0.88)),
    radial-gradient(circle at center, rgba(77, 248, 255, 0.1), transparent 58%);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.48),
    0 0 34px rgba(77, 248, 255, 0.2),
    inset 0 0 42px rgba(77, 248, 255, 0.09);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(2, 7, 17, 0.2), rgba(2, 7, 17, 0.74));
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

.settings-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 7, 17, 0.62);
  backdrop-filter: blur(7px);
}

.settings-panel.hidden {
  display: none;
}

.settings-box {
  width: min(92vw, 430px);
  padding: 18px;
  border: 1px solid rgba(77, 248, 255, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 20, 43, 0.96), rgba(8, 9, 28, 0.96)),
    radial-gradient(circle at 20% 0%, rgba(77, 248, 255, 0.2), transparent 34%);
  box-shadow:
    0 0 34px rgba(77, 248, 255, 0.18),
    inset 0 0 24px rgba(255, 79, 234, 0.1);
}

.settings-head,
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.settings-head {
  margin-bottom: 12px;
}

.settings-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
  text-shadow: 0 0 14px rgba(77, 248, 255, 0.72);
}

.setting-row {
  min-height: 48px;
  border-top: 1px solid rgba(234, 252, 255, 0.12);
  color: rgba(234, 252, 255, 0.9);
  font-weight: 700;
}

.range-row {
  display: grid;
  align-items: center;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px 0;
}

.setting-row strong {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--cyan);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--magenta);
}

.overlay h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow:
    0 0 16px rgba(77, 248, 255, 0.82),
    0 0 34px rgba(255, 79, 234, 0.6);
}

.overlay p {
  max-width: 680px;
  margin: 0 auto;
  color: rgba(234, 252, 255, 0.86);
  font-size: clamp(16px, 2.4vw, 21px);
}

.controls {
  display: grid;
  gap: 7px;
  color: rgba(234, 252, 255, 0.72);
  font-size: 14px;
}

button {
  justify-self: center;
  min-width: 150px;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid rgba(77, 248, 255, 0.72);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(77, 248, 255, 0.26), rgba(255, 79, 234, 0.26));
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(77, 248, 255, 0.26), inset 0 0 16px rgba(255, 255, 255, 0.08);
}

button:hover {
  filter: brightness(1.16);
}

@media (max-width: 700px) {
  .shell {
    gap: 8px;
    padding: 8px;
  }

  .hud {
    align-items: flex-start;
    min-height: 76px;
    padding: 9px;
  }

  .brand {
    font-size: 12px;
  }

  .stats {
    gap: 8px;
    font-size: 12px;
  }

  .overlay {
    gap: 14px;
    padding: 18px;
  }

  .controls {
    font-size: 13px;
  }

  button {
    min-width: 170px;
    min-height: 52px;
  }

  .icon-button {
    min-width: 44px;
    min-height: 44px;
  }

  .settings-box {
    padding: 16px;
  }

  .setting-row {
    min-height: 54px;
  }
}
