:root {
  color-scheme: dark;
  --ink: #f5f0e2;
  --muted: #aba9b7;
  --dim: #727184;
  --night: #090b18;
  --panel: rgba(20, 22, 42, .78);
  --panel-solid: #15172b;
  --line: rgba(214, 189, 123, .22);
  --line-soft: rgba(255, 255, 255, .1);
  --gold: #d8bc77;
  --gold-light: #f1dda5;
  --violet: #8e7cc3;
  --radius: 24px;
  --serif: "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-family: var(--sans);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--night);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(65, 60, 116, .3), transparent 42%),
    linear-gradient(180deg, #0c0e20 0%, #090b18 65%, #080a15 100%);
  overflow-x: hidden;
}

button, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
button { -webkit-tap-highlight-color: transparent; }

.ambient, .ambient > * { position: fixed; pointer-events: none; }
.ambient { inset: 0; z-index: -1; overflow: hidden; }
.orb { width: 440px; height: 440px; border-radius: 50%; filter: blur(90px); opacity: .16; }
.orb-one { top: -240px; left: -170px; background: #7663bf; }
.orb-two { right: -260px; top: 42%; background: #8a6d39; }
.stars { inset: 0; opacity: .4; background-image: radial-gradient(circle, rgba(255,255,255,.75) 0 1px, transparent 1.4px); background-size: 89px 89px; background-position: 17px 31px; mask-image: linear-gradient(to bottom, black, transparent 75%); }
.grain { inset: 0; opacity: .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='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }

.app { width: min(100%, 1180px); min-height: 100vh; min-height: 100svh; margin: 0 auto; position: relative; }
.site-header { height: 80px; padding: max(18px, env(safe-area-inset-top)) clamp(20px, 5vw, 56px) 10px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold-light); font-size: 16px; box-shadow: inset 0 0 15px rgba(216,188,119,.09); }
.brand strong { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: .12em; font-weight: 600; }
.brand small { display: block; margin-top: 2px; color: var(--dim); font-size: 7px; letter-spacing: .26em; }
.icon-button { min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-soft); border-radius: 999px; background: rgba(12,14,30,.6); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); }
.icon-button[aria-pressed="false"] { opacity: .55; }
.sound-label { font-size: 11px; letter-spacing: .08em; }

.screen { display: none; width: 100%; min-height: calc(100svh - 80px); padding: 24px clamp(20px, 5vw, 56px) max(34px, env(safe-area-inset-bottom)); animation: enter .52s cubic-bezier(.2,.8,.2,1) both; }
.screen.active { display: flex; }
#setup-screen:target { display: flex; }
body:has(#setup-screen:target) #welcome-screen { display: none; }
.focus-mode .site-header { display: none; }
.focus-mode .screen { min-height: 100vh; min-height: 100svh; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.eyebrow { margin: 0 0 18px; color: var(--gold); font-size: 10px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.eyebrow > span { width: 24px; height: 1px; background: var(--gold); opacity: .55; }
.eyebrow.centered { justify-content: center; }

#welcome-screen { flex-direction: column; justify-content: space-between; text-align: center; padding-top: 7vh; }
.hero-copy { position: relative; z-index: 2; }
.hero-copy .eyebrow { justify-content: center; }
.hero-copy h1 { margin: 0; font-family: var(--serif); font-size: clamp(42px, 12.5vw, 78px); line-height: 1.18; letter-spacing: .04em; font-weight: 600; text-shadow: 0 3px 24px rgba(0,0,0,.45); }
.hero-intro { width: min(100%, 480px); margin: 24px auto 0; color: var(--muted); font-family: var(--serif); font-size: 14px; line-height: 1.9; }
.hero-orbit { width: min(390px, 95vw); height: 260px; position: relative; margin: -6px auto -8px; perspective: 900px; pointer-events: none; }
.orbit-ring { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(216,188,119,.15); border-radius: 50%; transform: translate(-50%, -50%) rotateX(68deg); }
.ring-one { width: 330px; height: 330px; }
.ring-two { width: 245px; height: 245px; border-style: dashed; animation: orbit 24s linear infinite; }
@keyframes orbit { to { transform: translate(-50%, -50%) rotateX(68deg) rotateZ(360deg); } }
.hero-card { position: absolute; top: 50%; left: 50%; width: 118px; aspect-ratio: .59; display: grid; place-items: center; border: 1px solid rgba(222,198,134,.42); border-radius: 10px; background: linear-gradient(145deg, rgba(38,40,71,.98), rgba(12,14,29,.98)); box-shadow: 0 28px 70px rgba(0,0,0,.42), inset 0 0 0 5px #111429, inset 0 0 0 6px rgba(216,188,119,.15); color: rgba(239,219,164,.55); }
.hero-card::before { content: ""; position: absolute; inset: 11px; border: 1px solid rgba(216,188,119,.18); border-radius: 50%; }
.hero-card span { font-family: var(--serif); font-size: 34px; z-index: 1; }
.hero-card-left { transform: translate(-120%, -43%) rotate(-15deg) translateZ(-60px); opacity: .58; }
.hero-card-right { transform: translate(20%, -43%) rotate(15deg) translateZ(-60px); opacity: .58; }
.hero-card-center { transform: translate(-50%, -50%) translateZ(35px); animation: breathe 4s ease-in-out infinite; }
.hero-card-center .card-star { font-size: 32px; color: var(--gold-light); filter: drop-shadow(0 0 10px rgba(216,188,119,.45)); }
.hero-card-center i { position: absolute; width: 58px; height: 58px; border: 1px solid rgba(216,188,119,.26); transform: rotate(45deg); }
@keyframes breathe { 50% { transform: translate(-50%, -53%) translateZ(35px); box-shadow: 0 34px 80px rgba(0,0,0,.5), 0 0 32px rgba(112,91,175,.13), inset 0 0 0 5px #111429, inset 0 0 0 6px rgba(216,188,119,.2); } }
.welcome-actions { width: min(100%, 460px); margin: 0 auto; position: relative; z-index: 5; }
#start-button { position: relative; z-index: 1; touch-action: manipulation; }
.primary-button, .secondary-button { width: 100%; min-height: 58px; border-radius: 999px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.primary-button { border: 1px solid #e9d49a; color: #11121f; background: linear-gradient(105deg, #cab06e, #f0dca5 52%, #c9aa64); box-shadow: 0 12px 35px rgba(198,163,83,.17); font-weight: 700; letter-spacing: .06em; }
.primary-button { text-decoration: none; }
.primary-button i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(15,16,27,.11); font-style: normal; }
.primary-button:active, .mode-card:active, .category-card:active { transform: scale(.985); }
.trust-row { margin-top: 20px; display: flex; justify-content: center; gap: 17px; color: var(--dim); font-size: 9px; white-space: nowrap; }
.trust-row i { color: var(--gold); font-style: normal; margin-right: 3px; }

.setup-screen, .mode-screen { max-width: 660px; margin: 0 auto; flex-direction: column; }
.step-header { display: grid; grid-template-columns: 44px 1fr 52px; align-items: center; gap: 18px; margin-bottom: clamp(40px, 8vh, 74px); }
.back-button { width: 44px; height: 44px; border: 1px solid var(--line-soft); border-radius: 50%; background: rgba(15,17,34,.68); color: var(--muted); font-size: 18px; cursor: pointer; }
.step-progress { display: flex; justify-content: center; gap: 6px; }
.step-progress i { width: 35px; height: 2px; border-radius: 3px; background: rgba(255,255,255,.1); }
.step-progress i.active { background: var(--gold); }
.step-header > span { color: var(--dim); font-size: 10px; letter-spacing: .12em; text-align: right; }
.setup-copy h2 { margin: 0 0 12px; font-family: var(--serif); font-size: clamp(30px, 8vw, 44px); font-weight: 600; letter-spacing: .04em; }
.setup-copy > p:last-child { margin: 0 0 28px; color: var(--muted); font-size: 13px; }
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.category-card { min-height: 110px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 16px; background: rgba(20,22,42,.62); text-align: left; cursor: pointer; transition: border .2s, background .2s, transform .2s; }
.category-card i { display: block; color: var(--gold); font-family: var(--serif); font-size: 22px; font-style: normal; }
.category-card span { display: block; margin: 9px 0 3px; font-family: var(--serif); font-size: 15px; }
.category-card small { color: var(--dim); font-size: 10px; }
.category-card.selected { border-color: rgba(216,188,119,.66); background: linear-gradient(140deg, rgba(49,45,69,.9), rgba(24,25,44,.84)); box-shadow: inset 0 0 25px rgba(216,188,119,.035); }
.question-box { position: relative; display: block; margin-top: 18px; }
.question-box > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.question-box > span small { color: var(--dim); margin-left: 5px; }
.question-box textarea { width: 100%; min-height: 105px; resize: none; padding: 16px 18px 30px; border: 1px solid var(--line-soft); border-radius: 16px; background: rgba(12,14,29,.62); color: var(--ink); line-height: 1.7; }
.question-box textarea::placeholder { color: #646477; }
.question-box em { position: absolute; right: 14px; bottom: 11px; color: var(--dim); font-size: 9px; font-style: normal; }
.default-question { margin: 9px 3px 24px; color: var(--dim); font-size: 10px; }
.setup-next { margin-top: auto; }

.mode-list { display: grid; gap: 12px; }
.mode-card { width: 100%; min-height: 112px; padding: 18px; display: grid; grid-template-columns: 55px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line-soft); border-radius: 20px; background: rgba(20,22,42,.65); text-align: left; cursor: pointer; transition: .2s ease; }
.mode-card.recommended { border-color: rgba(216,188,119,.48); background: linear-gradient(120deg, rgba(52,47,69,.83), rgba(20,22,42,.76)); }
.mode-icon { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 16px; color: var(--gold-light); background: rgba(216,188,119,.05); font-size: 26px; }
.hand-icon { font-family: "Segoe UI Emoji", sans-serif; }
.mode-copy strong, .mode-copy small { display: block; }
.mode-copy strong { margin-bottom: 7px; font-family: var(--serif); font-size: 16px; }
.mode-copy small { color: var(--muted); font-size: 10px; line-height: 1.55; }
.mode-meta { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.mode-meta em { padding: 3px 7px; border-radius: 99px; color: var(--gold); background: rgba(216,188,119,.09); font-size: 8px; font-style: normal; letter-spacing: .1em; }
.mode-meta i { color: var(--gold); font-style: normal; }
.privacy-note { margin-top: 28px; padding: 16px 18px; display: flex; gap: 12px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); color: var(--dim); }
.privacy-note > span { color: var(--gold); }
.privacy-note p { margin: 0; font-size: 10px; line-height: 1.65; }
.privacy-note strong { color: var(--muted); font-size: 11px; font-weight: 500; }

.reading-screen { flex-direction: column; padding-left: 0; padding-right: 0; overflow: hidden; }
.reading-head { padding: 0 clamp(20px, 5vw, 56px); display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; text-align: center; }
.reading-head p { margin: 0 0 3px; color: var(--gold); font-size: 9px; letter-spacing: .16em; }
.reading-head h2 { margin: 0; font-family: var(--serif); font-size: clamp(16px, 4.4vw, 23px); font-weight: 500; }
.mode-pill { min-width: 65px; height: 36px; border: 1px solid var(--line-soft); border-radius: 99px; background: rgba(15,17,34,.8); cursor: pointer; color: var(--muted); font-size: 10px; }
.mode-pill span { color: var(--gold); margin-right: 3px; }
.mode-pill em { font-style: normal; }
.instruction { min-height: 34px; margin: clamp(24px, 5vh, 46px) auto 6px; padding: 7px 12px; border-radius: 99px; background: rgba(255,255,255,.035); color: var(--dim); font-size: 9px; letter-spacing: .07em; }
.instruction span { color: var(--gold); margin-right: 5px; }
.deck-wrap { position: relative; width: 100%; overflow: hidden; }
.card-strip { min-height: 224px; display: flex; align-items: center; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-behavior: smooth; scroll-padding-inline: calc(50vw - 53px); padding: 18px calc(50vw - 53px) 25px; scrollbar-width: none; touch-action: pan-x pinch-zoom; -webkit-overflow-scrolling: touch; cursor: grab; }
.card-strip.gesture-controlled { scroll-snap-type: none; scroll-behavior: auto; }
.card-strip:active { cursor: grabbing; }
.card-strip::-webkit-scrollbar { display: none; }
.deck-fade { position: absolute; z-index: 4; top: 0; bottom: 0; width: 52px; pointer-events: none; }
.fade-left { left: 0; background: linear-gradient(to right, var(--night), transparent); }
.fade-right { right: 0; background: linear-gradient(to left, var(--night), transparent); }
.deck-nav { position: absolute; z-index: 7; top: 50%; width: 38px; height: 38px; margin-top: -19px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(15,17,34,.88); color: var(--gold-light); font-size: 25px; line-height: 1; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.deck-prev { left: 8px; }
.deck-next { right: 8px; }
.tarot-back, .slot-card, .drag-ghost { background: linear-gradient(145deg, #282846, #101327 72%); border: 1px solid rgba(222,198,134,.43); box-shadow: inset 0 0 0 4px #111329, inset 0 0 0 5px rgba(216,188,119,.16); }
.tarot-back { flex: 0 0 106px; width: 106px; height: 178px; position: relative; border-radius: 9px; scroll-snap-align: center; scroll-snap-stop: normal; cursor: grab; opacity: var(--card-opacity, 1); transform: translateY(var(--card-y, 0)) scale(var(--card-scale, 1)) rotate(var(--card-rotate, 0deg)); transition: opacity .1s linear, filter .16s ease, border-color .16s ease; will-change: transform, opacity; touch-action: pan-x pinch-zoom; }
.tarot-back::before, .slot-card::before, .drag-ghost::before { content: ""; position: absolute; inset: 11px; border: 1px solid rgba(216,188,119,.2); border-radius: 50%; }
.tarot-back::after, .slot-card::after, .drag-ghost::after { content: "✦"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); font-size: 20px; text-shadow: 0 0 12px rgba(216,188,119,.35); }
.tarot-back:hover, .tarot-back:focus-visible, .tarot-back.selected { border-color: var(--gold-light); filter: brightness(1.1) drop-shadow(0 13px 14px rgba(0,0,0,.3)); }
.tarot-back.gesture-hover { border-color: var(--gold-light); filter: brightness(1.16) drop-shadow(0 0 14px rgba(216,188,119,.34)); }
.tarot-back.centered:not(.selected) { filter: brightness(1.05) drop-shadow(0 8px 12px rgba(0,0,0,.2)); }
.tarot-back.selected::after { font-size: 27px; color: var(--gold-light); }
.tarot-back.drawn { opacity: .12; transform: translateY(18px) scale(.9) !important; pointer-events: none; }
.selection-action { min-height: 42px; margin: -4px auto 12px; padding: 5px 6px 5px 14px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 99px; background: rgba(24,25,44,.92); color: var(--muted); font-size: 9px; }
.selection-action button { min-height: 32px; padding: 0 13px; border: 0; border-radius: 99px; background: var(--gold); color: #121421; font-size: 9px; font-weight: 700; cursor: pointer; }
.spread { width: min(100% - 28px, 590px); margin: auto auto 0; display: grid; grid-template-columns: 1fr 14px 1fr 14px 1fr; align-items: start; }
.spread-line { height: 1px; margin-top: 54px; background: var(--line); }
.spread-slot { padding: 0; border: 0; background: transparent; cursor: pointer; text-align: center; opacity: .44; transition: opacity .3s, transform .3s; }
.spread-slot.current { opacity: 1; }
.spread-slot.current .slot-card { border-color: var(--gold); box-shadow: 0 0 25px rgba(216,188,119,.1), inset 0 0 0 4px #111329, inset 0 0 0 5px rgba(216,188,119,.24); }
.spread-slot.current.gesture-drop-target { transform: translateY(-5px) scale(1.04); }
.spread-slot.current.gesture-drop-target .slot-card { border-color: var(--gold-light); box-shadow: 0 0 34px rgba(216,188,119,.38), inset 0 0 0 4px #111329, inset 0 0 0 5px rgba(216,188,119,.32); }
.spread-slot.filled { opacity: 1; }
.slot-card { width: clamp(66px, 21vw, 88px); aspect-ratio: .61; margin: 0 auto 9px; position: relative; display: grid; place-items: center; border-radius: 7px; }
.slot-card > i { position: absolute; top: -8px; z-index: 2; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #1c1e36; color: var(--gold); font-size: 8px; font-style: normal; }
.spread-slot.filled .slot-card > i { display: none; }
.mini-symbol { position: relative; z-index: 2; color: var(--gold-light); font-family: var(--serif); font-size: clamp(20px, 6vw, 30px); text-shadow: 0 0 12px rgba(216,188,119,.35); }
.spread-slot strong { display: block; font-family: var(--serif); font-size: 12px; font-weight: 500; }
.spread-slot small { display: block; margin-top: 3px; color: var(--dim); font-size: 8px; }
.reading-footnote { margin: 18px auto 0; color: #555668; font-size: 8px; text-align: center; }

.camera-panel { z-index: 8; position: fixed; top: max(88px, calc(env(safe-area-inset-top) + 70px)); right: max(14px, env(safe-area-inset-right)); width: min(43vw, 190px); aspect-ratio: 3/4; border: 1px solid rgba(216,188,119,.45); border-radius: 18px; background: #0d0f1d; overflow: hidden; box-shadow: 0 15px 40px rgba(0,0,0,.45); }
.camera-panel video, .camera-panel canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-panel canvas { z-index: 1; }
.camera-state { position: absolute; z-index: 2; left: 7px; right: 7px; bottom: 40px; padding: 6px 7px; display: flex; gap: 5px; align-items: center; border-radius: 8px; background: rgba(5,6,13,.72); font-size: 7px; }
.camera-state i { width: 5px; height: 5px; border-radius: 50%; background: #e2ba68; box-shadow: 0 0 7px #e2ba68; }
.camera-panel > button { position: absolute; z-index: 3; bottom: 7px; left: 7px; right: 7px; min-height: 28px; border: 0; border-radius: 8px; background: rgba(236,218,167,.92); color: #171827; font-size: 8px; cursor: pointer; }

.reveal-screen { flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.reveal-screen h2 { margin: 0 0 clamp(45px, 8vh, 75px); font-family: var(--serif); font-size: clamp(28px, 7vw, 40px); font-weight: 500; }
.reveal-cards { display: flex; align-items: center; justify-content: center; width: min(100%, 540px); margin-bottom: 70px; }
.reveal-card { width: clamp(104px, 28vw, 150px); aspect-ratio: .59; position: relative; margin: 0 -9px; border-radius: 10px; perspective: 900px; }
.reveal-card-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .72s cubic-bezier(.2,.75,.2,1); }
.reveal-card.flipped .reveal-card-inner { transform: rotateY(180deg); }
.reveal-card-back, .reveal-card-front { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; backface-visibility: hidden; box-shadow: 0 22px 50px rgba(0,0,0,.37); }
.reveal-card-back { background: linear-gradient(145deg, #282846, #101327 72%); border: 1px solid rgba(222,198,134,.43); box-shadow: 0 22px 50px rgba(0,0,0,.37), inset 0 0 0 5px #111329, inset 0 0 0 6px rgba(216,188,119,.16); }
.reveal-card-back::after { content: "✦"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); font-size: 24px; }
.reveal-card-front { transform: rotateY(180deg); background: #d7c9a5; border: 1px solid rgba(222,198,134,.55); }
.reveal-card-front img { width: 100%; height: 100%; display: block; object-fit: cover; }
.reveal-card-front.reversed img { transform: rotate(180deg); }
.reveal-card:nth-child(1) { transform: rotate(-8deg) translateY(13px); }
.reveal-card:nth-child(2) { z-index: 2; transform: translateY(-7px); }
.reveal-card:nth-child(3) { transform: rotate(8deg) translateY(13px); }
.reveal-screen .primary-button { width: min(100%, 400px); }

.result-screen { flex-direction: column; max-width: 760px; margin: 0 auto; }
.result-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; }
.result-head p { color: var(--muted); font-family: var(--serif); font-size: 12px; }
.result-intro { margin: clamp(48px, 8vh, 76px) 0 32px; text-align: center; }
.result-intro h1 { margin: 0; font-family: var(--serif); font-size: clamp(28px, 8vw, 46px); line-height: 1.35; font-weight: 500; }
.result-intro > p:last-child { width: min(100%, 550px); margin: 16px auto 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.result-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 2.6vw, 18px); align-items: start; }
.result-card { text-align: center; }
.card-face { width: 100%; aspect-ratio: .5833; position: relative; border: 1px solid rgba(216,188,119,.55); border-radius: 9px; background: linear-gradient(160deg, #ede3c7 0%, #cfc09a 100%); color: #252335; box-shadow: 0 18px 40px rgba(0,0,0,.25); overflow: hidden; }
.card-image { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .4s; }
.card-face.reversed .card-image { transform: rotate(180deg) scale(1.01); }
.card-image-fallback { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 10px; }
.card-image-fallback i { width: 70%; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid rgba(52,48,65,.22); border-radius: 50%; font-family: var(--serif); font-size: clamp(30px, 9vw, 62px); font-style: normal; }
.card-image-fallback b { font-family: var(--serif); font-size: clamp(9px, 2.7vw, 16px); }
.card-face.image-missing .card-image { display: none; }
.card-face.image-missing .card-image-fallback { display: flex; }
.result-card > small { display: block; margin-top: 12px; color: var(--gold); font-size: 8px; letter-spacing: .14em; }
.result-card > strong { display: block; margin-top: 5px; font-family: var(--serif); font-size: clamp(11px, 3vw, 15px); font-weight: 500; }
.card-reading { margin: 12px 0 0; color: var(--muted); font-size: clamp(9px, 2.45vw, 11px); line-height: 1.7; text-align: left; }
.reading-basis { margin-top: 12px; border-top: 1px solid rgba(255,255,255,.065); color: var(--muted); text-align: left; }
.reading-basis summary { padding: 10px 0; color: var(--gold); font-size: 8px; letter-spacing: .08em; cursor: pointer; list-style-position: inside; }
.reading-basis dl { margin: 0; padding: 2px 0 8px; }
.reading-basis dl > div { margin-bottom: 9px; }
.reading-basis dt { color: #8d8997; font-size: 8px; letter-spacing: .08em; }
.reading-basis dd { margin: 3px 0 0; color: #aaa7b1; font-size: 9px; line-height: 1.65; }
.reading-summary, .action-guidance { margin-top: 48px; border-top: 1px solid var(--line); }
.reading-summary header { display: flex; align-items: center; gap: 13px; padding-top: 26px; }
.reading-summary header > span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); }
.reading-summary small { color: var(--gold); font-size: 8px; letter-spacing: .18em; }
.reading-summary h2 { margin: 3px 0 0; font-family: var(--serif); font-size: 19px; font-weight: 500; }
#summary-text { margin-top: 22px; color: #c3c0c8; font-family: var(--serif); font-size: 13px; line-height: 2; }
#summary-text p { margin: 0 0 15px; }
.action-guidance { padding-top: 27px; }
.action-guidance ol { list-style: none; margin: 0; padding: 0; }
.action-guidance li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,.065); color: var(--muted); font-size: 12px; line-height: 1.7; }
.action-guidance li i { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); font-size: 9px; font-style: normal; }
.result-actions { margin-top: 48px; display: grid; gap: 12px; }
.secondary-button { border: 1px solid var(--line); background: rgba(20,22,42,.7); color: var(--ink); }
.secondary-button i { color: var(--gold); font-style: normal; }
.text-button { min-height: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.disclaimer { margin: 30px 0 0; padding: 18px 0; border-top: 1px solid var(--line-soft); color: #5e5f70; font-size: 8px; line-height: 1.7; text-align: center; }

.gesture-cursor { position: fixed; z-index: 30; width: 32px; height: 32px; border: 1px solid var(--gold-light); border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); transition: left .065s linear, top .065s linear, width .12s, height .12s, background .12s; box-shadow: 0 0 15px rgba(216,188,119,.25); }
.gesture-cursor i { position: absolute; inset: 9px; border-radius: 50%; background: var(--gold-light); }
.gesture-cursor.over-card { width: 38px; height: 38px; box-shadow: 0 0 22px rgba(216,188,119,.5); }
.gesture-cursor.holding::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; background: conic-gradient(var(--gold-light) var(--hold-progress, 0deg), rgba(216,188,119,.12) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0); }
.gesture-cursor.pinching { width: 22px; height: 22px; background: rgba(216,188,119,.25); }
.gesture-cursor.confirmed { animation: gesture-confirm .34s ease-out; }
@keyframes gesture-confirm { 50% { transform: translate(-50%, -50%) scale(1.8); background: rgba(216,188,119,.42); } }
.drag-ghost { position: fixed; z-index: 25; width: 88px; height: 148px; border-radius: 8px; pointer-events: none; transform: translate(-50%, -50%) rotate(2deg); opacity: .92; box-shadow: 0 18px 35px rgba(0,0,0,.4); }
.toast { z-index: 50; position: fixed; left: 50%; bottom: max(26px, calc(env(safe-area-inset-bottom) + 15px)); max-width: calc(100vw - 32px); padding: 11px 16px; border: 1px solid var(--line); border-radius: 99px; background: rgba(24,25,44,.96); color: var(--ink); font-size: 10px; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .25s; box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

dialog { width: min(calc(100% - 34px), 400px); padding: 0; border: 1px solid var(--line); border-radius: 24px; background: #15172b; color: var(--ink); box-shadow: 0 25px 100px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(4,5,12,.78); backdrop-filter: blur(8px); }
dialog form { padding: 28px; text-align: center; }
.dialog-mark { width: 50px; height: 50px; margin: 0 auto 17px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); font-size: 22px; }
dialog h2 { margin: 0; font-family: var(--serif); font-size: 21px; }
dialog p { color: var(--muted); font-size: 11px; }
dialog form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 25px; }
dialog button { min-height: 44px; border: 1px solid var(--line-soft); border-radius: 99px; background: rgba(255,255,255,.035); cursor: pointer; }
dialog .danger-light { border-color: var(--line); background: var(--gold); color: #151622; }

@media (min-width: 700px) {
  #welcome-screen { padding-top: 5vh; }
  .hero-orbit { height: 300px; }
  .hero-card { width: 136px; }
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .category-card { min-height: 125px; }
  .mode-list { grid-template-columns: 1fr 1fr; }
  .mode-card { min-height: 150px; grid-template-columns: 55px 1fr; }
  .mode-meta { grid-column: 1 / -1; flex-direction: row; }
  .card-strip { min-height: 260px; gap: 14px; padding-top: 25px; padding-bottom: 32px; }
  .tarot-back { flex-basis: 126px; width: 126px; height: 212px; }
  .result-card .card-reading { font-size: 11px; }
}

@media (max-width: 370px) {
  .screen { padding-left: 16px; padding-right: 16px; }
  .site-header { padding-left: 16px; padding-right: 16px; }
  .reading-screen { padding-left: 0; padding-right: 0; }
  .reading-head { padding-left: 14px; padding-right: 14px; }
  .trust-row { gap: 9px; font-size: 8px; }
  .mode-card { padding: 14px; grid-template-columns: 48px 1fr auto; }
  .mode-icon { width: 46px; height: 46px; }
  .result-screen { padding-left: 15px; padding-right: 15px; }
}

@media (pointer: coarse) {
  .deck-nav { display: none; }
  .deck-fade { width: 26px; }
}

@media (max-height: 700px) and (orientation: portrait) {
  #welcome-screen { padding-top: 2vh; }
  .hero-orbit { height: 215px; transform: scale(.86); margin-top: -12px; margin-bottom: -18px; }
  .hero-intro { margin-top: 15px; }
  .step-header { margin-bottom: 26px; }
  .instruction { margin-top: 18px; }
  .card-strip { min-height: 188px; }
  .tarot-back { flex-basis: 88px; width: 88px; height: 148px; }
  .slot-card { width: 60px; }
}

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