:root {
  --bg: #07070a;
  --surface-1: #0d0e12;
  --surface-2: #12131a;
  --fg: #f4f0e6;
  --fg-soft: #d8d2c6;
  --gold: #d7b86e;
  --gold-light: #f1dca6;
  --gold-dark: #9c7d3b;
  --violet: #6b4eff;
  --violet-soft: #b7a9ff;
  --success: #34d399;
  --alert: #fbbf24;
  --danger: #f87171;
  --hairline: rgba(244, 240, 230, 0.1);
  --glow-border: rgba(215, 184, 110, 0.35);
  --radius-card: 16px;
  --radius-control: 14px;
  --shadow-gold-soft: 0 14px 38px rgba(156, 125, 59, 0.22);
  --shadow-gold-strong: 0 18px 50px rgba(156, 125, 59, 0.35);
  --transition-fast: 180ms ease;
  --transition-main: 220ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--fg);
  font-family: "Manrope", "Inter", sans-serif;
  background:
    radial-gradient(circle at 16% 0%, rgba(107, 78, 255, 0.22) 0%, transparent 34%),
    radial-gradient(circle at 88% 82%, rgba(215, 184, 110, 0.14) 0%, transparent 43%),
    linear-gradient(180deg, #07070a 0%, #08090f 48%, #07070a 100%);
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(244, 240, 230, 0.05) 0 1px,
      transparent 1px 4px
    );
  z-index: -1;
}

a {
  color: inherit;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.container {
  width: min(1200px, 100% - 32px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 7, 10, 0.84);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(10px);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(215, 184, 110, 0.42);
  display: grid;
  place-items: center;
  font-family: "Bodoni Moda", serif;
  font-size: 18px;
  color: var(--gold-light);
  box-shadow: inset 0 0 0 1px rgba(241, 220, 166, 0.2);
}

.title {
  margin: 0;
  font-family: "Bodoni Moda", serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: clamp(16px, 3.4vw, 22px);
}

.eyebrow {
  margin: 0 0 3px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--gold);
}

.top-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button {
  min-height: 40px;
  min-width: 40px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02);
  color: var(--fg-soft);
  cursor: pointer;
  font-weight: 700;
  transition: var(--transition-main);
}

.icon-button:hover {
  border-color: var(--glow-border);
  color: var(--fg);
  box-shadow: 0 0 0 3px rgba(215, 184, 110, 0.12);
}

.link-button {
  border-radius: 999px;
  border: 1px solid var(--hairline);
  color: var(--fg-soft);
  text-decoration: none;
  padding: 10px 14px;
  font-size: 13px;
  transition: var(--transition-main);
}

.link-button:hover {
  border-color: var(--glow-border);
  color: var(--fg);
  background: rgba(244, 240, 230, 0.05);
}

.app-root {
  padding: 20px 0 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  background: rgba(7, 7, 10, 0.72);
}

.footer-row {
  padding: 12px 0 16px;
  color: var(--fg-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.footer-row p {
  margin: 0;
  font-size: 12px;
  opacity: 0.85;
}

.admin-footer-link {
  text-decoration: none;
  font-size: 12px;
  color: var(--violet-soft);
}

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

.card-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.012)),
    var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 18px;
  position: relative;
}

.card-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 62px;
  height: 62px;
  border-top: 1px solid rgba(215, 184, 110, 0.42);
  border-right: 1px solid rgba(215, 184, 110, 0.42);
  border-top-right-radius: var(--radius-card);
  pointer-events: none;
  opacity: 0.85;
}

.screen-shell {
  display: grid;
  gap: 16px;
}

.screen-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.screen-main,
.screen-visual {
  display: grid;
  gap: 14px;
}

.onboarding-card-preview {
  min-width: 0;
  width: clamp(160px, 22vh, 260px);
  margin: 6px auto 0;
}

.screen-title {
  margin: 0;
  font-size: clamp(26px, 4.6vw, 34px);
  font-weight: 600;
  font-family: "Bodoni Moda", serif;
  letter-spacing: 0.03em;
}

.screen-subtitle {
  margin: 7px 0 0;
  font-size: 15px;
  color: var(--fg-soft);
}

.flow-header {
  display: grid;
  gap: 6px;
}

