/* =========================================================
   星屿牌室 · styles
   A self-contained, mobile-first oracle interface.
   ========================================================= */

:root {
  --bg: #080a12;
  --bg-soft: #0d101d;
  --panel: rgba(17, 20, 35, 0.78);
  --panel-solid: #111422;
  --panel-raised: #161a2c;
  --ink: #f2eee5;
  --ink-soft: #d8d2c7;
  --muted: #ada8b8;
  --muted-2: #898497;
  --gold: #d6b878;
  --gold-bright: #f0d9a5;
  --gold-deep: #9a7b46;
  --rose: #cf999c;
  --blue: #97a9d6;
  --green: #9bb7a6;
  --line: rgba(214, 184, 120, 0.15);
  --line-soft: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(214, 184, 120, 0.34);
  --danger: #d98f88;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --shadow-lg: 0 32px 80px rgba(0, 0, 0, 0.4);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

::selection { background: rgba(214, 184, 120, 0.28); color: #fff8e8; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
a { color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.sky, .aurora, .noise { position: fixed; inset: 0; pointer-events: none; }
.sky { z-index: 0; overflow: hidden; }
.sky .star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #f4e6c8;
  opacity: 0.35;
  animation: twinkle var(--dur, 5s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.sky .star.big { width: 3px; height: 3px; box-shadow: 0 0 10px rgba(240, 217, 165, 0.7); }
.sky .shooting {
  position: absolute;
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 217, 165, 0.7), transparent);
  transform: rotate(-35deg);
  opacity: 0;
  animation: shoot 12s ease-in infinite;
  animation-delay: var(--delay, 2s);
}

.aurora {
  z-index: 0;
  filter: blur(100px);
  opacity: 0.4;
  border-radius: 50%;
  width: 52vw;
  height: 52vw;
}
.aurora-a {
  left: -24vw;
  top: -22vw;
  background: radial-gradient(circle, rgba(57, 50, 103, 0.75), transparent 66%);
}
.aurora-b {
  right: -26vw;
  bottom: -20vw;
  background: radial-gradient(circle, rgba(121, 78, 56, 0.42), transparent 68%);
}
.noise {
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

/* ---------- Header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
  padding: 0 clamp(20px, 4vw, 58px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  color: var(--gold);
  display: grid;
  place-items: center;
}
.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}
.brand-mark path:nth-child(2) { fill: rgba(214, 184, 120, 0.12); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.24em;
  font-weight: 500;
}
.brand-text small {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.26em;
}
.topnav { display: flex; align-items: center; gap: 6px; }
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  transition: color 0.2s, background 0.2s;
}
.nav-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.045); }
.nav-btn .icon { width: 16px; height: 16px; }
.install-btn { color: var(--gold); }

/* ---------- Layout ---------- */
.page {
  position: relative;
  z-index: 2;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 58px);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  align-items: center;
  gap: clamp(24px, 4vw, 70px);
  min-height: 470px;
  padding: clamp(48px, 7vw, 88px) 0 clamp(42px, 5vw, 62px);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--gold);
  font-size: 9.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.eyebrow > span {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.eyebrow.small { font-size: 8.5px; letter-spacing: 0.26em; margin-bottom: 13px; }
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(38px, 4.4vw, 64px);
  line-height: 1.26;
  letter-spacing: 0.015em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #f4e3bd 0%, #d6b878 44%, #b8935b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  max-width: 570px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.95;
  letter-spacing: 0.02em;
}
.hero-facts {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 31px;
  color: var(--muted-2);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}
.hero-facts b { color: var(--gold-bright); font-family: var(--serif); font-size: 17px; font-weight: 500; margin-right: 3px; }
.hero-facts i { width: 1px; height: 15px; background: var(--line); }

.hero-art {
  position: relative;
  justify-self: center;
  width: min(100%, 390px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.orbit {
  position: absolute;
  border: 1px solid rgba(214, 184, 120, 0.14);
  border-radius: 50%;
}
.orbit-1 { inset: 7%; transform: rotate(-22deg) scaleY(0.6); }
.orbit-2 { inset: 21%; transform: rotate(38deg) scaleY(0.85); border-color: rgba(151, 169, 214, 0.13); }
.orbit::before, .orbit::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(214, 184, 120, 0.8);
}
.orbit-1::before { left: 14%; top: 10%; }
.orbit-1::after { right: 8%; bottom: 20%; width: 3px; height: 3px; }
.orbit-2::before { right: 21%; top: 2%; background: var(--blue); box-shadow: 0 0 16px rgba(151, 169, 214, 0.8); }
.orbit-2::after { left: 5%; bottom: 23%; width: 4px; height: 4px; }
.hero-moon {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #f6e8c8, #d8ba7d 38%, #8d6b3c 72%, #4d3922 100%);
  box-shadow: 0 0 70px rgba(214, 184, 120, 0.23), 0 0 160px rgba(214, 184, 120, 0.12);
}
.hero-moon::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: radial-gradient(circle at 69% 29%, #080a12 0 37%, rgba(8, 10, 18, 0.97) 38%, rgba(8, 10, 18, 0.88) 40%, transparent 41%);
  filter: blur(0.4px);
}
.hero-moon::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1px solid rgba(214, 184, 120, 0.18);
}
.float-card {
  position: absolute;
  width: 62px;
  aspect-ratio: 5 / 7;
  border-radius: 7px;
  border: 1px solid rgba(214, 184, 120, 0.36);
  background:
    radial-gradient(circle at 50% 45%, rgba(214, 184, 120, 0.2), transparent 38%),
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(214, 184, 120, 0.055) 8px 9px),
    linear-gradient(150deg, #1a1d34, #0a0c18);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 0 0 3px rgba(9, 11, 20, 0.45);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 20px;
  animation: floaty 7s ease-in-out infinite;
}
.float-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(214, 184, 120, 0.16);
  border-radius: 4px;
}
.fc-1 { left: 5%; top: 27%; transform: rotate(-15deg); animation-delay: -2s; }
.fc-2 { right: 2%; top: 18%; transform: rotate(12deg); animation-delay: -4s; width: 50px; }
.fc-3 { right: 15%; bottom: 5%; transform: rotate(-5deg); animation-delay: -1s; width: 44px; }
.hero-note {
  position: absolute;
  right: -2%;
  bottom: 14%;
  margin: 0;
  color: var(--muted-2);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 2;
  text-align: right;
}

/* ---------- Workspace ---------- */
.workspace {
  display: grid;
  grid-template-columns: 372px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.setup-panel {
  position: sticky;
  top: 98px;
  display: flex;
  flex-direction: column;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.035), transparent 35%),
    var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.27);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-height: calc(100vh - 118px);
  overflow: hidden;
}
.setup-scroll {
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 184, 120, 0.24) transparent;
}
.setup-scroll::-webkit-scrollbar { width: 4px; }
.setup-scroll::-webkit-scrollbar-thumb { background: rgba(214, 184, 120, 0.24); border-radius: 99px; }
#startBtn { flex: 0 0 auto; margin-top: 1px; }
.panel-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.16em;
}
.panel-kicker > span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 0;
}
.panel-kicker b {
  margin-left: auto;
  color: var(--muted-2);
  font-weight: 400;
  font-size: 9.5px;
  letter-spacing: 0.08em;
}
.section-rule { height: 1px; margin: 20px 0 17px; background: linear-gradient(90deg, var(--line), transparent); }

