
:root {
  --bg-1: #031111;
  --bg-2: #092c2c;
  --ink: #f3f7ef;
  --muted: #b7ccc5;
  --accent: #8af0cf;
  --accent-2: #f3db86;
  --panel: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.16);
  --volume: 62%;
  --brightness: 52%;
}

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

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 50% 32%, rgba(45, 166, 143, 0.28), transparent 34rem),
    linear-gradient(160deg, var(--bg-2), var(--bg-1) 70%);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  touch-action: manipulation;
}

button {
  font: inherit;
}

.app {
  width: min(100%, 640px);
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(24px, env(safe-area-inset-top))
    22px
    max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.header {
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.24em;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 9vw, 4rem);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.subtitle {
  max-width: 34rem;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.instrument {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status {
  min-height: 1.5em;
  margin-bottom: 16px;
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 650;
  text-align: center;
}

.sound-pad {
  position: relative;
  width: min(62vw, 290px);
  aspect-ratio: 1;
  border: 1px solid rgba(138, 240, 207, 0.5);
  border-radius: 50%;
  padding: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 40% 32%, rgba(255, 255, 255, 0.18), transparent 22%),
    radial-gradient(circle, rgba(57, 190, 159, 0.34), rgba(5, 31, 31, 0.88) 67%);
  box-shadow:
    0 0 0 12px rgba(138, 240, 207, 0.04),
    0 0 54px rgba(52, 201, 168, 0.18),
    inset 0 0 46px rgba(138, 240, 207, 0.12);
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: transform 130ms ease, box-shadow 130ms ease, border-color 130ms ease;
}

.sound-pad::before,
.sound-pad::after {
  content: "";
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
}

.sound-pad::after {
  inset: 29%;
}

.sound-pad.active {
  transform: scale(0.965);
  border-color: rgba(243, 219, 134, 0.94);
  box-shadow:
    0 0 0 16px rgba(243, 219, 134, 0.06),
    0 0 84px rgba(138, 240, 207, 0.38),
    inset 0 0 54px rgba(243, 219, 134, 0.16);
}

.pad-core {
  position: absolute;
  inset: 42%;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 30px rgba(138, 240, 207, 0.7);
  transition: transform 120ms ease, background 120ms ease;
}

.sound-pad.active .pad-core {
  transform: scale(2.4);
  background: var(--accent-2);
}

.pad-label {
  position: relative;
  z-index: 2;
  display: block;
  font-size: clamp(0.73rem, 3.2vw, 0.9rem);
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.45;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.axes {
  width: min(78vw, 380px);
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.gesture-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
}

.meters {
  width: min(86vw, 410px);
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(8px);
}

.meter-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 12px;
}

.meter-row + .meter-row {
  margin-top: 10px;
}

.meter-row > span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.meter i {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 80ms linear;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

footer p {
  margin: 0;
}

.test-info {
  margin-top: 12px;
  border: 0;
  color: rgba(183, 204, 197, 0.6);
  background: transparent;
  font-size: 0.7rem;
  text-decoration: underline;
  cursor: pointer;
}

.debug-panel {
  width: min(100%, 380px);
  margin: 10px auto 0;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.debug-panel p {
  margin: 0 0 8px;
  color: var(--accent-2);
}

.debug-panel button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

@media (max-height: 720px) {
  .app {
    gap: 14px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .sound-pad {
    width: min(48vh, 240px);
  }

  .gesture-help {
    display: none;
  }
}
