/* ────────────────────────────────────────────────
   1. BASE / GLOBAL STYLES
───────────────────────────────────────────────── */

:root {
    /* Base font size (1rem = 16px by default in most browsers) */
    --font-size-root: 16px;
    --font-size-base: 1rem;
    --font-size-small: 0.875rem;     /* ≈14px */
    --font-size-smaller: 0.75rem;     /* ≈12px */
    --font-size-large: 1.25rem;       /* ≈20px */
    --font-size-xlarge: 1.5rem;       /* ≈24px */
    --font-size-xxlarge: 2rem;        /* ≈32px */
    
    /* Line height scale */
    --line-height-body: 1.5;
    --line-height-heading: 1.2;
}

html {
    font-size: var(--font-size-root);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: radial-gradient(circle,rgba(238, 174, 202, 1) 0%, rgba(148, 187, 233, 1) 100%);
    background: linear-gradient(45deg, #638DCD 0%, #602EAB 100%);
    color: white;
    font-family: Poppins, "Times New Roman", serif;
    text-align: center;
    /* background-image: url("images/bg-bear.jpg"); */
    background-position: right;
    background-repeat: no-repeat;
    background-size: cover;
    height: 100%;
    overflow: hidden;
;
    
}

h1, h2, h3, h4, h5, h6 {
    line-height: var(--line-height-heading);
    margin: 0.8em 0 0.4em;
}

h1 { font-size: var(--font-size-xxlarge); }
h2 { font-size: var(--font-size-xlarge); }
h3 { font-size: var(--font-size-large); }

/* ────────────────────────────────────────────────
   2. FORM ELEMENTS & BUTTONS
───────────────────────────────────────────────── */

input {
    padding: 8px 12px;
    box-sizing: border-box;
    margin-bottom: 20px;
}

input:focus {
    outline: none !important;
}

label{
    outline: none !important;
}

#userQuestion::placeholder {
    color: #FFFFFF;
    opacity: 1;
}

.form-control{
    border-radius: 8px !important;
}

button,
.btn {
    padding: 10px 24px;
    color: #FFF;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.5s ease;
    outline: none !important;
}

button:hover,
.btn:hover:not(.disabled):not(:disabled) {

}

.btn.disabled,
.btn:disabled,
fieldset:disabled .btn {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary{
    background: linear-gradient(135deg, rgba(0, 211, 243, 1), rgba(43, 127, 255, 1), rgba(190, 109, 255, 1)) !important;
    
}

.btn-secondary{
    background: #ffffff25;
    border: 1px solid #ffffff35;
    color: #ffffffc8;
    font-weight: 400;
    outline: none !important;
}

.btn-secondary:hover{
    background: #ffffff4c;
    border: 1px solid #ffffff56;
    color: #FFF;
}

.btn-spread, .btn-spread:active {
    font-weight: bold; 
    font-size: 20px; 
    border-radius: 12px !important; 
    box-shadow: 0 1px 8px #2c2c2c3d; 
    display: flex;
    padding: 20px 16px;
    width: 100%;
    transition: 0.3s ease;
    outline: none !important;
}

.btn-spread.selected, .btn-check:checked{
    background: linear-gradient(135deg, #7c3aed7a, #3b83f68e) !important;
    color: white !important;
    border-color: #caf4ff52 !important;
}

.btn-spread:focus,
.btn-spread:focus-visible {
    outline: none !important;
}

.btn-success{
    background: linear-gradient(135deg, rgba(0, 211, 243, 1), rgba(43, 127, 255, 1), rgba(173, 70, 255, 1)) !important;
    color: white !important;
    box-shadow: 0 1px 8px #2c2c2c3d; 
}

.btn-warning{
    background: linear-gradient(135deg, rgba(0, 211, 243, 1), rgba(43, 127, 255, 1), rgba(173, 70, 255, 1)) !important;
    color: white !important;
    box-shadow: 0 1px 8px #2c2c2c3d; 
}

.btn-check:active+.btn-secondary, .btn-check:checked+.btn-secondary, .btn-secondary.active, .btn-secondary:active, .show>.btn-secondary.dropdown-toggle, {
    background: linear-gradient(135deg, rgba(0, 211, 243, 1), rgba(43, 127, 255, 1), rgba(173, 70, 255, 1)) !important;
    color: white !important;
    box-shadow: 0 1px 8px #2c2c2c3d;
    border: 1px solid #ffffff56;
    outline: none !important;
}

.text-warning{
    color:#c69aff !important;
}

.spread-icon{
    width: 48px;
    height: auto;
}

.form-control-lg{
    padding: 1rem;
}

#spreadTitle{
    font-weight: 200;
    font-size: 32px;
    color: #FFFFFF !important;
}

.suggested-label{
    border-radius: 50px;
    background: #ffffff1c;
    font-weight: 400;
    opacity: .7;
    font-size: 12px;
}

.suggested-label:hover{
    color: white;
    opacity: 1;
}

/* ────────────────────────────────────────────────
   3. LAYOUT CONTAINERS
───────────────────────────────────────────────── */
#intro.container{
    max-width: 700px;

}


