:root {
      --bg: #130d0a;
      --panel: #211510;
      --panel-2: #2d1b12;
      --text: #fff5e8;
      --muted: #d7bfa4;
      --gold: #f5b84b;
      --fire: #ff6847;
      --jade: #74c69d;
      --line: rgba(255, 245, 232, 0.16);
      --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
      --porcelain: #f8ead6;
      --ink: #20110b;
    }

    * { box-sizing: border-box; }

    html {
      overflow-x: hidden;
    }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background:
        radial-gradient(circle at top left, rgba(255, 104, 71, 0.34), transparent 34rem),
        radial-gradient(circle at 82% 10%, rgba(116, 198, 157, 0.14), transparent 26rem),
        radial-gradient(circle at bottom right, rgba(245, 184, 75, 0.2), transparent 30rem),
        linear-gradient(135deg, #130d0a 0%, #21100b 48%, #0f0b09 100%);
      color: var(--text);
      overflow-x: hidden;
    }

    .page {
      width: min(1120px, calc(100% - 32px));
      margin: 0 auto;
      padding: 48px 0;
    }

    header {
      display: grid;
      gap: 18px;
      margin-bottom: 32px;
    }

    .kicker {
      color: var(--gold);
      letter-spacing: 0.16em;
      text-transform: uppercase;
      font-weight: 700;
      font-size: 0.78rem;
    }

    h1 {
      margin: 0;
      font-size: clamp(2.6rem, 8vw, 6rem);
      line-height: 0.92;
      letter-spacing: -0.07em;
      max-width: 880px;
    }

    .subtitle {
      margin: 0;
      max-width: 760px;
      color: var(--muted);
      font-size: clamp(1rem, 2vw, 1.25rem);
      line-height: 1.7;
    }

    .hero-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 2px;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid rgba(245, 184, 75, 0.28);
      border-radius: 999px;
      padding: 9px 13px;
      color: var(--porcelain);
      background: rgba(255, 255, 255, 0.055);
      font-size: 0.88rem;
      font-weight: 750;
      backdrop-filter: blur(10px);
    }

    main {
      display: grid;
      grid-template-columns: 0.9fr 1.1fr;
      gap: 20px;
      align-items: start;
      min-width: 0;
    }

    .card {
      min-width: 0;
      border: 1px solid var(--line);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)), var(--panel);
      border-radius: 28px;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .form-card { padding: 28px; position: sticky; top: 24px; }

    label {
      display: block;
      margin-bottom: 10px;
      color: var(--muted);
      font-size: 0.92rem;
      font-weight: 650;
    }

    input[type="date"],
    input[type="time"],
    input[type="text"] {
      display: block;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 16px 18px;
      background: #130d0a;
      color: var(--text);
      font: inherit;
      color-scheme: dark;
      outline: none;
      appearance: none;
      -webkit-appearance: none;
    }

    input[type="date"]:focus,
    input[type="time"]:focus,
    input[type="text"]:focus {
      border-color: rgba(245, 184, 75, 0.7);
      box-shadow: 0 0 0 4px rgba(245, 184, 75, 0.12);
    }

    button {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      margin-top: 16px;
      border: 0;
      border-radius: 999px;
      padding: 16px 20px;
      font: inherit;
      font-weight: 800;
      color: #1b1009;
      background: linear-gradient(135deg, var(--gold), var(--fire));
      cursor: pointer;
      transition: transform 160ms ease, filter 160ms ease;
    }

    button:hover { transform: translateY(-1px); filter: brightness(1.05); }

    .hint {
      margin: 18px 0 0;
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.6;
    }

    .privacy-note {
      margin: 10px 0 0;
      color: rgba(116, 198, 157, 0.95);
      font-size: 0.86rem;
      font-weight: 700;
      line-height: 1.45;
    }

    .advanced-options {
      margin-top: 16px;
      border: 1px solid rgba(255, 245, 232, 0.12);
      border-radius: 18px;
      padding: 14px 16px;
      background: rgba(0, 0, 0, 0.16);
    }

    .advanced-options summary {
      cursor: pointer;
      color: var(--gold);
      font-weight: 850;
    }

    .advanced-grid {
      display: grid;
      gap: 12px;
      margin-top: 14px;
    }

    .mini-note {
      margin: 4px 0 0;
      color: rgba(215, 191, 164, 0.78);
      font-size: 0.82rem;
      line-height: 1.5;
    }

    .text-link {
      color: var(--gold);
      font-weight: 800;
      text-decoration: none;
    }

    .text-link:hover { text-decoration: underline; }

    .result-card { min-height: 520px; }

    .result-hero {
      position: relative;
      overflow: hidden;
      padding: 28px;
      background:
        linear-gradient(135deg, rgba(255, 104, 71, 0.18), rgba(245, 184, 75, 0.08)),
        var(--panel-2);
      border-bottom: 1px solid var(--line);
    }

    .result-hero::before,
    .result-hero::after {
      content: "";
      position: absolute;
      inset: -20%;
      pointer-events: none;
      opacity: 0.36;
      background-image:
        radial-gradient(circle, rgba(245, 184, 75, 0.72) 0 1px, transparent 2px),
        radial-gradient(circle, rgba(255, 104, 71, 0.5) 0 1px, transparent 2px);
      background-size: 82px 82px, 126px 126px;
      animation: emberDrift 18s linear infinite;
      mix-blend-mode: screen;
    }

    .result-hero::after {
      opacity: 0.2;
      animation-duration: 28s;
      animation-direction: reverse;
      transform: rotate(8deg);
    }

    .result-hero > * {
      position: relative;
      z-index: 1;
    }

    .result-hero h2 {
      margin: 8px 0 10px;
      font-size: clamp(1.8rem, 4vw, 3.4rem);
      line-height: 1;
      letter-spacing: -0.05em;
    }

    .profile-line {
      margin: 0 0 16px;
      color: var(--muted);
      font-size: 1rem;
      line-height: 1.55;
    }

    .archetype-mantra {
      margin: 14px 0 0;
      color: var(--text);
      font-size: 1.05rem;
      line-height: 1.6;
    }

    .pattern-line {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin: 0 0 16px;
      color: var(--text);
      font-size: 0.94rem;
      font-weight: 750;
    }

    .pattern-line span {
      color: var(--gold);
    }

    .pill-row { display: flex; flex-wrap: wrap; gap: 10px; }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 8px 12px;
      color: var(--text);
      background: rgba(255, 255, 255, 0.05);
      font-size: 0.88rem;
    }

    .share-panel {
      min-width: 0;
      margin-top: 22px;
      display: grid;
      gap: 14px;
    }

    .share-card {
      min-width: 0;
      overflow: hidden;
      border: 1px solid rgba(245, 184, 75, 0.32);
      border-radius: 24px;
      padding: 22px;
      background:
        radial-gradient(circle at top right, rgba(255, 104, 71, 0.28), transparent 12rem),
        linear-gradient(135deg, rgba(245, 184, 75, 0.12), rgba(255, 255, 255, 0.03));
    }

    .share-symbol {
      color: var(--gold);
      font-size: clamp(2.6rem, 8vw, 4.8rem);
      line-height: 1;
      margin-bottom: 10px;
      letter-spacing: -0.12em;
    }

    .share-card p {
      max-width: 100%;
      margin: 0;
      color: var(--text);
      font-size: 1.05rem;
      line-height: 1.55;
      overflow-wrap: anywhere;
      word-break: normal;
    }

    .share-card strong { color: var(--gold); }

    .share-nudge {
      margin: 0;
      color: var(--muted);
      font-size: 0.94rem;
      line-height: 1.55;
    }

    .share-actions {
      min-width: 0;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
      gap: 12px;
      align-items: stretch;
    }

    .share-actions button,
    .share-actions a {
      width: 100%;
      min-width: 0;
      min-height: 48px;
      margin: 0;
      border: 1px solid rgba(255, 245, 232, 0.2);
      border-radius: 18px;
      padding: 10px 12px;
      color: var(--text);
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
      font: inherit;
      font-size: 0.86rem;
      font-weight: 780;
      line-height: 1.1;
      text-align: center;
      text-decoration: none;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
    }

    .share-actions button:hover,
    .share-actions a:hover {
      filter: brightness(1.12);
      border-color: rgba(245, 184, 75, 0.45);
    }

    .share-icon {
      width: 24px;
      height: 24px;
      flex: 0 0 24px;
      display: inline-grid;
      place-items: center;
      border-radius: 999px;
      color: #1b1009;
      background: linear-gradient(135deg, var(--gold), var(--fire));
      font-size: 0.86rem;
      font-weight: 900;
    }

    .result-body {
      padding: 28px;
      display: grid;
      gap: 18px;
    }

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

    .score-card {
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 14px;
      background: rgba(255, 255, 255, 0.045);
    }

    .score-top {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
      color: var(--text);
      font-weight: 780;
    }

    .score-value {
      color: var(--gold);
      font-variant-numeric: tabular-nums;
    }

    .score-track {
      height: 9px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(0, 0, 0, 0.28);
    }

    .score-fill {
      width: var(--score);
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--gold), var(--fire));
      box-shadow: 0 0 18px rgba(255, 104, 71, 0.34);
      transform-origin: left center;
      animation: scoreGrow 1.05s cubic-bezier(.2, .9, .2, 1) both;
    }

    .section {
      padding: 18px;
      border: 1px solid var(--line);
      border-radius: 22px;
      background: rgba(0, 0, 0, 0.12);
    }

    .section h3 {
      margin: 0 0 8px;
      color: var(--gold);
      font-size: 1rem;
    }

    .section p, .section li {
      color: var(--muted);
      line-height: 1.7;
    }

    .section p { margin: 0; }
    ul { margin: 8px 0 0; padding-left: 20px; }

    .placeholder {
      min-height: 520px;
      display: grid;
      place-items: center;
      padding: 28px;
      text-align: center;
      color: var(--muted);
    }

    .placeholder span {
      display: block;
      font-size: 5rem;
      margin-bottom: 18px;
    }

    .reveal-screen {
      min-height: 520px;
      display: grid;
      place-items: center;
      padding: 36px;
      text-align: center;
      background:
        radial-gradient(circle at center, rgba(255, 104, 71, 0.2), transparent 18rem),
        var(--panel);
    }

    .reveal-symbol {
      color: var(--gold);
      font-size: clamp(5rem, 18vw, 8rem);
      line-height: 1;
      text-shadow: 0 0 34px rgba(245, 184, 75, 0.45);
      animation: emberPulse 1.2s ease-in-out infinite alternate;
    }

    .reveal-step {
      margin-top: 14px;
      color: var(--muted);
      font-weight: 750;
      opacity: 0;
      transform: translateY(8px);
      animation: revealStep 1.4s ease forwards;
    }

    .reveal-step:nth-child(2) { animation-delay: 0.15s; }
    .reveal-step:nth-child(3) { animation-delay: 0.55s; }
    .reveal-step:nth-child(4) { animation-delay: 0.95s; }

    .result-enter {
      animation: resultEnter 520ms cubic-bezier(.2, .9, .2, 1) both;
    }

    .confetti-canvas {
      position: fixed;
      inset: 0;
      width: 100vw;
      height: 100vh;
      pointer-events: none;
      z-index: 99;
    }

    @keyframes emberPulse {
      from { transform: scale(0.96); filter: brightness(0.95); }
      to { transform: scale(1.04); filter: brightness(1.18); }
    }

    @keyframes revealStep {
      to { opacity: 1; transform: translateY(0); }
    }

    @keyframes resultEnter {
      from { opacity: 0; transform: translateY(18px) scale(0.985); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    @keyframes emberDrift {
      from { transform: translate3d(0, 0, 0); }
      to { transform: translate3d(88px, -126px, 0); }
    }

    @keyframes scoreGrow {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }



    .culture-panels {
      margin-top: 20px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
    }

    .culture-panel {
      border: 1px solid var(--line);
      border-radius: 26px;
      padding: 22px;
      background:
        radial-gradient(circle at top right, rgba(116, 198, 157, 0.12), transparent 12rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
      box-shadow: var(--shadow);
    }

    .culture-panel h2 {
      margin: 0 0 10px;
      font-size: 1.1rem;
      color: var(--gold);
    }

    .culture-panel p,
    .culture-panel li {
      color: var(--muted);
      line-height: 1.65;
      font-size: 0.95rem;
    }

    .culture-panel p { margin: 0; }

    .starter-list {
      margin: 10px 0 0;
      padding-left: 18px;
    }

    .info-section {
      margin-top: 20px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 18px;
    }

    .info-card {
      border: 1px solid var(--line);
      border-radius: 26px;
      padding: 22px;
      background: rgba(0, 0, 0, 0.16);
    }

    .info-card h2 {
      margin: 0 0 10px;
      color: var(--gold);
      font-size: 1.2rem;
    }

    .info-card p,
    .info-card li {
      color: var(--muted);
      line-height: 1.65;
      font-size: 0.94rem;
    }

    .link-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 12px;
    }

    .topic-link {
      display: inline-flex;
      align-items: center;
      border: 1px solid rgba(245, 184, 75, 0.25);
      border-radius: 999px;
      padding: 8px 11px;
      color: var(--porcelain);
      text-decoration: none;
      background: rgba(255,255,255,0.045);
      font-size: 0.86rem;
      font-weight: 750;
    }

    .topic-link:hover { border-color: rgba(245, 184, 75, 0.6); }

    .disclaimer {
      margin-top: 18px;
      border: 1px solid rgba(255, 245, 232, 0.14);
      border-radius: 22px;
      padding: 16px 18px;
      color: rgba(215, 191, 164, 0.86);
      background: rgba(0, 0, 0, 0.16);
      font-size: 0.9rem;
      line-height: 1.65;
    }

    footer {
      margin-top: 28px;
      color: rgba(215, 191, 164, 0.75);
      font-size: 0.86rem;
      line-height: 1.6;
    }

    @media (max-width: 820px) {
      .page {
        width: min(100% - 24px, 1120px);
        padding: 32px 0;
      }

      main { grid-template-columns: minmax(0, 1fr); }

      .form-card {
        position: static;
        padding: 24px;
      }

      .result-hero,
      .result-body {
        padding: 24px;
      }

      .share-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }

      .score-grid { grid-template-columns: 1fr; }
      .culture-panels,
      .info-section { grid-template-columns: 1fr; }
    }

    @media (max-width: 420px) {
      h1 { font-size: clamp(2.3rem, 12vw, 3.1rem); }
      .form-card { padding: 20px; }
      input[type="date"], input[type="time"], input[type="text"], button { padding-inline: 14px; }
      .result-hero,
      .result-body { padding: 20px; }
      .share-card { padding: 18px; }

      .share-actions button,
      .share-actions a {
        min-height: 46px;
        border-radius: 16px;
        font-size: 0.82rem;
        padding-inline: 10px;
      }
    }

:where(a, button, input, summary):focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

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