@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Cormorant+Garamond:wght@400;500;600;700&family=Crimson+Pro:wght@300;400;500;600&display=swap');

:root {
    --font-display: 'Cinzel', 'Cormorant Garamond', serif;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Crimson Pro', serif;

    --ease-ritual: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.tarot-app-container[data-theme="noir"] {
    --bg-0: #05070d;
    --bg-1: #0a1325;
    --bg-2: #1a2235;
    --ink-0: #e9e4d6;
    --ink-1: #c9c1ac;
    --ink-2: #9e9888;
    --gold-0: #c8a24c;
    --gold-1: #f0d7a0;
    --gold-2: #876425;
    --paper-0: #f2ead7;
    --paper-1: #e5d8bf;
    --paper-2: #d6c6a6;
    --accent-0: #6e819e;
    --accent-1: #44556f;
    --danger-0: #d0a291;

    --shadow-soft: 0 14px 32px rgba(0, 0, 0, 0.35);
    --shadow-deep: 0 26px 70px rgba(0, 0, 0, 0.55);
    --glow-gold: 0 0 0 1px rgba(200, 162, 76, 0.35), 0 0 28px rgba(200, 162, 76, 0.25);

    font-family: var(--font-body);
    color: var(--ink-0);
    min-height: 540px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(140% 110% at 50% 5%, #263452 0%, var(--bg-1) 38%, var(--bg-0) 72%),
        linear-gradient(160deg, var(--bg-2) 0%, var(--bg-0) 100%);
}

.tarot-app-container[data-theme="noir"]::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 18% 25%, rgba(200, 162, 76, 0.2) 0%, rgba(200, 162, 76, 0) 45%),
        radial-gradient(circle at 82% 78%, rgba(108, 127, 161, 0.14) 0%, rgba(108, 127, 161, 0) 42%),
        radial-gradient(circle at 50% 100%, rgba(11, 16, 31, 0.76) 0%, rgba(11, 16, 31, 0) 52%);
}

.bg-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-layer-stars {
    opacity: 0.55;
    background-image:
        radial-gradient(1px 1px at 14% 18%, rgba(240, 215, 160, 0.65) 0%, rgba(240, 215, 160, 0) 100%),
        radial-gradient(1px 1px at 37% 52%, rgba(225, 226, 238, 0.6) 0%, rgba(225, 226, 238, 0) 100%),
        radial-gradient(1px 1px at 62% 24%, rgba(240, 215, 160, 0.55) 0%, rgba(240, 215, 160, 0) 100%),
        radial-gradient(1px 1px at 73% 67%, rgba(194, 210, 235, 0.45) 0%, rgba(194, 210, 235, 0) 100%),
        radial-gradient(1px 1px at 89% 33%, rgba(240, 215, 160, 0.58) 0%, rgba(240, 215, 160, 0) 100%),
        radial-gradient(1px 1px at 24% 78%, rgba(245, 227, 188, 0.4) 0%, rgba(245, 227, 188, 0) 100%);
    animation: driftStars 25s linear infinite;
}

.bg-layer-vignette {
    z-index: 1;
    background: radial-gradient(circle at center, rgba(5, 7, 13, 0) 33%, rgba(5, 7, 13, 0.42) 74%, rgba(2, 3, 7, 0.82) 100%);
}

.tarot-loading {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    color: var(--ink-1);
    font-family: var(--font-display);
    font-size: 1.18rem;
    letter-spacing: 0.08em;
}

.tarot-loading-small {
    text-align: center;
    color: var(--ink-1);
    font-size: 0.95rem;
    padding: 1rem 0;
}

.tarot-screen {
    position: relative;
    z-index: 2;
    width: min(560px, 100%);
    margin: 0 auto;
    padding: 2.2rem 1rem;
}

.fade-in {
    animation: emerge 0.7s var(--ease-ritual);
}

@keyframes emerge {
    from {
        opacity: 0;
        transform: translateY(14px);
        filter: blur(1px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes driftStars {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-14px);
    }
}

.tarot-header {
    text-align: center;
    margin-bottom: 2.3rem;
}

.tarot-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 5vw, 3.4rem);
    color: var(--ink-0);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(240, 215, 160, 0.24);
}

