/* 
======================
ROLL WITH ADVANTAGE - ENHANCED STYLESHEET
======================
*/

/* 
======================
VARIABLES
======================
*/
:root {
    /* Brand Colors */
    --divine-light-white: #efe6f6;
    --primary-blue: #0B2AA9;
    --primary-blue-light: #3C50C7;
    --primary-blue-dark: #091D82;
    --primary-red: #C30A3D;
    --primary-red-light: #D6335C;
    --primary-red-dark: #A30831;
    --primary-purple: #7F0EBD;
    --primary-purple-light: #9B3DD7;
    --primary-purple-dark: #6B0AA1;
    
    /* Additional colors */
    --text-dark: #333333;
    --text-light: #FFFFFF;
    --background-dark: #111111;
    --background-light: #F5F5F5;
    --border-color: #DDDDDD;
    
    /* Fantasy theme colors */
    --parchment: #F4E9C9;
    --aged-parchment: #E8D7A9;
    --leather-brown: #8B4513;
    --gold: #FFD700;
    --silver: #C0C0C0;
    
    /* Font families */
    --font-body: 'EB Garamond', serif;
    --font-headers: 'Cinzel', serif;
    --font-titles: 'Uncial Antiqua', cursive;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;
    
    /* Container width */
    --container-width: 1200px;
    
    /* Border radius */
    --border-radius: 8px;
    
    /* Transitions */
    --transition-speed: 0.3s;
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.2);
    --shadow-magical: 0 0 15px rgba(127, 14, 189, 0.5);
    --shadow-blue: 0 0 20px rgba(11, 42, 169, 0.5);
    --shadow-purple: 0 0 20px rgba(127, 14, 189, 0.5);
    --shadow-red: 0 0 20px rgba(195, 10, 61, 0.5);
    
    /* Magical gradients */
    --gradient-blue: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    --gradient-purple: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
    --gradient-red: linear-gradient(135deg, var(--primary-red), var(--primary-red-dark));
    --gradient-rainbow: linear-gradient(90deg, var(--primary-red), var(--primary-purple), var(--primary-blue));
    --gradient-magic: linear-gradient(135deg, 
        var(--primary-blue-dark), 
        var(--primary-purple), 
        var(--primary-red-dark),
        var(--primary-purple), 
        var(--primary-blue-dark));
    
    /* Z-index layers */
    --z-background: -10;
    --z-normal: 1;
    --z-overlay: 10;
    --z-dropdown: 50;
    --z-fixed: 100;
    --z-modal: 1000;
    
    /* Tool card variables for tilt effect */
    --card-tilt-amount: 10deg;
    --card-scale-amount: 1.05;
    --card-translate-amount: -10px;
    --card-rotate-x: 0deg;
    --card-rotate-y: 0deg;
    --card-rotate-z: 0deg;
    --card-perspective: 1000px;
    --card-transition-speed: 400ms;
}

/* 
======================
SCROLLBAR STYLING
======================
*/
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--background-dark);
}
 
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-blue), var(--primary-purple));
    border-radius: 6px;
    border: 3px solid var(--background-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-blue-light), var(--primary-purple-light));
}

/* 
======================
SELECTION STYLING 
======================
*/
::selection {
    background: var(--primary-purple);
    color: var(--divine-light-white);
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* 
======================
PRELOADER
======================
*/
.loading {
    overflow: hidden;
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: var(--z-modal);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.dice-loader {
    width: 100px;
    height: 100px;
    position: relative;
    perspective: 1000px;
    animation: float 2s ease-in-out infinite alternate;
}

.dice {
    width: 100%;
    height: 100%;
    animation: spin 3s linear infinite;
}

.dice-outline {
    fill: none;
    stroke: var(--divine-light-white);
    stroke-width: 2;
    stroke-dasharray: 350;
    stroke-dashoffset: 350;
    animation: drawDice 3s ease infinite alternate;
}

.dice-number {
    fill: var(--divine-light-white);
    opacity: 0;
    animation: fadeNumber 3s ease infinite alternate;
}

@keyframes drawDice {
    0% {
        stroke-dashoffset: 350;
    }
    70% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes fadeNumber {
    0%, 50% {
        opacity: 0;
    }
    80%, 100% {
        opacity: 1;
    }
}

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

.loading-text {
    margin-top: 20px;
    color: var(--divine-light-white);
    font-family: var(--font-headers);
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeIn 2s ease-in-out infinite alternate;
}

@keyframes fadeIn {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* 
======================
PARTICLES CONTAINER
======================
*/
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    pointer-events: none;
    opacity: 0.5;
}

/* 
======================
GENERAL STYLES
======================
*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
    overflow-x: hidden;
    position: relative;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    position: relative;
    z-index: var(--z-normal);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 
======================
TYPOGRAPHY
======================
*/
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headers);
    margin-top: 0;
    line-height: 1.2;
    color: var(--text-dark);
}

h1 {
    font-family: var(--font-titles);
    font-size: clamp(2rem, 8vw, 4.5rem);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0px;
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(127, 14, 189, 0.5);
}

h2 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    margin-bottom: var(--spacing-sm);
    position: relative;
    display: inline-block;
    font-weight: 700;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    position: relative;
}

a:focus-visible {
    outline: 2px solid var(--primary-purple);
    outline-offset: 3px;
}

