:root {
    --color-bg-dark: #051105;
    --color-panel-bg: #0b2010;
    
    /* Gold Palette */
    --gold-100: #FBF5C4;
    --gold-300: #E6C873;
    --gold-500: #CFA642;
    --gold-700: #9E8436;
    --gold-900: #705B24;

    --font-heading: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-dark);
    color: white;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    /* Richer background texture */
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(20, 45, 25, 0.8) 0%, rgba(2, 8, 2, 0.95) 80%),
        url("assets/background.png");
    background-size: cover;
    background-attachment: fixed;
    padding-bottom: 50px;
}

.page-wrapper {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 25px;
    z-index: 1;
}

/* --- Golden Frames (Ads & Containers) --- */
.ad-space, .grid-col, .generate-all-btn, .gen-header {
    /* The metallic border effect */
    border: 1px solid var(--gold-700);
    box-shadow: 
        0 0 0 1px #000, /* sharp inner black line */
        0 0 0 2px var(--gold-900), /* outer dark gold */
        0 5px 15px rgba(0,0,0,0.7); /* drop shadow */
    position: relative;
}

/* Hide inline ads on desktop/tablet */
.inline-ad {
    display: none !important;
}

/* Hide sticky ad on desktop/tablet */
.sticky-ad {
    display: none !important;
}

.ad-space {
    background: radial-gradient(ellipse at center, #16381b 0%, #0a1b0b 100%);
    color: #aebfad;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    /* Inset shadow for depth */
    box-shadow: 
        inset 0 0 30px rgba(0,0,0,0.9),
        0 0 0 1px var(--gold-700),
        0 0 0 3px #081409; 
}

/* Add that "inner glowing frame" look */
.ad-space::before {
    content: '';
    position: absolute;
    top: 6px; bottom: 6px; left: 6px; right: 6px;
    border: 1px solid rgba(230, 200, 115, 0.3);
    pointer-events: none;
}

.top-ad { width: 728px; height: 90px; }
.bottom-ad { width: 970px; height: 250px; }
.side-ad {
    width: 300px;
    height: 600px;
    text-align: center;
    line-height: 1.5;
}

/* --- Layout --- */
.content-row {
    display: flex;
    gap: 25px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.main-content {
    flex: 1;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Typography & Header --- */
.gen-header {
    width: 100%;
    margin-bottom: 25px;
    border: none;
    box-shadow: none;
    background: transparent;
}

.gen-header h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    /* Metallic Gold Text Gradient */
    background: linear-gradient(180deg, var(--gold-100) 20%, var(--gold-500) 50%, var(--gold-700) 80%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,0.8));
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.sub-header {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.95rem;
    color: #dcdcdc;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    text-shadow: 0 2px 4px black;
}

.sub-header .dot { color: var(--gold-500); }

/* --- Generate All Button --- */
.generate-all-btn {
    display: block;
    margin: 0 auto 35px;
    /* Deep green glossy button */
    background: linear-gradient(180deg, #2b4f30 0%, #152918 50%, #0e1c10 100%);
    border: 1px solid var(--gold-500);
    color: #e8f5e9;
    font-family: var(--font-body);
    font-weight: 800;
    text-transform: uppercase;
    padding: 14px 80px;
    font-size: 1.1rem;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.2), /* top highlight */
        0 0 0 1px #000, /* tight black outline */
        0 0 0 3px var(--gold-900), /* gold ring */
        0 5px 10px rgba(0,0,0,0.6);
    text-shadow: 0 2px 2px rgba(0,0,0,0.8);
    transition: transform 0.1s, filter 0.1s;
}

.generate-all-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}
.generate-all-btn:active { transform: translateY(1px); box-shadow: none; }


/* --- Grid System --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
}

.grid-col {
    background: linear-gradient(180deg, #0d2210 0%, #030a04 100%);
    /* Distinct Gold Border */
    border: 2px solid var(--gold-700);
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.8), /* inner depth */
        0 0 0 1px #000, /* black separator */
        0 4px 8px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
}

.col-header {
    border-bottom: 2px solid var(--gold-700);
    padding: 10px;
    text-align: center;
    font-family: var(--font-body);
    font-weight: 800;
    color: var(--gold-100);
    font-size: 0.95rem;
    background: linear-gradient(180deg, rgba(20,40,20,0.9) 0%, rgba(10,20,10,0.9) 100%);
    text-transform: capitalize;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 2px black;
}

.col-body {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 240px; /* Fixed height for uniformity */
}

