:root {
  --ink: #1d1a16;
  --muted: rgba(29, 26, 22, 0.66);
  --line: rgba(39, 35, 29, 0.24);
  --panel: #c9c0b1;
  --screen: #080909;
  --chassis: #c9c0b1;
  --chassis-dark: #9f9689;
  --rubber: #5f6262;
  --rubber-dark: #343636;
  --blue: #009dd6;
  --orange: #ef4f1a;
  --orange-dark: #b83113;
  --gold: #d4a338;
  --guide-blue: #009dd6;
  --green: #62d38e;
  --wave-yellow: #f2a900;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.44);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(160deg, #9f998e 0%, #d1c7b8 46%, #8b877e 100%);
  background-size: 34px 34px, 34px 34px, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body.is-scheduled-overlay {
  background: #000;
}

body.week-4-overlay-lab.is-scheduled-overlay {
  background:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(160deg, #9f998e 0%, #d1c7b8 46%, #8b877e 100%);
  background-size: 34px 34px, 34px 34px, auto;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.lab-shell {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) 12px max(24px, env(safe-area-inset-bottom));
}

.standalone-lab {
  align-content: center;
  gap: 10px;
}

.standalone-back {
  display: inline-grid;
  min-height: 42px;
  width: min(720px, 100%);
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(18, 19, 18, 0.58);
  border-radius: 6px;
  color: #f3efe7;
  font-size: 14px;
  font-weight: 950;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  background:
    linear-gradient(180deg, #777b7a, var(--rubber-dark));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(0, 0, 0, 0.32),
    0 7px 10px rgba(0, 0, 0, 0.24);
  touch-action: manipulation;
}

.standalone-back:active {
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18),
    0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(2px);
}

.mpc-panel {
  display: grid;
  gap: 12px;
  width: min(720px, 100%);
  border: 1px solid rgba(45, 42, 36, 0.48);
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), transparent 24%),
    linear-gradient(180deg, #d8d1c5, var(--chassis) 46%, #ada597);
  box-shadow: var(--shadow);
}

.lab-header {
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 13px;
  color: #f5efe1;
  background:
    linear-gradient(90deg, rgba(239, 79, 26, 0.18), transparent 31%),
    #080909;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.eyebrow,
.screen-step {
  margin: 0 0 4px;
  color: var(--orange);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: #f5efe1;
  font-size: clamp(20px, 6vw, 36px);
  line-height: 0.98;
  font-weight: 950;
}

h2 {
  color: #15130f;
  font-size: clamp(17px, 4.6vw, 24px);
  line-height: 1.08;
  font-weight: 950;
}

.lab-progress {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(18, 19, 18, 0.58);
  border-radius: 6px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    #090a09;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.62),
    0 6px 10px rgba(0, 0, 0, 0.18);
}

.spottie-lab .lab-progress {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.spottie-lab .compare-grid {
  grid-template-columns: 1fr;
}

.stronger-lab .screen-panel {
  gap: 10px;
}

.stronger-lab .waveform {
  height: 96px;
}

.tempo-card {
  display: grid;
  gap: 8px;
  border: 2px solid rgba(30, 27, 23, 0.64);
  border-radius: 10px;
  padding: 11px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.12)),
    #8e887c;
  box-shadow:
    inset 0 3px 7px rgba(0, 0, 0, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28);
}

.tempo-labels {
  display: flex;
  justify-content: space-between;
  color: #1b1712;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tempo-labels span:first-child {
  color: var(--wave-yellow);
}

.tempo-labels span:last-child {
  color: #f3efe7;
}

.tempo-slider {
  width: 100%;
  accent-color: var(--orange);
  touch-action: pan-x;
}

.tempo-slider:disabled {
  opacity: 0.8;
}

.sample-switch-stack {
  display: grid;
  gap: 9px;
}

.lab-progress span {
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  background: rgba(255, 248, 238, 0.12);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.56);
}