/* 
======================
MAGICAL TEXT EFFECTS
======================
*/
.magical-text {
    background-image: linear-gradient(
        90deg,
        var(--divine-light-white) 0%,
        #fff8e1 25%,
        var(--divine-light-white) 50%,
        #fff8e1 75%,
        var(--divine-light-white) 100%
    );
    background-size: 200% auto;
    background-clip: text;
    position:relative;
    left: -15px;
    -webkit-background-clip: text;
    color: transparent;
    animation: shineText 8s linear infinite;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: inline-block;
}

@keyframes shineText {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.animated-text {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1.5s var(--transition-smooth) forwards;
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.magical-heading {
    display: inline-block;
    position: relative;
    color: var(--primary-blue);
    transform: translateZ(0);
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.1),
        0 0 10px rgba(11, 42, 169, 0.3);
    transition: color 0.3s ease;
}

.magical-heading::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: transparent;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.magical-heading:hover {
    color: var(--primary-purple);
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.1),
        0 0 15px rgba(127, 14, 189, 0.5);
}

.crimson-heading {
    color: var(--primary-red);
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.1),
        0 0 10px rgba(195, 10, 61, 0.3);
}

.crimson-heading:hover {
    color: var(--primary-red-light);
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.1),
        0 0 15px rgba(195, 10, 61, 0.5);
}

.purple-heading {
    color: var(--primary-purple);
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.1),
        0 0 10px rgba(127, 14, 189, 0.3);
}

.purple-heading:hover {
    color: var(--primary-purple-light);
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.1),
        0 0 15px rgba(127, 14, 189, 0.5);
}

.blue-heading {
    color: var(--primary-blue);
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.1),
        0 0 10px rgba(11, 42, 169, 0.3);
}

.blue-heading:hover {
    color: var(--primary-blue-light);
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.1),
        0 0 15px rgba(11, 42, 169, 0.5);
}

.light-heading {
    color: var(--divine-light-white);
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(127, 14, 189, 0.5);
}

.magical-underline {
    height: 3px;
    width: 0;
    margin: 10px auto 20px;
    background: var(--gradient-rainbow);
    border-radius: 3px;
    transition: width 0.8s var(--transition-smooth);
    box-shadow: 0 0 10px rgba(127, 14, 189, 0.3);
}

.section-appear.in-view .magical-underline {
    width: 100px;
}

.crimson-underline {
    background: var(--gradient-red);
    box-shadow: var(--shadow-red);
}

.purple-underline {
    background: var(--gradient-purple);
    box-shadow: var(--shadow-purple);
}

.blue-underline {
    background: var(--gradient-blue);
    box-shadow: var(--shadow-blue);
}

.light-underline {
    background: linear-gradient(90deg, transparent, var(--divine-light-white), transparent);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.magic-line {
    height: 2px;
    width: 0;
    margin: 20px auto;
    background: linear-gradient(90deg, transparent, var(--divine-light-white), transparent);
    transition: width 1s var(--transition-smooth);
    opacity: 0.7;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.magic-line.animated {
    width: 200px;
}

/* 
======================
SIMPLIFIED SECTION DIVIDER STYLES
======================
*/

/* Base divider styles */
.section-divider {
    position: relative;
    width: 100%;
    height: 10px; /* Consistent height for all dividers */
    margin: 0;
    padding: 0;
}

/* Color-specific dividers with gradients */
.blue-divider {
    background: linear-gradient(to right, #091D82, #0B2AA9, #3C50C7);
    box-shadow: 0 0 10px rgba(11, 42, 169, 0.3);
}

.purple-divider {
    background: linear-gradient(to right, #6B0AA1, #7F0EBD, #9B3DD7);
    box-shadow: 0 0 10px rgba(127, 14, 189, 0.3);
}

.red-divider {
    background: linear-gradient(to right, #A30831, #C30A3D, #D6335C);
    box-shadow: 0 0 10px rgba(195, 10, 61, 0.3);
}

.rainbow-divider {
    background: linear-gradient(to right, #C30A3D, #7F0EBD, #0B2AA9, #C30A3D);
    box-shadow: 0 0 10px rgba(127, 14, 189, 0.3);
}

.light-divider {
    background: linear-gradient(to right, rgba(251, 251, 215, 0.7), #FBFBD7, rgba(251, 251, 215, 0.7));
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Footer divider */
.footer-divider {
    width: 100%;
    height: 10px;
    background: var(--background-dark);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .section-divider,
    .footer-divider {
        height: 5px; /* Thinner on mobile */
    }
}

/* 
======================
SECTION STYLES
======================
*/
section {
    position: relative;
    padding: var(--spacing-lg) 0;
    overflow: hidden;
}

.section-appear {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-appear.in-view {
    opacity: 1;
    transform: translateY(0);
}

.section-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-rainbow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--divine-light-white);
    font-size: 1.5rem;
    box-shadow: var(--shadow-magical);
    position: relative;
    overflow: hidden;
}

.section-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}


.section-icon i {
    position: relative;
    z-index: 1;
}

.crimson-icon {
    background: var(--gradient-red);
}

.purple-icon {
    background: var(--gradient-purple);
}

.blue-icon {
    background: var(--gradient-blue);
}

.light-icon {
    background: rgba(255, 255, 255, 0.2);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
    position: relative;
}

.section-header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.light-header p {
    color: var(--divine-light-white);
    opacity: 0.9;
}

.section-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    background-size: cover;
    background-position: center;
    opacity: 0.15;
}

.section-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 2;
}

.section-divider.reverse {
    transform: rotate(180deg);
    bottom: auto;
    top: -1px;
}

.section-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.footer-fill {
    fill: var(--background-dark);
}

/* 
======================
BUTTONS
======================
*/
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-family: var(--font-headers);
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.3s var(--transition-bounce), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--gradient-blue);
    color: var(--text-light);
    border: 2px solid var(--divine-light-white);
}

.btn-primary:hover, .btn-primary:focus {
    transform: translateY(-5px);
    box-shadow: 
        0 10px 20px rgba(11, 42, 169, 0.4),
        0 0 15px rgba(127, 14, 189, 0.3);
    color: var(--text-light);
}

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

.btn-secondary {
    background: var(--gradient-red);
    color: var(--text-light);
    border: 2px solid var(--divine-light-white);
}

.btn-secondary:hover, .btn-secondary:focus {
    transform: translateY(-5px);
    box-shadow: 
        0 10px 20px rgba(195, 10, 61, 0.4),
        0 0 15px rgba(195, 10, 61, 0.3);
    color: var(--text-light);
}

.btn-tertiary {
    background: var(--gradient-purple);
    color: var(--text-light);
    border: 2px solid var(--divine-light-white);
}

.btn-tertiary:hover, .btn-tertiary:focus {
    transform: translateY(-5px);
    box-shadow: 
        0 10px 20px rgba(127, 14, 189, 0.4),
        0 0 15px rgba(127, 14, 189, 0.3);
    color: var(--text-light);
}

.magical-btn {
    position: relative;
    overflow: hidden;
}

.magical-btn::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    transition: transform 0.5s ease;
    transform: translateX(-100%);
}

.magical-btn::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    transition: transform 0.5s ease;
    transform: translateX(100%);
}

