:root {
  color-scheme: dark;
  --ink: #f8f5ec;
  --muted: rgba(248, 245, 236, 0.72);
  --panel: rgba(16, 18, 23, 0.74);
  --panel-strong: rgba(16, 18, 23, 0.9);
  --line: rgba(248, 245, 236, 0.18);
  --accent: #ffcf5a;
  --accent-2: #65d6c4;
  --danger: #ff7b91;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #101217;
  color: var(--ink);
}

button,
textarea,
input { font: inherit; }

.dance-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 207, 90, 0.18), transparent 28%),
    radial-gradient(circle at 76% 12%, rgba(101, 214, 196, 0.18), transparent 30%),
    linear-gradient(135deg, #101217 0%, #1c2430 48%, #17181d 100%);
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 84px);
  padding: clamp(24px, 6vw, 76px);
  background:
    linear-gradient(90deg, rgba(16, 18, 23, 0.98), rgba(16, 18, 23, 0.88)),
    radial-gradient(circle at 30% 54%, rgba(255, 207, 90, 0.22), transparent 34%);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
}

.intro.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  visibility: hidden;
}

.intro-visual {
  position: relative;
  min-height: min(70vh, 620px);
}

.spotlight {
  position: absolute;
  inset: 4% 12% 0;
  clip-path: polygon(41% 0, 59% 0, 94% 100%, 6% 100%);
  background: linear-gradient(180deg, rgba(255, 207, 90, 0.34), rgba(101, 214, 196, 0.04));
}

.floor-ring {
  position: absolute;
  left: 50%;
  bottom: 11%;
  width: min(58vw, 420px);
  height: 82px;
  border: 2px solid rgba(255, 207, 90, 0.34);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 50px rgba(101, 214, 196, 0.22);
}

.hero-dancer {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 160px;
  height: 300px;
  transform: translateX(-50%);
  animation: introDance 1.6s ease-in-out infinite;
}

.hero-dancer::before,
.hero-dancer::after,
.hero-dancer span,
.coach-avatar::before,
.coach-avatar span {
  content: "";
  position: absolute;
  display: block;
}

.hero-dancer::before {
  left: 58px;
  top: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffd4a6;
  box-shadow: 0 -10px 0 #17181d inset;
}

.hero-dancer span {
  left: 48px;
  top: 54px;
  width: 68px;
  height: 112px;
  border-radius: 34px 34px 18px 18px;
  background: linear-gradient(140deg, #ff5c8a, #ffcf5a);
}

.hero-dancer::after {
  left: 24px;
  top: 82px;
  width: 120px;
  height: 142px;
  border: solid #f8f5ec;
  border-width: 10px 0;
  border-radius: 44% 54% 50% 48%;
  transform: rotate(-10deg);
}

@keyframes introDance {
  0%, 100% { transform: translateX(-50%) rotate(-2deg); }
  50% { transform: translateX(-50%) rotate(3deg) translateY(-10px); }
}

.intro-copy { max-width: 680px; }

.kicker {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.8rem, 9vw, 7.2rem);
  line-height: 0.82;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  line-height: 1.05;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.intro-actions,
.practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button,
.home-link {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

button { padding: 0 16px; }

.primary {
  border-color: rgba(255, 207, 90, 0.78);
  background: #ffcf5a;
  color: #17181d;
  font-weight: 850;
}

.secondary,
.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 245, 236, 0.08);
  backdrop-filter: blur(18px);
}

.topbar,
.style-panel,
.practice-panel,
.emotion-panel,
.body-map,
.coach-card,
.journal-panel,
.unlocks {
  position: absolute;
  z-index: 5;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  top: 18px;
  left: 18px;
  right: 18px;
  display: grid;
  grid-template-columns: auto 1fr minmax(110px, 210px);
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 8px;
}

.topbar h2 { margin: 0; }

.home-link { width: 72px; }

.pulse-meter {
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
}