.lab-progress span.is-green {
  background: linear-gradient(180deg, #7cff8f, #15bf42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 12px rgba(42, 235, 83, 0.58);
}

.lab-progress span.is-yellow {
  background: linear-gradient(180deg, #ffe66a, #f2a900);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 12px rgba(242, 169, 0, 0.58);
}

.lab-progress span.is-red {
  background: linear-gradient(180deg, #ff6b58, #d4211d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 12px rgba(255, 47, 38, 0.6);
}

.lab-progress.is-navigable span.is-available {
  cursor: pointer;
}

.lab-progress.is-navigable span.is-available:active {
  filter: brightness(0.78);
  transform: translateY(1px);
}

.lab-button {
  min-height: 46px;
  border: 1px solid rgba(18, 19, 18, 0.58);
  border-radius: 6px;
  color: #f3efe7;
  font-weight: 950;
  background:
    linear-gradient(180deg, #777b7a, var(--rubber-dark));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(0, 0, 0, 0.32),
    0 7px 10px rgba(0, 0, 0, 0.24);
  touch-action: manipulation;
  transform: translateY(0);
  transition:
    transform 100ms ease,
    box-shadow 100ms ease,
    filter 100ms ease,
    background 140ms ease;
}

.lab-button.primary {
  border-color: rgba(122, 43, 10, 0.76);
  background: linear-gradient(180deg, #f25b22, var(--orange-dark));
}

.lab-button.your-beat {
  border-color: rgba(122, 43, 10, 0.76);
  background: linear-gradient(180deg, #f25b22, var(--orange-dark));
}

.lab-button.final-track {
  border-color: rgba(41, 21, 54, 0.82);
  background: linear-gradient(180deg, #6f3b87, #32143f);
}

.lab-button:active:not(:disabled),
.lab-button.is-pressed {
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18),
    0 2px 4px rgba(0, 0, 0, 0.2);
  filter: brightness(0.96);
  transform: translateY(2px);
}

.lab-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.guide-pulse {
  animation: guidePulse 1.35s ease-in-out infinite;
}

.screen-panel {
  display: grid;
  gap: 13px;
  border: 1px solid rgba(53, 50, 43, 0.36);
  border-radius: 10px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 32%),
    #bcb3a4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.screen-header {
  display: grid;
  gap: 2px;
}

.sample-credit {
  color: rgba(29, 26, 22, 0.64);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
}

.waveform-shell {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(29, 26, 22, 0.74);
  border-radius: 8px;
  background:
    linear-gradient(rgba(242, 169, 0, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 169, 0, 0.09) 1px, transparent 1px),
    #0d120f;
  background-size: 18px 18px, 18px 18px, auto;
}

.waveform-shell.is-loading::after {
  content: "Loading...";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--wave-yellow);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.waveform {
  display: block;
  width: 100%;
  height: 110px;
  background: transparent;
  transform: scaleX(var(--waveform-stretch, 1));
  transform-origin: left center;
  transition: transform 520ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.screen-panel > .waveform {
  border: 2px solid rgba(29, 26, 22, 0.74);
  border-radius: 8px;
  background:
    linear-gradient(rgba(242, 169, 0, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 169, 0, 0.09) 1px, transparent 1px),
    #0d120f;
  background-size: 18px 18px, 18px 18px, auto;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--orange);
  box-shadow: 0 0 16px rgba(239, 79, 26, 0.85);
  opacity: 0;
  transform: translateX(0);
  transition: opacity 160ms ease;
}

.playhead.is-active {
  opacity: 1;
}

.rate-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: 2px solid rgba(30, 27, 23, 0.64);
  border-radius: 999px;
  padding: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(0, 0, 0, 0.16)),
    #8e887c;
  box-shadow:
    inset 0 3px 7px rgba(0, 0, 0, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.34),
    0 8px 12px rgba(0, 0, 0, 0.18);
}

.rate-toggle {
  position: relative;
  min-height: 50px;
  border: 1px solid rgba(18, 19, 18, 0.7);
  color: #f3efe7;
  font-weight: 950;
  text-transform: uppercase;
  background:
    linear-gradient(180deg, #8b8e8c 0%, #626564 48%, #3b3d3c 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.32),
    inset 0 -4px 0 rgba(0, 0, 0, 0.28),
    0 5px 8px rgba(0, 0, 0, 0.26);
  touch-action: manipulation;
  transition:
    background 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease,
    opacity 140ms ease,
    filter 140ms ease;
}

.rate-toggle:first-child {
  border-radius: 999px 0 0 999px;
}

.rate-toggle:last-child {
  margin-left: -1px;
  border-radius: 0 999px 999px 0;
}

.rate-toggle::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.rate-toggle.is-active {
  z-index: 1;
  border-color: rgba(126, 88, 0, 0.86);
  color: #19130a;
  background: linear-gradient(180deg, #ffd64a 0%, #f2a900 54%, #b97700 100%);
  box-shadow:
    inset 0 4px 9px rgba(0, 0, 0, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22),
    0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(2px);
}

.rate-toggle:active:not(:disabled) {
  box-shadow:
    inset 0 4px 9px rgba(0, 0, 0, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.2);
  filter: brightness(0.96);
  transform: translateY(2px);
}

.rate-toggle:not(.is-active):not(:disabled) {
  border-color: rgba(30, 27, 23, 0.72);
}

.rate-toggle:disabled {
  cursor: default;
  opacity: 0.5;
  filter: grayscale(0.55);
}

@keyframes guidePulse {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 12px 20px rgba(0, 0, 0, 0.22),
      0 0 0 0 rgba(0, 157, 214, 0),
      0 0 0 0 rgba(0, 157, 214, 0);
  }

  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 12px 20px rgba(0, 0, 0, 0.22),
      0 0 0 7px rgba(0, 157, 214, 0.48),
      0 0 30px 13px rgba(0, 157, 214, 0.42);
  }
}

.action-grid,
.compare-grid {
  display: grid;
  gap: 10px;
}

.action-grid,
.compare-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-grid.is-stacked,
.compare-grid.is-stacked {
  grid-template-columns: 1fr;
}

.standalone-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.nav-arrow {
  min-height: 50px;
  border: 1px solid rgba(18, 19, 18, 0.58);
  border-radius: 6px;
  color: #f3efe7;
  font-size: 25px;
  font-weight: 950;
  line-height: 1;
  background:
    linear-gradient(180deg, #777b7a, var(--rubber-dark));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(0, 0, 0, 0.32),
    0 7px 10px rgba(0, 0, 0, 0.24);
  touch-action: manipulation;
  transition:
    transform 100ms ease,
    box-shadow 100ms ease,
    filter 100ms ease,
    opacity 120ms ease;
}

.nav-arrow:active:not(:disabled) {
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.34),
    inset 0 -1px 0 rgba(255, 255, 255, 0.18),
    0 2px 4px rgba(0, 0, 0, 0.2);
  filter: brightness(0.96);
  transform: translateY(2px);
}

.nav-arrow:disabled {
  cursor: default;
  opacity: 0.34;
  filter: grayscale(0.5);
}

.hint {
  color: rgba(29, 26, 22, 0.68);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.pad-label {
  color: rgba(29, 26, 22, 0.72);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pad-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  touch-action: manipulation;
}

.pad-row.is-two-pad-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pad-row.is-chop-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.pad-row button {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(239, 79, 26, 0.78);
  border-radius: 5px;
  color: #f6f3ec;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent),
    #777a78;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition:
    transform 90ms ease,
    border-color 90ms ease,
    box-shadow 90ms ease,
    filter 90ms ease;
}

.pad-row.is-chop-grid button {
  aspect-ratio: 1.38;
  min-height: 58px;
  padding: 5px;
  font-size: clamp(8px, 2.2vw, 11px);
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-align: center;
}

.pad-row button.is-hit {
  border-color: var(--wave-yellow);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 4px rgba(242, 169, 0, 0.3),
    0 0 22px rgba(242, 169, 0, 0.55);
  filter: brightness(1.2);
  transform: translateY(1px) scale(0.98);
}

.pad-row button:disabled {
  cursor: default;
  opacity: 0.48;
}

@media (max-width: 420px) {
  .mpc-panel {
    border-radius: 18px;
    padding: 10px;
  }

  .action-grid,
  .compare-grid {
    grid-template-columns: 1fr;
  }

}
