:root {
    color-scheme: dark;
    --void: #090912;
    --night: #111420;
    --panel: rgba(19, 22, 34, 0.78);
    --panel-strong: rgba(28, 32, 48, 0.92);
    --ink: #f9f2df;
    --muted: #b9ad95;
    --line: rgba(242, 213, 144, 0.22);
    --gold: #f2c86b;
    --amber: #c88732;
    --teal: #4fd1c5;
    --crimson: #d65a62;
    --violet: #8e72ff;
    --green: #76c77a;
    --shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
    --glow: 0 0 32px rgba(242, 200, 107, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background:
        linear-gradient(120deg, rgba(214, 90, 98, 0.16), transparent 28%),
        linear-gradient(235deg, rgba(79, 209, 197, 0.12), transparent 34%),
        radial-gradient(circle at 50% -20%, rgba(242, 200, 107, 0.18), transparent 38%),
        var(--void);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    opacity: 0.58;
    background-image:
        linear-gradient(rgba(242, 200, 107, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 209, 197, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 86%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(249, 242, 223, 0.72) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(79, 209, 197, 0.44) 0 1px, transparent 1.5px);
    background-position: 0 0, 28px 18px;
    background-size: 120px 120px, 180px 180px;
    animation: starDrift 28s linear infinite;
}

a {
    color: var(--teal);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 16px;
    max-width: 760px;
    font-size: clamp(34px, 6vw, 78px);
    line-height: 0.98;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 14px;
    font-size: clamp(22px, 3vw, 34px);
    line-height: 1.12;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 6px;
    font-size: 22px;
    line-height: 1.2;
}

.cosmic-sky {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.sky-ring {
    position: absolute;
    border: 1px solid rgba(242, 200, 107, 0.15);
    border-radius: 50%;
    transform: rotate(18deg);
}

.ring-one {
    right: -160px;
    top: 80px;
    width: 420px;
    height: 420px;
}

.ring-two {
    left: -140px;
    bottom: 70px;
    width: 340px;
    height: 340px;
    border-color: rgba(79, 209, 197, 0.13);
}

.sky-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(242, 200, 107, 0.35), transparent);
    transform-origin: center;
}

.line-one {
    top: 28%;
    left: -10%;
    width: 70%;
    transform: rotate(-18deg);
}

.line-two {
    right: -8%;
    bottom: 24%;
    width: 58%;
    transform: rotate(22deg);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 76px;
    padding: 15px min(5vw, 58px);
    background: rgba(9, 9, 18, 0.72);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-weight: 900;
}

.brand-mark {
    position: relative;
    display: grid;
    width: 38px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(242, 200, 107, 0.78);
    border-radius: 8px;
    background:
        linear-gradient(160deg, rgba(214, 90, 98, 0.72), rgba(17, 20, 32, 0.96)),
        var(--night);
    color: var(--gold);
    font-family: Georgia, serif;
    box-shadow: var(--glow);
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(249, 242, 223, 0.18);
    border-radius: 5px;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.nav a,
.nav-user {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 800;
}

.nav a:hover {
    border-color: rgba(242, 200, 107, 0.28);
    background: rgba(242, 200, 107, 0.08);
}

.nav-user {
    color: var(--muted);
}

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

.footer {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 34px;
    color: var(--muted);
    font-size: 14px;
}

.button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid rgba(242, 200, 107, 0.34);
    border-radius: 999px;
    background: rgba(249, 242, 223, 0.08);
    color: var(--ink);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
    overflow: hidden;
}

.button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent, rgba(249, 242, 223, 0.18), transparent);
    transform: translateX(-110%);
    transition: transform 460ms ease;
}

.button:hover {
    transform: translateY(-2px);
    border-color: rgba(242, 200, 107, 0.82);
    box-shadow: var(--glow), 0 18px 38px rgba(0, 0, 0, 0.3);
}

.button:hover::before {
    transform: translateX(110%);
}

.button.primary {
    background: linear-gradient(135deg, var(--gold), var(--crimson) 52%, var(--teal));
    color: #090912;
    border-color: rgba(249, 242, 223, 0.6);
}

.button.ghost {
    background: rgba(9, 9, 18, 0.32);
    box-shadow: none;
}

.button.small {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 14px;
}

.button.danger {
    background: var(--crimson);
    color: #fff;
}

.button-sigil {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-shadow: inset 0 0 0 3px rgba(9, 9, 18, 0.28);
}

.panel,
.ritual-panel,
.history-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(249, 242, 223, 0.09), rgba(249, 242, 223, 0.035)),
        var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.panel {
    padding: 24px;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--teal);
    border-radius: 8px;
    background: rgba(19, 22, 34, 0.86);
    color: var(--ink);
}

.alert.success {
    border-left-color: var(--green);
}

.alert.warning {
    border-left-color: var(--gold);
}

.alert.danger {
    border-left-color: var(--crimson);
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0;
}

.install-layout,
.auth-page,
.auth-splash {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
    gap: 28px;
    align-items: start;
}

.auth-splash {
    min-height: 520px;
    align-items: center;
}

.hero-oracle {
    grid-template-columns: minmax(0, 1fr) 280px;
}

.auth-copy,
.install-copy {
    padding-top: 18px;
}

.auth-copy p,
.install-copy p,
.ritual-copy p,
.stage-note p {
    max-width: 620px;
    color: var(--muted);
    font-size: 18px;
}

