:root {
    --primary: #FF8C00;
    --primary-dark: #E67E00;
    --primary-gradient: linear-gradient(135deg, #FF8C00 0%, #E67E00 100%);
    --text-on-primary: #1A0E00;
    --text-on-primary-dark: #ffffff;

    --background: #1a1a1a;
    --background-card: rgba(26, 26, 26, 0.6);
    --text-on-background: #fff;
    --text-on-background-secondary: #eeee;
}

body {
    opacity: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--background);
    color: var(--text-on-background);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.loaded {
    opacity: 1;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

main {
    flex: 1;
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 3rem;
    position: relative;
    z-index: 1;
}

footer {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 0.9rem 0 0.25rem;
    border-top: 1px solid rgba(138,43,226,0.12);
}

footer p {
    margin: 0;
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-on-background-secondary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

#page-content {
    width: 100%;
}

#loader-container[hidden] {
    display: none;
}

#loader-container {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    pointer-events: all; /* prevent interaction with the page underneath */
}

/* centered square panel that uses theme background */
#loader-container #loader {
    width: min(300px, 30vmin);
    height: min(300px, 30vmin);
    background-color: var(--background);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    position: relative;
    padding: 1rem;
}

/* spinner ring rendered via pseudo-element so the panel stays square */
#loader-container #loader::before {
    content: '';
    width: 120px;
    height: 120px;
    border: 12px solid rgba(255, 140, 0, 0.18);
    border-top: 12px solid var(--primary);
    border-radius: 50%;
    animation: spin 1.6s linear infinite;
    box-sizing: border-box;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
        font-size: 15px;
    }

    main,
    footer {
        width: calc(100% - 1rem);
    }

    main {
        padding: 1.5rem 0 2rem;
    }

    footer {
        padding-top: 0.75rem;
    }

    #loader-container #loader {
        width: min(220px, 48vmin);
        height: min(220px, 48vmin);
    }

    #loader-container #loader::before {
        width: 84px;
        height: 84px;
        border-width: 10px;
    }
}

@media (max-width: 480px) {
    main {
        width: calc(100% - 0.75rem);
        padding: 1.25rem 0 1.75rem;
    }

    footer {
        width: calc(100% - 0.75rem);
    }
}