.magical-btn:hover::before, 
.magical-btn:focus::before {
    transform: translateX(100%);
}

.magical-btn:hover::after,
.magical-btn:focus::after {
    transform: translateX(-100%);
}

.magical-btn .btn-text {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.magical-btn .btn-text::before {
    content: '';
    position: absolute;
    left: -10px;
    top: -30%;
    width: calc(100% + 20px);
    height: 160%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, transparent 80%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.magical-btn:hover .btn-text::before,
.magical-btn:focus .btn-text::before {
    opacity: 0.3;
    animation: pulseBtn 2s infinite;
}

@keyframes pulseBtn {
    0% {
        opacity: 0.1;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.1;
        transform: scale(0.9);
    }
}

.cta-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
}

.crimson-btn {
    background: var(--gradient-red);
}

.purple-btn {
    background: var(--gradient-purple);
}

.blue-btn {
    background: var(--gradient-blue);
}

/* 
======================
HEADER
======================
*/
header {
    background-color: var(--divine-light-white);
    padding: var(--spacing-sm) 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: var(--z-fixed);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(127, 14, 189, 0.1);
    transition: background-color 0.3s ease, padding 0.3s ease;
}

header.scrolled {
    padding: 0.5rem 0;
    background-color: rgba(251, 251, 215, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    position: relative;
    transition: transform 0.3s var(--transition-bounce);
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    height: 60px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: filter 0.3s ease;
}

.logo:hover img {
    filter: drop-shadow(0 4px 8px rgba(127, 14, 189, 0.4));
}

.logo-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle at center, rgba(127, 14, 189, 0.3) 0%, rgba(11, 42, 169, 0) 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    border-radius: 50%;
}

.logo:hover .logo-glow {
    opacity: 1;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.1);
    }
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: var(--spacing-sm);
    position: relative;
}

.nav-item {
    font-family: var(--font-headers);
    color: var(--text-dark);
    font-weight: 600;
    padding: 0.5rem;
    transition: all var(--transition-speed) ease;
    display: inline-block;
    position: relative;
}

.nav-item i {
    margin-right: 0.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
    position: relative;
    color: var(--primary-blue);
}

.nav-item span {
    position: relative;
    transition: color 0.3s ease;
}

.nav-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-rainbow);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.nav-item:hover i, .nav-item.active i {
    transform: scale(1.2) rotate(-5deg);
    color: var(--primary-purple);
}

.nav-item:hover span, .nav-item.active span {
    color: var(--primary-purple);
}

.nav-item:hover::before, .nav-item.active::before {
    transform: scaleX(1);
    transform-origin: left;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: var(--z-dropdown);
    /* Ensure minimum touch target size of 44x44px */
    min-width: 44px;
    min-height: 44px;
    padding: 7px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius);
    transition: background-color var(--transition-speed);
}

.mobile-menu-toggle:hover {
    background-color: rgba(127, 14, 189, 0.1);
}

.mobile-menu-toggle:active {
    background-color: rgba(127, 14, 189, 0.2);
}

.mobile-menu-toggle span {
    width: 30px;
    height: 3px;
    background-color: var(--text-dark);
    margin: 3px 0;
    border-radius: 3px;
    transition: all var(--transition-speed) var(--transition-smooth);
}

