/* =====================================================
   MAGHΣLP TAROT ONLINE
   ===================================================== */

:root {
    --bg: #070707;
    --bg-soft: #101010;
    --panel: #121212;
    --panel-2: #181818;

    --text: #f3eee3;
    --muted: #aaa294;

    --gold: #c7a45a;
    --gold-light: #e3c77e;
    --gold-dark: #725827;

    --border: rgba(199, 164, 90, 0.28);
    --border-soft: rgba(255, 255, 255, 0.07);

    --danger: #d27373;

    --radius: 20px;
}


/* =====================================================
   BASE
   ===================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(
            circle at top,
            #19130a 0,
            #090909 34%,
            #050505 72%
        );

    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}


/* =====================================================
   APP
   ===================================================== */

.app {
    width: 100%;
    max-width: 720px;

    margin: 0 auto;

    padding:
        max(18px, env(safe-area-inset-top))
        18px
        max(30px, env(safe-area-inset-bottom));
}


/* =====================================================
   HEADER
   ===================================================== */

.app-header {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 24px;
}

.brand-symbol {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    border: 1px solid var(--border);
    border-radius: 50%;

    color: var(--gold-light);

    font-family: Georgia, serif;
    font-size: 27px;

    background:
        radial-gradient(
            circle,
            rgba(199, 164, 90, 0.12),
            rgba(0, 0, 0, 0.5)
        );
}

.brand-name {
    color: var(--gold-light);

    font-family: Georgia, serif;
    font-size: 20px;
    letter-spacing: 2px;
}

.brand-subtitle {
    margin-top: 2px;

    color: var(--muted);

    font-size: 13px;
    letter-spacing: 0.6px;
}


/* =====================================================
   SCREENS
   ===================================================== */

.screen {
    display: none;
}

.screen.active {
    display: block;

    animation:
        screenFade 0.3s ease;
}

@keyframes screenFade {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =====================================================
   INTRO
   ===================================================== */

.hero {
    text-align: center;
}

.hero-card-wrap {
    width: 138px;

    margin:
        6px auto
        24px;

    padding: 5px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: rgba(199, 164, 90, 0.04);
}

.hero-card {
    width: 100%;

    border-radius: 10px;
}

h1,
h2 {
    margin-top: 0;

    font-family: Georgia, serif;
    font-weight: 400;
}

h1 {
    margin-bottom: 12px;

    color: var(--gold-light);

    font-size: 29px;
}

h2 {
    margin-bottom: 9px;

    color: var(--gold-light);

    font-size: 26px;
}

.lead,
.section-heading p {
    color: var(--muted);

    line-height: 1.55;
}

.reading-structure {
    margin:
        26px 0
        18px;

    overflow: hidden;

    border: 1px solid var(--border-soft);
    border-radius: var(--radius);

    background: rgba(255, 255, 255, 0.025);
}

.structure-row {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 15px 17px;

    text-align: left;

    border-bottom: 1px solid var(--border-soft);
}

.structure-row:last-child {
    border-bottom: none;
}

.roman {
    width: 27px;

    color: var(--gold);

    font-family: Georgia, serif;
    font-size: 16px;
}

.age-notice {
    margin-bottom: 22px;

    color: var(--muted);

    font-size: 14px;
}


/* =====================================================
   SECTIONS
   ===================================================== */

.section-heading {
    margin-bottom: 24px;
}

.eyebrow {
    display: inline-block;

    margin-bottom: 8px;

    color: var(--gold);

    font-size: 12px;
    letter-spacing: 1.4px;
}


/* =====================================================
   FORM
   ===================================================== */

.form-group {
    margin-bottom: 19px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    color: var(--gold-light);

    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;

    padding: 13px 14px;

    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 14px;

    outline: none;

    background: var(--panel);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--gold);
}

.form-group textarea {
    resize: vertical;

    min-height: 110px;
}

.date-input-wrap {
    width: 100%;

    padding: 0;

    border-radius: 14px;
}

.date-input-wrap input {
    min-width: 0;
}

.form-group small {
    display: block;

    margin-top: 7px;

    color: var(--muted);

    font-size: 12px;
}

.error-message {
    min-height: 21px;

    margin:
        3px 0
        13px;

    color: var(--danger);

    font-size: 14px;
}


/* =====================================================
   BUTTONS
   ===================================================== */

.primary-button,
.secondary-button {
    width: 100%;

    min-height: 50px;

    margin-top: 10px;

    padding: 12px 18px;

    border-radius: 14px;
}

.primary-button {
    color: #0a0804;

    border: 1px solid var(--gold-light);

    background:
        linear-gradient(
            135deg,
            #ae8840,
            #e0c176,
            #a57a32
        );

    font-weight: 600;
}

.primary-button:active {
    transform: translateY(1px);
}

.secondary-button {
    color: var(--gold-light);

    border: 1px solid var(--border);

    background: transparent;
}

.hidden {
    display: none !important;
}


/* =====================================================
   QUESTION PREVIEW
   ===================================================== */

.question-preview {
    margin-bottom: 18px;

    padding: 15px 16px;

    border-left: 2px solid var(--gold);
    border-radius: 0 14px 14px 0;

    background: rgba(199, 164, 90, 0.05);
}

.question-preview-label {
    display: block;

    margin-bottom: 5px;

    color: var(--muted);

    font-size: 12px;
}

.question-preview strong {
    line-height: 1.45;
}


/* =====================================================
   SELECTION
   ===================================================== */

.selection-status {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 16px;

    color: var(--muted);
}

.selection-status strong {
    color: var(--gold-light);
}


