:root {
  color-scheme: dark;
}

body:has(.practice-shell) {
  overflow: hidden;
  background: #050505;
}

body:has(.practice-shell) > header,
body:has(.practice-shell) > footer {
  display: none;
}

body:has(.practice-shell) > main {
  height: 100vh;
  height: 100dvh;
}

.practice-shell {
  position: fixed;
  z-index: 100;
  inset: 0;
  min-height: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", sans-serif;
}

.practice-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
}

.practice-stage video {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center;
  transform: translate(-50%, -50%);
}

.practice-stage video.is-mirrored {
  transform: translate(-50%, -50%) scaleX(-1);
}

.practice-stage > p {
  position: absolute;
  z-index: 5;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #ffffff1f;
  border-radius: 999px;
  background: #111d;
  color: #d2d2d2;
  font-size: 13px;
  backdrop-filter: blur(16px);
}

.practice-stage > p:empty {
  display: none;
}

.practice-panel {
  position: absolute;
  z-index: 10;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #000c 0, transparent 25%, transparent 55%, #000e 100%);
  transition: opacity 180ms ease;
}

.practice-heading {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  left: clamp(18px, 3vw, 42px);
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: min(66vw, 760px);
  pointer-events: auto;
}

.practice-heading .eyebrow,
.practice-heading h1 {
  margin: 0;
  text-shadow: 0 2px 18px #000;
}

.practice-heading .eyebrow {
  color: #ff6b35;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}

.practice-heading h1 {
  margin-top: 4px;
  overflow: hidden;
  color: #fff;
  font-size: clamp(17px, 2vw, 25px);
  font-weight: 650;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-to-dance {
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 1px solid #ffffff3d;
  border-radius: 999px;
  background: #111a;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  backdrop-filter: blur(18px);
}

.app-store-link {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: clamp(18px, 3vw, 42px);
  display: grid;
  min-width: 154px;
  min-height: 42px;
  align-content: center;
  padding: 0 16px;
  border: 1px solid #ffffff4d;
  border-radius: 999px;
  background: #fff;
  color: #111;
  text-align: left;
  text-decoration: none;
  pointer-events: auto;
  box-shadow: 0 10px 34px #0007;
}

.app-store-link span {
  font-size: 12px;
  font-weight: 750;
}

.app-store-link small {
  margin-top: 2px;
  color: #666;
  font-size: 9px;
}

.practice-controls {
  position: absolute;
  right: clamp(14px, 3vw, 38px);
  bottom: max(20px, env(safe-area-inset-bottom));
  left: clamp(14px, 3vw, 38px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 42px 12px 12px;
  border: 1px solid #ffffff24;
  border-radius: 20px;
  background: #171717d9;
  box-shadow: 0 18px 55px #000a;
  backdrop-filter: blur(28px);
  pointer-events: auto;
}

.core-controls,
.ab-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.core-controls {
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.core-controls::-webkit-scrollbar {
  display: none;
}

.practice-controls button {
  flex: 0 0 auto;
  min-width: 50px;
  min-height: 40px;
  padding: 8px 13px;
  border: 0;
  border-radius: 11px;
  background: #ffffff12;
  color: #fff;
  font: 650 12px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  cursor: pointer;
}

.practice-controls button:hover {
  background: #ffffff24;
}

.practice-controls button[aria-pressed="true"] {
  background: #ff6b35;
  color: #fff;
}

.practice-controls .primary-play {
  min-width: 54px;
  background: #fff;
  color: #111;
  font-size: 17px;
}

.practice-timeline {
  position: absolute;
  top: 10px;
  right: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: 38px minmax(80px, 1fr) 38px;
  align-items: center;
  gap: 9px;
  color: #bbb;
  font-size: 10px;
}

.practice-timeline span:last-child {
  text-align: right;
}

.practice-timeline input {
  width: 100%;
  height: 22px !important;
  margin: 0;
  accent-color: #ff6b35;
  cursor: pointer;
  touch-action: none;
}

.ab-tools {
  justify-content: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ffffff1c;
}

.ab-tools[hidden] {
  display: none;
}

.ab-tools [data-loop-readout] {
  margin: 0 8px 0 0;
  color: #aaa;
  font-size: 11px;
}

.player-note {
  position: absolute;
  right: clamp(18px, 3vw, 42px);
  bottom: 126px;
  margin: 0;
  color: #ffffff80;
  font-size: 10px;
  letter-spacing: .04em;
}

.controls-hidden .practice-panel {
  opacity: 0;
}

.controls-hidden {
  cursor: none;
}

.practice-shell:fullscreen .practice-stage,
.practice-shell:-webkit-full-screen .practice-stage {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.practice-shell:fullscreen .practice-stage video,
.practice-shell:-webkit-full-screen .practice-stage video {
  max-width: 100vw !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  object-fit: contain !important;
}

@media (max-width: 700px) {
  .practice-heading {
    top: max(14px, env(safe-area-inset-top));
    left: 14px;
    gap: 10px;
    max-width: calc(100vw - 130px);
  }

  .practice-heading .eyebrow {
    display: none;
  }

  .practice-heading h1 {
    margin: 0;
    font-size: 15px;
  }

  .back-to-dance {
    padding: 9px 11px;
    font-size: 11px;
  }

  .app-store-link {
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    min-width: 0;
    min-height: 36px;
    padding: 0 12px;
  }

  .app-store-link span {
    font-size: 11px;
  }

  .app-store-link small {
    display: none;
  }

  .practice-controls {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    padding-right: 8px;
    padding-left: 8px;
    border-radius: 17px;
  }

  .core-controls {
    justify-content: flex-start;
  }

  .practice-controls button {
    min-width: 46px;
    min-height: 38px;
    padding: 7px 11px;
  }

  .ab-tools {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .player-note {
    display: none;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .practice-heading,
  .app-store-link {
    top: max(8px, env(safe-area-inset-top));
  }

  .practice-controls {
    bottom: max(7px, env(safe-area-inset-bottom));
    padding-top: 34px;
    padding-bottom: 7px;
  }

  .practice-controls button {
    min-height: 34px;
  }

  .player-note {
    display: none;
  }
}