.install-preview {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-top: 28px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(249, 242, 223, 0.06);
}

.install-preview span {
    display: block;
    color: var(--muted);
}

.form-grid,
.auth-form {
    display: grid;
    gap: 16px;
}

.form-grid h2 {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 850;
}

label span {
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid rgba(242, 200, 107, 0.24);
    border-radius: 8px;
    background: rgba(9, 9, 18, 0.56);
    color: var(--ink);
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(79, 209, 197, 0.18);
    border-color: rgba(79, 209, 197, 0.72);
}

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

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

.form-hint {
    margin-bottom: 0;
    color: var(--muted);
}

.ritual-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.96fr) minmax(360px, 0.74fr);
    gap: 26px;
    align-items: stretch;
}

.ritual-copy {
    grid-column: 1 / -1;
    position: relative;
    min-height: 210px;
    padding: 32px 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(110deg, rgba(242, 200, 107, 0.12), transparent 46%),
        linear-gradient(220deg, rgba(79, 209, 197, 0.11), transparent 50%),
        rgba(19, 22, 34, 0.64);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ritual-copy::after {
    content: "";
    position: absolute;
    right: 36px;
    top: 28px;
    width: 170px;
    height: 170px;
    border: 1px solid rgba(242, 200, 107, 0.2);
    border-radius: 50%;
    box-shadow:
        inset 0 0 0 32px rgba(79, 209, 197, 0.03),
        inset 0 0 0 68px rgba(214, 90, 98, 0.04);
}

.ritual-metrics {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.ritual-metrics span {
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(9, 9, 18, 0.34);
    color: var(--muted);
}

.ritual-metrics strong {
    color: var(--gold);
    font-size: 20px;
}

.ritual-panel {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.ritual-panel.is-working {
    pointer-events: none;
}

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

.spread-option {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
    min-height: 134px;
    padding: 15px;
    border: 1px solid rgba(242, 200, 107, 0.2);
    border-radius: 8px;
    background: rgba(9, 9, 18, 0.42);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.spread-option:hover,
.spread-option:has(input:checked) {
    transform: translateY(-2px);
    border-color: rgba(242, 200, 107, 0.66);
    background: linear-gradient(180deg, rgba(242, 200, 107, 0.14), rgba(79, 209, 197, 0.08));
}

.spread-option input {
    position: absolute;
    opacity: 0;
}

.spread-sigil {
    width: 24px;
    height: 24px;
    margin-top: 4px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    background:
        linear-gradient(90deg, transparent 46%, rgba(242, 200, 107, 0.9) 47% 53%, transparent 54%),
        linear-gradient(0deg, transparent 46%, rgba(242, 200, 107, 0.9) 47% 53%, transparent 54%);
}

.spread-option:has(input:checked) .spread-sigil {
    box-shadow: 0 0 20px rgba(242, 200, 107, 0.45);
}

.spread-text strong,
.spread-text em {
    display: block;
}

.spread-text strong {
    font-size: 17px;
}

.spread-text em {
    margin-top: 5px;
    color: var(--muted);
    font-style: normal;
    font-weight: 500;
}

.ritual-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.switch-row {
    display: inline-flex;
    grid-template-columns: none;
    align-items: center;
    gap: 10px;
}

.switch-row input {
    position: absolute;
    opacity: 0;
}

.switch-track {
    position: relative;
    width: 54px;
    height: 30px;
    border: 1px solid rgba(242, 200, 107, 0.32);
    border-radius: 999px;
    background: rgba(9, 9, 18, 0.72);
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 160ms ease, background 160ms ease;
}

.switch-row input:checked + .switch-track::after {
    transform: translateX(24px);
    background: var(--gold);
}

.draw-button {
    min-width: 176px;
}

.oracle-stage {
    position: relative;
    display: grid;
    min-height: 430px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(249, 242, 223, 0.08), transparent),
        rgba(9, 9, 18, 0.46);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.stage-glow {
    position: absolute;
    width: 74%;
    aspect-ratio: 1;
    border: 1px solid rgba(242, 200, 107, 0.18);
    border-radius: 50%;
    box-shadow:
        inset 0 0 0 24px rgba(79, 209, 197, 0.035),
        inset 0 0 0 70px rgba(214, 90, 98, 0.032),
        0 0 80px rgba(242, 200, 107, 0.12);
    animation: slowSpin 18s linear infinite;
}

.deck-stack {
    position: relative;
    width: 176px;
    height: 264px;
    transform-style: preserve-3d;
    perspective: 800px;
}

.deck-card {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(242, 200, 107, 0.55);
    border-radius: 8px;
    background:
        linear-gradient(140deg, rgba(214, 90, 98, 0.72), rgba(17, 20, 32, 0.95)),
        var(--night);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.deck-card::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(249, 242, 223, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(45deg, transparent 48%, rgba(242, 200, 107, 0.18) 49% 51%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(79, 209, 197, 0.14) 49% 51%, transparent 52%);
    background-size: 28px 28px;
}

.deck-card::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 82px;
    height: 82px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(242, 200, 107, 0.72);
    border-radius: 50%;
    box-shadow: inset 0 0 0 20px rgba(9, 9, 18, 0.2);
}

.deck-card-1 { transform: rotate(-8deg) translate(-18px, 6px); }
.deck-card-2 { transform: rotate(-4deg) translate(-10px, 2px); }
.deck-card-3 { transform: rotate(-1deg) translate(-3px, 0); }
.deck-card-4 { transform: rotate(2deg) translate(4px, -2px); }
.deck-card-5 { transform: rotate(5deg) translate(12px, 1px); }
.deck-card-6 { transform: rotate(8deg) translate(18px, 6px); }
.deck-card-7 { transform: rotate(0deg) translate(0, -8px); }

.is-shuffling .deck-card-1 { animation: shuffleOne 1.2s ease-in-out both; }
.is-shuffling .deck-card-2 { animation: shuffleTwo 1.2s ease-in-out both; }
.is-shuffling .deck-card-3 { animation: shuffleThree 1.2s ease-in-out both; }
.is-shuffling .deck-card-4 { animation: shuffleFour 1.2s ease-in-out both; }
.is-shuffling .deck-card-5 { animation: shuffleFive 1.2s ease-in-out both; }
.is-shuffling .deck-card-6 { animation: shuffleSix 1.2s ease-in-out both; }
.is-shuffling .deck-card-7 { animation: shuffleSeven 1.2s ease-in-out both; }

.orbit {
    position: absolute;
    border: 1px solid rgba(79, 209, 197, 0.2);
    border-radius: 50%;
    transform: rotate(22deg);
}

.orbit-one {
    width: 320px;
    height: 160px;
}

.orbit-two {
    width: 220px;
    height: 360px;
    border-color: rgba(242, 200, 107, 0.18);
    transform: rotate(-32deg);
}

.stage-note {
    position: absolute;
    right: 18px;
    bottom: 18px;
    left: 18px;
    padding: 16px;
    border: 1px solid rgba(242, 200, 107, 0.18);
    border-radius: 8px;
    background: rgba(9, 9, 18, 0.54);
}

.stage-note p {
    margin: 4px 0 0;
    font-size: 14px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.reveal-section {
    margin-top: 34px;
    padding-top: 4px;
}

.question-box {
    padding: 16px 18px;
    border: 1px solid rgba(242, 200, 107, 0.22);
    border-left: 5px solid var(--gold);
    border-radius: 8px;
    background: rgba(9, 9, 18, 0.42);
    color: var(--ink);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.tarot-card {
    position: relative;
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    min-height: 256px;
    border: 1px solid rgba(242, 200, 107, 0.24);
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(249, 242, 223, 0.08), rgba(249, 242, 223, 0.03)),
        rgba(19, 22, 34, 0.88);
    box-shadow: var(--shadow);
    transform: translateY(24px) rotateX(12deg);
    opacity: 0;
    animation: revealCard 720ms cubic-bezier(.2,.8,.2,1) forwards;
    animation-delay: var(--delay);
}

.tarot-card.is-focused {
    border-color: rgba(79, 209, 197, 0.54);
}

.card-art {
    position: relative;
    display: grid;
    place-items: center;
    background:
        linear-gradient(160deg, rgba(214, 90, 98, 0.78), rgba(9, 9, 18, 0.96)),
        var(--night);
}

.card-art::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(249, 242, 223, 0.2);
    border-radius: 8px;
}

.card-art span {
    position: relative;
    display: grid;
    width: 60px;
    height: 78px;
    place-items: center;
    border: 1px solid rgba(242, 200, 107, 0.72);
    border-radius: 8px;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 950;
    box-shadow: inset 0 0 24px rgba(242, 200, 107, 0.12);
}

.card-body {
    min-width: 0;
    padding: 18px;
}

.position,
.latin,
.keywords {
    color: var(--muted);
    font-size: 14px;
}

.keywords {
    color: var(--teal);
    font-weight: 850;
}

.oracle-report {
    margin-top: 20px;
    padding: 24px;
    border: 1px solid rgba(242, 200, 107, 0.26);
    border-radius: 8px;
    background:
        linear-gradient(120deg, rgba(242, 200, 107, 0.12), transparent 42%),
        linear-gradient(240deg, rgba(79, 209, 197, 0.1), transparent 46%),
        rgba(19, 22, 34, 0.86);
    box-shadow: var(--shadow);
}

.report-head,
.report-mini-head,
.history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.report-body {
    color: #fff7e8;
    font-size: 17px;
}

.report-body h3 {
    margin: 22px 0 10px;
    color: var(--gold);
    font-size: 22px;
}

.report-body h3:first-child {
    margin-top: 0;
}

.report-body p {
    margin-bottom: 14px;
}

.report-body strong {
    color: #fff;
}

.report-body ul {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.report-body li {
    position: relative;
    padding-left: 22px;
}

.report-body li::before {
    content: "";
    position: absolute;
    top: 0.78em;
    left: 0;
    width: 9px;
    height: 1px;
    background: var(--teal);
}

.summary {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(242, 200, 107, 0.08);
}

.history-list {
    display: grid;
    gap: 18px;
}

.history-item {
    padding: 22px;
}

.count-pill,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid rgba(242, 200, 107, 0.28);
    border-radius: 999px;
    background: rgba(9, 9, 18, 0.46);
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.badge.active {
    border-color: rgba(79, 209, 197, 0.42);
    color: var(--teal);
}

.badge.disabled {
    border-color: rgba(214, 90, 98, 0.48);
    color: var(--crimson);
}

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

.mini-card {
    min-height: 90px;
    padding: 12px;
    border: 1px solid rgba(242, 200, 107, 0.18);
    border-radius: 8px;
    background: rgba(9, 9, 18, 0.42);
}

.mini-card.has-image {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
}

.mini-card strong,
.mini-card span {
    display: block;
}

.mini-card span {
    color: var(--muted);
}

.mini-card.has-image span {
    grid-column: 2;
}

.mini-card img {
    grid-row: span 2;
    width: 42px;
    aspect-ratio: 244 / 419;
    border: 1px solid rgba(242, 200, 107, 0.28);
    border-radius: 4px;
    object-fit: cover;
}

.history-report {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(79, 209, 197, 0.22);
    border-radius: 8px;
    background: rgba(79, 209, 197, 0.065);
}

.history-report p {
    display: -webkit-box;
    margin-bottom: 0;
    overflow: hidden;
    color: var(--muted);
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    white-space: pre-line;
}

.report-mini-head {
    margin-bottom: 10px;
}

.report-mini-head span {
    color: var(--gold);
    font-size: 13px;
}

.report-mini-head a {
    color: var(--gold);
    font-size: 13px;
    font-weight: 850;
}

.paywall {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 14px;
    padding: 18px;
    border: 1px solid rgba(242, 200, 107, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(120deg, rgba(242, 200, 107, 0.12), transparent 50%),
        rgba(9, 9, 18, 0.5);
}

.paywall h3 {
    margin-bottom: 6px;
    color: var(--gold);
}

.paywall p {
    margin-bottom: 0;
    color: var(--muted);
}

.paywall-action {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.paywall-action strong {
    color: var(--gold);
    font-size: 30px;
    line-height: 1;
}

.payment-transfer {
    display: grid;
    min-height: 58vh;
    place-items: center;
}

.payment-transfer .panel {
    width: min(620px, 100%);
}

.payment-transfer form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.payment-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.72fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 20px;
}

.payment-help p {
    color: var(--muted);
}

.readonly-list {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.readonly-list input {
    color: var(--muted);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 56px 20px;
    text-align: center;
}

.empty-state p {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    min-height: 132px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(249, 242, 223, 0.09), rgba(249, 242, 223, 0.03)),
        rgba(19, 22, 34, 0.82);
    box-shadow: var(--shadow);
}

.stat-card span {
    color: var(--muted);
    font-weight: 850;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    color: var(--gold);
    font-size: 38px;
    line-height: 1;
}

.admin-note {
    max-width: 820px;
}

.compact-head {
    margin-bottom: 12px;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 360px) auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.edit-user {
    margin-bottom: 20px;
}

.home-hero,
.step-page,
.select-hero,
.result-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
    gap: 26px;
    align-items: stretch;
    margin-bottom: 26px;
}

.home-copy,
.step-aside,
.select-hero > div:first-child,
.result-hero > div:first-child {
    min-height: 260px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(110deg, rgba(242, 200, 107, 0.12), transparent 48%),
        linear-gradient(220deg, rgba(79, 209, 197, 0.1), transparent 52%),
        rgba(19, 22, 34, 0.68);
    box-shadow: var(--shadow);
}

.home-copy p,
.step-aside p,
.select-hero p,
.result-hero p,
.home-panel p {
    max-width: 700px;
    color: var(--muted);
    font-size: 18px;
}

.home-oracle {
    position: relative;
    display: grid;
    min-height: 360px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(9, 9, 18, 0.42);
    overflow: hidden;
}

.home-oracle .tarot-back {
    position: absolute;
}

.home-oracle .tarot-back:nth-child(1) {
    transform: rotate(-11deg) translate(-78px, 18px);
}

.home-oracle .tarot-back:nth-child(2) {
    transform: rotate(3deg) translate(0, -8px);
}

.home-oracle .tarot-back:nth-child(3) {
    transform: rotate(12deg) translate(78px, 20px);
}

.flow-map {
    display: grid;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(9, 9, 18, 0.48);
    box-shadow: var(--shadow);
}

.flow-step {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: center;
    min-height: 92px;
    padding: 16px;
    border: 1px solid rgba(242, 200, 107, 0.2);
    border-radius: 8px;
    background: rgba(249, 242, 223, 0.05);
}

.flow-step strong {
    color: var(--gold);
    font-size: 28px;
}

.flow-step span {
    font-size: 20px;
    font-weight: 900;
}

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 22px;
}

.home-panel {
    min-height: 260px;
}

.recent-list {
    display: grid;
    gap: 10px;
}

.recent-list a {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid rgba(242, 200, 107, 0.18);
    border-radius: 8px;
    background: rgba(9, 9, 18, 0.4);
}

.recent-list a:hover {
    border-color: rgba(79, 209, 197, 0.4);
}

.recent-list span,
.muted-text {
    color: var(--muted);
}

.flow-list {
    display: grid;
    gap: 10px;
    max-width: 420px;
    margin-top: 24px;
}

.flow-list span {
    padding: 12px 14px;
    border: 1px solid rgba(242, 200, 107, 0.18);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(9, 9, 18, 0.34);
    font-weight: 800;
}

.flow-list .active {
    border-color: rgba(242, 200, 107, 0.62);
    color: var(--ink);
    background: rgba(242, 200, 107, 0.1);
}

.question-form {
    align-self: stretch;
}

.select-hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.54fr);
    gap: 18px;
    margin-bottom: 18px;
}

.select-hero > div:first-child {
    min-height: 210px;
    padding: 28px;
}

.select-hero .question-box {
    align-self: stretch;
    display: grid;
    align-content: center;
    margin: 0;
}

.select-form {
    display: grid;
    gap: 18px;
}

.pick-slots {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(9, 9, 18, 0.84);
    backdrop-filter: blur(16px);
}

.pick-slots div {
    min-height: 72px;
    padding: 12px;
    border: 1px solid rgba(242, 200, 107, 0.18);
    border-radius: 8px;
    background: rgba(249, 242, 223, 0.045);
}

.pick-slots strong,
.pick-slots span {
    display: block;
}

.pick-slots span {
    color: var(--muted);
}

.pick-slots .is-filled {
    border-color: rgba(79, 209, 197, 0.42);
    background: rgba(79, 209, 197, 0.08);
}

.candidate-stage {
    position: relative;
    display: grid;
    min-height: 142px;
    place-items: center;
    margin-top: 2px;
    margin-bottom: -4px;
    border: 1px solid rgba(242, 200, 107, 0.2);
    border-radius: 8px;
    background:
        linear-gradient(90deg, transparent, rgba(79, 209, 197, 0.1), transparent),
        rgba(9, 9, 18, 0.48);
    overflow: hidden;
}

.candidate-stage::before,
.candidate-stage::after {
    content: "";
    position: absolute;
    inset: auto 12% 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(242, 200, 107, 0.58), transparent);
}

.candidate-stage::after {
    inset: 28px 20% auto;
    background: linear-gradient(90deg, transparent, rgba(79, 209, 197, 0.5), transparent);
}

.candidate-source {
    position: relative;
    width: 92px;
    aspect-ratio: 2 / 3;
    animation: deckPulse 1800ms ease-in-out infinite alternate;
}

.candidate-source span {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(242, 200, 107, 0.52);
    border-radius: 8px;
    background:
        linear-gradient(45deg, transparent 46%, rgba(242, 200, 107, 0.16) 47% 53%, transparent 54%),
        linear-gradient(-45deg, transparent 46%, rgba(79, 209, 197, 0.12) 47% 53%, transparent 54%),
        linear-gradient(160deg, rgba(214, 90, 98, 0.78), rgba(9, 9, 18, 0.96));
    background-size: 22px 22px, 22px 22px, auto;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.34);
}