.tarot-subtitle {
    margin-top: 0.6rem;
    color: var(--ink-1);
    letter-spacing: 0.07em;
    font-size: 1.02rem;
}

.ritual-copy {
    margin-top: 1.1rem;
    color: var(--gold-1);
    opacity: 0.94;
    font-size: 1rem;
    letter-spacing: 0.05em;
    font-style: italic;
}

.tarot-form {
    background:
        linear-gradient(145deg, rgba(15, 24, 42, 0.86), rgba(8, 13, 25, 0.9));
    border: 1px solid rgba(200, 162, 76, 0.5);
    border-radius: 22px;
    padding: clamp(1.3rem, 4vw, 2.45rem);
    box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
    position: relative;
}

.tarot-form::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    pointer-events: none;
}

.form-section {
    margin-bottom: 1.7rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.65rem;
    color: var(--ink-0);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    letter-spacing: 0.03em;
}

.required {
    color: var(--gold-1);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    border-radius: 13px;
    border: 1px solid rgba(185, 162, 122, 0.45);
    background: rgba(7, 12, 22, 0.75);
    color: var(--ink-0);
    padding: 0.9rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s var(--ease-ritual), box-shadow 0.3s var(--ease-ritual), background-color 0.3s var(--ease-ritual);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(201, 193, 172, 0.66);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: rgba(240, 215, 160, 0.95);
    box-shadow: var(--glow-gold);
    background: rgba(12, 19, 34, 0.9);
}

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

.char-counter {
    margin-top: 0.45rem;
    text-align: right;
    color: var(--ink-2);
    font-size: 0.9rem;
}

.consent-label {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    color: var(--ink-1);
    line-height: 1.6;
    font-size: 0.95rem;
    cursor: pointer;
}

.consent-label input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    accent-color: var(--gold-0);
}

.spread-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-top: 0.6rem;
    align-items: stretch;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.spread-option {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(196, 168, 117, 0.44);
    background:
        linear-gradient(155deg, rgba(15, 23, 39, 0.92), rgba(10, 16, 29, 0.94));
    padding: 1.1rem;
    cursor: pointer;
    transition: transform 0.32s var(--ease-ritual), border-color 0.32s var(--ease-ritual), box-shadow 0.32s var(--ease-ritual);
}

.spread-option::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(130deg, rgba(240, 215, 160, 0.2), rgba(240, 215, 160, 0));
    transition: opacity 0.32s var(--ease-ritual);
}

.spread-option:hover,
.spread-option.selected {
    transform: translateY(-3px);
    border-color: rgba(240, 215, 160, 0.86);
    box-shadow: var(--glow-gold), var(--shadow-soft);
}

.spread-option:hover::before,
.spread-option.selected::before {
    opacity: 1;
}

.spread-option-header,
.spread-option p,
.spread-positions {
    position: relative;
    z-index: 1;
}

.spread-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}

.spread-option h3 {
    color: var(--ink-0);
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    min-height: 28px;
    padding: 0.2rem 0.75rem;
    font-size: 0.74rem;
    color: #2b1f0d;
    font-weight: 700;
    background: linear-gradient(130deg, var(--gold-0), var(--gold-1));
    letter-spacing: 0.08em;
}

.spread-option p {
    color: var(--ink-1);
    line-height: 1.55;
    margin-bottom: 0.85rem;
}

.spread-positions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.position-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 193, 172, 0.24);
    background: rgba(240, 229, 204, 0.08);
    color: var(--ink-1);
    font-size: 0.84rem;
}

.btn {
    font-family: var(--font-display);
    font-size: 1.02rem;
    letter-spacing: 0.08em;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    min-height: 48px;
    transition: transform 0.25s var(--ease-ritual), box-shadow 0.25s var(--ease-ritual), opacity 0.25s var(--ease-ritual);
}

.btn:focus-visible {
    outline: 2px solid rgba(240, 215, 160, 0.9);
    outline-offset: 2px;
}

.btn-primary,
.btn-accent {
    color: #2e220f;
    background: linear-gradient(135deg, var(--gold-0), var(--gold-1));
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.32), 0 0 18px rgba(200, 162, 76, 0.2);
}

