/* ========================================
   CSS Variables & Global Reset (Performance Focus)
   ======================================== */

:root {
    /* Color Palette - Thematic choices */
    --color-primary: #4a235a; /* Deep Purple/Mystic Tone */
    --color-primary-complementary1: #335a23;
    --color-primary-complementary2: #E67E22;
    --color-primary-analogous: #5a234f;
    --color-secondary: #f7e8c9; /* Parchment/Light Accent */
    --color-dark: #1d0b26;    /* Near Black for contrast */
    --color-text: #ececec;   /* Light text on dark background */


    /* Spacing and Sizing */
    --spacing-unit: 1rem;
    --border-radius: 8px;
}

*,
::before,
::after {
    box-sizing: border-box; /* Essential for predictable layout sizing */
    margin: 0;
    padding: 0;
}

/* ========================================
   Base & Typography (Minimal Footprint)
   ======================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* System font stack for zero load time dependency */
    background-color: var(--color-dark);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* Allows header and main to stack */
}

/* ========================================
   Header (Site Branding)
   ======================================== */

.site-header {
    text-align: center;
    padding: var(--spacing-unit);
    background-color: rgba(0, 0, 0, 0.2); /* Subtle background for separation */
}

.site-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem); /* Responsive font sizing using clamp() */
    letter-spacing: 4px;
    color: var(--color-secondary);
    text-shadow: 0 0 8px rgba(74, 35, 90, 0.6); /* Subtle glow effect for theme */
}

/* ========================================
   Main Application Container (Centering Logic)
   ======================================== */

.app-container {
    flex-grow: 1; /* Ensures the container takes up remaining vertical space */
    display: grid;
    place-items: center; /* Perfect centering of content block */
    padding: var(--spacing-unit);
}


/* ========================================
   Oracle Display (Image & Text Wrapper)
   ======================================== */

.oracle-display {
    text-align: center;
    max-width: 90vw; /* Responsive width limit */
    margin-bottom: calc(var(--spacing-unit) * 2);
}

#fortuneTellerImage {
    /* Image styling for the fortune teller portrait */
    display: block;
    width: 100%;
    max-height: 50vh; /* Limit height on large screens to keep layout balanced */
    object-fit: cover; /* Ensures image covers area without distortion */
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(74, 35, 90, 0.8); /* Dramatic shadow effect */
    transition: transform 0.6s ease-in-out; /* Smooth transition for image changes (JS driven) */
}

/* State change class applied by JS when a fortune is revealed */
#fortuneTellerImage.is-active {
    transform: scale(1.02);
}


.fortune-text {
    margin-top: var(--spacing-unit);
    font-size: clamp(1rem, 3vw, 1.5rem); /* Responsive text size */
    padding: calc(var(--spacing-unit) * 1.5);
    background-color: rgba(247, 232, 201, 0.1); /* Subtle background for the fortune box */
    border: 1px solid var(--color-secondary);
    border-radius: var(--border-radius);
}

/* ========================================
   Button Styling (Action Element)
   ======================================== */

.btn {
    font-family: inherit; /* Inherit system font for speed */
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

/* Primary Button Style (The main action button) */
.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 3);
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    box-shadow: 0 4px 15px rgba(74, 35, 90, 0.6); /* Strong shadow for presence */
}

/* Hover state optimization (minimal change) */
.btn--primary:hover {
    background-color: #6a387e; /* Slightly lighter shade on hover */
    transform: translateY(-2px); /* Subtle lift effect */
}

.btn--primary:active {
    transform: translateY(0);
}


/* ========================================
   Media Queries (Responsiveness)
   ======================================== */

@media screen and (max-width: 600px) {
    body {
        padding: 1rem; /* Ensure padding on small screens doesn't cause overflow issues */
    }
    .oracle-display {
        margin-bottom: calc(var(--spacing-unit) * 1);
    }

    #fortuneTellerImage {
        max-height: 40vh; /* Smaller image viewports for mobile */
    }
}