.candidate-source span:nth-child(1) {
    transform: rotate(-14deg) translate(-42px, 12px);
    animation: shuffleFanOne 1800ms ease-in-out infinite alternate;
}

.candidate-source span:nth-child(2) {
    transform: rotate(-7deg) translate(-20px, 2px);
    animation: shuffleFanTwo 1900ms ease-in-out infinite alternate;
}

.candidate-source span:nth-child(3) {
    transform: rotate(0deg);
}

.candidate-source span:nth-child(4) {
    transform: rotate(7deg) translate(20px, 2px);
    animation: shuffleFanFour 1900ms ease-in-out infinite alternate;
}

.candidate-source span:nth-child(5) {
    transform: rotate(14deg) translate(42px, 12px);
    animation: shuffleFanFive 1800ms ease-in-out infinite alternate;
}

.deck-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(92px, 1fr));
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(249, 242, 223, 0.06), rgba(249, 242, 223, 0.02)),
        rgba(19, 22, 34, 0.72);
    box-shadow: var(--shadow);
    margin-bottom: 92px;
}

.candidate-board {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    perspective: 1100px;
}

.candidate-board::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(120deg, transparent 0 38%, rgba(242, 200, 107, 0.1) 46%, transparent 54% 100%),
        linear-gradient(180deg, rgba(79, 209, 197, 0.08), transparent 45%);
    animation: boardSweep 2600ms ease-in-out infinite;
}