.pulse-meter span {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--danger));
  transition: width 0.3s ease;
}

.style-panel {
  top: 112px;
  left: 18px;
  width: min(340px, calc(100vw - 36px));
  padding: 14px;
  border-radius: 8px;
}

.style-grid,
.emotion-grid {
  display: grid;
  gap: 8px;
}

.style-card,
.emotion-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 8px;
  text-align: left;
  background: rgba(248, 245, 236, 0.08);
}

.style-card.active,
.emotion-card.active {
  border-color: var(--accent);
  background: rgba(255, 207, 90, 0.18);
}

.style-icon,
.emotion-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--style-color);
  box-shadow: 0 0 24px color-mix(in srgb, var(--style-color), transparent 55%);
}

.style-card strong,
.emotion-card strong { display: block; }

.style-card span:not(.style-icon),
.emotion-card span:not(.emotion-icon) {
  color: var(--muted);
  font-size: 0.82rem;
}

.practice-panel {
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 16px;
  padding: 14px;
  border-radius: 8px;
}

.practice-panel p { margin-bottom: 0; }

.emotion-panel {
  top: 112px;
  right: 18px;
  width: min(285px, calc(100vw - 36px));
  padding: 14px;
  border-radius: 8px;
}

.body-map {
  right: 18px;
  bottom: 180px;
  width: min(285px, calc(100vw - 36px));
  padding: 14px;
  border-radius: 8px;
}

.readouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.readouts div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 245, 236, 0.06);
}

.readouts span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.readouts strong { font-size: 1.35rem; }

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

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

.coach-card {
  left: 18px;
  top: 460px;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  width: min(340px, calc(100vw - 36px));
  padding: 12px;
  border-radius: 8px;
}

.coach-card p {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.coach-avatar {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffd4a6;
  overflow: hidden;
}

.coach-avatar::before {
  inset: -10px 7px 32px;
  border-radius: 50%;
  background: #22242b;
}

.coach-avatar span {
  left: 16px;
  bottom: 0;
  width: 28px;
  height: 26px;
  border-radius: 18px 18px 0 0;
  background: var(--accent-2);
}

.movement-pad {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 156px;
  display: grid;
  justify-items: center;
  gap: 6px;
  transform: translateX(-50%);
}

.movement-pad div {
  display: flex;
  gap: 6px;
}

.movement-pad button {
  width: 46px;
  height: 46px;
  padding: 0;
  background: var(--panel-strong);
  font-size: 1.2rem;
}

.journal-panel {
  left: 374px;
  bottom: 156px;
  width: min(380px, calc(100vw - 748px));
  min-width: 270px;
  padding: 12px;
  border-radius: 8px;
}

textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--ink);
}

.journal-panel button { margin-top: 8px; }

.unlocks {
  right: 322px;
  bottom: 156px;
  display: flex;
  max-width: 360px;
  min-height: 46px;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  overflow-x: auto;
}

.note-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(248, 245, 236, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 1100px) {
  .journal-panel,
  .unlocks { display: none; }
}

@media (max-width: 860px) {
  body { overflow: auto; }

  .dance-shell { min-height: 1180px; }

  .intro {
    grid-template-columns: 1fr;
    align-content: center;
    overflow: auto;
  }

  .intro-visual { min-height: 300px; }

  .topbar {
    grid-template-columns: auto 1fr;
  }

  .pulse-meter { grid-column: 1 / -1; }

  .style-panel,
  .emotion-panel,
  .body-map,
  .coach-card,
  .practice-panel {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: calc(100% - 24px);
    margin: 12px;
  }

  .topbar {
    position: relative;
    margin: 12px;
    inset: auto;
  }

  .style-panel { margin-top: 24px; }

  .practice-panel { grid-template-columns: 1fr; }

  .movement-pad {
    left: auto;
    right: 16px;
    bottom: 16px;
    transform: none;
  }
}