/* 
======================
HERO SECTION
======================
*/
.hero {
    padding: 0;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    color: var(--text-light);
    text-align: center;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../assets/images/hero-bg.png');
    background-size: cover;
    background-position: center;
    z-index: var(--z-background);
    transition: transform 0.5s ease;
}

.magical-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 70%, rgba(195, 10, 61, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(127, 14, 189, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(11, 42, 169, 0.3) 0%, transparent 70%);
    z-index: calc(var(--z-background) + 1);
    animation: pulseGradient 10s ease infinite alternate;
}

@keyframes pulseGradient {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

.parallax-section {
    perspective: 1000px;
}

.hero-content {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: var(--z-normal);
}

.reveal-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.reveal-content.show {
    opacity: 1;
    transform: translateY(0);
}

.floating-dice-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: calc(var(--z-background) + 2);
    pointer-events: none;
}

.floating-dice {
    position: absolute;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='rgba(251, 251, 215, 0.15)' d='M50 0L100 25v50L50 100L0 75V25L50 0z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6;
    filter: drop-shadow(0 0 10px rgba(127, 14, 189, 0.5));
}

.floating-dice.d20 {
    width: 60px;
    height: 60px;
}

.hero-divider {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 2;
}

.hero-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 120px;
}

/* 
======================
FEATURED CONTENT
======================
*/
.featured-content {
    background-color: var(--background-light);
    position: relative;
}

.featured-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

/* 
======================
VIDEO CARD STYLING
======================
*/
.video-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.5s var(--transition-bounce);
    background-color: white;
    border: 2px solid rgba(251, 251, 215, 0.5);
    z-index: 1;
    transform-style: preserve-3d;
}

/* Rainbow bar at the top of the card when hovered */
.video-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-rainbow);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
    z-index: 5;
}

/* Slight tilt effect on the entire card */
.video-card:hover {
    transform: perspective(1000px) translateY(-5px) rotateX(5deg);
    box-shadow: 
        var(--shadow-lg),
        0 0 20px rgba(127, 14, 189, 0.3);
    border-color: var(--divine-light-white);
}

.video-card:hover::before {
    transform: scaleX(1);
}

/* 
======================
SLIDING OVERLAY EFFECT - BOTTOM UP
======================
*/

/* Thumbnail wrapper with fixed ratio */
.video-thumbnail {
    position: relative !important;
    padding-top: 56.25% !important; /* 16:9 Aspect Ratio */
    overflow: hidden !important;
    background-color: #f0f0f0; /* Light background color */
    cursor: pointer;
    display: block !important; /* Ensure it's a block element */
}

/* Static thumbnail image - always visible */
.video-thumbnail img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    z-index: 1;
}

/* Sliding overlay with gradient and play button - FROM BOTTOM */
.thumbnail-preview {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: translateY(100%) !important; /* Start hidden below */
    transition: transform 0.4s var(--transition-bounce);
    z-index: 2;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3); /* Shadow for bottom-up slide */
    background: linear-gradient(
        135deg, 
        rgba(11, 42, 169, 0.3),
        rgba(127, 14, 189, 0.3)
    );
}

/* Play icon on the sliding overlay */
.thumbnail-preview-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 3rem;
    z-index: 2;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    opacity: 0.9;
    transition: transform 0.3s ease;
}

/* Loading state indicator */
.video-thumbnail.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 50%;
    border: 3px solid rgba(127, 14, 189, 0.2);
    border-top-color: var(--primary-purple);
    animation: spin 1s linear infinite;
    z-index: 4;
}

/* Show the sliding overlay on hover - SLIDE UP FROM BOTTOM */
.video-card:hover .thumbnail-preview {
    transform: translateY(0) !important; /* Slide up from bottom */
}