.flow-header .screen-title {
  font-size: clamp(28px, 2.8vw, 44px);
  line-height: 1.04;
}

.flow-header .screen-subtitle {
  font-size: clamp(14px, 0.95vw, 18px);
  line-height: 1.25;
}

.flow-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.step-dot {
  height: 6px;
  border-radius: 999px;
  background: rgba(244, 240, 230, 0.14);
  border: 1px solid transparent;
}

.step-dot.active {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-color: rgba(241, 220, 166, 0.35);
}

.step-counter {
  font-size: 11px;
  color: var(--fg-soft);
  letter-spacing: 0.04em;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.label {
  display: block;
  font-size: 13px;
  color: var(--fg);
  margin-bottom: 6px;
}

.helper-text {
  margin: 6px 0 0;
  color: var(--fg-soft);
  font-size: 12px;
  opacity: 0.9;
}

.ritual-count {
  margin: 0;
  font-size: 12px;
  color: var(--fg-soft);
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
}

.hidden {
  display: none !important;
}

.input,
.textarea,
.select {
  width: 100%;
  border-radius: var(--radius-control);
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  color: var(--fg);
  padding: 12px 13px;
  font-size: 15px;
  transition: var(--transition-main);
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(244, 240, 230, 0.45);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: rgba(215, 184, 110, 0.5);
  box-shadow: 0 0 0 3px rgba(215, 184, 110, 0.18);
}

.textarea {
  min-height: 114px;
  resize: vertical;
}

.radio-group,
.switch-group,
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.switch-item {
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 12px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-soft);
  cursor: pointer;
  transition: var(--transition-main);
}

.switch-item:hover {
  border-color: var(--glow-border);
  color: var(--fg);
}

.switch-item input {
  accent-color: var(--gold);
}

.switch-block {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.switch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.switch-label {
  font-size: 14px;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 44px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-main);
}

.button:active {
  transform: scale(0.98);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.button {
  color: #07070a;
  background: linear-gradient(120deg, var(--gold) 0%, var(--gold-light) 100%);
  box-shadow: var(--shadow-gold-soft);
}

.button:hover {
  filter: brightness(1.03);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-strong);
}

.button.secondary {
  color: var(--fg);
  background: transparent;
  border-color: var(--hairline);
  box-shadow: none;
}

.button.secondary:hover {
  background: rgba(244, 240, 230, 0.06);
  border-color: var(--glow-border);
}

.button.ghost {
  color: var(--violet-soft);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button.ghost:hover {
  color: #d3caff;
}

.button.period {
  min-height: 38px;
  font-size: 12px;
  padding: 9px 11px;
}

.button.period.active {
  color: #07070a;
  background: linear-gradient(120deg, var(--gold) 0%, var(--gold-light) 100%);
  border-color: transparent;
}

.notice {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  color: var(--fg-soft);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
}

.notice.error {
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

.notice.success {
  border-color: rgba(52, 211, 153, 0.55);
  color: #bbf7d0;
}

.ritual-shell {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.ritual-shell::before {
  content: "";
  position: absolute;
  inset: -14%;
  background:
    radial-gradient(circle at 20% 30%, rgba(107, 78, 255, 0.22) 0%, transparent 52%),
    radial-gradient(circle at 82% 72%, rgba(215, 184, 110, 0.16) 0%, transparent 48%);
  filter: blur(12px);
  pointer-events: none;
  z-index: 0;
}

.ritual-shell > * {
  position: relative;
  z-index: 1;
}

.ritual-meta {
  display: grid;
  gap: 8px;
}

.ritual-meta .notice {
  font-size: clamp(15px, 1.6vw, 20px);
  border-radius: 16px;
  padding: 12px 14px;
}

.shuffle-stage {
  position: relative;
  height: clamp(340px, 48vh, 540px);
  width: 100%;
  margin: 0 auto;
  border-radius: 24px;
  border: 1px solid rgba(244, 240, 230, 0.14);
  background:
    radial-gradient(circle at 50% 56%, rgba(241, 220, 166, 0.18) 0%, transparent 36%),
    radial-gradient(circle at 15% 16%, rgba(107, 78, 255, 0.2) 0%, transparent 30%),
    radial-gradient(circle at 84% 78%, rgba(215, 184, 110, 0.14) 0%, transparent 34%),
    rgba(12, 13, 20, 0.86);
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(156, 125, 59, 0.18),
    0 24px 56px rgba(7, 7, 10, 0.45);
}

.shuffle-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.03), transparent 30%),
    repeating-linear-gradient(
      45deg,
      rgba(244, 240, 230, 0.015) 0 1px,
      transparent 1px 6px
    );
  pointer-events: none;
}