.pick-card {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.candidate-board .pick-card {
    opacity: 0;
    animation: dealCandidate 620ms cubic-bezier(.2,.8,.2,1) forwards;
    animation-delay: calc(120ms + var(--deal-index) * 55ms);
}

.pick-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pick-card-back {
    position: relative;
    display: grid;
    min-height: 148px;
    aspect-ratio: 2 / 3;
    place-items: end center;
    padding: 10px;
    border: 1px solid rgba(242, 200, 107, 0.36);
    border-radius: 8px;
    background:
        linear-gradient(45deg, transparent 46%, rgba(242, 200, 107, 0.13) 47% 53%, transparent 54%),
        linear-gradient(-45deg, transparent 46%, rgba(79, 209, 197, 0.1) 47% 53%, transparent 54%),
        linear-gradient(160deg, rgba(214, 90, 98, 0.7), rgba(9, 9, 18, 0.96));
    background-size: 22px 22px, 22px 22px, auto;
    color: rgba(249, 242, 223, 0.64);
    font-size: 12px;
    font-weight: 900;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    overflow: hidden;
}

.candidate-board .pick-card-back {
    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.28),
        inset 0 0 24px rgba(249, 242, 223, 0.045);
}

.pick-card-back::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(242, 200, 107, 0.7);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(242, 200, 107, 0.28);
    transition: box-shadow 160ms ease, transform 160ms ease;
}

