:root {
  color-scheme: dark;
  --bg: #000000;
  --text: #f5f5f5;
  --muted: #8c8c8c;
  --line: rgba(255, 255, 255, 0.9);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.page-shell {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 2rem 1.25rem 3rem;
}

.shape-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shape {
  position: absolute;
  border: 1px solid var(--line);
  opacity: 0.7;
  animation: drift 10s ease-in-out infinite alternate;
}

.shape-line {
  width: 10rem;
  height: 1px;
  top: 18%;
  left: 8%;
  transform: rotate(22deg);
}

.shape-arc {
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  top: 14%;
  right: 9%;
  border-color: rgba(255, 255, 255, 0.7);
  border-left-color: transparent;
  border-bottom-color: transparent;
}

.shape-curve {
  width: 10rem;
  height: 6rem;
  border-radius: 50%;
  bottom: 18%;
  left: 14%;
  border-top-color: transparent;
  transform: rotate(135deg);
}

.shape-spark {
  width: 7rem;
  height: 7rem;
  top: 64%;
  right: 16%;
  border-color: rgba(255, 255, 255, 0.75);
  transform: rotate(45deg);
}

.hero {
  position: relative;
  z-index: 1;
  max-width: 720px;
  min-height: calc(100vh - 4rem);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
}

.hero.is-hidden {
  opacity: 0;
  pointer-events: none;
}

h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 1.5rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  max-width: 620px;
}

