:root {
    --gold: #d4af37;
    --dark-bg: #0a0a0c;
}

body {
    /* Background fix: Image kategi nahi aur sides se dissolve hogi */
    background-color: #0a0510;
    background-image: url('TarotReader.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed;
    
    color: white;
    font-family: 'Cinzel', serif;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    text-align: center;
}

/* Dissolve effect overlay taaki sides black mein ghul jayein */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(to right, #050505 0%, transparent 20%, transparent 80%, #0a0510 100%);
    pointer-events: none;
    z-index: 1;
}

#instructions {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 280px;
    padding: 15px;
    background: rgba(10, 10, 15, 0.8); /* Dark mystical translucent background */
    border-left: 3px solid var(--gold); /* Side mein gold line */
    border-radius: 5px;
    font-size: 0.9rem;
    color: #e0e0e0;
    text-align: left;
    z-index: 100; /* Taaki cards ke niche na dab jaye */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px); /* Premium glass effect */
}

#app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.glow-text {
    text-shadow: 0 0 15px var(--gold);
    color: var(--gold);
    letter-spacing: 3px;
    margin-bottom: 5px;
}

#selection-area {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    left: auto; 
    bottom: auto;
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin: 20px 0;
    z-index: 5;
}

.slot {
    width: 80px;
    height: 130px;
    border: 1.5px solid var(--gold);
    background: rgba(212, 175, 55, 0.1); /* Halka gold tint */
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

#deck-container {
    position: absolute;
    bottom: 0px; 
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100px;
    z-index: 10;
    pointer-events: none;
}

/* Card Style */
.card {
    position: absolute;
    width: 65px;
    height: 110px;
    left: 50%;
    margin-left: -32.5px;
    cursor: pointer;
    z-index: 10;
    transform-style: preserve-3d;
    transition: all 0.5s ease-out;
    transform-origin: center center; 
    pointer-events: auto;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.card-face img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}

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

.card.is-flipped {
    transform: rotateY(180deg);
}

/* Modal Layering */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Sabse upar */
}

.modal.hidden { display: none; }

.modal-content {
    background: #111;
    padding: 25px;
    border: 2px solid var(--gold);
    max-width: 90%;
    width: 450px;
    border-radius: 12px;
}

/* AI Reading Text Area */
#ai-response-text {
    color: #f0f0f0;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: justify; 
    max-height: 250px; /* Isse zyada bada hua toh scrollbar aa jayega */
    overflow-y: auto;  /* Scrolling enabled */
    padding: 10px 5px;
    margin-top: 10px;
    white-space: pre-line; /* Paragraphs aur line breaks ko respect karega */
}

/* Scrollbar ko thoda gold look dene ke liye (Optional par cool hai) */
#ai-response-text::-webkit-scrollbar {
    width: 4px;
}

#ai-response-text::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}

.gold-line { border: 0; border-top: 1px solid var(--gold); margin: 15px 0; }
.close-btn { float: right; cursor: pointer; font-size: 24px; color: var(--gold); }