.shuffle-stage-label {
  position: absolute;
  left: 22px;
  top: 18px;
  margin: 0;
  color: var(--gold-light);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.shuffle-stage-subtitle {
  position: absolute;
  right: 22px;
  top: 18px;
  margin: 0;
  color: rgba(216, 210, 198, 0.8);
  font-size: 12px;
}

.shuffle-orbit {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(241, 220, 166, 0.16);
  pointer-events: none;
  transform-origin: center;
}

.shuffle-orbit.orbit-a {
  width: 62%;
  height: 72%;
  left: 19%;
  top: 14%;
  animation: orbitSpin 20s linear infinite;
}

.shuffle-orbit.orbit-b {
  width: 74%;
  height: 62%;
  left: 13%;
  top: 20%;
  border-style: dashed;
  border-color: rgba(107, 78, 255, 0.25);
  animation: orbitSpinReverse 24s linear infinite;
}

.shuffle-orbit.orbit-c {
  width: 46%;
  height: 46%;
  left: 27%;
  top: 27%;
  border-color: rgba(215, 184, 110, 0.24);
  animation: orbitPulse 4.2s ease-in-out infinite;
}

.shuffle-card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(52px, 4.7vw, 88px);
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  border: 1px solid rgba(156, 125, 59, 0.45);
  background:
    radial-gradient(circle at 50% 32%, rgba(241, 220, 166, 0.32), transparent 40%),
    linear-gradient(140deg, #f4f0e6, #ddd9c8 52%, #d5ccb9);
  color: #53472b;
  display: grid;
  place-items: center;
  font-size: 14px;
  transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s));
  transform-origin: center center;
  box-shadow:
    0 12px 22px rgba(156, 125, 59, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  animation: shuffleDrift calc(var(--dur) * var(--speed, 1)) cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: var(--delay);
  will-change: transform;
}

.shuffle-card.depth-0 {
  opacity: 0.56;
  filter: saturate(0.95);
}

.shuffle-card.depth-1 {
  opacity: 0.76;
}

.shuffle-card.depth-2 {
  opacity: 0.96;
}

.shuffle-stage.is-running .shuffle-card {
  box-shadow:
    0 14px 30px rgba(156, 125, 59, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.shuffle-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 58%, rgba(215, 184, 110, 0.3), transparent 44%),
    radial-gradient(circle at 50% 58%, rgba(107, 78, 255, 0.18), transparent 56%);
  filter: blur(26px);
  pointer-events: none;
}

@keyframes shuffleDrift {
  0%,
  100% {
    transform: translate(-50%, -50%) translate(0, 0) rotate(var(--r)) scale(var(--s));
  }
  25% {
    transform: translate(-50%, -50%) translate(calc(var(--dx) * 0.65), calc(var(--dy) * -0.42))
      rotate(calc(var(--r) + var(--tw) * 0.45)) scale(calc(var(--s) * 1.03));
  }
  50% {
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy))
      rotate(calc(var(--r) + var(--tw))) scale(calc(var(--s) * 1.05));
  }
  75% {
    transform: translate(-50%, -50%) translate(calc(var(--dx) * -0.56), calc(var(--dy) * 0.38))
      rotate(calc(var(--r) - var(--tw) * 0.42)) scale(calc(var(--s) * 0.98));
  }
}

@keyframes orbitSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbitSpinReverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@keyframes orbitPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.95;
  }
}

.meter {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  overflow: hidden;
  background: var(--surface-2);
}

.meter > span {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width var(--transition-main);
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(156, 125, 59, 0.4);
  color: var(--gold-light);
  font-size: 11px;
  padding: 4px 8px;
  background: rgba(215, 184, 110, 0.08);
}