.btn-primary:hover:not(:disabled),
.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.42), 0 0 24px rgba(200, 162, 76, 0.28);
}

.btn-secondary {
    color: #2e220f;
    background: linear-gradient(135deg, var(--gold-0), var(--gold-1));
    border: none;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.32), 0 0 18px rgba(200, 162, 76, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.42), 0 0 24px rgba(200, 162, 76, 0.28);
}

.btn-large {
    display: block;
    width: min(100%, 410px);
    margin: 0.4rem auto 0;
    padding: 0.9rem 1.7rem;
    font-size: 1.12rem;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-accent:disabled {
    opacity: 0.64;
    cursor: not-allowed;
}

.pulse {
    animation: pulseSeal 2.2s ease-in-out infinite;
}

@keyframes pulseSeal {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.tarot-focus {
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.focus-panel {
    width: min(520px, 100%);
    text-align: center;
    padding: 2.1rem 1.4rem 1.8rem;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(13, 21, 39, 0.88), rgba(8, 13, 24, 0.9));
    border: 1px solid rgba(200, 162, 76, 0.45);
    box-shadow: var(--shadow-deep);
}

.focus-orb {
    width: 90px;
    height: 90px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, rgba(251, 244, 222, 0.95) 0%, rgba(240, 215, 160, 0.6) 30%, rgba(240, 215, 160, 0.1) 70%, rgba(240, 215, 160, 0) 100%);
    box-shadow: 0 0 28px rgba(240, 215, 160, 0.33);
    animation: ritualBreathe 2.6s ease-in-out infinite;
}

.focus-panel h2 {
    font-family: var(--font-display);
    color: var(--ink-0);
    letter-spacing: 0.08em;
    font-size: clamp(1.65rem, 4.8vw, 2.15rem);
}

.focus-panel p {
    color: var(--ink-1);
    line-height: 1.8;
    margin-top: 0.8rem;
}

.focus-countdown {
    font-family: var(--font-display);
    font-size: 2.1rem;
    color: var(--gold-1);
    letter-spacing: 0.08em;
}

@keyframes ritualBreathe {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.88;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

.tarot-shuffle {
    min-height: 610px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shuffle-container {
    position: relative;
    width: min(700px, 100%);
    text-align: center;
    padding: 1rem;
}

.mystical-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(70vw, 460px);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(200, 162, 76, 0.45);
    box-shadow: inset 0 0 42px rgba(200, 162, 76, 0.08), 0 0 34px rgba(19, 29, 48, 0.6);
    opacity: 0.55;
    animation: rotateCircle 24s linear infinite;
}

.mystical-circle::before,
.mystical-circle::after {
    content: '';
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 1px dashed rgba(240, 215, 160, 0.22);
}

.mystical-circle::after {
    inset: 26%;
    border-style: solid;
    border-color: rgba(201, 193, 172, 0.22);
}

.mystical-circle.inner {
    width: min(56vw, 350px);
    opacity: 0.34;
    animation-duration: 33s;
    animation-direction: reverse;
}

@keyframes rotateCircle {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.shuffle-prompt,
.shuffle-animation {
    position: relative;
    z-index: 2;
}

.shuffle-prompt h2,
.shuffle-animation h2 {
    font-family: var(--font-display);
    color: var(--ink-0);
    font-size: clamp(1.8rem, 4.8vw, 2.4rem);
    margin-bottom: 0.8rem;
    letter-spacing: 0.09em;
}

.shuffle-prompt p,
.shuffle-text {
    color: var(--ink-1);
    font-style: italic;
    line-height: 1.75;
    margin-bottom: 1.8rem;
}

.card-stack {
    width: 192px;
    height: 280px;
    margin: 0 auto 1.8rem;
    position: relative;
}

.tarot-cut .card-stack::before,
.tarot-cut .card-stack::after {
    content: '';
    position: absolute;
    top: 8px;
    width: 45%;
    height: calc(100% - 16px);
    border: 1px solid rgba(240, 215, 160, 0.2);
    border-radius: 10px;
    opacity: 0.5;
}

.tarot-cut .card-stack::before {
    left: 0;
    transform: translateX(-6px);
}

.tarot-cut .card-stack::after {
    right: 0;
    transform: translateX(6px);
}

.card-back {
    position: absolute;
    inset: 0;
    border-radius: 13px;
    border: 1px solid rgba(225, 206, 164, 0.8);
    background:
        radial-gradient(circle at center, rgba(240, 215, 160, 0.12) 0%, rgba(240, 215, 160, 0.02) 60%),
        repeating-linear-gradient(45deg, rgba(200, 162, 76, 0.15) 0, rgba(200, 162, 76, 0.15) 2px, rgba(10, 15, 28, 0) 2px, rgba(10, 15, 28, 0) 8px),
        linear-gradient(145deg, #0b1629 0%, #091021 55%, #050a14 100%);
    box-shadow: var(--shadow-deep);
}

.card-stack .card-back:nth-child(2) {
    transform: translate(4px, 3px);
}

.card-stack .card-back:nth-child(3) {
    transform: translate(8px, 6px);
}

.card-back::before {
    content: '';
    position: absolute;
    inset: 20px;
    border: 1px solid rgba(240, 215, 160, 0.6);
    border-radius: 8px;
}

.card-back::after {
    content: 'ARCANA';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.28em;
    color: rgba(240, 215, 160, 0.78);
    text-shadow: 0 0 10px rgba(240, 215, 160, 0.22);
}

.card-stack.shuffling .card-back:nth-child(1) {
    animation: shuffle1 0.9s ease-in-out infinite;
}

.card-stack.shuffling .card-back:nth-child(2) {
    animation: shuffle2 0.9s ease-in-out infinite;
    animation-delay: 0.2s;
}

.card-stack.shuffling .card-back:nth-child(3) {
    animation: shuffle3 0.9s ease-in-out infinite;
    animation-delay: 0.4s;
}

@keyframes shuffle1 {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(-22px, -15px) rotate(-8deg);
    }
}

@keyframes shuffle2 {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(22px, -15px) rotate(8deg);
    }
}

@keyframes shuffle3 {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(0, -26px) rotate(4deg);
    }
}

.tarot-spread {
    text-align: center;
}

.spread-header {
    margin-bottom: 0.95rem;
}

.spread-header h2 {
    font-family: var(--font-display);
    color: var(--ink-0);
    letter-spacing: 0.09em;
    font-size: clamp(1.8rem, 4.9vw, 2.45rem);
    margin-bottom: 0.4rem;
}

.spread-header p {
    color: var(--ink-1);
}

.spread-note {
    margin-top: 0.25rem;
    font-style: italic;
}

.spread-board {
    display: grid;
    gap: 1rem;
    align-items: start;
    justify-items: center;
    grid-template-columns: 1fr;
}

.spread-board.count-1 {
    grid-template-columns: 1fr;
}

.spread-board.count-2 {
    grid-template-columns: 1fr;
}

.spread-board.count-3 {
    grid-template-columns: 1fr;
}

.spread-slot {
    width: min(320px, 100%);
}

.spread-position {
    margin-bottom: 0.55rem;
    min-height: 1.4em;
    color: var(--gold-1);
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.spread-card {
    position: relative;
    width: 100%;
    height: 520px;
    border: none;
    padding: 0;
    background: transparent;
}

.spread-card-back {
    cursor: pointer;
    border-radius: 14px;
    transition: transform 0.28s var(--ease-ritual), box-shadow 0.28s var(--ease-ritual);
}

.spread-card-back:focus-visible {
    outline: 2px solid rgba(240, 215, 160, 0.9);
    outline-offset: 3px;
}

.spread-card-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}

.spread-card-back .card-back {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    display: block;
}

.spread-card.revealed {
    animation: spreadReveal 0.62s var(--ease-ritual);
}

.spread-card.revealed .card-front {
    height: 100%;
}

.spread-actions {
    margin-top: 1.2rem;
}

@keyframes spreadReveal {
    from {
        transform: translateY(10px) scale(0.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.tarot-draw {
    text-align: center;
}

.draw-progress {
    width: min(560px, 100%);
    margin: 0 auto 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 999px;
    padding: 0.7rem 1.25rem;
    border: 1px solid rgba(201, 193, 172, 0.34);
    background: rgba(9, 14, 26, 0.64);
    color: var(--ink-1);
    font-size: 1.05rem;
    font-family: var(--font-heading);
}

.position-label {
    color: var(--gold-1);
    letter-spacing: 0.08em;
}

.card-reveal {
    margin: 2.4rem auto;
    display: flex;
    justify-content: center;
}

.card-flip-container {
    width: 280px;
    height: 420px;
    perspective: 1200px;
}

.flip-animation {
    animation: revealCard 1s var(--ease-ritual);
}

@keyframes revealCard {
    from {
        opacity: 0;
        transform: rotateY(120deg) scale(0.92);
        filter: saturate(0.8);
    }
    to {
        opacity: 1;
        transform: rotateY(0deg) scale(1);
        filter: saturate(1);
    }
}

.card-front {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    background:
        linear-gradient(180deg, rgba(255, 252, 244, 0.98) 0%, var(--paper-0) 42%, var(--paper-1) 100%);
    border: 2px solid #b99238;
    color: #26203d;
    padding: 1.1rem 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 244, 211, 0.5) inset;
}

.card-front::before {
    content: none;
    position: absolute;
    inset: 13px;
    border: 0;
    border-radius: 10px;
}

.card-front::after {
    content: none;
    position: absolute;
    left: 20px;
    right: 20px;
    top: 22%;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(126, 96, 35, 0.6), rgba(0, 0, 0, 0));
}

.card-front.reversed {
    transform: rotate(180deg);
}

.card-art {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 345px;
    border: 0;
    border-radius: 9px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(240, 230, 207, 0.82) 0%, rgba(214, 192, 152, 0.9) 100%);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.card-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: rgba(247, 240, 223, 0.92);
}

.card-art-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a3a1f;
    font-family: var(--font-display);
    font-size: 1.4rem;
    text-align: center;
    padding: 1rem;
}