/* Animate the play icon on hover */
.video-card:hover .thumbnail-preview-play {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Special styles for different sections */
.crimson-court-preview .video-card .thumbnail-preview {
    background: linear-gradient(
        135deg, 
        rgba(195, 10, 61, 0.4),
        rgba(127, 14, 189, 0.3)
    );
}

.dm-advice-preview .video-card .thumbnail-preview {
    background: linear-gradient(
        135deg, 
        rgba(127, 14, 189, 0.4),
        rgba(11, 42, 169, 0.3)
    );
}

/*
======================
VIDEO PREVIEW CONTAINER
======================
*/
.video-card {
    padding: 10px;
}

.video-preview-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000; /* Ensure it's above everything */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.video-preview-container.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.video-preview-inner {
    width: 80%;
    max-width: 900px;
    aspect-ratio: 16/9;
    position: relative;
    background-color: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(127, 14, 189, 0.5);
}

.video-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(11, 42, 169, 0.6), 
        rgba(127, 14, 189, 0.6)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.video-preview-play {
    font-size: 5rem;
    color: var(--divine-light-white);
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
    transform: scale(1);
    transition: transform 0.3s ease;
}

.video-preview-overlay:hover .video-preview-play {
    transform: scale(1.2);
}

.video-preview-title {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    color: var(--divine-light-white);
    text-align: center;
    padding: 0 20px;
    font-family: var(--font-headers);
    font-size: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.video-preview-close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: var(--divine-light-white);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-preview-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Loading state */
.video-preview-container.loading .video-preview-inner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border-radius: 50%;
    border: 4px solid rgba(127, 14, 189, 0.3);
    border-top-color: var(--primary-purple);
    animation: spin 1s linear infinite;
    z-index: 11;
}

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

/* 
======================
DND TOOLS CARD STYLING - ENHANCED 3D TILT EFFECT
======================
*/
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.tool-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(11, 42, 169, 0.1);
    z-index: 1;
    
    /* New 3D tilt properties */
    transform-style: preserve-3d;
    transform: perspective(var(--card-perspective)) 
               rotateY(var(--card-rotate-y)) 
               rotateX(var(--card-rotate-x)) 
               rotateZ(var(--card-rotate-z));
    transition: transform var(--card-transition-speed) ease, 
                box-shadow var(--card-transition-speed) ease, 
                border-color var(--card-transition-speed) ease;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(11, 42, 169, 0.05), 
        rgba(127, 14, 189, 0.05), 
        rgba(195, 10, 61, 0.05));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.card-glint {
    position: absolute;
    top: -100%;
    left: -100%;
    width: 50%;
    height: 50%;
    background: linear-gradient(
        135deg, 
        transparent, 
        rgba(255, 255, 255, 0.5) 50%, 
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.5s ease;
    z-index: 2;
    pointer-events: none;
}

.tool-card:hover .card-glint {
    top: 150%;
    left: 150%;
}

.tool-card:hover {
    box-shadow: 
        0 15px 30px rgba(11, 42, 169, 0.2),
        0 0 20px rgba(127, 14, 189, 0.2);
    border-color: var(--primary-blue-light);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-size: 3rem;
    transition: all 0.5s ease;
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(20px); /* Push the icon out in 3D space for depth */
}

.tool-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(11, 42, 169, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.5s ease;
}

.tool-card:hover .tool-icon {
    transform: translateZ(30px); /* Increase the push in 3D space on hover */
    color: var(--primary-blue-dark);
}

.tool-card:hover .tool-icon::after {
    transform: scale(1.5);
    animation: pulse 2s infinite;
}

.tool-card h3 {
    position: relative;
    display: inline-block;
    margin-bottom: var(--spacing-sm);
    transition: color 0.3s ease;
    transform-style: preserve-3d;
    transform: translateZ(15px); /* Push the heading out in 3D space for depth */
}

.tool-card:hover h3 {
    color: var(--primary-blue);
}

.tool-card p {
    transform-style: preserve-3d;
    transform: translateZ(10px); /* Push the text out in 3D space for depth */
}

.tool-card .btn {
    margin-top: var(--spacing-sm);
    position: relative;
    z-index: 3;
    transform-style: preserve-3d;
    transform: translateZ(25px); /* Push the button out in 3D space for depth */
}

.tool-preview {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    opacity: 0.2;
    transition: opacity 0.5s ease;
    pointer-events: none;
    transform-style: preserve-3d;
    transform: translateZ(5px) rotate(-5deg); /* Add some rotation for style */
}

.tool-card:hover .tool-preview {
    opacity: 0.5;
    animation: pulse 2s infinite;
}

/* 
======================
TOOLS SECTION PREVIEWS
======================
*/
.mini-dice {
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%230b2aa9' d='M50 0L100 25v50L50 100L0 75V25L50 0z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    animation: spin 8s linear infinite;
}

.quiz-options {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.option {
    width: 100%;
    height: 25%;
    background-color: rgba(11, 42, 169, 0.2);
    border-radius: 3px;
    margin-bottom: 5px;
}

.option:nth-child(1) {
    width: 80%;
}

.option:nth-child(3) {
    width: 60%;
}

.map-preview {
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-marker {
    width: 50%;
    height: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230b2aa9' d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    animation: pulse 2s infinite;
}

/* 
======================
CRIMSON COURT SECTION
======================
*/
.crimson-court-preview {
    background-color: var(--divine-light-white);
}

.crimson-bg {
    background-image: url("data:image/svg+xml,%3Csvg width='180' height='180' viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M82.42 180h-1.415L0 98.995v-2.827L6.167 90 0 83.833V81.004L81.005 0h2.827L90 6.167 96.167 0H98.996L180 81.005v2.827L173.833 90 180 96.167V98.996L98.995 180h-2.827L90 173.833 83.833 180H82.42zm0-1.414L1.413 97.58 8.994 90l-7.58-7.58L82.42 1.413 90 8.994l7.58-7.58 81.006 81.006-7.58 7.58 7.58 7.58-81.006 81.006-7.58-7.58-7.58 7.58zM175.196 0h-25.832c1.033 2.924 2.616 5.59 4.625 7.868C152.145 9.682 151 12.208 151 15c0 5.523 4.477 10 10 10 1.657 0 3 1.343 3 3v4h16V0h-4.803c.51.883.803 1.907.803 3 0 3.314-2.686 6-6 6s-6-2.686-6-6c0-1.093.292-2.117.803-3h10.394-13.685C161.18.938 161 1.948 161 3v4c-4.418 0-8 3.582-8 8s3.582 8 8 8c2.76 0 5 2.24 5 5v2h4.803L175.196 0z' fill='%23c30a3d' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.8;
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-background);
    overflow: hidden;
}

.float-element {
    position: absolute;
    width: 80px;
    height: 80px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
    filter: drop-shadow(0 0 5px rgba(195, 10, 61, 0.5));
}

.crown {
    top: 15%;
    left: 10%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23c30a3d' d='M32 8L22 22 8 18 14 36 50 36 56 18 42 22z'/%3E%3Cpath fill='%23c30a3d' d='M14 40v6h36v-6z'/%3E%3C/svg%3E");
    animation: floatUpDown 8s ease-in-out infinite;
}

.scroll {
    top: 70%;
    left: 85%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23c30a3d' d='M16 8C12 8 8 12 8 16v32c0 4 4 8 8 8h32c4 0 8-4 8-8V16c0-4-4-8-8-8H16zm0 4h32c2 0 4 2 4 4v32c0 2-2 4-4 4H16c-2 0-4-2-4-4V16c0-2 2-4 4-4z'/%3E%3Cpath fill='%23c30a3d' d='M24 16v32h16V16H24zm4 4h8v24h-8V20z'/%3E%3C/svg%3E");
    animation: floatUpDown 12s ease-in-out infinite reverse;
}

.sword {
    top: 30%;
    left: 80%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23c30a3d' d='M32 4L28 8 8 28l4 4 20-20L48 28l4-4L32 4z'/%3E%3Cpath fill='%23c30a3d' d='M32 20v36h4V20z'/%3E%3C/svg%3E");
    animation: floatLeftRight 15s ease-in-out infinite;
}

.shield {
    top: 60%;
    left: 15%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23c30a3d' d='M32 8L16 16v16c0 8 4 16 16 24 12-8 16-16 16-24V16L32 8z'/%3E%3C/svg%3E");
    animation: floatLeftRight 10s ease-in-out infinite reverse;
}

.goblet {
    top: 40%;
    left: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23c30a3d' d='M24 12v4c0 8 4 12 8 12s8-4 8-12v-4H24zm0 24h16v4H24z'/%3E%3Cpath fill='%23c30a3d' d='M28 44h8v8h-8z'/%3E%3C/svg%3E");
    animation: floatUpDown 6s ease-in-out infinite;
}

@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes floatLeftRight {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(20px);
    }
}

.latest-episodes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.crimson-court-preview .video-card {
    box-shadow: 
        0 10px 20px rgba(195, 10, 61, 0.1),
        0 0 15px rgba(195, 10, 61, 0.1);
    border: 2px solid rgba(195, 10, 61, 0.1);
}

.crimson-court-preview .video-card:hover {
    box-shadow: 
        0 15px 30px rgba(195, 10, 61, 0.2),
        0 0 20px rgba(195, 10, 61, 0.2);
    border-color: rgba(195, 10, 61, 0.3);
}

.crimson-court-preview .video-thumbnail::before {
    background: linear-gradient(
        135deg, 
        rgba(195, 10, 61, 0.7),
        rgba(127, 14, 189, 0.5)
    );
}

.crimson-spinner .spinner-inner {
    border-top-color: var(--primary-red);
}

/* 
======================
DM ADVICE SECTION
======================
*/
.dm-advice-preview {
    background-color: var(--background-light);
    position: relative;
}

.energy-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: var(--z-background);
    opacity: 0.5;
    pointer-events: none;
}

.energy-lines::before, 
.energy-lines::after {
    content: '';
    position: absolute;
    top: 0;
    width: 300%;
    height: 100%;
    background-image: 
        linear-gradient(transparent 0%, transparent calc(50% - 1px), rgba(127, 14, 189, 0.1) 50%, transparent calc(50% + 1px), transparent 100%),
        linear-gradient(transparent 0%, transparent calc(50% - 1px), rgba(11, 42, 169, 0.1) 50%, transparent calc(50% + 1px), transparent 100%);
    background-size: 100px 100px, 30px 30px;
    animation: moveLines 20s linear infinite;
}

.energy-lines::before {
    left: 0;
    transform: rotate(30deg);
}

.energy-lines::after {
    right: 0;
    transform: rotate(-30deg);
    animation-direction: reverse;
}

@keyframes moveLines {
    0% {
        transform: translateX(-100px) rotate(30deg);
    }
    100% {
        transform: translateX(100px) rotate(30deg);
    }
}

.advice-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.dm-advice-preview .video-card {
    box-shadow: 
        0 10px 20px rgba(127, 14, 189, 0.1),
        0 0 15px rgba(127, 14, 189, 0.1);
    border: 2px solid rgba(127, 14, 189, 0.1);
}

.dm-advice-preview .video-card:hover {
    box-shadow: 
        0 15px 30px rgba(127, 14, 189, 0.2),
        0 0 20px rgba(127, 14, 189, 0.2);
    border-color: rgba(127, 14, 189, 0.3);
}

.dm-advice-preview .video-thumbnail::before {
    background: linear-gradient(
        135deg, 
        rgba(127, 14, 189, 0.7),
        rgba(11, 42, 169, 0.5)
    );
}

.purple-spinner .spinner-inner {
    border-top-color: var(--primary-purple);
}

/* 
======================
TOOLS SECTION
======================
*/
.tools-preview {
    background-color: var(--divine-light-white);
}

.tools-bg {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='152' height='152' viewBox='0 0 152 152'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='temple' fill='%230b2aa9' fill-opacity='0.05'%3E%3Cpath d='M152 150v2H0v-2h28v-8H8v-20H0v-2h8V80h42v20h20v42H30v8h90v-8H80v-42h20V80h42v40h8V30h-8v40h-42V50H80V8h40V0h2v8h20v20h8V0h2v150zm-2 0v-28h-8v20h-20v8h28zM82 30v18h18V30H82zm20 18h20v20h18V30h-20V10H82v18h20v20zm0 2v18h18V50h-18zm20-22h18V10h-18v18zm-54 92v-18H50v18h18zm-20-18H28V82H10v38h20v20h38v-18H48v-20zm0-2V82H30v18h18zm-20 22H10v18h18v-18zm54 0v18h38v-20h20V82h-18v20h-20v20H82zm18-20H82v18h18v-18zm2-2h18V82h-18v18zm20 40v-18h18v18h-18zM30 0h-2v8H8v20H0v2h8v40h42V50h20V8H30V0zm20 48h18V30H50v18zm18-20H48v20H28v20H10V30h20V10h38v18zM30 50h18v18H30V50zm-2-40H10v18h18V10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.8;
}

.floating-dice {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-background);
    pointer-events: none;
}