.menu-shell {
  position: relative;
}

.menu-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
}

.menu-hero::before {
  content: "";
  position: absolute;
  inset: -16%;
  background:
    radial-gradient(circle at 10% 20%, rgba(107, 78, 255, 0.18), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(215, 184, 110, 0.12), transparent 35%);
  pointer-events: none;
}

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

.menu-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.menu-ambient .star {
  position: absolute;
  color: rgba(241, 220, 166, 0.5);
  font-size: 12px;
  animation: menuTwinkle 4.8s ease-in-out infinite;
}

.menu-ambient .s1 { top: 10%; left: 20%; animation-delay: 0ms; }
.menu-ambient .s2 { top: 22%; left: 74%; animation-delay: 900ms; }
.menu-ambient .s3 { top: 54%; left: 8%; animation-delay: 1600ms; }
.menu-ambient .s4 { top: 66%; left: 86%; animation-delay: 2400ms; }
.menu-ambient .s5 { top: 80%; left: 42%; animation-delay: 3200ms; }
.menu-ambient .s6 { top: 36%; left: 50%; animation-delay: 4100ms; }

@keyframes menuTwinkle {
  0%, 100% {
    opacity: 0.2;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.88;
    transform: scale(1.16);
  }
}

.menu-stepline {
  display: grid;
  gap: 8px;
}

.menu-greeting {
  margin: 4px 0 0;
  color: var(--gold);
  font-family: "Bodoni Moda", serif;
  font-style: italic;
  font-size: clamp(22px, 2.8vw, 32px);
  text-align: center;
}

.menu-title {
  margin: 0;
  text-align: center;
  color: var(--fg);
  font-family: "Bodoni Moda", serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: clamp(46px, 8.6vw, 102px);
  line-height: 0.96;
}

.menu-subtitle {
  margin: 0;
  text-align: center;
  color: rgba(216, 210, 198, 0.72);
  font-size: clamp(18px, 2.1vw, 34px);
  font-family: "Bodoni Moda", serif;
  font-weight: 400;
}

.menu-notice {
  max-width: 980px;
  margin: 8px auto 0;
}

.tirage-grid {
  display: grid;
  gap: 16px;
}

.tirage-grid-luxe {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.tirage-card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--surface-1);
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  padding: 14px 15px;
  display: grid;
  gap: 8px;
  transition: var(--transition-main);
}

.tirage-card:hover {
  border-color: var(--glow-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-soft);
}

.tirage-card-luxe {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 142px;
  padding: 22px 24px;
  border-radius: 22px;
  background:
    linear-gradient(100deg, rgba(7, 7, 10, 0.92), rgba(12, 13, 18, 0.92)),
    var(--surface-1);
}

.tirage-card-luxe:focus-visible {
  outline: none;
  border-color: rgba(241, 220, 166, 0.6);
  box-shadow: 0 0 0 4px rgba(215, 184, 110, 0.18);
}

.tirage-icon-luxe {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid rgba(215, 184, 110, 0.3);
  background: radial-gradient(circle at 40% 30%, rgba(241, 220, 166, 0.18), rgba(215, 184, 110, 0.08));
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  box-shadow: inset 0 0 0 1px rgba(215, 184, 110, 0.06);
}

.tirage-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.tirage-name {
  margin: 0;
  font-family: "Bodoni Moda", serif;
  letter-spacing: 0.03em;
  font-size: 17px;
  color: var(--fg);
}

.tirage-desc {
  margin: 0;
  color: var(--fg-soft);
  font-size: 13px;
}

.tirage-card-luxe .tirage-name {
  margin: 0;
  font-size: clamp(24px, 2.9vw, 40px);
  text-transform: uppercase;
  line-height: 1.02;
}

.tirage-card-luxe .tirage-desc {
  margin: 0;
  color: rgba(216, 210, 198, 0.8);
  font-size: clamp(15px, 1.2vw, 20px);
  line-height: 1.25;
}

.tirage-count {
  color: var(--gold);
  font-size: clamp(20px, 1.8vw, 30px);
  font-family: "Bodoni Moda", serif;
  letter-spacing: 0.02em;
}

