:root {
    --primary: rgb(76, 61, 49);
    --secondary: #e0c48f;
    --accent-gold: #ffb744;
    --mystic-purple: #989785;
}

body {
    overflow-x: hidden;
    font-family: 'Cabin', sans-serif;
}

h1, .h1, h2, .h2 {
    font-family: 'Cinzel', serif;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
}

.logo {
    max-height: 70px;
}

.bg-primary {
    --bs-bg-opacity: 1;
    background-color: rgb(92, 43, 120) !important;
}

.text-gradient {
    background: linear-gradient(45deg, var(--secondary), var(--accent-gold), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(2px 2px 5px rgb(0, 0, 0));
}

.text-gold {
    color: var(--secondary);
}

.btn-primary {
    background: linear-gradient(45deg, var(--mystic-purple), var(--accent-gold));
    border: 1px solid var(--secondary);
    color: #000;
    transition: all 0.3s ease;
    --bs-btn-active-bg: var(--accent-gold);
    --bs-btn-active-border-color: var(--secondary);
    font-size: 1.3rem;
}

.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    background: linear-gradient(45deg, var(--mystic-purple), var(--accent-gold));
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--accent-gold);
    color: #000;
    border-color: var(--secondary);
}

.text-danger {
    --bs-text-opacity: 1;
    color: rgb(255, 66, 66) !important;
}

.navbar-porteur {
    max-height: 120px;
}

.mystic-overlay {
    background: radial-gradient(circle at center, transparent 20%, rgba(97, 81, 68, 0.8) 100%);
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    background: #e2c389;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.8);
        box-shadow: 0 0 0 transparent;
    }
    50% {
        opacity: 1;
        transform: scale(1.4);
        box-shadow: 0 0 10px var(--secondary), 0 0 4px white;
    }
}

.porteur-bg {
    position: fixed;
    top: 0;
    left: -100px;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
    overflow: hidden;
}

.porteur-img {
    height: 110vh;
    width: auto;
    max-width: none;
    opacity: 0.5;
    mask-image: linear-gradient(to bottom, black 40%, transparent 95%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 95%);
    filter: drop-shadow(0 0 20px rgba(155, 107, 158, 0.3));
    transform: translateY(-5%);
}

.counter-circle {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(224, 196, 143, 0.3);
    font-weight: bold;
    margin: -60px auto 10px;
}

#deck-container {
    height: 210px;
    margin-bottom: 4.5rem !important;
}

#slots-container {
    display: grid;
    grid-template-columns: repeat(3, 130px);
    grid-template-rows: repeat(3, 245px);
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin-top: 2rem;
}

.slot {
    width: 120px;
    height: 211px;
    border: 2px solid var(--mystic-purple);
    border-radius: 10px 10px 0 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
    background: #000;
}

.slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/card-back.webp');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    border-radius: 6px 6px 0 0;
}

.slot-label {
    position: absolute;
    bottom: -23px;
    left: -2px;
    width: calc(100% + 4px);
    background-color: var(--mystic-purple);
    color: var(--primary);
    padding: 4px 0;
    border-radius: 0 0 8px 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 1;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    font-weight: bold;
    text-align: center;
}

.tarot-card {
    width: 100px;
    height: 175px;
    background-image: url('../img/card-back.webp');
    background-size: cover;
    background-position: center;
    border: 2px solid var(--secondary);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform-origin: 50% 250%;
    user-select: none;
    margin-left: -50px;
}

#slots-container .card-label {
    display: none;
}

#slots-container .slot:nth-child(1) {
    grid-area: 2 / 1 / 3 / 2;
}

#slots-container .slot:nth-child(2) {
    grid-area: 2 / 3 / 3 / 4;
}

#slots-container .slot:nth-child(3) {
    grid-area: 3 / 2 / 4 / 3;
}

#slots-container .slot:nth-child(4) {
    grid-area: 1 / 2 / 2 / 3;
}

#slots-container .slot:nth-child(5) {
    grid-area: 2 / 2 / 3 / 3;
    z-index: 5;
}

#slots-container .tarot-card {
    position: absolute !important;
    margin: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100%;
    height: 100%;
    transform: none !important;
    z-index: 2;
}

.card-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--secondary);
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    width: 150%;
    text-align: center;
    pointer-events: none;
}

.tarot-card:hover {
    box-shadow: 0 0 20px var(--secondary);
}

.tarot-card.selected {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    border-color: var(--mystic-purple);
    box-shadow: 0 0 15px var(--mystic-purple);
    animation: revealCard 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

@keyframes revealCard {
    0% {
        opacity: 0;
        transform: scale(0.6) rotateY(90deg);
        filter: brightness(2);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
        filter: brightness(1);
    }
}

.border-secondary {
    --bs-border-opacity: 1;
    border-color: var(--mystic-purple) !important;
}

.form-check-input:checked {
    background-color: var(--mystic-purple) !important;
    border-color: var(--mystic-purple) !important;
}

#infoIcon {
    cursor: pointer;
    position: relative;
    z-index: 999;
    pointer-events: auto;
}

.popover {
    width: 175px;
    font-size: .7rem;
    z-index: 9999;
    color: #000;
}

.popover.show {
    z-index: 9999;
}

#legal h1, #legal .h1 {
    font-size: 1.9rem;
    background: linear-gradient(45deg, var(--secondary), var(--accent-gold), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(2px 2px 5px rgb(0, 0, 0));
    text-transform: uppercase;
    font-weight: 700 !important;
}

@media (max-width: 991px) {
    .game-area {
        display: flex;
        flex-direction: column;
    }

    #slots-container {
        order: 1;
        margin-top: 10px !important;
        margin-bottom: 20px;
    }

    #reveal-btn {
        order: 2;
        margin-top: 0 !important;
        padding-bottom: 20px;
    }

    #slots-container {
        min-height: 120px;
        margin-top: 30px;
    }

    #infoIcon {
        top: 2px;
    }

    .tarot-card {
        width: 60px;
        height: 105px;
        margin-left: -30px;
    }

    .slot {
        width: 90px;
        height: 158px;
    }

    #deck-container {
        height: 135px !important;
    }

    #slots-container {
        gap: 4px !important;
        flex-wrap: nowrap !important;
    }

    .porteur-bg {
        top: -40px;
        left: -50px;
    }

    .porteur-img {
        height: 80vh;
        opacity: 0.4;
        transform: translateY(0);
    }

    #deck-container {
        margin-bottom: 2.2rem !important;
    }

    .logo {
        max-height: 50px;
    }

    h1, .h1 {
        font-size: 1.6rem;
    }

    .tarot-card {
        transform-origin: 50% 220%;
    }

    .counter-circle {
        width: 60px;
        height: 60px;
        margin: -40px auto 10px;
    }

    .fs-4 {
        font-size: 1.1rem !important;
    }

    #slots-container {
        display: grid;
        grid-template-columns: repeat(3, 95px);
        grid-template-rows: repeat(3, 180px);
        margin-bottom: 10px !important;
    }

    .slot-label {
        bottom: -18px;
        left: -2px;
        font-size: 0.7rem;
    }

    #legal h1, #legal .h1 {
        font-size: 1.4rem;
    }
}