.pick-card-back::after {
    content: var(--pick-order);
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: var(--gold);
    color: #090912;
    font-size: 13px;
    font-weight: 950;
    opacity: 0;
}

.pick-card:hover .pick-card-back {
    transform: translateY(-5px) scale(1.015);
    border-color: rgba(242, 200, 107, 0.8);
}

.pick-card.is-picked .pick-card-back {
    transform: translateY(-8px) rotate(-1deg);
    border-color: rgba(79, 209, 197, 0.9);
    box-shadow: 0 0 28px rgba(79, 209, 197, 0.28);
}

.pick-card.is-picked .pick-card-back::after {
    opacity: 1;
}

.pick-card.is-picked .pick-card-back::before {
    transform: translate(-50%, -50%) scale(1.18);
    box-shadow: 0 0 34px rgba(79, 209, 197, 0.34);
}

.is-revealing .pick-card:not(.is-picked) {
    opacity: 0.26;
    transform: scale(0.98);
    transition: opacity 260ms ease, transform 260ms ease;
}

.is-revealing .pick-card.is-picked .pick-card-back {
    animation: chosenAscend 900ms cubic-bezier(.2,.8,.2,1) both;
}

.sticky-action {
    position: sticky;
    bottom: 14px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(9, 9, 18, 0.88);
    backdrop-filter: blur(16px);
}

