:root {
  --bg: #071018;
  --bg-2: #10171b;
  --panel: rgba(9, 16, 22, 0.76);
  --panel-strong: rgba(12, 20, 28, 0.92);
  --line: rgba(246, 240, 220, 0.18);
  --line-strong: rgba(246, 240, 220, 0.36);
  --text: #fbf5e8;
  --muted: #c8c2b5;
  --dim: #8f918d;
  --accent: #d8f6ff;
  --accent-2: #ffd47a;
  --accent-3: #88d9b3;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.44);
  --radius: 8px;
  --max: 1180px;
  --theme-rgb: 216, 246, 255;
  --theme-rgb-2: 255, 212, 122;
  --theme-name: "Aether";
}

body[data-theme="fire"] {
  --bg: #120908;
  --bg-2: #23100c;
  --accent: #ff7a45;
  --accent-2: #ffd26b;
  --accent-3: #ff3d2e;
  --theme-rgb: 255, 122, 69;
  --theme-rgb-2: 255, 210, 107;
  --theme-name: "Fire";
}

body[data-theme="water"] {
  --bg: #03151b;
  --bg-2: #08242d;
  --accent: #4ee4dc;
  --accent-2: #9bc8ff;
  --accent-3: #7affc7;
  --theme-rgb: 78, 228, 220;
  --theme-rgb-2: 155, 200, 255;
  --theme-name: "Water";
}

body[data-theme="earth"] {
  --bg: #111008;
  --bg-2: #20210f;
  --accent: #d9c36a;
  --accent-2: #89d17b;
  --accent-3: #f0a95c;
  --theme-rgb: 217, 195, 106;
  --theme-rgb-2: 137, 209, 123;
  --theme-name: "Earth";
}

body[data-theme="air"] {
  --bg: #071019;
  --bg-2: #121d27;
  --accent: #d8f6ff;
  --accent-2: #b6b1ff;
  --accent-3: #75e0ff;
  --theme-rgb: 216, 246, 255;
  --theme-rgb-2: 182, 177, 255;
  --theme-name: "Air";
}

body[data-theme="aether"] {
  --bg: #090a13;
  --bg-2: #161322;
  --accent: #d9c2ff;
  --accent-2: #ffd47a;
  --accent-3: #73f2bd;
  --theme-rgb: 217, 194, 255;
  --theme-rgb-2: 255, 212, 122;
  --theme-name: "Aether";
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(var(--theme-rgb), 0.12), transparent 32%),
    linear-gradient(250deg, rgba(var(--theme-rgb-2), 0.1), transparent 35%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 64%);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background 500ms ease;
}

body::selection {
  background: rgba(var(--theme-rgb), 0.34);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.aurora-bg,
.ink-wash,
#particleCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.aurora-bg {
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(var(--theme-rgb), 0.14), transparent 38%, rgba(var(--theme-rgb-2), 0.12)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 18px);
  opacity: 0.78;
  animation: current-shift 18s ease-in-out infinite alternate;
}

.ink-wash {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 32%, rgba(0, 0, 0, 0.36)),
    linear-gradient(110deg, transparent 0 20%, rgba(255, 255, 255, 0.035) 36%, transparent 54%);
  mix-blend-mode: screen;
  opacity: 0.5;
}

#particleCanvas {
  z-index: 2;
}

@keyframes current-shift {
  from {
    transform: translate3d(-1.5rem, -1rem, 0) scale(1.02);
    filter: saturate(1);
  }
  to {
    transform: translate3d(1rem, 1.5rem, 0) scale(1.06);
    filter: saturate(1.18);
  }
}

.app {
  position: relative;
  z-index: 3;
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: screen-in 460ms ease both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.glass-card,
.feature-card,
.element-result {
  background:
    linear-gradient(135deg, rgba(var(--theme-rgb), 0.08), transparent 48%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-mark {
  margin: 0 auto 1.2rem;
  width: fit-content;
  color: var(--accent-2);
  text-transform: uppercase;
  font-family: "Cinzel", serif;
  font-size: 0.88rem;
  letter-spacing: 0;
  border: 1px solid rgba(var(--theme-rgb-2), 0.28);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
}

.hero {
  min-height: 72vh;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before,
.quiz-shell::before,
.results-header::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(var(--theme-rgb), 0.55);
  opacity: 0.7;
  pointer-events: none;
}

.hero-kicker,
.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
}

.hero h1 {
  margin-top: 1rem;
  max-width: 850px;
  font-family: "Cinzel", serif;
  font-size: 4.6rem;
  line-height: 0.98;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--accent-2), var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(var(--theme-rgb), 0.32));
}

