* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at 20% 0%, rgba(55, 154, 184, 0.22), transparent 34rem), #0b1728;
  display: flex;
  justify-content: center;
  min-height: 100vh;   /* fallback for older browsers */
  min-height: 100dvh;  /* accounts for mobile browser address bar showing/hiding */
  padding: 28px 16px;
}

.app {
  width: 100%;
  max-width: 440px;
  background: #142236;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.28);
}

/* ===== Header ===== */
.titlebar {
  background: linear-gradient(135deg, #1c4d8f, #2896b0 85%);
  color: #f3f8fb;
  padding: 28px 26px 25px;
}

.titlebar h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
}

.titlebar p {
  margin: 5px 0 0;
  font-size: 0.88rem;
  color: rgba(243, 248, 251, 0.8);
}

.eyebrow {
  margin: 0 0 5px !important;
  color: rgba(243, 248, 251, 0.7) !important;
  font-size: 0.7rem !important;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ===== Cards ===== */
.card {
  padding: 22px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card:last-child {
  border-bottom: none;
}

.label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(243, 248, 251, 0.5);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.label .value {
  color: #3fb6d8;
  font-weight: 700;
  background: rgba(63, 182, 216, 0.15);
  padding: 1px 9px;
  border-radius: 20px;
  font-size: 0.78rem;
}

/* ===== Volume slider ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    #3fb6d8 0%,
    #3fb6d8 var(--fill, 60%),
    rgba(255, 255, 255, 0.12) var(--fill, 60%),
    rgba(255, 255, 255, 0.12) 100%
  );
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f3f8fb;
  border: 3px solid #3fb6d8;
  cursor: pointer;
  transition: transform 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f3f8fb;
  border: 3px solid #3fb6d8;
  cursor: pointer;
}

/* ===== Toggle switch ===== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle-row .name {
  color: #f3f8fb;
  font-weight: 600;
  font-size: 0.98rem;
}

.toggle-row .sub {
  color: rgba(243, 248, 251, 0.45);
  font-size: 0.76rem;
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.25s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #f3f8fb;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.4, 1.6, 0.6, 1);
}

input:checked + .slider {
  background: linear-gradient(135deg, #1c4d8f, #3fb6d8);
}

input:checked + .slider::before {
  transform: translateX(22px);
}

/* ===== Pitch grid ===== */
.pitch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.pitch-btn {
  appearance: none;
  width: 100%;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 13px 0;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(243, 248, 251, 0.7);
  transition: all 0.15s ease;
}

.pitch-btn:hover {
  border-color: #3fb6d8;
  color: #3fb6d8;
  background: rgba(63, 182, 216, 0.08);
}

.pitch-btn.selected {
  background: linear-gradient(135deg, #1c4d8f, #2896b0);
  color: #fff;
  border-color: transparent;
}

.pitch-btn:focus-visible,
.transport-btn:focus-visible,
input:focus-visible + .slider,
input[type="range"]:focus-visible {
  outline: 3px solid rgba(96, 207, 235, 0.75);
  outline-offset: 3px;
}

/* ===== Play / Stop button ===== */
.transport-btn {
  width: 100%;
  padding: 16px 0;
  border: none;
  border-radius: 10px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0e1b2e;
  background: linear-gradient(135deg, #3fb6d8, #2896b0);
  cursor: pointer;
  transition: all 0.15s ease;
}

.transport-btn:hover {
  filter: brightness(1.08);
}

.transport-btn:active {
  transform: scale(0.98);
}

.transport-btn.playing {
  color: #f3f8fb;
  background: linear-gradient(135deg, #1c4d8f, #123863);
}

@media (max-width: 380px) {
  body { padding: 12px; }
  .titlebar, .card { padding-left: 20px; padding-right: 20px; }
  .pitch-grid { gap: 7px; }
}