.card-title-band {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-top: 0.7rem;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(247, 239, 222, 0.95) 0%, rgba(235, 221, 191, 0.96) 100%);
    padding: 0.45rem 0.6rem 0.55rem;
    text-align: center;
}

.card-number {
    position: absolute;
    top: 0.75rem;
    left: 0.85rem;
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 700;
    color: #4b3b1f;
    background: rgba(244, 235, 212, 0.92);
    border-radius: 999px;
    min-width: 2rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    line-height: 1;
}

.card-name {
    font-family: var(--font-display);
    color: #2a2150;
    line-height: 1.1;
    text-align: center;
}

.card-title-band .card-name {
    font-size: 1.5rem;
    letter-spacing: 0.04em;
}

.card-name-en {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: #5a4d33;
    text-transform: uppercase;
}

.card-orientation-badge {
    margin-top: auto;
    border-radius: 999px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 1rem;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: #4a3619;
    background: linear-gradient(135deg, #ead3a0, #d8ba7b);
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.result-header h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-0);
}

.spread-name {
    margin-top: 0.35rem;
    color: var(--ink-1);
    font-style: italic;
    font-size: 1.15rem;
}

.interpretation-section {
    position: relative;
    background:
        linear-gradient(180deg, rgba(251, 244, 227, 0.98) 0%, rgba(235, 221, 194, 0.96) 100%);
    color: #302636;
    border-radius: 20px;
    border: 1px solid #bd9547;
    padding: clamp(1.2rem, 4vw, 2.25rem);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
    margin-bottom: 2.1rem;
    overflow: hidden;
}