.hero p {
  max-width: 760px;
  margin-top: 1.4rem;
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.42rem;
}

.element-orbit {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  width: min(100%, 780px);
  margin: 2.4rem 0;
}

.orbit-item {
  min-height: 5rem;
  border: 1px solid rgba(var(--theme-rgb), 0.2);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.orbit-item:hover,
.orbit-item:focus-visible {
  transform: translateY(-5px);
  border-color: var(--accent);
  background: rgba(var(--theme-rgb), 0.14);
  box-shadow: 0 0 32px rgba(var(--theme-rgb), 0.2);
  outline: none;
}

.orbit-item.fire { color: #ff7a45; }
.orbit-item.water { color: #4ee4dc; }
.orbit-item.earth { color: #d9c36a; }
.orbit-item.air { color: #d8f6ff; }
.orbit-item.aether { color: #d9c2ff; }

.intake-form {
  width: min(100%, 760px);
}

.mode-preview {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  text-align: left;
  min-height: 6.5rem;
  margin: -1rem 0 1.2rem;
  border: 1px solid rgba(var(--theme-rgb), 0.22);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  padding: 0.9rem;
  overflow: hidden;
}

.preview-title {
  color: var(--accent-2);
  font-weight: 900;
  text-transform: uppercase;
}

.mode-preview p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 1rem;
  font-family: "Inter", system-ui, sans-serif;
}

.preview-meter {
  height: 4rem;
  display: flex;
  align-items: end;
  gap: 0.3rem;
}

.preview-meter span {
  flex: 1;
  height: 30%;
  border-radius: 999px 999px 0 0;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(var(--theme-rgb), 0.45);
  animation: meter-rise 1.6s ease-in-out infinite;
}

.preview-meter span:nth-child(2) { animation-delay: 120ms; }
.preview-meter span:nth-child(3) { animation-delay: 240ms; }
.preview-meter span:nth-child(4) { animation-delay: 360ms; }
.preview-meter span:nth-child(5) { animation-delay: 480ms; }

@keyframes meter-rise {
  0%, 100% { height: 22%; opacity: 0.55; }
  50% { height: 96%; opacity: 1; }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

label span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--accent-2);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 3.4rem;
  border: 1px solid rgba(var(--theme-rgb), 0.3);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 0.85rem 1rem;
}

input:focus {
  outline: 2px solid rgba(var(--theme-rgb), 0.5);
  border-color: var(--accent);
}

.cta-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.6rem;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #081016;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(var(--theme-rgb), 0.24);
}

.cta-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: translateX(-100%);
  transition: transform 520ms ease;
}

.cta-button:hover::before,
.cta-button:focus-visible::before {
  transform: translateX(100%);
}

.cta-button span {
  position: relative;
  z-index: 1;
}

.cta-button.secondary {
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border: 1px solid rgba(var(--theme-rgb), 0.34);
}

.privacy-note {
  margin-top: 0.85rem;
  color: var(--dim);
  font-size: 0.9rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.feature-card {
  padding: 1.15rem;
  min-height: 13rem;
}

.feature-icon {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--theme-rgb), 0.35);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 900;
  margin-bottom: 1rem;
}

.feature-card h2 {
  font-family: "Cinzel", serif;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0;
}

.feature-card p {
  margin-top: 0.65rem;
  color: var(--muted);
}

.quiz-screen,
.results-screen {
  padding-top: 1rem;
}

.quiz-shell {
  position: relative;
  padding: 1.5rem;
  overflow: hidden;
}

.quiz-header,
.section-head,
.element-header,
.results-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.quiz-header h2,
.results-header h2,
.section-head h3,
.wheel-panel h3 {
  font-family: "Cinzel", serif;
  letter-spacing: 0;
}

.quiz-header h2 {
  font-size: 2.35rem;
}

.counter {
  min-width: 6rem;
  text-align: center;
  color: var(--accent-2);
  border: 1px solid rgba(var(--theme-rgb-2), 0.3);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  background: rgba(0, 0, 0, 0.24);
  font-weight: 900;
}

.progress-wrap {
  margin: 1.4rem 0 1.6rem;
}

.progress-text {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.progress-bar,
.element-bar {
  width: 100%;
  height: 0.65rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill,
.element-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 360ms ease;
  box-shadow: 0 0 18px rgba(var(--theme-rgb), 0.55);
}

.chapter-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.chapter-pill {
  min-height: 4rem;
  display: grid;
  gap: 0.18rem;
  text-align: left;
  border: 1px solid rgba(var(--theme-rgb), 0.18);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
  padding: 0.55rem;
  cursor: pointer;
}

.chapter-pill span,
.chapter-pill em {
  color: var(--dim);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
}

.chapter-pill strong {
  color: var(--muted);
  font-size: 0.84rem;
}

.chapter-pill.active {
  border-color: var(--accent);
  background: rgba(var(--theme-rgb), 0.12);
}

.chapter-pill.complete strong,
.chapter-pill.complete span,
.chapter-pill.complete em {
  color: var(--accent-2);
}

.question-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(var(--theme-rgb), 0.18);
  border-radius: var(--radius);
  padding: 1.2rem;
  transform-origin: center;
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.question-card.exiting {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  filter: blur(6px);
}

.question-card.entering {
  animation: question-enter 320ms ease both;
}

@keyframes question-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.question-card h3 {
  font-size: 1.65rem;
  line-height: 1.22;
  margin-bottom: 1rem;
  font-family: "Cormorant Garamond", serif;
}

.options {
  display: grid;
  gap: 0.75rem;
}

.option {
  position: relative;
  display: grid;
  grid-template-columns: 0.4rem minmax(0, 1fr);
  gap: 0.95rem;
  text-align: left;
  min-height: 5.5rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(4, 8, 11, 0.52);
  padding: 1rem;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.option::before {
  content: "";
  width: 0.4rem;
  height: 100%;
  border-radius: 999px;
  background: var(--option-color);
  box-shadow: 0 0 18px var(--option-color);
}

.option:hover,
.option:focus-visible {
  transform: translateX(8px);
  outline: none;
  border-color: color-mix(in srgb, var(--option-color), white 25%);
  background: color-mix(in srgb, var(--option-color), transparent 86%);
}

.option.selected {
  border-color: var(--option-color);
  background: color-mix(in srgb, var(--option-color), transparent 78%);
  box-shadow: 0 0 28px color-mix(in srgb, var(--option-color), transparent 70%);
}

.option.fire { --option-color: #ff7a45; }
.option.water { --option-color: #4ee4dc; }
.option.earth { --option-color: #d9c36a; }
.option.air { --option-color: #d8f6ff; }
.option.aether { --option-color: #d9c2ff; }

.option-text {
  color: var(--text);
  font-weight: 800;
}

.option-shadow {
  margin-top: 0.35rem;
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.08rem;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
}

.nav-btn {
  min-width: 10rem;
  min-height: 3.2rem;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--theme-rgb), 0.34);
  background: rgba(0, 0, 0, 0.26);
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
}

.nav-btn:hover:not(:disabled),
.nav-btn:focus-visible:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(var(--theme-rgb), 0.22);
  outline: none;
}

.nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-next {
  color: #081016;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn-next.ready {
  animation: ready-pulse 520ms ease both;
}

@keyframes ready-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 34px rgba(var(--theme-rgb), 0.36); }
}

.results-header {
  position: relative;
  text-align: center;
  padding: 2rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.results-header h2 {
  margin-top: 0.65rem;
  font-size: 3.1rem;
  background: linear-gradient(135deg, var(--accent-2), var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.results-header p {
  margin: 0.85rem auto 0;
  max-width: 820px;
  color: var(--muted);
  font-size: 1.1rem;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
}

.wheel-panel,
.now-panel,
.signal-lab,
.toolkit {
  padding: 1.2rem;
}

.wheel-panel h3 {
  color: var(--accent-2);
  margin-bottom: 1rem;
}

#elementWheel {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.now-panel {
  display: grid;
  gap: 1rem;
}

.now-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.element-pill {
  border: 1px solid rgba(var(--theme-rgb), 0.32);
  color: var(--accent);
  background: rgba(var(--theme-rgb), 0.1);
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.response-grid,
.micro-grid,
.organ-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.response-card,
.micro-card,
.decoder-output,
.element-mini,
.organ-item {
  border: 1px solid rgba(var(--theme-rgb), 0.18);
  border-radius: var(--radius);
  padding: 0.95rem;
  background: rgba(0, 0, 0, 0.24);
}

.response-card h4,
.micro-card h4,
.organ-item strong {
  color: var(--accent-2);
  margin-bottom: 0.45rem;
}

.response-card p,
.micro-card p,
.organ-item p,
.decoder-output p,
.section-head p {
  color: var(--muted);
}

.element-results {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.element-result {
  padding: 1.2rem;
  border-color: color-mix(in srgb, var(--element-color), white 10%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--element-color), transparent 84%), transparent 52%),
    var(--panel);
}

.element-result.primary {
  border-width: 2px;
  box-shadow: 0 0 44px color-mix(in srgb, var(--element-color), transparent 76%);
}

.element-result.fire { --element-color: #ff7a45; }
.element-result.water { --element-color: #4ee4dc; }
.element-result.earth { --element-color: #d9c36a; }
.element-result.air { --element-color: #d8f6ff; }
.element-result.aether { --element-color: #d9c2ff; }

.element-name {
  color: var(--element-color);
  font-family: "Cinzel", serif;
  font-size: 1.7rem;
  font-weight: 900;
}

.element-score {
  color: var(--element-color);
  font-size: 2rem;
  font-weight: 900;
}

.element-copy {
  color: var(--muted);
  margin: 0.85rem 0;
}

.element-bar {
  margin: 0.8rem 0;
}

.element-fill {
  background: linear-gradient(90deg, var(--element-color), var(--accent-2));
}

.tag-row,
.toolkit-tabs,
.decoder-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tag {
  border: 1px solid color-mix(in srgb, var(--element-color, var(--accent)), white 10%);
  border-radius: 999px;
  padding: 0.38rem 0.62rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
}

.signal-lab,
.toolkit {
  margin-top: 1rem;
}

.portal-sequence,
.audio-player,
.program,
.script-lab {
  margin-top: 1rem;
  padding: 1.2rem;
}

.sequence-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.sequence-step {
  position: relative;
  min-height: 13rem;
  border: 1px solid rgba(var(--theme-rgb), 0.2);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
  padding: 0.9rem;
  overflow: hidden;
}

.sequence-step::before {
  content: "";
  position: absolute;
  left: 1.1rem;
  top: 4.2rem;
  bottom: 1rem;
  width: 1px;
  background: linear-gradient(var(--accent), transparent);
}

.step-index {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #071018;
  font-weight: 900;
  margin-bottom: 0.7rem;
}

.sequence-step span,
.program-card span,
.script-card span {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sequence-step h4,
.program-card h4 {
  margin-top: 0.35rem;
  color: var(--text);
}

.sequence-step p,
.program-card p,
.script-card p {
  margin-top: 0.55rem;
  color: var(--muted);
}

.player-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(16rem, 0.9fr);
  gap: 1rem;
}

.player-stage {
  min-height: 18rem;
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(var(--theme-rgb), 0.2);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 22% 50%, rgba(var(--theme-rgb), 0.32), transparent 30%),
    rgba(0, 0, 0, 0.26);
  padding: 1rem;
}

.breath-ring {
  width: 10rem;
  aspect-ratio: 1;
  border: 1px solid rgba(var(--theme-rgb), 0.32);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.breath-ring span {
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent), transparent 68%);
  animation: breath-pulse 5.6s ease-in-out infinite;
}

@keyframes breath-pulse {
  0%, 100% { transform: scale(0.68); opacity: 0.5; }
  45% { transform: scale(1.08); opacity: 0.95; }
}

.player-stage h4 {
  color: var(--accent-2);
  font-family: "Cinzel", serif;
  font-size: 2rem;
}

.player-stage p {
  color: var(--muted);
  margin-top: 0.5rem;
}

.track-list {
  display: grid;
  gap: 0.55rem;
}

.track-button,
.audio-toggle {
  min-height: 3.2rem;
  border: 1px solid rgba(var(--theme-rgb), 0.22);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  text-align: left;
  padding: 0.75rem;
  cursor: pointer;
}

.track-button strong,
.track-button span {
  display: block;
}

.track-button span {
  color: var(--muted);
  font-size: 0.86rem;
}

.track-button.active,
.track-button:hover,
.track-button:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: rgba(var(--theme-rgb), 0.13);
}

.audio-toggle {
  width: 100%;
  margin-top: 0.75rem;
  text-align: center;
  color: #071018;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
  text-transform: uppercase;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h3 {
  font-size: 2rem;
}

.decoder-button,
.tab-button {
  min-height: 2.9rem;
  border: 1px solid rgba(var(--theme-rgb), 0.25);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-weight: 800;
}

.decoder-button.active,
.tab-button.active,
.decoder-button:hover,
.tab-button:hover,
.decoder-button:focus-visible,
.tab-button:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: rgba(var(--theme-rgb), 0.14);
  box-shadow: 0 0 24px rgba(var(--theme-rgb), 0.18);
}

.decoder-output {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.toolkit-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 1rem;
  margin-top: 1rem;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.program-card,
.script-card {
  border: 1px solid rgba(var(--theme-rgb), 0.18);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.23);
  padding: 0.95rem;
}

.program-card ol {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.script-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.script-card p {
  color: var(--text);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.45rem;
  line-height: 1.25;
}

.script-card.danger {
  border-color: rgba(255, 122, 69, 0.32);
}

.script-card.repair {
  border-color: rgba(var(--theme-rgb-2), 0.34);
}

.toolkit-hero {
  min-height: 22rem;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--theme-rgb), 0.22);
  padding: 1rem;
  background:
    linear-gradient(145deg, rgba(var(--theme-rgb), 0.22), rgba(var(--theme-rgb-2), 0.1)),
    rgba(0, 0, 0, 0.25);
  display: grid;
  align-content: end;
  overflow: hidden;
  position: relative;
}

.toolkit-hero::before {
  content: var(--theme-name);
  position: absolute;
  left: 1rem;
  top: 0.4rem;
  color: rgba(255, 255, 255, 0.08);
  font-family: "Cinzel", serif;
  font-size: 5.5rem;
  font-weight: 900;
  pointer-events: none;
}

.toolkit-hero h4 {
  font-family: "Cinzel", serif;
  color: var(--text);
  font-size: 2.2rem;
  letter-spacing: 0;
}

.toolkit-hero p {
  color: var(--muted);
  margin-top: 0.65rem;
}

.toolkit-stack {
  display: grid;
  gap: 0.75rem;
}

.micro-card ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.results-actions {
  align-items: center;
  margin-top: 1rem;
}

.results-actions .cta-button {
  max-width: 18rem;
}

@media (max-width: 860px) {
  .app {
    width: min(calc(100% - 1rem), var(--max));
    padding-top: 0.5rem;
  }

  .hero {
    min-height: auto;
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 2.85rem;
  }

  .hero p {
    font-size: 1.18rem;
  }

  .element-orbit,
  .feature-grid,
  .form-grid,
  .results-grid,
  .toolkit-detail,
  .player-grid,
  .player-stage,
  .program-grid,
  .script-grid,
  .response-grid,
  .micro-grid,
  .organ-grid {
    grid-template-columns: 1fr;
  }

  .mode-preview,
  .sequence-track {
    grid-template-columns: 1fr;
  }

  .chapter-rail {
    grid-template-columns: 1fr;
  }

  .sequence-step {
    min-height: auto;
  }

  .player-stage {
    min-height: auto;
  }

  .breath-ring {
    width: min(100%, 11rem);
    margin: 0 auto;
  }

  .quiz-header,
  .section-head,
  .element-header,
  .results-actions,
  .now-title {
    flex-direction: column;
  }

  .quiz-shell,
  .results-header,
  .wheel-panel,
  .now-panel,
  .signal-lab,
  .toolkit {
    padding: 1rem;
  }

  .results-header h2 {
    font-size: 2.25rem;
  }

  .quiz-header h2,
  .section-head h3 {
    font-size: 1.72rem;
  }

  .question-card h3 {
    font-size: 1.35rem;
  }

  .quiz-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .nav-btn {
    min-width: 0;
  }

  .results-actions .cta-button {
    max-width: none;
  }
}

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