/* =====================================================
   FULL 78-CARD TAROT SPREAD
   ===================================================== */

.deck-grid {
    position: relative;

    display: flex;
    align-items: flex-end;

    width: 100%;

    padding:
        28px
        12px
        30px;

    margin-bottom: 20px;

    overflow-x: auto;
    overflow-y: visible;

    scroll-behavior: smooth;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
    scrollbar-color:
        rgba(199, 164, 90, 0.35)
        transparent;
}


.deck-grid::-webkit-scrollbar {
    height: 5px;
}


.deck-grid::-webkit-scrollbar-track {
    background: transparent;
}


.deck-grid::-webkit-scrollbar-thumb {
    border-radius: 10px;

    background:
        rgba(
            199,
            164,
            90,
            0.35
        );
}


/* Individual hidden card */

.deck-card {
    position: relative;

    flex:
        0
        0
        78px;

    width: 78px;

    padding: 0;

    margin-left: -57px;

    overflow: visible;

    border:
        1px solid
        rgba(
            199,
            164,
            90,
            0.25
        );

    border-radius: 7px;

    background: #080808;

    box-shadow:
        0 4px 12px
        rgba(
            0,
            0,
            0,
            0.38
        );

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;

    touch-action: manipulation;
}


/* First card should not overlap empty space */

.deck-card:first-child {
    margin-left: 0;
}


/* Make every following card sit above
   the previous one */

.deck-card:nth-child(1)  { z-index: 1; }
.deck-card:nth-child(2)  { z-index: 2; }
.deck-card:nth-child(3)  { z-index: 3; }
.deck-card:nth-child(4)  { z-index: 4; }
.deck-card:nth-child(5)  { z-index: 5; }
.deck-card:nth-child(6)  { z-index: 6; }
.deck-card:nth-child(7)  { z-index: 7; }
.deck-card:nth-child(8)  { z-index: 8; }
.deck-card:nth-child(9)  { z-index: 9; }
.deck-card:nth-child(10) { z-index: 10; }


.deck-card img {
    display: block;

    width: 100%;

    aspect-ratio: 500 / 861;

    object-fit: cover;

    border-radius: 6px;

    pointer-events: none;

    user-select: none;
}


/* Desktop hover */

@media (hover: hover) {

    .deck-card:hover {
        z-index: 200;

        transform:
            translateY(-18px)
            scale(1.04);

        border-color:
            var(--gold-light);

        box-shadow:
            0 12px 24px
            rgba(
                0,
                0,
                0,
                0.65
            );
    }
}


/* Selected card */

.deck-card.selected {
    z-index: 500 !important;

    transform:
        translateY(-22px)
        scale(1.06);

    border-color:
        var(--gold-light);

    box-shadow:
        0 0 0 2px
        rgba(
            227,
            199,
            126,
            0.18
        ),
        0 14px 26px
        rgba(
            0,
            0,
            0,
            0.7
        );
}


/* Selection number */

.selection-number {
    position: absolute;

    top: 5px;
    right: 5px;

    width: 25px;
    height: 25px;

    display: none;
    align-items: center;
    justify-content: center;

    z-index: 600;

    border-radius: 50%;

    color: #090704;

    background:
        var(--gold-light);

    box-shadow:
        0 2px 8px
        rgba(
            0,
            0,
            0,
            0.45
        );

    font-size: 12px;
    font-weight: 700;
}


.deck-card.selected
.selection-number {
    display: flex;
}


/* =====================================================
   RESULT
   ===================================================== */

.person-summary {
    margin-bottom: 24px;

    padding: 15px 16px;

    border: 1px solid var(--border-soft);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.025);
}

.person-summary strong,
.person-summary span {
    display: block;
}

.person-summary strong {
    margin-bottom: 6px;

    color: var(--gold-light);
}

.person-summary span {
    color: var(--muted);

    line-height: 1.4;
}

.result-cards {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;

    margin-bottom: 25px;
}

.result-card {
    min-width: 0;
}

.result-card-image {
    perspective: 1000px;
}

.card-flip {
    position: relative;

    width: 100%;

    aspect-ratio: 500 / 861;

    transform-style: preserve-3d;

    transition:
        transform 0.8s
        cubic-bezier(
            0.2,
            0.8,
            0.2,
            1
        );
}

.card-flip.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;

    inset: 0;

    backface-visibility: hidden;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: #080808;
}

.card-face img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.card-front {
    transform: rotateY(180deg);
}

.result-position {
    margin-top: 10px;

    color: var(--gold);

    font-family: Georgia, serif;
    font-size: 12px;
}

.result-card-name {
    margin-top: 4px;

    color: var(--text);

    font-size: 13px;
    line-height: 1.3;
}


/* =====================================================
   INTERPRETATION PLACEHOLDER
   ===================================================== */

.coming-next {
    display: flex;
    gap: 13px;

    margin-bottom: 20px;

    padding: 17px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background:
        rgba(
            199,
            164,
            90,
            0.055
        );
}

.coming-next-symbol {
    color: var(--gold-light);

    font-size: 20px;
}

.coming-next strong {
    display: block;

    margin-bottom: 5px;

    color: var(--gold-light);
}

.coming-next p {
    margin: 0;

    color: var(--muted);

    line-height: 1.45;
}


/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 430px) {

    .app {
        padding-left: 14px;
        padding-right: 14px;
    }

    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 23px;
    }

    .deck-grid {
        gap: 7px;
    }

    .result-cards {
        gap: 7px;
    }

    .result-card-name {
        font-size: 11px;
    }
}