/* Tarot Oracle App - Main Styles with CSS Variables */

:root {
    --primary-color: #ff0033;
    --bg-dark: #181018;
    --bg-card: #222;
    --bg-container: #111;
    --bg-collapsible: #1a101a;
    --bg-hover: #2a102a;
    --border-color: #333;
    --text-light: #fff;
    --text-gray: #ccc;
    --font-mono: 'Courier New', monospace;
    --shadow-dark: 0 0 24px #000;
    --shadow-text: 0 0 12px #000;
    --shadow-inset: 0 0 32px #000 inset;
    --shadow-small: 0 0 8px #000;
    --shadow-medium: 0 0 18px #000;
    --card-width: 190px;
    --card-height: 400px;
    --card-min-width: 140px;
    --card-max-width: 200px;
    --card-min-height: 360px;
    --card-max-height: 440px;
    --transition-card: transform 0.5s cubic-bezier(.68,-0.55,.27,1.55), opacity 0.3s;
    --transition-flip: transform 0.6s cubic-bezier(.68,-0.55,.27,1.55);
    --transition-collapsible: max-height 0.6s cubic-bezier(.68,-0.55,.27,1.55), opacity 0.5s;
}

/* Base Styles */
body {
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-mono);
    margin: 0;
    padding: 0;
}

#tarot-app-root {
    max-width: 900px;
    margin: 48px auto 0 auto;
    padding: 0 12px;
}

/* Tarot Components */
.tarot-heading {
    font-size: 2.2em;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 18px;
    font-family: var(--font-mono);

    /* the reflective gold (owner ruling 2026-08-24): a slow-sheening
       metallic gradient clipped into the letterforms */
    background: linear-gradient(100deg, #9a7b2f 0%, #ffd700 30%, #fff3b0 45%, #ffd700 60%, #9a7b2f 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 22px rgba(255, 215, 0, 0.35);
    animation: tarotGoldSheen 7s ease-in-out infinite alternate;
}

@keyframes tarotGoldSheen {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

.tarot-spread-container {
    display: flex;
    justify-content: center;
    gap: 32px;
    background: var(--bg-container);
    padding: 24px 12px;
    border-radius: 12px;
    box-shadow: var(--shadow-inset);
    border: 1px dashed var(--primary-color);
}

.tarot-card {
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    box-shadow: var(--shadow-dark);
    min-width: var(--card-min-width);
    max-width: var(--card-max-width);
    width: var(--card-width);
    min-height: var(--card-min-height);
    max-height: var(--card-max-height);
    height: var(--card-height);
    padding: 18px 16px;
    color: var(--text-light);
    font-family: var(--font-mono);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    transition: var(--transition-card);
    cursor: pointer;
    perspective: 1000px;
}

.tarot-card.upsidedown {
    transform: rotate(180deg);
    opacity: 0.7;
}

.tarot-card.flipping {
    transition: var(--transition-flip);
    transform: rotateY(180deg);
}

.tarot-card.flipped {
    transform: rotateY(0deg);
}

.tarot-card.upsidedown-animate {
    transition: var(--transition-card);
    transform: rotate(180deg);
    opacity: 0.7;
}

.tarot-footer {
    margin-top: 18px;
    text-align: center;
    color: var(--primary-color);
    font-size: 1.1em;
    font-family: var(--font-mono);
    opacity: 0.8;
}

.tarot-draw-details {
    background: var(--bg-dark);
    padding: 12px 10px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    color: var(--text-light);
    font-size: 1em;
    margin-bottom: 12px;
    box-shadow: var(--shadow-small);
}

/* Collapsible Components */
.tarot-collapsible-box {
    background: var(--bg-collapsible);
    border: 2px solid var(--primary-color);
    margin: 0 auto 18px auto;
    box-shadow: var(--shadow-medium);
    border-radius: 10px;
    transition: var(--transition-collapsible);
    overflow: hidden;
    opacity: 0;
    padding-left: 10px;
    padding-right: 10px;
    
}

.tarot-collapsible-box[style*="opacity: 1"] {
    opacity: 1;
    max-height: 1200px;
}

.tarot-collapse-btn {
    background: var(--bg-dark);
    color: var(--primary-color);
    border: 1px  var(--primary-color);
    border-radius: 7px;
    cursor: pointer;
    font-size: 1.1em;
    display: block;
    transition: background 0.2s;
    box-shadow: var(--shadow-small);
    letter-spacing: 1px;
}

.tarot-collapse-btn:hover {
    background: var(--bg-hover);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    table-layout: fixed;
    font-size: 0.86em;
}

th {
    border-bottom: 1px solid var(--primary-color);
    padding: 4px 8px;
    text-align: left;
    word-break: break-word;
    font-size: 0.91em;
}

td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--border-color);
    word-break: break-word;
    max-width: 180px;
    overflow-wrap: break-word;
    font-size: 0.86em;
}

/* Animation Effects */
.smoke-reveal {
    position: relative;
    overflow: hidden;
}

.smoke-reveal-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    background: radial-gradient(circle at 50% 50%, rgba(255,0,51,0.18) 0%, rgba(24,16,24,0.98) 80%);
    animation: smokeRevealAnim 2.2s cubic-bezier(.68,-0.55,.27,1.55) forwards;
    animation-play-state: paused;
}

@keyframes smokeRevealAnim {
    0% { opacity: 1; }
    80% { opacity: 0.7; }
    100% { opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tarot-spread-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .tarot-card {
        width: min(var(--card-width), 90vw);
    }
    
    #tarot-app-root {
        padding: 0 8px;
        margin-top: 24px;
    }
    
    .tarot-heading {
        font-size: 1.8em;
    }
}