#spread {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

#controls {
    margin: 24px 0;
    text-align: center;
}

/* ────────────────────────────────────────────────
   4. CARD STYLES — COMMON
───────────────────────────────────────────────── */

.card-facedown,
.deck-fanned img.card-facedown {
    width: 140px;                   /* base mobile size */
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    box-shadow: 2px 2px 16px rgba(130, 130, 130, 0.35);
    transition: all 0.25s ease;
    cursor: pointer;
    user-select: none;
    display: block;
    margin: 30px;
}

.card-facedown:hover,
.deck-fanned img.card-facedown:hover {
    transform: scale(1.06) translateY(-12px);
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.5);
    z-index: 10;
}

/* Selected state (used in multiple places) */
.card-facedown.selected,
.deck-facedown.selected {
    transform: scale(1.08) translateY(-12px) !important;
    border: 3px solid gold;
    box-shadow: 0 0 24px rgba(255, 215, 0, 0.7);
    z-index: 15;
}

.card-glass{
    background-color: #ffffff25;
    border: 1px solid #ffffff25;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 20px #3c3c3c3d;
    backdrop-filter: blur(2px);
}

.card-remarks{
    font-size: 12px;
    background-color: #ffffff1c;
    padding: 4px 8px;
    border-radius: 50px;
}

/* ────────────────────────────────────────────────
   5. DECK — FAN LAYOUT (horizontal scroll)
───────────────────────────────────────────────── */

.deck-fanned {
    position: relative;
    width: 100%;
    height: 290px;                  /* card height + breathing room */
    margin: 32px 0;
    padding: 20px 20px 60px 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.deck-fanned img.card-facedown {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;                   /* smaller = more fan overlap */
    transform-origin: bottom center;
}

/* ────────────────────────────────────────────────
   6. DECK — GRID LAYOUT (#deck)
───────────────────────────────────────────────── */

#deck {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    max-height: 65vh;
    overflow-y: auto;
    padding: 16px;
    border-radius: 10px;
    margin: 0 auto;
    max-width: 1400px;
    width: 100% !important;
}

/* Slightly larger cards in grid view when there's space */
@media (min-width: 600px) {
    #deck .card-facedown {
        width: 100%;
        max-width: 125px;
    }
}

/* ────────────────────────────────────────────────
   7. SPREAD / INDIVIDUAL CARDS
───────────────────────────────────────────────── */

.spread-card img,
#spread img {
    max-width: 180px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 0 16px rgba(0,0,0,0.3);
}

.logo-ai{
    width: 110px;
    height: auto;
    background: linear-gradient(
        120deg,
        rgba(139, 193, 255, 0.5) 0%,
        rgba(255, 174, 216, 0.556) 35%,
        rgba(193, 154, 247, 0.5) 70%

    );
    /* border: 1px solid #ffffff2e; */
    border-radius: 80px;
    padding: 12px;
    box-shadow: 0 4px 12px #db59ff36;
    animation: floating 4s ease-in-out infinite;
}

@keyframes floating{
    0%{
        transform: translateY(8px);
        rotate: 0deg;
    }
    25%{
        transform: translateY(4px);
        rotate: 5deg;
    }
    50%{
        transform: translateY(0px);
        rotate: 0deg;
    }
    75%{
        transform: translateY(4px);
        rotate: -5deg;
    }
    100%{
        transform: translateY(8px);
        rotate: 0deg;
    }
}

@keyframes floating{
    0%{
        transform: translateY(8px);
        rotate: 0deg;
    }
    25%{
        transform: translateY(4px);
        rotate: 5deg;
    }
    50%{
        transform: translateY(0px);
        rotate: 0deg;
    }
    75%{
        transform: translateY(4px);
        rotate: -5deg;
    }
    100%{
        transform: translateY(8px);
        rotate: 0deg;
    }
}

.bg-floating{
    z-index: -99;
    animation: bg-floating 5s ease-in-out infinite;
}

@keyframes bg-floating{
    0%{
        transform: translateY(8px);
        rotate: 0deg;
        opacity: 0.1;
    }
    25%{
        transform: translateY(4px);
        rotate: 5deg;
    }
    50%{
        transform: translateY(0px);
        rotate: 0deg;
        opacity: 0.8;
    }
    75%{
        transform: translateY(4px);
        rotate: -5deg;
    }
    100%{
        transform: translateY(8px);
        rotate: 0deg;
        opacity: 0.1;
    }
}

.bg-stardust{
    position: absolute;
    height: 100%;
    overflow: hidden;
    top: 0;
    left: 56%;
    transform: translateX(-50%);
    z-index: -99;
    /*animation: bg-floating 7s ease-in-out infinite;*/
}

.bg-stardust2{
    position: absolute;
    height: 100%;
    overflow: hidden;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: -99;
    opacity: .6;
    /*animation: bg-floating 7s ease-in-out infinite;*/
    animation-delay: 5s;
}

.remarks{
    font-size: 0.75rem;
    font-weight: 300;
    opacity: .7;
}