.tirage-arrow {
  color: rgba(216, 210, 198, 0.5);
  font-size: clamp(42px, 4.8vw, 72px);
  line-height: 1;
  transform: translateX(0);
  transition: transform var(--transition-main), color var(--transition-main);
}

.tirage-card-luxe:hover .tirage-arrow {
  color: var(--gold-light);
  transform: translateX(5px);
}

.menu-actions {
  justify-content: center;
}

.selection-flow {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: visible;
  padding-right: 0;
  padding-bottom: 6px;
}

.selection-head-panel {
  padding-top: 14px;
  padding-bottom: 14px;
}

.reveal-head-panel {
  padding-top: 14px;
  padding-bottom: 14px;
}

.reveal-flow {
  min-height: 0;
}

.fan-panel {
  padding-top: 14px;
  padding-bottom: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(107, 78, 255, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(241, 220, 166, 0.03), transparent),
    var(--surface-1);
}

.selection-main-grid {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.selection-flow .sticky-cta {
  position: static;
  margin-top: 2px;
}

.positions-grid {
  display: grid;
  gap: 12px;
  align-content: start;
}

.positions-grid.slots-1 {
  grid-template-columns: minmax(160px, 220px);
}

.positions-grid.slots-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.positions-grid.slots-5 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(58px, 1fr));
  max-width: 520px;
  margin: 0 auto;
}

.positions-grid.slots-5 .slot-1 {
  grid-column: 2;
  grid-row: 1;
}

.positions-grid.slots-5 .slot-2 {
  grid-column: 1;
  grid-row: 2;
}

.positions-grid.slots-5 .slot-3 {
  grid-column: 3;
  grid-row: 2;
}

.positions-grid.slots-5 .slot-4 {
  grid-column: 2;
  grid-row: 3;
}

.positions-grid.slots-5 .slot-5 {
  grid-column: 2;
  grid-row: 2;
}

.slots-panel {
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent),
    var(--surface-1);
}

.insight-panel {
  min-height: 0;
  justify-content: start;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(215, 184, 110, 0.45) transparent;
  background:
    radial-gradient(circle at 18% -4%, rgba(107, 78, 255, 0.15), transparent 42%),
    linear-gradient(180deg, rgba(241, 220, 166, 0.04), transparent),
    var(--surface-1);
}

.position-slot {
  border-radius: 14px;
  border: 1px dashed rgba(244, 240, 230, 0.22);
  min-height: 66px;
  padding: 8px 8px 6px;
  background: rgba(18, 19, 26, 0.82);
  transition: var(--transition-main);
  display: grid;
  justify-items: start;
  gap: 4px;
}

.position-slot.filled {
  border-style: solid;
  border-color: var(--glow-border);
  box-shadow: inset 0 0 0 1px rgba(241, 220, 166, 0.12);
}

.slot-card-dashed {
  width: 44px;
  aspect-ratio: 2 / 3;
  border-radius: 9px;
  border: 1px dashed rgba(244, 240, 230, 0.28);
  background: rgba(255, 255, 255, 0.02);
}