.deck-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}
.deck-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: 0.22s var(--ease);
}
.deck-tab:hover { color: var(--ink-soft); }
.deck-tab.is-active {
  border-color: rgba(214, 184, 120, 0.3);
  background: linear-gradient(145deg, rgba(214, 184, 120, 0.13), rgba(214, 184, 120, 0.035));
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}
.deck-tab-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 15px;
  flex: 0 0 auto;
}
.deck-tab span:last-child { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.deck-tab strong { font-size: 12.5px; font-weight: 500; letter-spacing: 0.05em; }
.deck-tab small { color: var(--muted-2); font-size: 8.5px; white-space: nowrap; letter-spacing: 0.02em; }

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}
.field-label span { color: var(--muted-2); font-size: 9px; letter-spacing: 0; }
.question-wrap {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(4, 5, 11, 0.36);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.question-wrap:focus-within {
  border-color: rgba(214, 184, 120, 0.45);
  box-shadow: 0 0 0 3px rgba(214, 184, 120, 0.06);
}
#question {
  display: block;
  width: 100%;
  min-height: 86px;
  resize: vertical;
  padding: 12px 13px 3px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.75;
}
#question::placeholder { color: var(--muted-2); }
.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px 7px 13px;
  color: var(--muted-2);
  font-size: 9px;
}
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}
.text-btn:hover { color: var(--gold-bright); }
.text-btn .icon { width: 14px; height: 14px; }
.text-btn.danger { color: #c98c86; }
.text-btn.danger:hover { color: #f0a49d; }

.example-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.example-chips button {
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  background: transparent;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.5;
  transition: 0.2s;
}
.example-chips button:hover { border-color: var(--line-strong); color: var(--gold-bright); }

.spread-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}
.spread-tile {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  padding: 9px 9px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.014);
  color: var(--muted);
  text-align: left;
  transition: 0.2s var(--ease);
}
.spread-tile:hover { border-color: rgba(214, 184, 120, 0.25); color: var(--ink-soft); }
.spread-tile strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.spread-tile small { margin-left: auto; color: var(--muted-2); font-size: 8px; white-space: nowrap; }
.spread-tile.is-selected {
  border-color: rgba(214, 184, 120, 0.48);
  background: linear-gradient(140deg, rgba(214, 184, 120, 0.14), rgba(214, 184, 120, 0.03));
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(214, 184, 120, 0.05);
}
.spread-tile.is-selected small { color: rgba(240, 217, 165, 0.65); }

.spread-detail {
  padding: 12px 13px;
  border-left: 1px solid var(--line-strong);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, rgba(214, 184, 120, 0.07), transparent);
  margin-bottom: 14px;
}
.spread-detail-head { display: flex; align-items: center; gap: 9px; }
.spread-detail-head > span {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  width: 27px;
  text-align: center;
}
.spread-detail-head div { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.spread-detail-head strong { font-family: var(--serif); font-size: 14px; font-weight: 500; letter-spacing: 0.08em; }
.spread-detail-head small { color: var(--muted-2); font-size: 9px; }
.spread-detail > p { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.75; }
.position-preview { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.position-preview span {
  padding: 2px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.03em;
}

.option-row { margin: 0 0 16px; }
.switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch-label > span:first-child { display: flex; flex-direction: column; line-height: 1.4; }
.switch-label b { color: var(--ink-soft); font-size: 11px; font-weight: 400; letter-spacing: 0.06em; }
.switch-label small { color: var(--muted-2); font-size: 9px; }
.switch-label input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  position: relative;
  width: 37px;
  height: 21px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  transition: 0.22s;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  transition: 0.22s var(--ease);
}
.switch-label input:checked + .switch {
  border-color: rgba(214, 184, 120, 0.45);
  background: rgba(214, 184, 120, 0.17);
}
.switch-label input:checked + .switch::after { transform: translateX(16px); background: var(--gold-bright); }
.switch-label input:focus-visible + .switch { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch-label.is-disabled { opacity: 0.4; pointer-events: none; }

.primary-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 245, 220, 0.28);
  border-radius: 13px;
  background: linear-gradient(135deg, #e7cc94 0%, #c9a464 48%, #b18b50 100%);
  color: #1b160d;
  box-shadow: 0 10px 30px rgba(154, 123, 70, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  transition: transform 0.2s var(--ease), box-shadow 0.2s, filter 0.2s;
  overflow: hidden;
}
.primary-btn::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 30%;
  height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: rotate(18deg);
  transition: left 0.55s var(--ease);
}
.primary-btn:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 14px 36px rgba(154, 123, 70, 0.26); }
.primary-btn:hover::after { left: 115%; }
.primary-btn:active { transform: translateY(0); }
.primary-btn .icon { width: 18px; height: 18px; }
.primary-btn small {
  display: block;
  width: 100%;
  color: rgba(27, 22, 13, 0.6);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.4;
}
#startBtn { flex-wrap: wrap; row-gap: 1px; }
#startBtn .icon { margin-top: 2px; }
.primary-btn.compact { width: auto; min-height: 42px; padding: 8px 16px; font-size: 11.5px; border-radius: 10px; }
.primary-btn.compact small { display: none; }

.privacy-note {
  display: flex;
  gap: 6px;
  margin: 11px 0 0;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.65;
}
.privacy-note .icon { width: 12px; height: 12px; margin-top: 2px; }