.cta-button {
  display: inline-block;
  padding: 0.9rem 1.35rem;
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.cta-button:hover {
  background: #ffffff;
  color: #000000;
  transform: translateY(-1px);
}

.shape-stage {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 2;
  padding: 1.5rem;
}

.shape-stage.is-visible {
  display: flex;
}

.stage-label {
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.shape-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  width: min(90vw, 620px);
}

.shape-choice {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.shape-choice:hover,
.shape-choice.is-selected {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
}

.shape-icon {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.shape-icon-circle {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
}

.shape-icon-square {
  width: 2.8rem;
  height: 2.8rem;
}

.shape-icon-triangle {
  width: 0;
  height: 0;
  border-left: 1.45rem solid transparent;
  border-right: 1.45rem solid transparent;
  border-bottom: 2.6rem solid rgba(255, 255, 255, 0.9);
  background: transparent;
  border-top: none;
}

.shape-icon-line {
  width: 3rem;
  height: 1px;
}

.shape-icon-curve {
  width: 2.8rem;
  height: 1.6rem;
  border-radius: 999px;
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.9);
  border-left: none;
  border-right: none;
  background: transparent;
}

.emotion-stage {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 3;
  background: #000000;
}

.emotion-stage.is-visible {
  display: block;
}

.emotion-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
}

.line-field {
  position: relative;
  width: min(90vw, 42rem);
  height: 10rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.dash-line {
  position: absolute;
  top: 50%;
  left: -20%;
  height: 1px;
  border-top: 1px dashed rgba(255, 255, 255, 0.85);
  width: 24rem;
  opacity: 0;
  transform: translateY(-50%);
  animation: dashCross 3.2s ease-in-out infinite;
}

.dash-line-1 {
  animation-delay: 0.1s;
}

.dash-line-2 {
  animation-delay: 0.6s;
  top: 38%;
}

.dash-line-3 {
  animation-delay: 1.1s;
  top: 62%;
}

.dash-line-4 {
  animation-delay: 1.6s;
  top: 46%;
}

.dash-line-5 {
  animation-delay: 2.1s;
  top: 54%;
}

.emotion-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  max-width: 24rem;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.7s ease-out 2.6s forwards;
}

.emotion-button {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  color: var(--text);
  width: 4.2rem;
  height: 4.2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.emotion-button:hover,
.emotion-button.is-selected {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
  transform: translateY(-1px);
}

.emotion-symbol {
  display: block;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.95);
}

.emotion-square {
  width: 2rem;
  height: 2rem;
}

.emotion-square-dot::after {
  content: "";
  position: absolute;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.emotion-square-lines::before,
.emotion-square-lines::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
}

.emotion-square-lines::before {
  width: 1.1rem;
  height: 1px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.emotion-square-lines::after {
  width: 1px;
  height: 1.1rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.emotion-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.step-screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4;
  background: #000000;
  padding: 1.5rem;
  opacity: 0;
  animation: gentleFadeIn 0.7s ease forwards;
}

.step-screen.is-visible {
  display: flex;
}

.step-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(90vw, 36rem);
}

.step-question {
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.arrow-pair {
  display: flex;
  gap: 1.5rem;
}

.arrow-symbol,
.arrow-icon {
  display: inline-block;
  position: relative;
  width: 0;
  height: 0;
  border-left: 0.8rem solid transparent;
  border-right: 0.8rem solid transparent;
  border-bottom: 1.25rem solid rgba(255, 255, 255, 0.95);
}

.arrow-down {
  transform: rotate(180deg);
}

.arrow-left {
  transform: rotate(-90deg);
}

.arrow-right {
  transform: rotate(90deg);
}

.word-grid,
.arrow-grid,
.phrase-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.word-button,
.arrow-button,
.phrase-button,
.pattern-button {
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.word-button,
.phrase-button {
  padding: 0.7rem 1rem;
  min-width: 6.2rem;
}

.arrow-button {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pattern-button {
  width: 4.5rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.word-button:hover,
.arrow-button:hover,
.phrase-button:hover,
.pattern-button:hover,
.word-button.is-selected,
.arrow-button.is-selected,
.phrase-button.is-selected,
.pattern-button.is-selected {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
  transform: translateY(-1px);
}

.pulse-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pulse-circle {
  width: 8rem;
  height: 8rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

.pulse-label {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.balloon-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2rem;
}

.balloon-instruction {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.95rem;
  opacity: 0.9;
}

.balloon-button {
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  animation: balloonFall 2.8s ease-in forwards;
}

.balloon-oval {
  display: block;
  width: 4.2rem;
  height: 5rem;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.balloon-string {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 3rem;
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(-50%);
}

.white-step {
  background: #ffffff;
  color: #000000;
}

.white-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(90vw, 32rem);
}

.white-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0;
  letter-spacing: 0.04em;
}

.choice-row {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.choice-row.is-active {
  display: flex;
}

.choice-button {
  border: 1px solid #000000;
  background: transparent;
  color: #000000;
  padding: 0.7rem 1rem;
  min-width: 5.4rem;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.choice-button:hover,
.choice-button.is-selected {
  background: #000000;
  color: #ffffff;
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}

.pattern {
  display: block;
  position: relative;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.95);
}

.pattern-a {
  border-radius: 50%;
}

.pattern-b::before,
.pattern-b::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
}

.pattern-b::before {
  width: 1.2rem;
  height: 1px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.pattern-b::after {
  width: 1px;
  height: 1.2rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.pattern-c {
  border-radius: 0;
  border-left: none;
  border-right: none;
}

.pattern-d {
  transform: rotate(45deg);
}

.pattern-e::before {
  content: "";
  position: absolute;
  inset: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
}

.pattern-f::before {
  content: "";
  position: absolute;
  inset: 0.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.95);
}

.pattern-g::before,
.pattern-g::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.95);
}

.pattern-g::before {
  inset: 0.3rem 0.3rem auto 0.3rem;
  height: 0.6rem;
}

.pattern-g::after {
  inset: auto 0.3rem 0.3rem 0.3rem;
  height: 0.6rem;
}

.pattern-h {
  border-top-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(16px, -14px, 0) rotate(8deg);
  }
}

@keyframes dashCross {
  0% {
    opacity: 0;
    transform: translateX(-12rem) translateY(-50%);
  }
  12% {
    opacity: 1;
  }
  45% {
    opacity: 1;
    transform: translateX(55vw) translateY(-50%);
  }
  100% {
    opacity: 0;
    transform: translateX(120vw) translateY(-50%);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes balloonFall {
  0% {
    transform: translateY(-10vh) scale(0.95);
    opacity: 0.8;
  }
  100% {
    transform: translateY(78vh) scale(1);
    opacity: 1;
  }
}

@keyframes gentleFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analysis-card {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.analysis-text {
  color: #ffffff;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  opacity: 0;
  animation: fadeInText 0.45s ease 0.05s forwards;
}

.report-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 2.2rem;
  width: min(780px, 94%);
  margin: 2rem auto;
  color: #fff;
  text-align: left;
}

.report-text p {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 72ch;
  margin: 0 auto;
  color: #eee;
}

/* New report / analysis styles for premium feel */
.analysis-messages {
  color: #fff;
  font-size: 1rem;
  max-width: 700px;
  text-align: center;
  letter-spacing: 0.02em;
}

.analysis-message {
  opacity: 0;
  transition: opacity 600ms ease, transform 600ms ease;
  transform: translateY(6px);
}
.analysis-message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

#report-root {
  background: transparent;
  color: #fff;
  padding: 3.2rem 1rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.final-report {
  max-width: 700px;
  background: transparent;
  color: #fff;
  text-align: left;
  line-height: 1.6;
  font-size: 1.02rem;
}

.report-section {
  max-width: 700px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.report-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.report-section h3 {
  margin: 0 0 0.6rem 0;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.report-section p {
  margin: 0 0 0.8rem 0;
  color: #eaeaea;
}

/* subtle glow */
.final-report, .final-report p, .final-report h3 {
  text-shadow: 0 6px 18px rgba(0,0,0,0.6), 0 0 20px rgba(255,255,255,0.02);
}

.report-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

.report-next-button,
.report-cta-button,
.report-control-button {
  padding: 0.85rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease, border-color 180ms ease;
  text-decoration: none;
}

.report-next-button:hover,
.report-cta-button:hover,
.report-control-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
  transform: translateY(-1px);
}

.report-cta-button {
  display: inline-flex;
  align-items: center;
}

.report-cta-button::after {
  content: '→';
  display: inline-block;
  margin-left: 0.5rem;
}

.report-control-button {
  background: transparent;
}

.report-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.share-preview {
  margin-top: 1.4rem;
  background: rgba(255,255,255,0.04);
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
}

.share-preview-label {
  margin: 0 0 0.65rem 0;
  font-size: 0.9rem;
  color: #ccc;
}

.share-preview-text {
  width: 100%;
  min-height: 7rem;
  resize: vertical;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
}

.report-restart-button {
  border-color: rgba(255, 255, 255, 0.5);
}

.share-hint {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%) translateY(12px);
  background: rgba(0,0,0,0.9);
  color: #fff;
  padding: 0.95rem 1.2rem;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 20;
  pointer-events: none;
  font-size: 0.95rem;
}
.share-hint.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes fadeInText {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