.sticky-action strong {
    color: var(--gold);
    font-size: 26px;
}

.sticky-action span {
    color: var(--muted);
}

.sticky-action .button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.8);
    opacity: 0.55;
}

.is-revealing .sticky-action {
    border-color: rgba(79, 209, 197, 0.5);
    box-shadow: 0 0 46px rgba(79, 209, 197, 0.16);
}

.result-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.face-spread {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 22px 0;
}

.face-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid rgba(242, 200, 107, 0.24);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(19, 22, 34, 0.86);
    box-shadow: var(--shadow);
    opacity: 0;
    animation: revealCard 720ms cubic-bezier(.2,.8,.2,1) forwards;
    animation-delay: var(--delay);
}

.face-art {
    position: relative;
    display: grid;
    min-height: 360px;
    align-content: center;
    justify-items: center;
    gap: 10px;
    padding: 24px;
    background:
        linear-gradient(45deg, transparent 47%, rgba(242, 200, 107, 0.12) 48% 52%, transparent 53%),
        linear-gradient(-45deg, transparent 47%, rgba(79, 209, 197, 0.1) 48% 52%, transparent 53%),
        linear-gradient(160deg, rgba(214, 90, 98, 0.58), rgba(9, 9, 18, 0.98));
    background-size: 34px 34px, 34px 34px, auto;
    overflow: hidden;
}

.face-art::before {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(249, 242, 223, 0.18);
    border-radius: 8px;
    z-index: 0;
    pointer-events: none;
}

.face-art::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 130px;
    height: 130px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(242, 200, 107, 0.42);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.face-art img {
    position: relative;
    z-index: 1;
    display: block;
    width: min(78%, 244px);
    aspect-ratio: 244 / 419;
    border: 1px solid rgba(249, 242, 223, 0.36);
    border-radius: 8px;
    object-fit: cover;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.42),
        0 0 34px rgba(242, 200, 107, 0.14);
    transform: rotate(0deg) scale(1);
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.face-art.is-reversed img {
    transform: rotate(180deg) scale(1);
}

.face-card:hover .face-art img {
    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.5),
        0 0 46px rgba(79, 209, 197, 0.2);
}

.major-face {
    background-color: rgba(214, 90, 98, 0.2);
}

.minor-face {
    background-color: rgba(79, 209, 197, 0.12);
}

.face-number,
.face-symbol,
.face-name,
.face-en {
    position: relative;
    z-index: 1;
}

.face-number {
    position: absolute;
    top: 28px;
    left: 28px;
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: 950;
}

.face-symbol {
    color: var(--gold);
    font-size: 62px;
    line-height: 1;
}

.face-name {
    font-size: 30px;
    font-weight: 950;
}

.face-en {
    color: var(--muted);
    font-family: Georgia, serif;
}

.face-copy {
    padding: 18px;
}

.report-page {
    margin-top: 22px;
}

.tarot-back {
    width: 190px;
    aspect-ratio: 2 / 3;
    padding: 12px;
    border: 1px solid rgba(242, 200, 107, 0.68);
    border-radius: 8px;
    background:
        linear-gradient(160deg, rgba(214, 90, 98, 0.75), rgba(9, 9, 18, 0.96)),
        var(--night);
    box-shadow: var(--glow), var(--shadow);
}

.install-preview .tarot-back {
    width: 86px;
}

.tarot-back-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(249, 242, 223, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(45deg, transparent 46%, rgba(242, 200, 107, 0.14) 47%, rgba(242, 200, 107, 0.14) 53%, transparent 54%),
        linear-gradient(-45deg, transparent 46%, rgba(79, 209, 197, 0.12) 47%, rgba(79, 209, 197, 0.12) 53%, transparent 54%);
    background-size: 30px 30px;
}

.tarot-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(242, 200, 107, 0.62);
}

.corner-a {
    top: 12px;
    left: 12px;
    border-right: 0;
    border-bottom: 0;
}

.corner-b {
    right: 12px;
    bottom: 12px;
    border-left: 0;
    border-top: 0;
}

.moon-shape {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 76px;
    height: 76px;
    transform: translate(-50%, -50%);
    border: 3px solid var(--gold);
    border-radius: 50%;
}

.moon-shape::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #2b1824;
}

.star-line {
    position: absolute;
    inset: 20px;
    border: 1px solid rgba(249, 242, 223, 0.16);
    border-radius: 8px;
}