.display-number {
    font-family: var(--font-body);
    font-size: 3rem;
    font-weight: 700;
    /* Bright Gold Number */
    background: linear-gradient(180deg, #fffcdc 0%, #ffde75 40%, #cfa642 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,0.8));
    margin: auto 0;
    letter-spacing: -1px;
}

/* --- Inner Buttons --- */
.generate-btn {
    width: 100%;
    /* Bright Gold Gradient */
    background: linear-gradient(180deg, #fcdb74 0%, #e0b643 50%, #b08d28 51%, #8f701a 100%);
    border: 1px solid #705612;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.4),
        0 2px 5px rgba(0,0,0,0.5);
    color: #2b1d00;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 8px 0;
    cursor: pointer;
    border-radius: 2px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
    margin-bottom: 8px;
}

.generate-btn:hover {
    filter: brightness(1.1);
}

.copy-btn {
    width: 60%; /* Smaller copy button like in image */
    background: linear-gradient(180deg, #18331b 0%, #0e1f10 100%);
    border: 1px solid var(--gold-700);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    color: #e0e0e0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 0;
    cursor: pointer;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}



/* --- Responsive Media Queries --- */

/* Hide side ads on smaller screens (below 1350px) */
@media (max-width: 1350px) {
    .side-ad {
        display: none;
    }
    .content-row {
        gap: 0;
    }
}

/* Tablet Layout */
@media (max-width: 1024px) {
    .page-wrapper {
        padding: 15px;
    }
    
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .top-ad, .bottom-ad {
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 20px;
    }
    
    /* Ensure main content shrinks */
    .main-content {
        max-width: 100%;
        width: 100%;
    }
}

/* Mobile Layout */
@media (max-width: 600px) {
    .page-wrapper {
        padding: 10px;
    }

    .grid-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    /* Make the columns very compact */
    .col-header {
        font-size: 0.65rem;
        padding: 4px 2px;
        letter-spacing: 0;
    }

    .col-body {
        padding: 8px 4px;
        height: auto; /* Let it shrink to fit content */
        min-height: 120px;
        gap: 5px;
    }

    .display-number {
        font-size: 1.4rem;
        margin: 5px 0;
    }

    .generate-btn {
        font-size: 0.6rem;
        padding: 6px 0;
        margin-bottom: 4px;
    }

    .copy-btn {
        width: 100%; /* Full width in the restrictive column */
        font-size: 0.55rem;
        padding: 4px 0;
    }

    /* Adjust header for mobile */
    .gen-header {
        margin-bottom: 15px;
    }

    .gen-header h1 {
        font-size: 1.2rem;
        line-height: 1.2;
    }

    .sub-header {
        font-size: 0.75rem;
        gap: 8px;
    }

    .generate-all-btn {
        width: 100%;
        padding: 10px 0;
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    /* Mobile Ad Sizes */
    .top-ad {
        width: 320px;
        height: 50px;
    }

    .side-ad {
        width: 300px;
        height: 250px;
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .bottom-ad {
        width: 100%;
        height: auto;
        margin-top: 20px;
        display: none; /* Hide bottom ad on mobile, use sticky instead */
    }

    /* Inline Ads for Mobile */
    .inline-ad {
        display: flex !important;
        width: 300px;
        height: 250px;
        align-items: center;
        justify-content: center;
        text-align: center;
        margin: 20px auto;
        font-size: 1rem;
        font-weight: 700;
    }

    .inline-ad-1 {
        /* Post-Interaction Ad */
    }

    .inline-ad-2 {
        /* Scroll-Required Ad */
    }

    /* Sticky Mobile Ad */
    .sticky-ad {
        display: none; /* Hidden by default, shown on mobile */
    }
}

/* Show sticky ad only on mobile */
@media (max-width: 600px) {
    .sticky-ad {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 50px;
        margin: 0;
        border-radius: 0;
        border: 1px solid var(--gold-700);
        border-bottom: none;
        border-left: none;
        border-right: none;
        box-shadow: 
            0 -2px 10px rgba(0,0,0,0.8),
            0 0 0 1px #000;
        background: linear-gradient(180deg, #0d2210 0%, #030a04 100%);
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        font-size: 0.9rem;
        color: #dcdcdc;
        z-index: 1000;
    }

    .sticky-ad-close {
        background: transparent;
        border: none;
        color: var(--gold-500);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 5px 10px;
        transition: color 0.2s;
    }

    .sticky-ad-close:hover {
        color: var(--gold-100);
    }

    .sticky-ad.hidden {
        display: none !important;
    }

    /* Adjust page wrapper to account for sticky ad */
    body.sticky-ad-active {
        padding-bottom: 50px;
    }
}

/* --- Legal Pages Styling --- */
.legal-content {
    width: 100%;
    background: linear-gradient(180deg, #0d2210 0%, #030a04 100%);
    border: 2px solid var(--gold-700);
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.8),
        0 0 0 1px #000,
        0 4px 8px rgba(0,0,0,0.6);
    padding: 30px;
    color: #dcdcdc;
    line-height: 1.8;
}

.legal-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(207, 166, 66, 0.3);
}

.legal-section:last-child {
    border-bottom: none;
}

.legal-section h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    background: linear-gradient(180deg, var(--gold-100) 20%, var(--gold-500) 50%, var(--gold-700) 80%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 0 rgba(0,0,0,0.8));
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.legal-section p {
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.legal-section ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.legal-section li {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.contact-info p {
    font-size: 1.1rem;
    color: var(--gold-300);
}

/* --- Footer Styling --- */
.legal-footer {
    width: 100%;
    background: linear-gradient(180deg, #0a1b10 0%, #040a05 100%);
    border: 2px solid var(--gold-700);
    box-shadow: 
        0 0 0 1px #000,
        0 -4px 8px rgba(0,0,0,0.6);
    padding: 20px;
    text-align: center;
    margin-top: 30px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.footer-link {
    color: var(--gold-300);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s, text-shadow 0.2s;
    font-family: var(--font-body);
}

.footer-link:hover {
    color: var(--gold-100);
    text-shadow: 0 0 10px rgba(251, 245, 196, 0.4);
}

.footer-link.active {
    color: var(--gold-100);
    text-shadow: 0 0 10px rgba(251, 245, 196, 0.4);
}

.footer-separator {
    color: var(--gold-700);
    font-weight: 300;
}

.footer-text {
    color: #999;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* --- Footer Responsive --- */
@media (max-width: 600px) {
    .legal-content {
        padding: 15px;
        font-size: 0.9rem;
    }

    .legal-section {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    .legal-section h2 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .legal-section p {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    .legal-footer {
        padding: 15px 10px;
        margin-top: 20px;
    }

    .footer-links {
        gap: 5px;
        font-size: 0.7rem;
    }

    .footer-link {
        font-size: 0.7rem;
    }

    .footer-separator {
        margin: 0 2px;
    }

    .footer-text {
        font-size: 0.65rem;
        margin-top: 10px;
    }
}