/* ---------- Stage ---------- */
.stage {
  position: relative;
  min-height: 740px;
  scroll-margin-top: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 75% 8%, rgba(214, 184, 120, 0.07), transparent 33%),
    radial-gradient(circle at 15% 80%, rgba(80, 70, 130, 0.11), transparent 40%),
    linear-gradient(150deg, rgba(23, 26, 45, 0.78), rgba(11, 13, 24, 0.86));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(214, 184, 120, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 184, 120, 0.025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 77%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 77%);
}
.stage-empty {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 740px;
  padding: clamp(30px, 5vw, 64px);
  text-align: center;
}
.empty-visual {
  position: relative;
  width: 230px;
  height: 202px;
  margin-bottom: 20px;
}
.empty-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 90px;
  aspect-ratio: 5 / 7;
  transform-origin: 50% 110%;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35));
}
.ec-1 { transform: translate(-50%, -48%) rotate(-17deg) translate(-42px, 9px); }
.ec-2 { transform: translate(-50%, -48%) rotate(0deg) translateY(-5px); z-index: 2; }
.ec-3 { transform: translate(-50%, -48%) rotate(17deg) translate(42px, 9px); }
.card-back-mini {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 184, 120, 0.43);
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 42%, rgba(214, 184, 120, 0.22), transparent 34%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(214, 184, 120, 0.09) 0 2deg, transparent 2deg 14deg),
    linear-gradient(150deg, #1a1d35, #0a0c17);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 20px;
  box-shadow: inset 0 0 0 4px rgba(9, 11, 20, 0.7), inset 0 0 0 5px rgba(214, 184, 120, 0.18);
}
.empty-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(214, 184, 120, 0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: slowspin 30s linear infinite;
}
.empty-ring::before, .empty-ring::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}
.empty-ring::before { left: 18px; top: 35px; }
.empty-ring::after { right: 12px; bottom: 48px; width: 3px; height: 3px; opacity: 0.6; }
.stage-empty h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.02em;
}
.stage-empty > p:not(.eyebrow) {
  max-width: 490px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.95;
}
.mini-steps {
  display: flex;
  gap: 28px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}
.mini-steps li { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 10px; }
.mini-steps b {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.05em;
}
.empty-quote {
  margin-top: 38px;
  padding-top: 17px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

/* ---------- Reading ---------- */
.reading-view {
  position: relative;
  z-index: 1;
  padding: clamp(20px, 3.6vw, 40px);
  animation: fadeUp 0.6s var(--ease) both;
}
.reading-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
.reading-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.reading-badges span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--gold);
  font-size: 8.5px;
  letter-spacing: 0.11em;
}
.reading-badges span:last-child { color: var(--muted-2); border-color: var(--line-soft); }
.reading-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(25px, 2.8vw, 35px);
  font-weight: 500;
  letter-spacing: 0.04em;
}
#readingQuestion {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}
#readingQuestion::before { content: "“"; color: var(--gold-deep); }
#readingQuestion::after { content: "”"; color: var(--gold-deep); }
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  transition: 0.2s;
}
.ghost-btn:hover { border-color: var(--line-strong); color: var(--gold-bright); background: rgba(214, 184, 120, 0.05); }
.ghost-btn.danger:hover { border-color: rgba(217, 143, 136, 0.5); color: var(--danger); }
.ghost-btn .icon { width: 14px; height: 14px; }

.board-shell {
  position: relative;
  padding: 16px clamp(8px, 2vw, 22px) 14px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(214, 184, 120, 0.065), transparent 56%),
    rgba(5, 7, 14, 0.38);
  overflow: hidden;
}
.board-shell::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(214, 184, 120, 0.06);
  border-radius: 12px;
  pointer-events: none;
}
.board-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.board-topline i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-soft), transparent); }
.board-topline span:last-child { color: var(--gold); }
.spread-board {
  display: grid;
  justify-content: center;
  align-items: start;
  gap: 16px 13px;
  padding: 10px 0 4px;
  min-height: 100px;
}
.layout-one { grid-template-columns: minmax(0, 1fr); }
.layout-one .slot { max-width: 160px; margin: 0 auto; }
.layout-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout-row-3 .slot { max-width: 132px; margin: 0 auto; }
.layout-seasons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-seasons .slot { max-width: 136px; margin: 0 auto; }
.layout-cross {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  max-width: 560px;
  margin: 0 auto;
}
.layout-cross .slot:nth-child(1) { grid-area: 2 / 2; }
.layout-cross .slot:nth-child(2) { grid-area: 2 / 1; }
.layout-cross .slot:nth-child(3) { grid-area: 2 / 3; }
.layout-cross .slot:nth-child(4) { grid-area: 3 / 2; }
.layout-cross .slot:nth-child(5) { grid-area: 1 / 2; }
.layout-cross .slot { max-width: 118px; margin: 0 auto; }
.layout-relationship { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.layout-relationship .slot { max-width: 112px; margin: 0 auto; }
.layout-paths {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 620px;
  margin: 0 auto;
}
.layout-paths .slot { max-width: 112px; margin: 0 auto; }
.layout-paths .slot:nth-child(1) { grid-area: 1 / 2; }
.layout-paths .slot:nth-child(2) { grid-area: 2 / 1; }
.layout-paths .slot:nth-child(3) { grid-area: 3 / 1; }
.layout-paths .slot:nth-child(4) { grid-area: 2 / 3; }
.layout-paths .slot:nth-child(5) { grid-area: 3 / 3; }
.layout-row-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.layout-row-5 .slot { max-width: 112px; margin: 0 auto; }
.layout-grid-9 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 390px; margin: 0 auto; }
.layout-grid-9 .slot { max-width: 112px; margin: 0 auto; }
.layout-arc-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; }
.layout-arc-7 .slot { max-width: 100px; margin: 0 auto; }
.layout-arc-7 .slot:nth-child(1), .layout-arc-7 .slot:nth-child(7) { transform: translateY(32px); }
.layout-arc-7 .slot:nth-child(2), .layout-arc-7 .slot:nth-child(6) { transform: translateY(14px); }
.layout-arc-7 .slot:nth-child(3), .layout-arc-7 .slot:nth-child(5) { transform: translateY(3px); }
.layout-celtic {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: auto auto auto auto;
  max-width: 680px;
  margin: 0 auto;
  align-items: start;
}
.layout-celtic .slot { max-width: 106px; margin: 0 auto; }
.layout-celtic .slot:nth-child(1) { grid-area: 2 / 2; }
.layout-celtic .slot:nth-child(2) { grid-area: 3 / 2; }
.layout-celtic .slot:nth-child(3) { grid-area: 4 / 2; }
.layout-celtic .slot:nth-child(4) { grid-area: 2 / 1; }
.layout-celtic .slot:nth-child(5) { grid-area: 1 / 2; }
.layout-celtic .slot:nth-child(6) { grid-area: 2 / 3; }
.layout-celtic .slot:nth-child(7) { grid-area: 4 / 4; }
.layout-celtic .slot:nth-child(8) { grid-area: 3 / 4; }
.layout-celtic .slot:nth-child(9) { grid-area: 2 / 4; }
.layout-celtic .slot:nth-child(10) { grid-area: 1 / 4; }

