:root {
    color-scheme: dark;
    --bg: #030303;
    --panel: rgba(12, 12, 12, 0.78);
    --panel-strong: rgba(9, 9, 9, 0.9);
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.32);
    --text: #f6f2eb;
    --muted: rgba(246, 242, 235, 0.72);
    --accent: #d8c7a3;
    --shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Cormorant Garamond", serif;
    overflow-x: hidden;
}

#background {
    position: fixed;
    inset: 0;
    background-image: url("../assets/images/bg-desktop.png");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    transform: scale(1.05);
}

#background::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 34%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.82));
}

.page-shadow {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.7));
    pointer-events: none;
    z-index: 1;
}

.navbar {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem 0;
}

.logo {
    width: min(16rem, 58vw);
    height: auto;
    filter: drop-shadow(0 0 1rem rgba(0, 0, 0, 0.45));
}

.arcana-shell {
    position: relative;
    z-index: 3;
    min-height: calc(100vh - 7rem);
    display: grid;
    place-items: center;
    padding: 2rem 1rem 3rem;
}

.arcana-panel {
    width: min(100%, 52rem);
    border: .0625rem solid var(--line);
    background: linear-gradient(180deg, rgba(16, 16, 16, 0.84), rgba(8, 8, 8, 0.94));
    backdrop-filter: blur(1.2rem);
    box-shadow: var(--shadow);
    padding: clamp(1.35rem, 3vw, 2.4rem);
}

.eyebrow {
    color: var(--accent);
    letter-spacing: .18em;
    text-transform: uppercase;
    font-size: .82rem;
    margin-bottom: .8rem;
}

h1 {
    font-size: clamp(2.6rem, 6vw, 4.8rem);
    line-height: 0.95;
    margin-bottom: 1.1rem;
}

.arcana-app {
    display: grid;
    gap: 1.5rem;
}

.state-block,
.question-card,
.result-card {
    display: grid;
    gap: 1.2rem;
}

.lead,
.locked-copy,
.result-description,
.question-copy {
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1.5;
}

.progress {
    display: grid;
    gap: .65rem;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: .92rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.progress-track {
    width: 100%;
    height: .5rem;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-track > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, rgba(216, 199, 163, 0.55), rgba(255, 255, 255, 0.92));
    transition: width .35s ease;
}

.question-number {
    color: var(--accent);
    font-size: .95rem;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.question-title {
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1;
}

.options-form {
    display: grid;
    gap: 1rem;
}

.options-grid {
    display: grid;
    gap: .85rem;
}

.option-card {
    position: relative;
    display: grid;
    gap: .3rem;
    padding: 1rem 1rem 1rem 3.25rem;
    border: .0625rem solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.option-card:hover,
.option-card:focus-within {
    transform: translateY(-.0625rem);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.06);
}

.option-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 50%;
    width: 1.15rem;
    height: 1.15rem;
    border: .0625rem solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    transform: translateY(-50%);
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.option-card:has(input:checked) {
    border-color: rgba(216, 199, 163, 0.7);
    background: rgba(216, 199, 163, 0.08);
}

.option-card:has(input:checked)::before {
    border-color: rgba(216, 199, 163, 0.92);
    background: rgba(216, 199, 163, 0.92);
    box-shadow: 0 0 1rem rgba(216, 199, 163, 0.28);
}

.option-key {
    color: var(--accent);
    font-size: .88rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.option-label {
    font-size: 1.22rem;
    line-height: 1.35;
}

.actions,
.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .9rem;
}

.action-button,
.ghost-button,
.home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
    padding: .9rem 1.3rem;
    border: .0625rem solid var(--line-strong);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
    text-decoration: none;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.action-button:hover,
.action-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible,
.home-link:hover,
.home-link:focus-visible {
    transform: translateY(-.125rem);
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.64);
}

.action-button:disabled {
    opacity: .35;
    cursor: not-allowed;
    transform: none;
}

.ghost-button,
.home-link {
    background: transparent;
}

.action-button:focus-visible,
.ghost-button:focus-visible,
.home-link:focus-visible,
.reveal-button:focus-visible {
    outline: .125rem solid rgba(255, 255, 255, 0.68);
    outline-offset: .2rem;
}

.result-layout {
    display: grid;
    gap: 1.4rem;
    justify-items: center;
}

.reveal-button {
    width: min(100%, 22rem);
    border: 0;
    background: transparent;
    cursor: pointer;
    perspective: 1200px;
}

.tarot-card {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 941 / 1672;
    transform-style: preserve-3d;
    transition: transform .95s cubic-bezier(.22, .8, .24, 1);
}

.reveal-button.is-revealed .tarot-card {
    transform: rotateY(180deg);
}

.tarot-face {
    display: block;
    position: absolute;
    inset: 0;
    border: .0625rem solid rgba(255, 255, 255, 0.16);
    overflow: hidden;
    backface-visibility: hidden;
    box-shadow: 0 1.4rem 3rem rgba(0, 0, 0, 0.38);
}

.tarot-face img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tarot-face--front {
    transform: rotateY(180deg);
}

.reveal-hint {
    text-align: center;
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.45;
    margin-bottom: -.35rem;
}

.arcana-name {
    text-align: center;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1;
}

.result-description {
    max-width: 36rem;
    text-align: center;
    opacity: 0;
    transform: translateY(.6rem);
    transition: opacity .45s ease .2s, transform .45s ease .2s;
}

.result-description.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.loading-state {
    color: var(--muted);
    font-size: 1.1rem;
}

@media (max-width: 43.75rem) {
    #background {
        background-image: url("../assets/images/bg-mobile.png");
    }

    .arcana-shell {
        min-height: auto;
        padding-top: 1.4rem;
    }

    .arcana-panel {
        padding: 1.2rem;
    }

    .question-title,
    .arcana-name {
        line-height: 1.05;
    }

    .option-card {
        padding: .95rem .95rem .95rem 3rem;
    }

    .option-label,
    .lead,
    .locked-copy,
    .result-description,
    .question-copy,
    .reveal-hint {
        font-size: 1.03rem;
    }

    .actions,
    .result-actions {
        display: grid;
    }

    .action-button,
    .ghost-button,
    .home-link {
        width: 100%;
    }
}