.interpretation-section::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(125, 91, 34, 0.36);
    border-radius: 14px;
    pointer-events: none;
}

.section-title {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #2d1e3d;
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 4vw, 2.3rem);
    margin-bottom: 1.5rem;
    letter-spacing: 0.07em;
}

.interpretation-content {
    position: relative;
    z-index: 1;
    color: #2f3046;
    line-height: 1.85;
    font-size: 1.04rem;
}

.markdown-content h3 {
    margin: 1.5rem 0 0.8rem;
    color: #2b2042;
    font-family: var(--font-display);
    font-size: 1.62rem;
    letter-spacing: 0.05em;
}

.markdown-content h4 {
    margin: 1.1rem 0 0.7rem;
    color: #4a3556;
    font-family: var(--font-heading);
    font-size: 1.28rem;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0.8rem 0 1rem 1.35rem;
}

.markdown-content li {
    margin-bottom: 0.6rem;
}

.markdown-content strong {
    color: #2b1f45;
}

.note {
    text-align: center;
    color: #57485c;
    margin-top: 0.8rem;
    line-height: 1.8;
}

.result-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.result-card {
    background: linear-gradient(180deg, rgba(250, 245, 233, 0.96) 0%, rgba(233, 222, 200, 0.95) 100%);
    color: #312f4c;
    border-radius: 16px;
    border: 1px solid rgba(122, 98, 46, 0.45);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
    padding: 1rem;
}