.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  animation: fadeUp 0.45s var(--ease) both;
}
.slot-card-wrap { position: relative; width: 100%; }
.slot-label {
  max-width: 100%;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.5;
  text-align: center;
  letter-spacing: 0.03em;
}
.slot-label b { display: block; color: var(--muted); font-weight: 400; font-size: 10.5px; letter-spacing: 0.07em; }
.slot-label em { display: block; color: var(--muted-2); font-style: normal; font-size: 8.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.is-clickable .slot-card-wrap { cursor: pointer; }
.slot.is-clickable:hover .card { transform: translateY(-3px); }
.slot.is-clickable:hover .slot-label b { color: var(--gold); }

.slot-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed rgba(214, 184, 120, 0.22);
  border-radius: 9px;
  background: rgba(214, 184, 120, 0.022);
  color: var(--muted-2);
  transition: border-color 0.25s, background 0.25s;
}
.slot-placeholder b {
  color: rgba(214, 184, 120, 0.45);
  font-family: var(--serif);
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 400;
}
.slot-placeholder span { font-size: 7.5px; letter-spacing: 0.1em; }
.slot-placeholder i {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(214, 184, 120, 0.06);
  border-radius: 5px;
}
.slot.is-next .slot-placeholder {
  border-color: rgba(214, 184, 120, 0.52);
  background: rgba(214, 184, 120, 0.055);
  box-shadow: 0 0 26px rgba(214, 184, 120, 0.06);
}
.slot.is-next .slot-placeholder b { color: var(--gold); }
.slot.is-complete .slot-label b { color: var(--ink-soft); }

.board-hint {
  margin: 8px 0 0;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.7;
  text-align: center;
  letter-spacing: 0.03em;
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 7;
  perspective: 900px;
  transform-style: preserve-3d;
  transition: transform 0.25s var(--ease);
}
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.82s cubic-bezier(0.18, 0.85, 0.2, 1);
}
.card.is-flipped .card-inner { transform: rotateY(180deg); }
.card-back, .card-face {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.card-back {
  border: 1px solid rgba(214, 184, 120, 0.45);
  background:
    radial-gradient(circle at 50% 43%, rgba(214, 184, 120, 0.22), transparent 31%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(214, 184, 120, 0.09) 0 1.6deg, transparent 1.6deg 13deg),
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(214, 184, 120, 0.038) 10px 11px),
    linear-gradient(148deg, #1b1e37 0%, #111426 48%, #090b16 100%);
  box-shadow: inset 0 0 0 4px rgba(8, 10, 19, 0.74), inset 0 0 0 5px rgba(214, 184, 120, 0.17), 0 9px 20px rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
}
.card-back::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(214, 184, 120, 0.22);
  border-radius: 4px;
}
.card-back::after {
  content: "";
  position: absolute;
  width: 44%;
  aspect-ratio: 1;
  border: 1px solid rgba(214, 184, 120, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(214, 184, 120, 0.035), 0 0 24px rgba(214, 184, 120, 0.1);
}
.card-back-sigil {
  position: relative;
  z-index: 1;
  color: var(--gold);
  font-family: var(--serif);
  font-size: clamp(16px, 2.2vw, 25px);
  text-shadow: 0 0 18px rgba(214, 184, 120, 0.45);
}
.card-face {
  transform: rotateY(180deg);
  padding: 4.5%;
  border: 1px solid rgba(111, 83, 43, 0.52);
  background:
    radial-gradient(ellipse at 48% 18%, rgba(255, 252, 242, 0.92), transparent 55%),
    linear-gradient(150deg, #f3ead7 0%, #e9ddc5 52%, #f5eddc 100%);
  color: #44351d;
  box-shadow: inset 0 0 0 3px rgba(255, 250, 238, 0.4), 0 9px 20px rgba(0, 0, 0, 0.3);
}
.card-face::before {
  content: "";
  position: absolute;
  inset: 3%;
  border: 1px solid rgba(116, 86, 43, 0.41);
  border-radius: 3px;
  pointer-events: none;
}
.card-face::after {
  content: "";
  position: absolute;
  inset: 5.5%;
  border: 1px solid rgba(116, 86, 43, 0.16);
  border-radius: 2px;
  pointer-events: none;
}
.card-inner-face {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 8% 7% 6%;
  overflow: hidden;
}
.card-corner {
  position: absolute;
  top: 7%;
  left: 8%;
  color: rgba(93, 68, 33, 0.72);
  font-family: var(--serif);
  font-size: clamp(5px, 0.55vw, 8px);
  letter-spacing: 0.03em;
  line-height: 1;
}
.card-corner.bottom { top: auto; left: auto; right: 8%; bottom: 7%; transform: rotate(180deg); }
.card-art {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 5% 2% 2%;
  color: #6d5027;
  transition: transform 0.6s var(--ease);
}
.card.is-reversed .card-art,
.card.is-reversed .card-symbol { transform: rotate(180deg); }
.major-svg { width: 100%; height: 100%; }
.minor-art {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.minor-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(109, 80, 39, 0.075);
  font-family: var(--serif);
  font-size: clamp(46px, 14vw, 150px);
  line-height: 1;
  pointer-events: none;
}
.pip-grid {
  position: relative;
  display: grid;
  width: 82%;
  height: 82%;
  gap: 1%;
  align-content: center;
  justify-content: center;
}
.pip-rows {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5%;
  width: 100%;
  height: 84%;
}
.pip-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8%;
  width: 100%;
}
.pip {
  display: grid;
  place-items: center;
  color: #6d5027;
  line-height: 1;
  font-size: clamp(10px, 1.9vw, 21px);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}
.card[data-suit="wands"] .pip, .card[data-suit="wands"] .ace-suit, .card[data-suit="wands"] .court-suit { color: #895026; }
.card[data-suit="cups"] .pip, .card[data-suit="cups"] .ace-suit, .card[data-suit="cups"] .court-suit { color: #8e4e52; }
.card[data-suit="swords"] .pip, .card[data-suit="swords"] .ace-suit, .card[data-suit="swords"] .court-suit { color: #4b5b7d; }
.card[data-suit="pentacles"] .pip, .card[data-suit="pentacles"] .ace-suit, .card[data-suit="pentacles"] .court-suit { color: #526d52; }
.ace-art {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 58%;
  aspect-ratio: 1;
  border: 1px solid rgba(109, 80, 39, 0.26);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 253, 245, 0.5), transparent 70%);
}
.ace-ring {
  position: absolute;
  inset: 8%;
  border: 1px dashed rgba(109, 80, 39, 0.22);
  border-radius: 50%;
  transform: rotate(15deg);
}
.ace-suit { font-family: var(--serif); font-size: clamp(26px, 5.5vw, 50px); line-height: 1; }
.ace-star { position: absolute; top: -8%; right: 5%; color: var(--gold-deep); font-size: clamp(7px, 1vw, 12px); }
.court-art { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%; width: 100%; height: 100%; }
.court-crown { color: #6d5027; font-size: clamp(15px, 2.6vw, 27px); line-height: 1; }
.court-head {
  width: 35%;
  aspect-ratio: 1;
  border: 1px solid currentColor;
  border-radius: 50%;
  position: relative;
}
.court-head::before, .court-head::after {
  content: "";
  position: absolute;
  top: 44%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}
.court-head::before { left: 31%; }
.court-head::after { right: 31%; }
.court-body {
  width: 56%;
  height: 22%;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
}
.court-suit { margin-top: 2%; opacity: 0.7; font-size: clamp(9px, 1.3vw, 16px); }
.lenormand-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}
.lenormand-glyph {
  position: relative;
  z-index: 1;
  font-size: clamp(30px, 6.6vw, 58px);
  line-height: 1;
  filter: grayscale(1) sepia(0.72) brightness(0.62) contrast(1.32);
  opacity: 0.92;
  transform: translateZ(0);
}
.lenormand-art::before {
  content: "";
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border: 1px solid rgba(109, 80, 39, 0.22);
  border-radius: 50%;
}
.lenormand-art::after {
  content: "";
  position: absolute;
  width: 56%;
  aspect-ratio: 1;
  border: 1px dashed rgba(109, 80, 39, 0.14);
  border-radius: 50%;
  transform: rotate(18deg);
}
.card-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding-top: 3%;
  border-top: 1px solid rgba(109, 80, 39, 0.22);
  text-align: center;
}
.card-title strong {
  font-family: var(--serif);
  font-size: clamp(7px, 1vw, 12px);
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.2;
  color: #4a3820;
}
.card-title small {
  color: rgba(74, 56, 32, 0.55);
  font-family: var(--sans);
  font-size: clamp(4.5px, 0.5vw, 7px);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.card-rev-badge {
  position: absolute;
  right: 6%;
  top: 7%;
  z-index: 3;
  padding: 1px 3px;
  border: 1px solid rgba(109, 80, 39, 0.38);
  border-radius: 3px;
  color: rgba(93, 68, 33, 0.85);
  font-size: clamp(5px, 0.55vw, 7.5px);
  line-height: 1.4;
  letter-spacing: 0.06em;
  transform: none !important;
}
.card:hover .card-face { box-shadow: inset 0 0 0 3px rgba(255, 250, 238, 0.4), 0 14px 28px rgba(0, 0, 0, 0.36); }

/* ---------- Draw area ---------- */
.draw-controls {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.016);
}
.draw-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 13px;
}
.draw-tab {
  padding: 5px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.05em;
  transition: 0.2s;
}
.draw-tab span { margin-right: 3px; font-size: 9px; }
.draw-tab.is-active { background: rgba(214, 184, 120, 0.13); color: var(--gold-bright); }
.draw-copy { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.draw-copy strong { color: var(--ink-soft); font-size: 12px; font-weight: 400; letter-spacing: 0.05em; }
.draw-copy span { color: var(--muted-2); font-size: 9.5px; }
.deck-fan {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 158px;
  padding: 10px 20px 0;
  overflow: visible;
}
.fan-card {
  position: relative;
  width: 58px;
  aspect-ratio: 5 / 7;
  flex: 0 0 auto;
  margin-left: -24px;
  padding: 0;
  border: 0;
  background: transparent;
  transform-origin: 50% 112%;
  transform: translateY(var(--y, 0)) rotate(var(--r, 0));
  transition: transform 0.28s var(--ease), filter 0.28s;
  filter: drop-shadow(0 7px 9px rgba(0, 0, 0, 0.35));
}
.fan-card:first-child { margin-left: 0; }
.fan-card:nth-child(1) { z-index: 1; }
.fan-card:nth-child(2) { z-index: 2; }
.fan-card:nth-child(3) { z-index: 3; }
.fan-card:nth-child(4) { z-index: 4; }
.fan-card:nth-child(5) { z-index: 5; }
.fan-card:nth-child(6) { z-index: 6; }
.fan-card:nth-child(7) { z-index: 7; }
.fan-card:nth-child(8) { z-index: 8; }
.fan-card:nth-child(9) { z-index: 9; }
.fan-card:nth-child(10) { z-index: 10; }
.fan-card:nth-child(11) { z-index: 11; }
.fan-card:nth-child(12) { z-index: 12; }
.fan-card:nth-child(13) { z-index: 13; }
.fan-card .card-back { border-radius: 6px; }
.fan-card:hover, .fan-card:focus-visible {
  transform: translateY(calc(var(--y, 0) - 15px)) rotate(var(--r, 0)) scale(1.05);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.46)) brightness(1.12);
  outline: 0;
  z-index: 30 !important;
}
.fan-card:focus-visible .card-back { box-shadow: 0 0 0 2px var(--gold), inset 0 0 0 4px rgba(8, 10, 19, 0.74); }
.fan-card:hover .card-back-sigil { text-shadow: 0 0 22px rgba(240, 217, 165, 0.9); }
.fan-empty { color: var(--muted-2); font-size: 10px; align-self: center; }
.auto-draw {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 86px;
  padding: 8px 5px;
}
.auto-draw .draw-copy { margin: 0; }
.draw-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}
.progress { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted-2); font-size: 9px; }
.progress i { width: 90px; height: 3px; border-radius: 9px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.progress b { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); transition: width 0.5s var(--ease); }