.float-dice {
    position: absolute;
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
    filter: drop-shadow(0 0 5px rgba(11, 42, 169, 0.5));
}

@keyframes rotate3D {
    0% {
        transform: rotate3d(1, 1, 1, 0deg);
    }
    100% {
        transform: rotate3d(1, 1, 1, 360deg);
    }
}

/* 
======================
NEWSLETTER SECTION
======================
*/
.newsletter {
    background: linear-gradient(45deg, 
        var(--primary-blue-dark), 
        var(--primary-purple-dark), 
        var(--primary-red-dark));
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.glowing-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.newsletter-form {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(127, 14, 189, 0.3);
    border: 2px solid var(--divine-light-white);
    z-index: 1;
}

.form-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.newsletter-form:hover .form-glow {
    opacity: 1;
    animation: pulse 3s infinite;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
}

.newsletter-form input:focus {
    background-color: white;
    box-shadow: inset 0 0 0 2px var(--primary-purple-light);
}

.btn-newsletter {
    padding: 0 1.5rem;
    border: none;
    background: linear-gradient(45deg, var(--primary-blue-light), var(--primary-purple-light));
    color: var(--divine-light-white);
    font-family: var(--font-headers);
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.btn-newsletter i {
    margin-right: 8px;
    position: relative;
    z-index: 1;
}

.btn-newsletter::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -10px;
    width: 0;
    height: 150%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(35deg);
    transition: all 0.5s ease;
    z-index: 0;
}

.btn-newsletter:hover {
    background: linear-gradient(45deg, var(--primary-blue), var(--primary-purple));
}

.btn-newsletter:hover::before {
    width: 150%;
}

.btn-newsletter span {
    position: relative;
    z-index: 1;
}

.scroll-to-top {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

#scroll-top-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--divine-light-white);
    color: var(--divine-light-white);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

#scroll-top-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

/* 
======================
FOOTER
======================
*/
footer {
    position: relative;
    color: var(--text-light);
    overflow: hidden;
}

.footer-content {
    background-color: var(--background-dark);
    padding: var(--spacing-md) 0;
    position: relative;
    z-index: 1;
}

.footer-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='180' height='180' viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M81.28 88H68.413l19.298 19.298L81.28 88zm2.107 0h13.226L90 107.838 83.387 88zm15.334 0h12.866l-19.298 19.298L98.72 88zm-32.927-2.207L73.586 78h32.827l.5.5 7.294 7.293L115.414 87l-24.707 24.707-.707.707L64.586 87l1.207-1.207zm2.62.207L74 80.414 79.586 86H68.414L70 84.414l15.414-15.414.5-.5.5.5L89.414 72l23 23L98.414 86 86.707 74.293 82.414 78z' fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: var(--spacing-md);
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo img {
    height: 50px;
    margin-bottom: var(--spacing-sm);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.footer-logo p {
    opacity: 0.7;
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    justify-content: space-between;
}

.link-column h4 {
    color: var(--divine-light-white);
    margin-bottom: var(--spacing-sm);
    font-size: 1.2rem;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.link-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-rainbow);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.link-column:hover h4::after {
    width: 100%;
}

.link-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-column ul li {
    margin-bottom: var(--spacing-xs);
}

.link-column ul li a {
    color: var(--text-light);
    opacity: 0.7;
    transition: all var(--transition-speed) ease;
    display: inline-block;
    padding: 3px 0;
    position: relative;
}

.link-column ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gradient-rainbow);
    transition: width 0.3s ease;
}

.link-column ul li a:hover {
    opacity: 1;
    transform: translateX(5px);
    color: var(--divine-light-white);
}

.link-column ul li a:hover::after {
    width: 100%;
}

.social-links {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all var(--transition-speed) var(--transition-bounce);
    opacity: 0.8;
    position: relative;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.social-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    top: 0;
    left: 0;
    transition: all 0.3s ease;
    transform: scale(0.8);
    opacity: 0;
}

.social-icon:hover {
    opacity: 1;
    transform: translateY(-5px);
}

.social-icon:hover::after {
    transform: scale(1.2);
    opacity: 1;
}

.youtube:hover {
    color: #FF0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.youtube:hover::after {
    border-color: #FF0000;
}

.twitch:hover {
    color: #9146FF;
    box-shadow: 0 0 15px rgba(145, 70, 255, 0.5);
}

.twitch:hover::after {
    border-color: #9146FF;
}

.instagram:hover {
    color: #E1306C;
    box-shadow: 0 0 15px rgba(225, 48, 108, 0.5);
}

.instagram:hover::after {
    border-color: #E1306C;
}

.discord:hover {
    color: #7289DA;
    box-shadow: 0 0 15px rgba(114, 137, 218, 0.5);
}

.discord:hover::after {
    border-color: #7289DA;
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.3);
    padding: var(--spacing-sm) 0;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.7;
}