.slot-card-back {
  width: 44px;
  aspect-ratio: 2 / 3;
  border-radius: 9px;
  border: 1px solid rgba(156, 125, 59, 0.62);
  background:
    radial-gradient(circle at 50% 34%, rgba(241, 220, 166, 0.28), transparent 40%),
    linear-gradient(140deg, #f4f0e6, #ddd3bd);
  color: #4f4328;
  display: grid;
  place-items: center;
}

.position-name {
  margin: 0;
  font-size: 10px;
  color: var(--fg-soft);
}

.slot-card-name {
  margin: 0;
  font-size: 10px;
  color: var(--fg-soft);
}

.slot-card-name.slot-placeholder {
  opacity: 0.75;
}

.card-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.deck-fan {
  position: relative;
  width: 100%;
  min-height: 136px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background:
    radial-gradient(circle at 50% -10%, rgba(107, 78, 255, 0.2), transparent 48%),
    rgba(18, 19, 26, 0.72);
}

.deck-card {
  min-width: 80px;
  aspect-ratio: 2 / 3;
  border-radius: 11px;
  border: 1px solid rgba(156, 125, 59, 0.5);
  background:
    radial-gradient(circle at 50% 35%, rgba(241, 220, 166, 0.3), transparent 42%),
    linear-gradient(140deg, #f4f0e6, #ddd3bd);
  color: #483b20;
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: var(--transition-main);
}

.deck-card:hover {
  transform: translateY(-10px) rotate(-1deg);
  box-shadow: var(--shadow-gold-soft);
}

.deck-card.selected {
  opacity: 0.42;
  transform: scale(0.96);
  border-color: rgba(156, 125, 59, 0.8);
}

.fan-card {
  position: absolute;
  left: var(--left);
  bottom: 10px;
  transform: translateX(-50%) rotate(var(--rot));
  min-width: 74px;
  width: 74px;
}

.fan-card:hover {
  transform: translateX(-50%) translateY(-10px) rotate(calc(var(--rot) - 1.2deg));
}

.fly-card {
  transform-origin: center;
}

.sticky-cta {
  position: sticky;
  bottom: 10px;
  z-index: 25;
  background: rgba(7, 7, 10, 0.78);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 10px;
  backdrop-filter: blur(8px);
}

.reveal-layout {
  display: grid;
  gap: 14px;
}

.big-card {
  border-radius: var(--radius-card);
  border: 1px solid rgba(156, 125, 59, 0.52);
  background:
    linear-gradient(180deg, rgba(241, 220, 166, 0.03), transparent),
    var(--surface-1);
  padding: 16px;
  position: relative;
}

.big-card .name {
  margin: 0 0 8px;
  font-family: "Bodoni Moda", serif;
  font-size: clamp(21px, 4.2vw, 28px);
  color: var(--gold-light);
}

.big-card .meta {
  margin: 0 0 8px;
  color: var(--fg-soft);
  font-size: 13px;
}

.revealed-card-face {
  border-radius: 14px;
  border: 1px solid rgba(156, 125, 59, 0.52);
  background:
    radial-gradient(circle at 50% 35%, rgba(241, 220, 166, 0.12), transparent 48%),
    linear-gradient(180deg, #161720, #101117);
  min-height: 280px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.orientation-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  font-size: 12px;
  padding: 4px 8px;
  color: var(--fg-soft);
}

.reading-quote {
  margin: 0;
  font-family: "Bodoni Moda", serif;
  border-left: 3px solid rgba(215, 184, 110, 0.55);
  padding-left: 12px;
  font-size: clamp(18px, 3.8vw, 26px);
  line-height: 1.4;
}

.result-panel {
  background:
    radial-gradient(circle at 20% 0%, rgba(107, 78, 255, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(241, 220, 166, 0.04), transparent),
    var(--surface-1);
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(215, 184, 110, 0.45) transparent;
}

.result-title {
  margin: 0;
  color: var(--gold-light);
  font-family: "Bodoni Moda", serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
}

.result-main {
  margin: 0;
  color: var(--gold-light);
  font-family: "Bodoni Moda", serif;
  font-size: 24px;
  line-height: 1.4;
  text-shadow: 0 0 18px rgba(215, 184, 110, 0.22);
}

.selection-result {
  font-size: 24px;
}

.basic-interpretation {
  margin: 0;
  color: var(--fg-soft);
  font-size: 13px;
  line-height: 1.45;
}

.repeated-note {
  margin: 0;
  color: rgba(216, 210, 198, 0.9);
  font-size: 13px;
  line-height: 1.4;
  font-family: "Manrope", "Inter", sans-serif;
}

.see-more-link {
  justify-self: flex-start;
}

.section-subtitle {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border-radius: 999px;
  border: 1px solid var(--hairline);
  padding: 5px 9px;
  font-size: 12px;
  color: var(--fg-soft);
  background: rgba(255, 255, 255, 0.02);
}

.thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.thumb {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--fg-soft);
  min-width: 96px;
  padding: 9px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-main);
}

.thumb.active {
  border-color: var(--glow-border);
  box-shadow: 0 0 0 2px rgba(215, 184, 110, 0.18);
  color: var(--fg);
}

.stars {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.star-button {
  min-width: 52px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  color: var(--fg-soft);
  font-size: 17px;
  cursor: pointer;
  transition: var(--transition-main);
}

.star-button.active {
  border-color: var(--glow-border);
  color: var(--gold-light);
  box-shadow: inset 0 0 0 1px rgba(241, 220, 166, 0.2);
}

.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(680px, calc(100% - 26px));
  width: auto;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(13, 14, 18, 0.96);
  border: 1px solid var(--hairline);
  color: var(--fg);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-main);
  z-index: 70;
}

.toast.show {
  opacity: 1;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.kpi {
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  padding: 12px;
}

.kpi p {
  margin: 0;
}

.kpi .label {
  margin: 0;
  color: var(--fg-soft);
  font-size: 12px;
}

.kpi .value {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 74px 1fr 50px;
  gap: 8px;
  align-items: center;
}

.bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: #0d0f16;
  overflow: hidden;
}

.bar > span {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.table-wrap {
  border-radius: var(--radius-card);
  border: 1px solid var(--hairline);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid rgba(244, 240, 230, 0.08);
  font-size: 13px;
}

th {
  color: var(--fg-soft);
  font-weight: 600;
}

.muted {
  color: var(--fg-soft);
}

.stack {
  display: grid;
  gap: 12px;
}

.stack-lg {
  display: grid;
  gap: 18px;
}

.loading-shimmer {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (min-width: 1101px) {
  .app-root {
    padding-top: 28px;
  }

  .screen-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: 18px;
    align-items: start;
  }

  .site-shell {
    height: 100vh;
    overflow: hidden;
  }

  .app-root {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 16px 0;
  }

  .screen-shell {
    height: 100%;
    grid-template-rows: auto 1fr;
    min-height: 0;
  }

  body[data-step="menu"] .site-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-step="menu"] .app-root {
    overflow: visible;
    padding-bottom: 24px;
  }

  body[data-step="menu"] .screen-shell {
    height: auto;
    grid-template-rows: none;
  }

  body[data-step="preparation"] .site-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-step="preparation"] .app-root {
    overflow: visible;
    padding-bottom: 24px;
  }

  body[data-step="preparation"] .screen-shell {
    height: auto;
    grid-template-rows: none;
  }

  body[data-step="selection"] .site-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-step="selection"] .app-root {
    overflow: visible;
    padding-bottom: 24px;
  }

  body[data-step="selection"] .screen-shell {
    height: auto;
    grid-template-rows: none;
  }

  .selection-flow {
    grid-template-rows: none;
    height: auto;
  }

  .reveal-flow {
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
  }

  .selection-main-grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    gap: 12px;
    min-height: 0;
  }

  .selection-head-panel {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .reveal-head-panel {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .positions-grid.slots-1 {
    min-height: 100%;
    align-content: center;
  }

  .reveal-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 0;
  }

  .deck-fan {
    min-height: 154px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1100px) {
  .container {
    width: min(1200px, 100% - 24px);
  }

  .row-between {
    align-items: flex-start;
  }

  .app-root {
    padding: 14px 0 24px;
  }

  .card-panel {
    padding: 16px;
  }

  .screen-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .flow-header .screen-title {
    font-size: clamp(26px, 5.2vw, 40px);
  }

  .flow-header .screen-subtitle {
    font-size: clamp(14px, 2vw, 18px);
  }

  .selection-head-panel,
  .reveal-head-panel {
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .menu-shell {
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .menu-greeting {
    font-size: clamp(20px, 3vw, 28px);
  }

  .menu-title {
    font-size: clamp(42px, 9vw, 78px);
  }

  .menu-subtitle {
    font-size: clamp(17px, 3vw, 26px);
  }

  .tirage-grid-luxe {
    width: min(980px, 100%);
  }

  .tirage-card-luxe {
    min-height: 124px;
    padding: 18px 20px;
    gap: 14px;
  }

  .tirage-icon-luxe {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }

  .tirage-card-luxe .tirage-name {
    font-size: clamp(24px, 4.8vw, 36px);
  }

  .tirage-card-luxe .tirage-desc {
    font-size: clamp(14px, 2.2vw, 18px);
  }

  .tirage-count {
    font-size: clamp(20px, 3.2vw, 28px);
  }

  .ritual-meta .notice {
    font-size: clamp(14px, 2.4vw, 18px);
  }

  .shuffle-stage {
    height: clamp(300px, 45vh, 430px);
  }

  .shuffle-card {
    width: clamp(48px, 7.2vw, 78px);
  }

  .selection-main-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .positions-grid.slots-1 {
    justify-content: center;
  }

  .positions-grid.slots-3 {
    max-width: 760px;
    margin: 0 auto;
  }

  .positions-grid.slots-5 {
    max-width: 560px;
    grid-template-rows: repeat(3, minmax(64px, 1fr));
  }

  .deck-fan {
    min-height: 168px;
  }

  .fan-card {
    width: clamp(58px, 8vw, 72px);
    min-width: clamp(58px, 8vw, 72px);
  }

  .insight-panel,
  .result-panel {
    max-height: none;
    overflow: visible;
  }

  .sticky-cta {
    position: static;
    bottom: auto;
    margin-top: 6px;
  }

  .reveal-flow {
    height: auto;
    grid-template-rows: none;
  }

  .reveal-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .revealed-card-face {
    min-height: 230px;
  }

  .onboarding-card-preview {
    width: clamp(140px, 28vw, 220px);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(1200px, 100% - 16px);
  }

  .row-between {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .brand-wrap {
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .eyebrow {
    font-size: 10px;
  }

  .title {
    font-size: clamp(15px, 4.4vw, 21px);
  }

  .top-links {
    margin-top: 2px;
  }

  .icon-button {
    min-height: 38px;
    min-width: 38px;
  }

  .link-button {
    padding: 9px 12px;
  }

  .app-root {
    padding: 12px 0 20px;
  }

  .card-panel {
    padding: 14px;
  }

  .sticky-cta {
    padding: 8px;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .actions-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .flow-header .screen-title {
    font-size: clamp(24px, 9.2vw, 36px);
  }

  .flow-header .screen-subtitle {
    font-size: 15px;
  }

  .selection-flow {
    padding-bottom: 0;
  }

  .menu-shell {
    grid-template-rows: auto auto auto;
    height: auto;
  }

  .menu-greeting {
    font-size: 18px;
  }

  .menu-title {
    font-size: clamp(30px, 13vw, 48px);
    line-height: 0.98;
  }

  .menu-subtitle {
    font-size: 16px;
  }

  .tirage-grid-luxe {
    overflow: visible;
    padding-right: 0;
  }

  .tirage-card-luxe {
    grid-template-columns: auto 1fr;
    gap: 14px;
    min-height: 112px;
    padding: 16px;
  }

  .tirage-icon-luxe {
    width: 52px;
    height: 52px;
    font-size: 24px;
  }

  .tirage-card-luxe .tirage-name {
    font-size: clamp(20px, 8.8vw, 30px);
  }

  .tirage-card-luxe .tirage-desc {
    font-size: 15px;
  }

  .tirage-count {
    font-size: 19px;
  }

  .tirage-arrow {
    display: none;
  }

  .ritual-meta .notice {
    font-size: 14px;
  }

  .shuffle-stage {
    height: min(60vh, 360px);
    border-radius: 18px;
  }

  .shuffle-stage-label,
  .shuffle-stage-subtitle {
    font-size: 11px;
  }

  .shuffle-stage-subtitle {
    display: none;
  }

  .shuffle-card {
    width: clamp(46px, 14vw, 70px);
  }

  .deck-fan {
    min-height: 172px;
  }

  .fan-card {
    width: 56px;
    min-width: 56px;
    bottom: 12px;
  }

  .onboarding-card-preview {
    width: min(62vw, 220px);
  }

  .positions-grid.slots-3,
  .positions-grid.slots-5 {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    max-width: none;
    margin: 0;
  }

  .positions-grid.slots-5 .slot-1,
  .positions-grid.slots-5 .slot-2,
  .positions-grid.slots-5 .slot-3,
  .positions-grid.slots-5 .slot-4,
  .positions-grid.slots-5 .slot-5 {
    grid-column: auto;
    grid-row: auto;
  }

  .result-title,
  .result-main,
  .selection-result {
    font-size: 21px;
  }

  .basic-interpretation,
  .repeated-note {
    font-size: 12px;
  }

  .revealed-card-face {
    min-height: 204px;
  }

  .thumb {
    min-width: 84px;
  }
}