/* ---------- Completion ---------- */
.completion {
  margin-top: 22px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  animation: fadeUp 0.55s var(--ease) both;
  scroll-margin-top: 86px;
}
.reading-block, .draw-controls, .ai-block { scroll-margin-top: 86px; }
.completion-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.completion-head h2 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: 0.04em; }
.complete-actions { display: flex; align-items: center; gap: 8px; }
.reading-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 11px 0 16px; }
.save-state { margin-left: auto; color: var(--muted-2); font-size: 8.5px; letter-spacing: 0.05em; }
.save-state::before { content: "✓"; margin-right: 4px; color: var(--green); }

.reading-block {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(6, 8, 15, 0.32);
}
.block-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 15px; }
.block-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 17px;
  flex: 0 0 auto;
}
.block-icon.ai { color: var(--blue); border-color: rgba(151, 169, 214, 0.22); }
.block-icon .icon { width: 16px; height: 16px; }
.block-head h3 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 500; letter-spacing: 0.06em; }
.block-head p { margin: 3px 0 0; color: var(--muted-2); font-size: 9.5px; line-height: 1.6; }
.block-head > .text-btn { margin-left: auto; white-space: nowrap; }
.ai-dot { display: inline-block; width: 5px; height: 5px; margin-left: 5px; border-radius: 50%; background: var(--muted-2); vertical-align: middle; }
.ai-dot.is-live { background: var(--green); box-shadow: 0 0 9px rgba(155, 183, 166, 0.7); animation: pulse 1.6s ease-in-out infinite; }
.ai-dot.is-error { background: var(--danger); }

