:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #66706b;
  --paper: #fffdf8;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(44, 68, 61, 0.16);
  --gold: #d79b39;
  --focus: #3b82f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 234, 190, 0.62), transparent 34rem),
    linear-gradient(135deg, #f7fbf8 0%, #fff7ed 54%, #f6f1ff 100%);
}

.screen {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.visual-panel,
.context-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.visual-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.intro {
  padding: 12px 18px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 520px);
  align-items: end;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #8d5d19;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  max-width: 980px;
  font-size: clamp(1.65rem, 2.2vw, 2.75rem);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

h1 span {
  display: inline-block;
}

.intro p:not(.eyebrow) {
  max-width: 520px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.3vw, 1.08rem);
  line-height: 1.35;
}

.chakra-app {
  min-height: 0;
  padding: 0 10px 14px;
}

.source-mode {
  background: #000;
}

.source-mode .screen {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

.source-mode .visual-panel {
  min-height: 100vh;
  border: 0;
  background: #000;
  backdrop-filter: none;
  display: flex;
}

.source-mode .intro,
.source-mode .context-panel {
  display: none;
}

.source-mode .chakra-app {
  width: 100%;
  min-height: 100vh;
  padding: 0;
}

.source-point-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #000;
}

.source-point-button {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  outline: none;
}

.source-point-button:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.52);
  outline-offset: 12px;
}

.source-point {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 5px rgba(255, 255, 255, 0.88),
    0 0 16px rgba(255, 255, 255, 0.3);
}

.stage {
  width: 100%;
  height: auto;
  min-height: 0;
  display: block;
}

.body-fill {
  fill: url(#bodyGradient);
  stroke: rgba(25, 39, 46, 0.32);
  stroke-width: 2;
}

.body-line {
  fill: none;
  stroke: rgba(25, 39, 46, 0.33);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.body-line.subtle {
  stroke: rgba(25, 39, 46, 0.18);
  stroke-width: 6;
}

.reference-figure {
  opacity: 1;
  filter: saturate(1.02) contrast(1.02);
}

.spinal-cord-shadow,
.spinal-cord {
  fill: none;
  stroke-linecap: round;
}

.spinal-cord-shadow {
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 24;
  filter: url(#softGlow);
}

.spinal-cord {
  stroke: rgba(255, 242, 170, 0.95);
  stroke-width: 6;
  filter: url(#strongGlow);
}

.channel-base {
  stroke: rgba(79, 88, 83, 0.18);
  stroke-width: 10;
  stroke-linecap: round;
}

.channel-aura {
  stroke: rgba(255, 222, 125, 0.18);
  stroke-width: 28;
  stroke-linecap: round;
  filter: url(#softGlow);
}

.channel-lit {
  stroke: url(#channelGradient);
  stroke-width: 9;
  stroke-linecap: round;
  filter: url(#divineGlow);
  transition: none;
}

.petal {
  opacity: 0.72;
  transform-box: fill-box;
  transform-origin: center;
}

.chakra-core {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2;
}

.chakra.active .petal {
  animation: petalPulse 5.6s ease-in-out infinite alternate;
}

.chakra.active .chakra-core,
.chakra.completed .chakra-core {
  filter: url(#strongGlow);
}

.chakra-label {
  font-size: 23px;
  fill: #26312e;
}

.chakra-label .name {
  font-weight: 760;
}

.chakra-label .meta {
  font-size: 15px;
  fill: #6a736e;
}

.chakra-label.active .name {
  fill: var(--label-color);
  filter: url(#textGlow);
}

.label-rule {
  stroke: rgba(39, 50, 46, 0.2);
  stroke-width: 1;
}

.kundalini-button {
  cursor: pointer;
  outline: none;
}

.kundalini-button:focus-visible .kundalini-hit {
  stroke: var(--focus);
  stroke-width: 3;
}

.kundalini-hit {
  fill: rgba(255, 255, 255, 0.01);
}

.kundalini-coil {
  fill: none;
  stroke: url(#kundaliniGradient);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#strongGlow);
}

.energy-point {
  filter: url(#divineGlow);
}

.serpent-aura,
.serpent-core {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.serpent-aura {
  stroke: rgba(255, 213, 93, 0.62);
  stroke-width: 22;
  filter: url(#divineGlow);
}

.serpent-core {
  stroke: rgba(255, 255, 255, 0.94);
  stroke-width: 7;
  filter: url(#strongGlow);
}

.crown-halo {
  opacity: 0;
  transform-origin: center;
  transition: opacity 600ms ease, transform 600ms ease;
}

.crown-halo.visible {
  opacity: 1;
  animation: crownBreath 7s ease-in-out infinite alternate;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: -18px;
  position: relative;
  z-index: 2;
}

.replay-button {
  border: 1px solid rgba(91, 67, 28, 0.18);
  background: #2c3a35;
  color: white;
  padding: 16px 28px;
  border-radius: 999px;
  font-size: 1.2rem;
  font-weight: 760;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(36, 48, 43, 0.14);
}

.replay-button:hover,
.replay-button:focus-visible {
  background: #1e2b27;
  outline: 3px solid rgba(59, 130, 246, 0.28);
  outline-offset: 3px;
}

.status-text {
  min-width: 16rem;
  color: #16324f;
  font-size: 1.25rem;
  font-weight: 750;
}

.context-panel {
  align-self: start;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 1fr);
  gap: 14px 22px;
}

.context-panel h2 {
  margin-bottom: 12px;
  font-size: 1.45rem;
}

.context-panel p,
.context-panel dd {
  color: var(--muted);
  line-height: 1.48;
}

dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

dt {
  font-weight: 800;
  color: #26312e;
}

dd {
  margin: 3px 0 0;
}

.note {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 0.92rem;
}

@keyframes petalPulse {
  from {
    opacity: 0.7;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes crownBreath {
  from {
    transform: scale(0.96);
  }
  to {
    transform: scale(1.08);
  }
}

@media (max-width: 980px) {
  .screen {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .chakra-app {
    min-height: 0;
  }

  .stage {
    min-height: 0;
  }

  .context-panel {
    order: 2;
  }
}

@media (max-width: 640px) {
  .intro {
    display: none;
  }

  .chakra-app {
    padding: 0 2px 10px;
    min-height: 0;
  }

  .stage {
    min-height: 0;
  }

  .chakra-label {
    display: none;
  }

  .control-row {
    margin-top: -36px;
  }

  .status-text {
    min-width: 0;
    font-size: 0.82rem;
  }

  .context-panel {
    display: block;
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

html.embed body {
  margin: 0;
  background: #fffdf8;
}

html.embed .intro,
html.embed .context-panel {
  display: none;
}

html.embed .screen {
  width: 100%;
  min-height: 0;
  padding: 8px;
}

html.embed .visual-panel {
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

html.embed .replay-button {
  font-size: 1.35rem;
  padding: 18px 32px;
}

html.embed .status-text {
  min-width: 12rem;
  font-size: 1.35rem;
}

@media (max-width: 47.99rem) {
  html.embed .screen {
    padding: 0;
  }

  html.embed .control-row {
    margin-top: 0.35rem;
    flex-wrap: wrap;
  }

  html.embed .replay-button {
    font-size: 1rem;
    padding: 12px 22px;
  }

  html.embed .status-text {
    min-width: 0;
    font-size: 1.05rem;
  }
}