.easter-egg {
    color: inherit !important; /* First, inherit the parent color */
    opacity: 0 !important;  /* Make it completely invisible */
    transition: opacity 0.3s ease !important; /* Smooth transition for visibility */
    cursor: default !important; /* Keep the default cursor so it's truly hidden */
}

.easter-egg:hover {
    color: var(--primary-purple-light) !important; /* Change color on hover */
    opacity: 1 !important; /* Make fully visible on hover */
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 
======================
LOADING SPINNER
======================
*/
.loading-spinner {
    text-align: center;
    padding: var(--spacing-md);
    color: #888;
    position: relative;
}

.spinner-d20 {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    position: relative;
    perspective: 1000px;
}

.spinner-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid rgba(127, 14, 189, 0.2);
    border-top-color: var(--primary-blue);
    animation: spin 1.5s ease-in-out infinite;
}

.spinner-d20::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='rgba(127, 14, 189, 0.3)' d='M50 0L100 25v50L50 100L0 75V25L50 0z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transform: translate(-50%, -50%);
    z-index: 1;
    animation: spin 3s linear infinite reverse;
}

.spinner-d20::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(127, 14, 189, 0.3);
    opacity: 0.5;
    animation: pulse 2s infinite;
}

/* 
======================
RESPONSIVE STYLES
======================
*/
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-md);
    }
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-logo {
        grid-column: 1 / -1;
        align-items: center;
        margin-bottom: var(--spacing-md);
    }
    
    .social-links {
        justify-content: center;
        margin-top: var(--spacing-md);
        grid-column: 1 / -1;
    }
    
    .float-element, .float-dice {
        display: none;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .section-divider svg, .hero-divider svg {
        height: 40px;
    }

    /* Mobile Navigation Improvements */
    nav ul {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 80px);
        background-color: hsla(274, 39%, 86%, 0.98);
        flex-direction: column;
        padding: var(--spacing-md) var(--spacing-sm);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
        z-index: var(--z-dropdown);
        backdrop-filter: blur(15px);
        border-bottom: 3px solid rgba(127, 14, 189, 0.3);
        transform: translateY(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        opacity: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    nav ul.active {
        display: flex;
        transform: translateY(0);
        opacity: 1;
    }

    nav ul li {
        margin: 0;
        padding: var(--spacing-sm) 0;
        text-align: center;
        border-bottom: 1px solid rgba(127, 14, 189, 0.1);
        animation: slideInFromTop 0.3s ease forwards;
        opacity: 0;
    }

    nav ul.active li {
        opacity: 1;
    }

    /* Stagger animation for menu items */
    nav ul.active li:nth-child(1) { animation-delay: 0.1s; }
    nav ul.active li:nth-child(2) { animation-delay: 0.15s; }
    nav ul.active li:nth-child(3) { animation-delay: 0.2s; }
    nav ul.active li:nth-child(4) { animation-delay: 0.25s; }
    nav ul.active li:nth-child(5) { animation-delay: 0.3s; }

    @keyframes slideInFromTop {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav ul li a {
        display: block;
        padding: var(--spacing-sm);
        font-size: 1.1rem;
        /* Ensure touch targets are large enough */
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Improve button sizes on mobile */
    .btn, button {
        min-height: 44px;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* Ensure scroll-to-top button is large enough */
    #scroll-top-btn {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
    }

    /* Improve hero section on mobile */
    .hero {
        height: 50vh;
        min-height: 400px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    /* Container padding on mobile */
    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Improve form inputs on mobile */
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
    }

    /* Better spacing for cards on mobile */
    .cast-card, .tool-card, .article-card {
        margin-bottom: var(--spacing-md);
    }

    /* Prevent horizontal scrolling */
    body {
        overflow-x: hidden;
    }
}

/* Extra Small Devices (phones in portrait) */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .hero {
        height: 45vh;
        min-height: 350px;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    /* Stack footer items */
    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* Full width buttons on small screens */
    .btn-group, .result-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn, .result-actions .btn {
        width: 100%;
    }

    /* Improve tool cards on very small screens */
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Improve touch interactions across all mobile sizes */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .nav-item::before {
        display: none;
    }

    /* Add tap highlight color */
    * {
        -webkit-tap-highlight-color: rgba(127, 14, 189, 0.2);
    }

    /* Better button feedback on touch */
    .btn:active, button:active {
        transform: scale(0.95);
        transition: transform 0.1s;
    }

    /* Improve link spacing for touch */
    a {
        padding: 2px 0;
    }
}
/*
======================
ACCESSIBILITY STYLES
======================
*/

/* Skip to main content link - visible only when focused */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-purple);
    color: var(--text-light);
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    font-weight: bold;
    z-index: var(--z-modal);
    border-radius: 0 0 var(--border-radius) 0;
    transition: top var(--transition-speed) var(--transition-smooth);
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* Improved focus indicators for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-purple);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