.basic-reading { display: flex; flex-direction: column; gap: 0; }
.basic-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
}
.basic-item:first-child { border-top: 0; padding-top: 2px; }
.basic-pos { color: var(--gold); font-size: 9px; letter-spacing: 0.08em; padding-top: 2px; }
.basic-pos span { display: block; color: var(--muted-2); font-size: 8px; margin-top: 3px; letter-spacing: 0; }
.basic-card-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; }
.basic-card-name strong { font-family: var(--serif); font-size: 14px; font-weight: 500; color: var(--ink-soft); letter-spacing: 0.04em; }
.basic-card-name em {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--gold);
  font-size: 7.5px;
  font-style: normal;
}
.basic-card-name small { color: var(--muted-2); font-size: 8px; }
.basic-item p { margin: 5px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.8; }
.basic-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.basic-tags span { padding: 1px 6px; border-radius: 3px; background: rgba(214, 184, 120, 0.06); color: var(--muted-2); font-size: 8px; }
.basic-summary {
  margin-top: 13px;
  padding: 13px 15px;
  border-left: 2px solid var(--line-strong);
  background: linear-gradient(90deg, rgba(214, 184, 120, 0.06), transparent);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.85;
}
.basic-summary strong { color: var(--gold); font-weight: 400; }

.ai-block {
  background:
    radial-gradient(circle at 96% 0%, rgba(151, 169, 214, 0.08), transparent 36%),
    rgba(6, 8, 15, 0.34);
  border-color: rgba(151, 169, 214, 0.12);
}
.ai-empty {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border: 1px dashed rgba(151, 169, 214, 0.19);
  border-radius: 12px;
  background: rgba(151, 169, 214, 0.025);
}
.ai-empty-sigil {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(151, 169, 214, 0.24);
  border-radius: 50%;
  color: var(--blue);
  flex: 0 0 auto;
}
.ai-empty-sigil .icon { width: 20px; height: 20px; }
.ai-empty > div { min-width: 0; }
.ai-empty strong { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 400; letter-spacing: 0.04em; }
.ai-empty p { margin: 3px 0 0; color: var(--muted-2); font-size: 9.5px; line-height: 1.65; }
.ai-empty .primary-btn { margin-left: auto; flex: 0 0 auto; }
.ai-empty .primary-btn .icon { width: 14px; height: 14px; }
.prose {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.95;
  letter-spacing: 0.015em;
  overflow-wrap: anywhere;
}
.prose > :first-child { margin-top: 2px; }
.prose h1, .prose h2, .prose h3 {
  margin: 24px 0 8px;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
}
.prose h1 { font-size: 20px; }
.prose h2 { font-size: 17px; }
.prose h3 { font-size: 14px; color: var(--gold); }
.prose p { margin: 9px 0; }
.prose ul, .prose ol { margin: 8px 0; padding-left: 20px; }
.prose li { margin: 4px 0; padding-left: 2px; }
.prose li::marker { color: var(--gold-deep); }
.prose strong { color: #f4e6c8; font-weight: 600; }
.prose em { color: var(--gold); font-style: normal; }
.prose blockquote {
  margin: 14px 0;
  padding: 10px 15px;
  border-left: 2px solid var(--line-strong);
  background: rgba(214, 184, 120, 0.04);
  color: var(--muted);
}
.prose hr { margin: 22px 0; border: 0; border-top: 1px solid var(--line-soft); }
.prose code { padding: 1px 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); color: var(--gold-bright); font-size: 0.92em; }
.prose a { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(214, 184, 120, 0.35); }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 11px; }
.prose th, .prose td { padding: 6px 8px; border: 1px solid var(--line-soft); text-align: left; }
.prose th { color: var(--gold); font-weight: 400; background: rgba(255, 255, 255, 0.025); }
.prose .streaming-cursor::after {
  content: "▍";
  display: inline-block;
  margin-left: 2px;
  color: var(--gold);
  animation: blink 0.9s step-end infinite;
}
.ai-generating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 9.5px;
}
.typing { display: inline-flex; gap: 3px; }
.typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--blue); animation: bounce 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
.ai-generating .text-btn { margin-left: auto; color: var(--danger); }
.ai-error {
  margin-top: 11px;
  padding: 11px 13px;
  border: 1px solid rgba(217, 143, 136, 0.24);
  border-radius: 9px;
  background: rgba(217, 143, 136, 0.05);
  color: #d8aaa4;
  font-size: 10px;
  line-height: 1.7;
}
.ai-error button { margin-top: 4px; }
.followup {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.followup-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.followup-pair { display: flex; flex-direction: column; gap: 5px; }
.followup-q { align-self: flex-end; max-width: 82%; padding: 7px 11px; border-radius: 10px 10px 2px 10px; background: rgba(214, 184, 120, 0.1); color: var(--ink-soft); font-size: 10.5px; }
.followup-a { max-width: 94%; color: var(--muted); font-size: 11px; line-height: 1.85; }
.followup-a .prose { font-size: 11px; line-height: 1.85; }
.followup-form { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(0, 0, 0, 0.2); }
.followup-form:focus-within { border-color: var(--line-strong); }
.followup-form input { flex: 1; min-width: 0; padding: 5px 8px; border: 0; outline: 0; background: transparent; font-size: 10.5px; }
.followup-form input::placeholder { color: var(--muted-2); }
.followup-form button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(214, 184, 120, 0.1);
  color: var(--gold);
}
.followup-form button:hover { background: rgba(214, 184, 120, 0.17); }

/* ---------- Ritual strip ---------- */
.ritual-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: clamp(54px, 7vw, 92px) 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ritual-strip > div { padding: 30px clamp(12px, 2.4vw, 32px) 36px; border-left: 1px solid var(--line-soft); }
.ritual-strip > div:first-child { border-left: 0; padding-left: 0; }
.ritual-strip span { color: var(--gold); font-family: var(--serif); font-size: 10px; letter-spacing: 0.16em; }
.ritual-strip h3 { margin: 12px 0 7px; font-family: var(--serif); font-size: 17px; font-weight: 500; letter-spacing: 0.05em; }
.ritual-strip p { margin: 0; color: var(--muted-2); font-size: 10.5px; line-height: 1.9; }

.site-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px 0 42px;
  color: var(--muted-2);
  font-size: 9px;
}
.footer-brand { display: flex; flex-direction: column; line-height: 1.3; }
.footer-brand span { color: var(--gold); font-family: var(--serif); font-size: 14px; letter-spacing: 0.2em; }
.footer-brand small { margin-top: 3px; font-size: 7.5px; letter-spacing: 0.08em; }
.site-footer p { flex: 1; margin: 0; line-height: 1.7; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 5, 11, 0.72); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); animation: fadeIn 0.25s ease; }
.modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(214, 184, 120, 0.25);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(214, 184, 120, 0.08), transparent 34%),
    linear-gradient(160deg, #171a2b, #0e111d 75%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.35s var(--ease) both;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 27px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: 0.06em; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition: 0.2s;
  flex: 0 0 auto;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--gold-bright); transform: rotate(90deg); }
.icon-btn .icon { width: 16px; height: 16px; }

