:root {
  --bg: #090909;
  --grid: rgba(255, 245, 116, 0.05);
  --text: #f6f3e9;
  --muted: #cfc9b2;
  --gold: #f6ed7a;
  --gold-soft: rgba(246, 237, 122, 0.22);
  --line: rgba(244, 236, 155, 0.58);
  --line-dim: rgba(244, 236, 155, 0.2);
  --cyan: #19ecff;
  --panel: rgba(10, 10, 10, 0.94);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Courier New", Courier, monospace;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    #090909;
  background-size: 32px 32px, 32px 32px, auto;
}

#background-audio {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -9999px;
  top: -9999px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.app-shell {
  width: min(1100px, calc(100% - 28px));
  margin: 0 auto;
  padding: 26px 0 96px;
  position: relative;
  text-align: center;
}

.collect-panel,
.sound-button,
.journey-counter,
.nav-button,
.action-button,
.choice-button,
.mini-tag,
.wish-input,
.final-card {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.collect-panel {
  position: absolute;
  top: 48px;
  left: 16px;
  width: 170px;
  min-height: 136px;
  padding: 14px 16px;
  text-align: left;
}

.collect-title {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.95rem;
}

.collect-list {
  margin: 0;
  padding-left: 15px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.sound-button {
  position: absolute;
  top: 44px;
  right: 16px;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
  transition: box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.sound-button.is-on {
  color: var(--gold);
  box-shadow:
    0 0 0 1px rgba(246, 237, 122, 0.18) inset,
    0 0 18px rgba(246, 237, 122, 0.28);
  background: rgba(36, 31, 10, 0.95);
}

.sound-button.is-off {
  color: #8b8672;
  box-shadow: none;
  background: rgba(10, 10, 10, 0.94);
}

.brand-block {
  padding-top: 112px;
}

.main-logo {
  width: min(560px, 82vw);
  display: block;
  margin: 0 auto;
}

.timeline-block {
  margin-top: 28px;
}

.journey-counter {
  position: absolute;
  top: 96px;
  right: 16px;
  width: 190px;
  padding: 10px 12px;
  text-align: center;
  color: var(--gold);
  font-size: 0.78rem;
  line-height: 1.35;
}

.timeline {
  display: inline-grid;
  grid-template-columns: repeat(8, auto);
  gap: 14px;
  align-items: start;
  white-space: nowrap;
}

.timeline-step {
  min-width: 58px;
  position: relative;
  padding-top: 18px;
  color: #8e8e8e;
  font-size: 0.52rem;
  text-transform: uppercase;
}

.timeline-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7a7a7a;
}

.timeline-step::after {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(100% - 7px);
  width: 14px;
  height: 1px;
  background: #7a7a7a;
}

.timeline-step:last-child::after {
  display: none;
}

.timeline-step.done,
.timeline-step.preview,
.timeline-step.active {
  color: var(--gold);
}

.timeline-step.done::before,
.timeline-step.preview::before,
.timeline-step.active::before {
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold-soft);
}

.timeline-step.done::after,
.timeline-step.preview::after,
.timeline-step.active::after {
  background: var(--gold);
}

.copy-block {
  width: min(760px, 100%);
  margin: 42px auto 0;
}

.scene-heading {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.05em;
}

.scene-description,
.scene-prompt {
  margin: 10px auto 0;
  max-width: 700px;
  line-height: 1.35;
  font-size: 0.9rem;
}

.scene-prompt {
  margin-top: 12px;
  font-weight: 700;
}

.interaction-block {
  min-height: 210px;
  margin: 18px auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mini-canvas {
  width: 180px;
  height: 180px;
  position: relative;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    transparent;
  background-size: 18px 18px;
}

.mini-canvas.sai-canvas {
  width: 240px;
}

.mini-canvas.hair-mini-canvas {
  width: 230px;
  height: 220px;
}

.wide-canvas {
  width: min(620px, 100%);
  height: 140px;
  position: relative;
}

.journey-plane {
  position: absolute;
  left: 4%;
  bottom: 24px;
  font-size: 2.8rem;
  line-height: 1;
  transition: left 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dot-grid {
  width: 290px;
  height: 170px;
  position: relative;
  margin-right: 28px;
}

.niyyah-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
}

.hold-status {
  min-width: 156px;
  padding: 10px 0;
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.ihram-dot {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  border: 0;
}

.ihram-dot.active {
  background: #ffffff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.24);
}

.action-button,
.choice-button,
.nav-button {
  font: inherit;
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.action-button[disabled],
.nav-button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-button.is-ready:not([disabled]) {
  color: var(--gold);
  border-color: rgba(244, 236, 155, 0.8);
  background: rgba(36, 31, 10, 0.95);
  box-shadow:
    0 0 0 1px rgba(246, 237, 122, 0.18) inset,
    0 0 18px rgba(246, 237, 122, 0.2);
}

.choice-row,
.button-row,
.final-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.controls-block {
  margin-top: 10px;
  min-height: 68px;
}

.circle-guide,
.farewell-guide {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.kaaba-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  transform: translate(-50%, -50%);
  background: #fff;
}

.orbit-layer {
  position: absolute;
  inset: 0;
}

.orbit-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 2px dotted currentColor;
  transform: translate(-50%, -50%);
}

.sai-rock {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateY(-50%);
}

.sai-rock.left {
  left: 10px;
}

.sai-rock.right {
  right: 10px;
}

.sai-lines {
  position: absolute;
  inset: 0;
}

.sai-lines path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
}

.reflection-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.reflection-layout.top {
  margin-bottom: 14px;
}

.reflection-card {
  width: min(460px, 100%);
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.reflection-card--wish {
  gap: 10px;
}

.reflection-wish-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.step-label {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.reflection-meta {
  display: flex;
  gap: 14px;
  color: var(--gold);
  font-size: 0.78rem;
}

.reflection-stage {
  width: min(780px, 100%);
  height: 320px;
}

.stone-field {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.stone-zone,
.pillar-zone {
  position: relative;
  height: 100%;
  min-height: 320px;
  padding: 0 22px 16px;
  box-sizing: border-box;
  border: 1px solid rgba(244, 236, 155, 0.22);
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.field-label {
  margin: 12px 0 10px;
  color: var(--gold);
  font-size: 0.8rem;
  text-align: center;
}

.stone-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.pillar-row {
  position: absolute;
  left: 50%;
  top: 42px;
  transform: translateX(-50%);
  display: flex;
  gap: 34px;
  opacity: 0.4;
  transition: opacity 180ms ease;
}

.pillar-row.active {
  opacity: 1;
}

.pillar {
  width: 18px;
  height: 132px;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  position: relative;
}

.pillar.hit {
  background: rgba(246, 237, 122, 0.88);
  box-shadow: 0 0 12px rgba(246, 237, 122, 0.24);
}

.pillar-mark {
  position: absolute;
  left: 50%;
  bottom: -14px;
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(246, 237, 122, 0.24);
}

.choice-button.selected {
  color: var(--gold);
  box-shadow: 0 0 0 1px rgba(246, 237, 122, 0.16) inset;
  background: rgba(36, 31, 10, 0.95);
}

.wish-input {
  width: min(320px, 100%);
  border-radius: 4px;
  padding: 7px 10px;
  font: inherit;
  text-align: center;
}

.stone-row {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.stone {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
}

.carry-row {
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
}

@media (max-width: 640px) {
  .reflection-stage {
    width: min(620px, 100%);
    height: 420px;
  }

  .stone-field {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .stone-zone {
    height: 220px;
  }

  .pillar-zone {
    height: 150px;
  }

  .pillar-row {
    top: 8px;
  }
}

.heart-row {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.heart {
  font-size: 2.3rem;
  color: #ffffff;
}

.hair-line {
  position: absolute;
  height: 3px;
  background: #ffffff;
  cursor:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><text x='4' y='20' font-size='18' fill='white'>✂</text></svg>") 8 8,
    auto;
}

.hair-line.cut {
  opacity: 0;
}

.nav-block,
.final-actions {
  margin-top: 18px;
}

.hidden {
  display: none;
}

.disclaimer {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 20px));
  text-align: center;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--muted);
}

.final-card {
  width: min(340px, 100%);
  margin: 0 auto;
  padding: 18px 18px;
  text-align: left;
}

.final-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.final-card.exporting {
  box-shadow: 0 0 0 1px rgba(244, 236, 155, 0.08) inset;
}

.final-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.final-section--reflection:empty {
  display: none;
}

.final-card .collect-title {
  margin-bottom: 10px;
}

.final-divider {
  height: 1px;
  margin: 14px 0 16px;
  background: rgba(244, 236, 155, 0.22);
}

.final-note {
  margin-top: 0;
  font-size: 0.72rem;
  line-height: 1.4;
}

.final-name-block {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.final-name-label {
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--gold);
  text-align: center;
}

.final-name-input {
  width: 100%;
  text-align: left;
}

.creator-credit {
  width: min(340px, 100%);
  color: var(--muted);
  text-align: center;
}

.creator-credit-text {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.45;
}

.creator-credit-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.credit-button {
  padding: 5px 12px;
  font-size: 0.72rem;
  color: var(--muted);
  border-color: rgba(244, 236, 155, 0.28);
}

@media (hover: hover) {
  .choice-button:hover,
  .action-button:hover {
    border-color: rgba(244, 236, 155, 0.72);
    color: var(--gold);
    background: rgba(36, 31, 10, 0.9);
    box-shadow: 0 0 0 1px rgba(246, 237, 122, 0.12) inset;
  }

  .stone-dot:hover {
    transform: scale(1.12);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.24);
  }

  .pillar:hover {
    background: rgba(244, 236, 155, 0.88);
    box-shadow: 0 0 12px rgba(246, 237, 122, 0.16);
  }
}

.final-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.final-actions.hidden {
  display: none;
}

.final-actions-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-note {
  margin: 14px auto 0;
  min-height: 18px;
  color: var(--gold);
  font-size: 0.78rem;
}

@media (max-width: 1180px) {
  .app-shell {
    padding-top: 18px;
  }

  .collect-panel,
  .sound-button,
  .journey-counter {
    position: static;
  }

  .collect-panel {
    width: min(280px, 100%);
    margin: 0 auto 18px;
  }

  .sound-button {
    display: inline-block;
    margin: 0 auto 10px;
  }

  .journey-counter {
    width: min(280px, 100%);
    margin: 0 auto 18px;
    transform: none;
  }

  .brand-block {
    padding-top: 18px;
  }
}

@media (max-width: 860px) {
  .brand-block {
    padding-top: 18px;
  }

  .timeline {
    grid-template-columns: repeat(8, auto);
    gap: 8px;
  }

  .timeline-step {
    min-width: 52px;
    font-size: 0.46rem;
  }
}

@media (max-width: 640px) {
  .main-logo {
    width: min(92vw, 460px);
  }

  .timeline {
    gap: 6px;
  }

  .timeline-step {
    min-width: 44px;
    font-size: 0.4rem;
  }

  .scene-description,
  .scene-prompt {
    font-size: 0.8rem;
  }

  .wide-canvas {
    height: 120px;
  }

  .nav-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}