@keyframes starDrift {
    from { background-position: 0 0, 28px 18px; }
    to { background-position: 120px 120px, 208px 198px; }
}

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

@keyframes revealCard {
    0% { opacity: 0; transform: translateY(28px) rotateX(28deg) scale(0.96); filter: blur(8px); }
    65% { opacity: 1; transform: translateY(-5px) rotateX(0deg) scale(1.01); filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) rotateX(0deg) scale(1); filter: blur(0); }
}

@keyframes shuffleOne {
    0% { transform: rotate(-8deg) translate(-18px, 6px); }
    45% { transform: rotate(-24deg) translate(-130px, -22px); }
    100% { transform: rotate(-4deg) translate(-16px, -4px); }
}

@keyframes shuffleTwo {
    0% { transform: rotate(-4deg) translate(-10px, 2px); }
    45% { transform: rotate(18deg) translate(126px, -36px); }
    100% { transform: rotate(3deg) translate(10px, -2px); }
}

@keyframes shuffleThree {
    0% { transform: rotate(-1deg) translate(-3px, 0); }
    50% { transform: rotate(-18deg) translate(-90px, 72px); }
    100% { transform: rotate(-2deg) translate(-2px, -6px); }
}

@keyframes shuffleFour {
    0% { transform: rotate(2deg) translate(4px, -2px); }
    50% { transform: rotate(22deg) translate(88px, 74px); }
    100% { transform: rotate(1deg) translate(0, -10px); }
}

@keyframes shuffleFive {
    0% { transform: rotate(5deg) translate(12px, 1px); }
    42% { transform: rotate(28deg) translate(145px, 20px); }
    100% { transform: rotate(6deg) translate(16px, -5px); }
}

@keyframes shuffleSix {
    0% { transform: rotate(8deg) translate(18px, 6px); }
    42% { transform: rotate(-26deg) translate(-142px, 18px); }
    100% { transform: rotate(-5deg) translate(-9px, 0); }
}

@keyframes shuffleSeven {
    0% { transform: rotate(0deg) translate(0, -8px); }
    55% { transform: rotate(360deg) translate(0, -18px) scale(1.06); }
    100% { transform: rotate(0deg) translate(0, -12px); }
}

@keyframes chosenAscend {
    0% {
        transform: translateY(-8px) rotate(-1deg) scale(1);
        filter: brightness(1);
    }
    45% {
        transform: translateY(-34px) rotate(4deg) scale(1.08);
        filter: brightness(1.25);
    }
    100% {
        transform: translateY(-18px) rotate(0deg) scale(1.03);
        filter: brightness(1.12);
    }
}

@keyframes deckPulse {
    from { transform: translateY(2px) scale(0.98); filter: brightness(0.95); }
    to { transform: translateY(-3px) scale(1.02); filter: brightness(1.12); }
}

@keyframes shuffleFanOne {
    from { transform: rotate(-14deg) translate(-42px, 12px); }
    to { transform: rotate(-20deg) translate(-58px, 2px); }
}

@keyframes shuffleFanTwo {
    from { transform: rotate(-7deg) translate(-20px, 2px); }
    to { transform: rotate(-11deg) translate(-28px, -8px); }
}

@keyframes shuffleFanFour {
    from { transform: rotate(7deg) translate(20px, 2px); }
    to { transform: rotate(11deg) translate(28px, -8px); }
}

@keyframes shuffleFanFive {
    from { transform: rotate(14deg) translate(42px, 12px); }
    to { transform: rotate(20deg) translate(58px, 2px); }
}

@keyframes dealCandidate {
    0% {
        opacity: 0;
        transform: translateY(-88px) rotateX(58deg) scale(0.76);
        filter: blur(8px) brightness(1.2);
    }
    66% {
        opacity: 1;
        transform: translateY(5px) rotateX(0deg) scale(1.03);
        filter: blur(0) brightness(1.08);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg) scale(1);
        filter: blur(0) brightness(1);
    }
}

@keyframes boardSweep {
    0%, 100% { opacity: 0.4; transform: translateX(-18%); }
    50% { opacity: 0.86; transform: translateX(18%); }
}

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