.history-card { width: min(680px, 100%); }
.history-list { padding: 12px 18px; overflow-y: auto; min-height: 150px; }
.history-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 250px; color: var(--muted-2); text-align: center; }
.history-empty span { font-family: var(--serif); font-size: 38px; color: var(--gold-deep); opacity: 0.7; margin-bottom: 10px; }
.history-empty p { margin: 0; font-size: 11px; }
.history-empty small { margin-top: 5px; font-size: 9px; }
.history-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.history-item:last-child { border-bottom: 0; }
.history-item:hover { background: rgba(214, 184, 120, 0.04); }
.history-date { display: flex; flex-direction: column; align-items: center; color: var(--muted-2); font-size: 8px; line-height: 1.4; }
.history-date b { color: var(--gold); font-family: var(--serif); font-size: 21px; font-weight: 400; line-height: 1.1; }
.history-copy { min-width: 0; }
.history-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 11.5px; font-weight: 400; letter-spacing: 0.02em; }
.history-copy small { display: block; margin-top: 4px; color: var(--muted-2); font-size: 8.5px; }
.history-copy em { color: var(--gold-deep); font-style: normal; }
.history-delete {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  opacity: 0;
  transition: 0.2s;
}
.history-item:hover .history-delete { opacity: 1; }
.history-delete:hover { background: rgba(217, 143, 136, 0.1); color: var(--danger); }
.history-delete .icon { width: 13px; height: 13px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 15px 27px 19px; border-top: 1px solid var(--line-soft); }
.history-foot { justify-content: space-between; }
.history-foot span { color: var(--muted-2); font-size: 9px; }