.result-card-visual {
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: center;
}

.result-card-visual.reversed .card-art-small {
    transform: rotate(180deg);
}

.card-art-small {
    width: 170px;
    height: 248px;
    border-radius: 8px;
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.card-position {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: #8f6e2f;
}

.card-orientation {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    min-height: 32px;
    padding: 0.2rem 0.8rem;
    font-size: 0.83rem;
    font-weight: 600;
}

.card-orientation.upright {
    background: rgba(212, 171, 90, 0.24);
    color: #6f4f18;
}

.card-orientation.reversed {
    background: rgba(100, 85, 130, 0.2);
    color: #493965;
}

.result-card .card-name {
    font-size: 1.7rem;
    margin: 0.3rem 0 0.65rem;
    color: #2f2451;
}

.card-meaning {
    color: #424163;
    line-height: 1.66;
}

.card-details {
    margin-top: 0.8rem;
}

.card-details summary {
    cursor: pointer;
    user-select: none;
    color: #99722d;
    font-weight: 600;
    list-style: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.card-details summary::-webkit-details-marker {
    display: none;
}

.card-details summary::before {
    content: '▸';
    margin-right: 0.4rem;
    transition: transform 0.24s var(--ease-ritual);
}

.card-details[open] summary::before {
    transform: rotate(90deg);
}

.card-details-content {
    margin-top: 0.8rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(143, 110, 47, 0.3);
    color: #434262;
    line-height: 1.72;
}

.card-details-content p {
    margin-bottom: 0.85rem;
}

.trends-section {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(143, 110, 47, 0.24);
}

.trends-section h4 {
    font-family: var(--font-heading);
    margin-bottom: 0.7rem;
    color: #4d3e62;
}

.trends-list {
    list-style: none;
}

.trends-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(143, 110, 47, 0.2);
}

.trends-list li:last-child {
    border-bottom: none;
}

.trend-meta {
    display: block;
    margin-top: 0.22rem;
    color: #736e85;
    font-size: 0.85rem;
}

.result-actions {
    margin-top: 1.8rem;
    display: flex;
    justify-content: center;
    gap: 0.9rem;
}

@media (max-width: 1024px) {
    .spread-board.count-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .tarot-screen {
        padding: 2rem 1rem;
    }

    .tarot-title {
        letter-spacing: 0.12em;
    }

    .tarot-form {
        border-radius: 18px;
        padding: 1.2rem;
    }

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

    .spread-options {
        grid-template-columns: 1fr;
    }

    .card-stack {
        width: 160px;
        height: 235px;
    }

    .focus-panel {
        padding: 1.6rem 1rem 1.3rem;
    }

    .focus-orb {
        width: 74px;
        height: 74px;
    }

    .spread-slot {
        width: min(250px, 100%);
    }

    .spread-card {
        height: 440px;
    }

    .card-flip-container {
        width: 230px;
        height: 345px;
    }

    .card-art {
        height: 300px;
    }

    .card-title-band .card-name {
        font-size: 1.25rem;
    }

    .card-art-small {
        width: 150px;
        height: 220px;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn,
    .btn-large {
        min-height: 46px;
    }
}

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

    .bg-layer-stars,
    .mystical-circle,
    .mystical-circle.inner,
    .focus-orb,
    .pulse,
    .spread-card.revealed,
    .card-stack.shuffling .card-back:nth-child(1),
    .card-stack.shuffling .card-back:nth-child(2),
    .card-stack.shuffling .card-back:nth-child(3) {
        animation: none !important;
    }
}