@media (max-width: 1080px) {
    .ritual-shell,
    .install-layout,
    .auth-page,
    .auth-splash,
    .home-hero,
    .step-page,
    .select-hero,
    .result-hero,
    .payment-layout,
    .home-grid {
        grid-template-columns: 1fr;
    }

    .oracle-stage {
        min-height: 360px;
    }

    .spread-grid,
    .result-grid,
    .stats-grid,
    .face-spread {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .deck-board {
        grid-template-columns: repeat(5, minmax(72px, 1fr));
    }

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

@media (max-width: 720px) {
    .topbar {
        position: sticky;
        align-items: center;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 10px;
        min-height: auto;
        padding: 8px 10px;
    }

    .brand {
        flex: 0 0 auto;
        gap: 0;
    }

    .brand span:last-child {
        display: none;
    }

    .brand-mark {
        width: 28px;
        height: 38px;
        font-size: 14px;
    }

    .nav {
        flex: 1 1 auto;
        width: auto;
        justify-content: flex-start;
        gap: 5px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .nav a,
    .nav-user {
        flex: 0 0 auto;
        min-height: 28px;
        padding: 4px 8px;
        font-size: 12px;
    }

    .nav-user {
        display: none;
    }

    h1 {
        margin-bottom: 8px;
        font-size: 28px;
        line-height: 1.08;
    }

    h2 {
        font-size: 21px;
    }

    .page {
        width: min(100% - 20px, 1240px);
        padding-top: 10px;
        padding-bottom: 34px;
    }

    .panel,
    .ritual-panel,
    .history-item,
    .oracle-report {
        padding: 14px;
        border-radius: 8px;
    }

    .ritual-copy {
        padding: 24px 20px;
    }

    .ritual-copy::after {
        right: -32px;
        top: -28px;
    }

    .mysql-grid,
    .spread-grid,
    .result-grid,
    .stats-grid,
    .mini-cards,
    .toolbar,
    .pick-slots,
    .face-spread {
        grid-template-columns: 1fr;
    }

    .home-copy,
    .step-aside,
    .select-hero > div:first-child,
    .result-hero > div:first-child {
        min-height: auto;
        padding: 16px;
    }

    .home-hero,
    .step-page,
    .select-hero,
    .result-hero,
    .payment-layout {
        gap: 10px;
        margin-bottom: 12px;
    }

    .home-copy p,
    .step-aside p,
    .select-hero p,
    .result-hero p,
    .home-panel p {
        margin-bottom: 8px;
        font-size: 14px;
    }

    .flow-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 10px;
        max-width: none;
    }

    .flow-list span {
        min-height: 34px;
        padding: 7px 6px;
        text-align: center;
        font-size: 12px;
    }

    .question-form {
        gap: 10px;
    }

    .question-form textarea {
        min-height: 114px;
        height: 114px;
    }

    input,
    select,
    textarea {
        min-height: 40px;
        padding: 9px 11px;
    }

    label {
        gap: 6px;
    }

    label span {
        font-size: 13px;
    }

    .switch-row {
        gap: 8px;
        min-height: 30px;
    }

    .switch-track {
        width: 44px;
        height: 24px;
    }

    .switch-track::after {
        top: 3px;
        left: 3px;
        width: 16px;
        height: 16px;
    }

    .switch-row input:checked + .switch-track::after {
        transform: translateX(20px);
    }

    .action-row {
        gap: 8px;
    }

    .button {
        min-height: 38px;
        padding: 8px 13px;
        font-size: 14px;
    }

    .question-form .action-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .question-form .button {
        width: 100%;
    }

    .select-hero {
        gap: 12px;
        margin-bottom: 14px;
    }

    .select-hero > div:first-child {
        padding: 14px;
    }

    .select-hero p {
        font-size: 14px;
    }

    .home-oracle {
        min-height: 190px;
    }

    .home-oracle .tarot-back {
        width: 120px;
    }

    .flow-map {
        gap: 8px;
        padding: 12px;
    }

    .flow-step {
        grid-template-columns: 44px minmax(0, 1fr);
        min-height: 54px;
        padding: 9px 10px;
    }

    .flow-step strong {
        font-size: 18px;
    }

    .flow-step span {
        font-size: 15px;
    }

    .pick-slots {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 8px;
    }

    .pick-slots div {
        min-height: 68px;
        padding: 9px 7px;
    }

    .pick-slots strong {
        font-size: 13px;
    }

    .pick-slots span {
        font-size: 12px;
    }

    .deck-board {
        grid-template-columns: repeat(3, minmax(72px, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .candidate-stage {
        min-height: 84px;
    }

    .candidate-source {
        width: 58px;
    }

    .pick-card-back {
        min-height: 132px;
        aspect-ratio: auto;
    }

    .sticky-action {
        align-items: stretch;
        flex-direction: column;
    }

    .face-art {
        min-height: 230px;
        padding: 16px;
    }

    .face-copy {
        padding: 14px;
    }

    .face-copy p {
        font-size: 14px;
    }

    .question-box {
        padding: 11px 12px;
        font-size: 14px;
    }

    .result-hero > div:first-child {
        padding: 14px;
    }

    .result-hero p {
        display: none;
    }

    .result-hero .action-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .result-hero .button {
        width: 100%;
    }

    .face-spread {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 10px 0;
    }

    .face-card {
        grid-template-rows: auto auto;
    }

    .face-art {
        min-height: 132px;
        padding: 8px;
    }

    .face-art::before {
        inset: 8px;
    }

    .face-art::after {
        width: 58px;
        height: 58px;
    }

    .face-art img {
        width: min(88%, 78px);
        border-radius: 6px;
    }

    .face-copy {
        padding: 8px 7px 9px;
    }

    .face-copy .position {
        font-size: 11px;
    }

    .face-copy h2 {
        margin-bottom: 0;
        font-size: 14px;
        line-height: 1.2;
    }

    .face-copy p {
        display: none;
    }

    .report-page {
        margin-top: 12px;
    }

    .paywall {
        align-items: stretch;
        flex-direction: column;
        padding: 14px;
    }

    .paywall-action {
        justify-items: stretch;
    }

    .paywall-action strong {
        font-size: 24px;
    }

    .payment-layout {
        grid-template-columns: 1fr;
    }

    .payment-transfer {
        min-height: 48vh;
    }

    .payment-transfer form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .section-head,
    .history-head,
    .report-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .oracle-stage {
        min-height: 330px;
    }

    .deck-stack {
        width: 138px;
        height: 207px;
    }

    .tarot-card {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .card-art span {
        width: 48px;
        height: 64px;
        font-size: 20px;
    }

    .install-preview {
        grid-template-columns: 1fr;
    }
}