.settings-card { width: min(680px, 100%); }
#settingsForm { display: flex; flex-direction: column; min-height: 0; }
.settings-scroll { padding: 20px 27px; overflow-y: auto; }
.settings-section + .settings-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.settings-title { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.settings-title h3 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 500; letter-spacing: 0.06em; }
.server-pill {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.server-pill.is-on { border-color: rgba(155, 183, 166, 0.32); color: var(--green); }
.server-pill.is-off { border-color: rgba(217, 143, 136, 0.25); color: #c88d87; }
.settings-desc { margin: 0 0 15px; color: var(--muted-2); font-size: 9.5px; line-height: 1.75; }
.field-grid { display: grid; gap: 11px; margin-bottom: 11px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 11px; }
.field-grid .field { margin-bottom: 0; }
.field > span { color: var(--muted); font-size: 9.5px; letter-spacing: 0.05em; }
.field > span em { color: var(--muted-2); font-style: normal; font-size: 8px; margin-left: 3px; }
.field input, .field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  outline: 0;
  background: rgba(4, 6, 12, 0.38);
  color: var(--ink-soft);
  font-size: 11px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 16px, calc(100% - 9px) 16px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.field input:focus, .field select:focus { border-color: rgba(214, 184, 120, 0.5); box-shadow: 0 0 0 3px rgba(214, 184, 120, 0.06); }
.field input::placeholder { color: var(--muted-2); }
.secret-input { position: relative; display: flex; }
.secret-input input { padding-right: 52px; }
.secret-input button {
  position: absolute;
  right: 5px;
  top: 5px;
  bottom: 5px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-2);
  font-size: 8.5px;
}
.secret-input button:hover { color: var(--gold); }
.settings-actions { display: flex; align-items: center; gap: 10px; margin-top: 3px; }
.settings-actions span { font-size: 9px; line-height: 1.5; }
.settings-actions span.ok { color: var(--green); }
.settings-actions span.err { color: var(--danger); }
.settings-hint { margin: 10px 0 0; color: var(--muted-2); font-size: 8.5px; line-height: 1.7; }
.settings-hint code { color: var(--gold-deep); }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-card .modal-foot { justify-content: flex-end; }

.card-detail-card { width: min(760px, 100%); display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; padding: 34px; overflow: visible; }
.card-detail-close { position: absolute; top: 14px; right: 14px; z-index: 3; }
.card-detail-visual { align-self: center; }
.card-detail-visual .card { width: 100%; max-width: 220px; margin: 0 auto; }
.card-detail-visual .card .card-inner { transform: rotateY(180deg); }
.card-detail-copy { padding: 6px 5px 2px 0; min-width: 0; }
.card-detail-copy h2 { margin: 0 0 2px; font-family: var(--serif); font-size: 31px; font-weight: 500; letter-spacing: 0.07em; }
.card-detail-en { margin: 0 0 14px; color: var(--muted-2); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-row span { padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--gold); font-size: 8.5px; }
.card-detail-position { margin: 17px 0 12px; padding: 8px 11px; border-left: 2px solid var(--line-strong); background: rgba(214, 184, 120, 0.04); color: var(--muted); font-size: 9.5px; line-height: 1.7; }
.card-detail-text { margin: 0 0 12px; color: var(--ink-soft); font-size: 12.5px; line-height: 1.95; }
.card-detail-advice { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.85; }
.card-detail-advice:empty { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  max-width: min(90vw, 460px);
  padding: 10px 17px;
  border: 1px solid rgba(214, 184, 120, 0.28);
  border-radius: 99px;
  background: rgba(20, 23, 38, 0.94);
  color: var(--ink-soft);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45);
  font-size: 10.5px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: 0.3s var(--ease);
  backdrop-filter: blur(12px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animations ---------- */
@keyframes twinkle { 0%, 100% { opacity: 0.18; } 50% { opacity: 0.72; } }
@keyframes shoot { 0%, 88% { opacity: 0; transform: translate(-40px, -20px) rotate(-35deg); } 90% { opacity: 0.7; } 96%, 100% { opacity: 0; transform: translate(420px, 240px) rotate(-35deg); } }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -11px; } }
@keyframes slowspin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(15px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes dealIn { 0% { opacity: 0; transform: translate(0, -35px) scale(0.8); } 100% { opacity: 1; transform: translate(0, 0) scale(1); } }
.slot.is-new .slot-card-wrap { animation: dealIn 0.55s var(--ease) both; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 336px minmax(0, 1fr); }
  .hero h1 { font-size: clamp(38px, 4.8vw, 56px); }
  .layout-row-5 .slot, .layout-relationship .slot { max-width: 100px; }
  .layout-arc-7 .slot { max-width: 88px; }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr); min-height: 410px; }
  .hero-moon { width: 118px; height: 118px; }
  .float-card { width: 50px; }
  .hero-note { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .setup-panel { position: static; max-height: none; overflow: visible; }
  .setup-scroll { overflow: visible; padding-right: 0; }
  .stage { min-height: 620px; }
  .stage-empty { min-height: 620px; }
  .spread-grid { grid-template-columns: repeat(3, 1fr); }
  .setup-panel .primary-btn { margin-top: 2px; }
  .layout-row-5 .slot, .layout-relationship .slot { max-width: 120px; }
  .layout-arc-7 .slot { max-width: 110px; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .topbar { height: 64px; padding: 0 16px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-text strong { font-size: 17px; }
  .brand-text small { font-size: 6.5px; }
  .nav-btn { padding: 8px; }
  .nav-btn .icon { width: 17px; height: 17px; }
  .nav-btn span { display: none; }
  .page { padding: 0 14px; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 38px 2px 34px; gap: 18px; }
  .hero h1 { font-size: clamp(31px, 8vw, 42px); line-height: 1.32; }
  .lede { margin-top: 16px; font-size: 12.5px; line-height: 1.85; }
  .eyebrow { margin-bottom: 15px; font-size: 8px; }
  .hero-facts { margin-top: 20px; gap: 10px; font-size: 9.5px; }
  .hero-facts b { font-size: 14px; }
  .hero-art { display: none; }
  .workspace { gap: 14px; }
  .setup-panel { padding: 17px; border-radius: 20px; }
  .deck-tab { padding: 8px; gap: 7px; }
  .deck-tab-icon { width: 24px; height: 24px; font-size: 13px; }
  .deck-tab strong { font-size: 11.5px; }
  .deck-tab small { font-size: 7.5px; }
  .spread-grid { grid-template-columns: 1fr 1fr; }
  .spread-detail { padding: 11px; }
  .stage { border-radius: 20px; min-height: 540px; }
  .stage-empty { min-height: 540px; padding: 28px 20px; }
  .empty-visual { transform: scale(0.8); margin: -8px 0 4px; }
  .stage-empty h2 { font-size: 24px; }
  .stage-empty > p:not(.eyebrow) { font-size: 10.5px; }
  .mini-steps { gap: 14px; margin-top: 22px; }
  .mini-steps li { font-size: 8.5px; gap: 4px; }
  .empty-quote { margin-top: 24px; font-size: 9px; }
  .reading-view { padding: 17px; display: flex; flex-direction: column; }
  .reading-head { order: 1; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .draw-controls { order: 2; margin-top: 0; margin-bottom: 16px; }
  .board-shell { order: 3; }
  .completion { order: 4; }
  .reading-head h2 { font-size: 26px; }
  #readingQuestion { font-size: 11px; }
  .reading-head-actions { width: 100%; display: flex; justify-content: flex-end; }
  .reading-head-actions .ghost-btn { width: auto; }
  .board-shell { padding: 13px 7px 11px; border-radius: 14px; }
  .spread-board { gap: 13px 6px; }
  .layout-seasons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 26px; }
  .layout-seasons .slot { max-width: 102px; }
  .layout-row-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-row-5 .slot { max-width: 102px; }
  .layout-relationship { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-relationship .slot { max-width: 98px; }
  .layout-paths { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-paths .slot { max-width: 94px; }
  .layout-cross .slot { max-width: 94px; }
  .layout-grid-9 .slot { max-width: 96px; }
  .layout-arc-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 8px; }
  .layout-arc-7 .slot { max-width: 90px; transform: none !important; }
  .layout-arc-7 .slot:nth-child(5), .layout-arc-7 .slot:nth-child(6), .layout-arc-7 .slot:nth-child(7) { transform: none !important; }
  .layout-celtic { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
  .layout-celtic .slot { grid-area: auto !important; max-width: 104px; transform: none !important; }
  .slot-label { font-size: 8.5px; }
  .slot-label b { font-size: 9.5px; }
  .slot-label em {
    font-size: 7.5px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .draw-controls { padding: 12px; }
  .deck-fan { height: 136px; padding-left: 8px; padding-right: 8px; }
  .fan-card { width: 49px; margin-left: -22px; }
  .draw-copy strong { font-size: 11px; }
  .draw-copy span { font-size: 8.5px; }
  .auto-draw { flex-direction: column; align-items: flex-start; gap: 10px; }
  .auto-draw .primary-btn { width: 100%; }
  .progress i { width: 65px; }
  .completion { padding-top: 19px; }
  .completion-head { flex-direction: column; align-items: flex-start; gap: 13px; }
  .completion-head h2 { font-size: 22px; }
  .complete-actions { width: 100%; }
  .complete-actions .primary-btn { flex: 1; }
  .reading-tools { gap: 8px; }
  .save-state { width: 100%; margin-left: 0; }
  .reading-block { padding: 15px; border-radius: 13px; }
  .block-head { flex-wrap: wrap; }
  .block-head .text-btn { margin-left: 44px; }
  .basic-item { grid-template-columns: 1fr; gap: 3px; padding: 12px 0; }
  .basic-pos { display: flex; align-items: center; gap: 7px; }
  .basic-pos span { margin: 0; }
  .basic-item p { font-size: 10px; }
  .ai-empty { flex-direction: column; align-items: flex-start; }
  .ai-empty .primary-btn { margin-left: 0; width: 100%; }
  .prose { font-size: 12.5px; line-height: 1.92; }
  .prose h2 { font-size: 16px; }
  .prose h3 { font-size: 13.5px; }
  .ritual-strip { grid-template-columns: 1fr; margin-top: 46px; }
  .ritual-strip > div { padding: 22px 0 26px; border-left: 0; border-top: 1px solid var(--line-soft); }
  .ritual-strip > div:first-child { border-top: 0; padding-top: 24px; }
  .ritual-strip h3 { font-size: 16px; margin: 8px 0 5px; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 12px; padding: 26px 0 34px; }
  .site-footer p { font-size: 8px; }
  .modal { padding: 10px; align-items: flex-end; }
  .modal-card { max-height: 91vh; border-radius: 20px 20px 14px 14px; }
  .modal-head { padding: 20px 18px 14px; }
  .modal-head h2 { font-size: 21px; }
  .settings-scroll { padding: 16px 18px; }
  .field-grid.two { grid-template-columns: 1fr; }
  .settings-card .modal-foot { padding: 12px 18px 16px; }
  .history-list { padding: 8px 12px; }
  .history-item { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; padding: 12px 5px; }
  .history-delete { opacity: 1; }
  .card-detail-card { grid-template-columns: 1fr; gap: 18px; padding: 24px 20px 22px; max-height: 91vh; overflow-y: auto; }
  .card-detail-visual .card { max-width: 150px; }
  .card-detail-copy h2 { font-size: 25px; }
  .card-detail-close { top: 9px; right: 9px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 29px; }
  .spread-tile { padding: 8px 7px; }
  .spread-tile strong { font-size: 10px; }
  .spread-tile small { font-size: 7px; }
  .layout-row-3 .slot { max-width: 92px; }
  .layout-row-5 .slot { max-width: 92px; }
  .layout-seasons .slot { max-width: 92px; }
  .layout-celtic { gap: 14px 12px; }
  .layout-celtic .slot { max-width: 92px; }
  .fan-card { width: 43px; margin-left: -20px; }
  .deck-fan { height: 122px; }
  .progress i { width: 48px; }
  .reading-tools .text-btn { font-size: 10px; }
  .complete-actions { flex-wrap: wrap; }
  .complete-actions .ghost-btn { flex: 1; }
}

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

/* subtle scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(214, 184, 120, 0.16); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(214, 184, 120, 0.3); }
