:root {
    /* Dark Mode Colors */
    --bg-color-dark: #1a1a1a; /* Solid dark gray for main content sections */
    --text-color-dark: #e0e0e0; /* Off-white for readability */
    --primary-color-dark: #7b2c3a; /* Deep, muted red (Mafia theme) - for buttons/titles */
    --secondary-color-dark: #3a3a3a; /* Dark gray for cards/sections */
    --accent-color-dark: #b8860b; /* Muted gold/brass for highlights (e.g., nav links) */
    --border-color-dark: #444; /* Subtle border color */

    /* RGB values for primary colors (used in rgba for shadows) */
    --primary-color-dark-r: 123;
    --primary-color-dark-g: 44;
    --primary-color-dark-b: 58;

    /* Specific Blood Red for "Mafia Remastered" text */
    --mafia-title-color-dark: #8B0000; /* Darker blood red for dark mode */
    --mafia-title-color-dark-r: 139;
    --mafia-title-color-dark-g: 0;
    --mafia-title-color-dark-b: 0;

    /* Dark Purple Gradient for Body Background, Navbar, and Footer */
    --dark-purple-gradient: linear-gradient(135deg, #120A1A 0%, #08040C 100%); /* Very dark black-purple */
    --navbar-bg-dark: rgba(18, 10, 26, 0.8); /* Slightly transparent dark purple for navbar */
    

    /* Card elements for more color */
    --footer-bg-dark: black; /* Deepest part of the purple gradient for footer */


    /* Light Mode Colors (Adjust these to your preference for light theme) */
    --bg-color-light: #f5f5f5;
    --text-color-light: #333;
    --primary-color-light: #c0392b; /* Brighter red for light mode - for buttons/titles */
    --secondary-color-light: #ffffff;
    --accent-color-light: #e67e22; /* Orange-gold for light mode (e.g., nav links) */
    --border-color-light: #ccc;
    --footer-bg-light: white;

    /* RGB values for primary colors (used in rgba for shadows) */
    --primary-color-light-r: 192;
    --primary-color-light-g: 57;
    --primary-color-light-b: 43;

    /* Specific Blood Red for "Mafia Remastered" text in light mode */
    --mafia-title-color-light: #CC0000; /* Brighter blood red for light mode */
    --mafia-title-color-light-r: 204;
    --mafia-title-color-light-g: 0;
    --mafia-title-color-light-b: 0;

    /* Current Mode Variables - these will switch based on body class */
    --bg-current: var(--bg-color-dark);
    --text-current: var(--text-color-dark);
    --primary-current: var(--primary-color-dark);
    --secondary-current: var(--secondary-color-dark);
    --accent-current: var(--accent-color-dark);
    --border-current: var(--border-color-dark);
    --mafia-title-current: var(--mafia-title-color-dark);
    --mafia-title-current-r: var(--mafia-title-color-dark-r);
    --mafia-title-current-g: var(--mafia-title-color-dark-g);
    --mafia-title-current-b: var(--mafia-title-color-dark-b);
    --footer-bg-current: var(--footer-bg-dark);

    /* Role themes */
    --village-theme: 21, 255, 0;
    --mafia-theme: 255, 0, 0;
    --neutral-theme: 0, 255, 255;
}

#transition-overlay.closed {
    display: none;
}

#transition-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    padding: 0;
    margin: 0;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    color: white;
    background: rgb(0, 0, 0, 0.9);
    z-index: 999;
}

/* Apply light mode colors when body has 'light-mode' class */
body.light-mode {
    --bg-current: var(--bg-color-light);
    --text-current: var(--text-color-light);
    --primary-current: var(--primary-color-light);
    --secondary-current: var(--secondary-color-light);
    --accent-current: var(--accent-color-light);
    --border-current: var(--border-color-light);
    --mafia-title-current: var(--mafia-title-color-light);
    --mafia-title-current-r: var(--mafia-title-color-light-r);
    --mafia-title-current-g: var(--mafia-title-color-light-g);
    --mafia-title-current-b: var(--mafia-title-color-light-b);
    --footer-bg-current: var(--footer-bg-light);
}

/* Global Resets and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    min-height: 100vh;
}

body {
    font-family: 'Inter', sans-serif; /* Use Inter for all text */
    line-height: 1.6;
    background-color: var(--bg-current); /* Solid dark gray for the main body background */
    color: var(--text-current);
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth transition for dark/light mode */
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: scroll;
}

body.light-mode {
    background-color: var(--bg-current); /* Use solid color for light mode background */
    background-image: none; /* Ensure no gradient in light mode */
}

main {
    flex-grow: 1
}


h1, h2, h3, h4, h5, h6 {
    font-weight: 900; /* Force Inter Bold 900 as per branding */
    color: var(--text-current);
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1em;
}

a {
    color: var(--accent-current);
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background-color: color-mix(in srgb, var(--mafia-title-color-dark) 80%, transparent);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.3s, box-shadow 0.3s;
}

body.light-mode .navbar {
    background-color: color-mix(in srgb, var(--mafia-title-color-light) 80%, transparent); /* Lighter solid for light mode */
    background-image: none; /* Remove gradient in light mode */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8em;
    color: white; /* Use new blood-red color */
    text-shadow: 0 0 5px rgba(var(--mafia-title-current-r), var(--mafia-title-current-g), var(--mafia-title-current-b), 0.6); /* Glow with blood-red */
    letter-spacing: 1px; /* Slightly spaced out for style */
    justify-self: center;
    align-self: center;
    margin: 0;
}

.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--accent-color-dark);
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
}

body.light-mode .hamburger-menu span {
    background: var(--accent-color-light);
}

/* Hamburger animation using JavaScript */
.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.navbar nav {
    position: absolute;
    top: 0; /* Aligned to the top of the viewport */
    left: 0;
    width: 15%; /* Changed to 50% */
    height: 100vh; /* Now takes up 100% of the viewport height */
    background: var(--dark-purple-gradient);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

body.light-mode .navbar nav {
    background-image: none;
    background-color: var(--bg-color-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar ul {
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 1rem 0;
    width: 100%;
    display: flex; /* Added to make centering possible */
    align-items: center; /* Centers the list items horizontally */
    padding-top: 80px;
    height: 100%;
}

.navbar ul > a {
    margin-top: auto;
    margin-bottom: 3rem;
}

.navbar li {
    width: 120px; /* Adjusted to fit the longest element (Discord) */
    margin: 0.5rem 0;
    display: flex; /* Added to center the link within the list item */
    justify-content: center;
}

.navbar li a {
    color: var(--text-color-dark);
    text-decoration: none;
    padding: 15px 25px;
    text-align: center;
    display: block;
    transition: color 0.3s, background-color 0.3s;
}

body.light-mode .navbar li a {
    color: var(--text-color-light);
}

.navbar li a:hover, body.light-mode .navbar li a:hover {
    color: var(--mafia-title-color-dark);
}

.navbar nav.active {
    transform: translateX(0);
}

/* Active link styling */
.navbar li.active a {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}

.top-logo {
    height: 35px;
    margin-right: -10px;
    /* filter: brightness(150%); */
    filter: saturate(200%);
    border-radius: 9999px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

body.light-mode .navbar li.active a {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Mode Toggle Button */
.mode-toggle-btn {
    background-color: var(--primary-current);
    color: var(--text-color-dark); /* Text color fixed for contrast on this button */
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow */
}

/* Specific hover colors for mode toggle button (since CSS darken() is not available) */
.dark-mode .mode-toggle-btn:hover { background-color: #6a2633; } /* Slightly darker red for dark mode */
.light-mode .mode-toggle-btn:hover { background-color: #a32d21; } /* Slightly darker red for light mode */

.mode-toggle-btn:hover {
    transform: scale(1.05); /* Slight scale on hover */
}

/* General Button Styling */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px; /* More rounded corners */
    font-weight: 900;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--primary-current);
    color: var(--text-color-dark); /* Fixed text color for primary button */
    /* Dynamic box-shadow using RGB variables */
    box-shadow: 0 0 10px rgba(var(--primary-color-dark-r), var(--primary-color-dark-g), var(--primary-color-dark-b), 0.5);
}

/* Adjust box-shadow for light mode primary button */
body.light-mode .btn-primary {
    box-shadow: 0 0 10px rgba(var(--primary-color-light-r), var(--primary-color-light-g), var(--primary-color-light-b), 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px); /* Lift effect on hover */
    box-shadow: 0 5px 15px rgba(var(--primary-color-dark-r), var(--primary-color-dark-g), var(--primary-color-dark-b), 0.7); /* Stronger glow on hover */
}

body.light-mode .btn-primary:hover {
    box-shadow: 0 5px 15px rgba(var(--primary-color-light-r), var(--primary-color-light-g), var(--primary-color-light-b), 0.7);
}

.btn-secondary {
    background-color: var(--secondary-current);
    color: var(--text-current);
    border: 1px solid var(--border-current);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
    background-color: var(--border-current);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}


.first-content {
    margin-top: calc(80px + 5vh);
}

/* Hero Section - The main visual introduction */
.hero-section {
    position: relative;
    height: 50vh; /* Takes 80% of viewport height */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-color-dark); /* Text always light on this dark background */
    /* Apply gradient to hero section */
    /* background: var(--dark-purple-gradient); */
    background: url('/media/MafiaRemasteredBackground.png');
    background-size: cover; /* Ensure gradient covers the section */
    background-position: center;
    background-attachment: fixed; /* Parallax scrolling effect */
    overflow: hidden; /* Ensures elements don't spill out */
    padding-top: 80px; /* Space for fixed navbar */
    flex-direction: column; /* Stack title and button vertically by default */
}

body.light-mode .hero-section {
    background-color: var(--bg-color-light); /* Solid light background for light mode */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75); /* Darkens the background image */
    backdrop-filter: blur(13px); /* Subtle blur effect over image */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2; /* Ensure content is above overlay */
    text-shadow: 0 0 10px rgb(0, 0, 0); /* Text shadow for readability */
    display: flex; /* Enable flexbox for logo and title */
    align-items: center; /* Vertically align logo and title */
    justify-content: center; /* Center logo and title horizontally */
    margin-bottom: 0.2em; /* Adjust spacing between title/logo and subtitle */
}

.hero-content h2 {
    font-size: clamp(50px, 4vw + 2vh, 100px);
    color: var(--mafia-title-current); /* Use new blood-red color */
    text-shadow: 0 0 10px rgb(0, 0, 0);
    align-self: center;
    margin: 0;
    /* animation: mafiatitle 3s ease; */
}

.hero-section > *:not(:first-child) {
    z-index: 2
}

.hero-logo {
    max-height: 6vw; /* Adjust logo size as needed */
    align-self: center;
    margin: 0;
    margin-right: 0.5em;
    margin-top: 0.03125rem;
}

.hero-content p {
    font-size: 1.5em;
    margin-bottom: 1.5em;
    font-weight: normal; /* Body text in Inter, but not 900 weight */
    text-align: center; /* Center the subtitle */
}

/* General Section Styling */
.section {
    padding: 80px 0;
    text-align: center;
    background-color: var(--bg-current); /* Solid current background color */
    border-bottom: 1px solid var(--border-current); /* Subtle separator */
    position: relative;
    overflow: hidden; /* For containing animations */
}


/* Tournament Section Specifics */
.tournament-section {
    padding: 0 20px;
    margin: 0 auto; /* Centered with vertical margin */
    width: calc(100% - 40px); /*Responsive width*/
    max-width: 1200px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
}

.tournament-controller {
    background-color: var(--secondary-current);
    border-radius: 10px; /* Rounded corners */
    width: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); /* Prominent shadow */
    overflow: hidden;
    border: 1px solid var(--border-current); /* Subtle border */
    padding: clamp(5px, 4.5vw, 60px);
}

.backdrop {
    background-image: url('/media/CardBackdrop.png');
    background-size: cover;
    background-blend-mode: soft-light;
    background-repeat: no-repeat;
    background-position: center center;
}

body.light-mode .backdrop {
    background-blend-mode: exclusion;
}

.tournament-section p {
    font-size: clamp(15px, 2vw, 18px);;
    max-width: 800px;
    margin: 0 auto 2em;
    line-height: 1.5;
}

.tournament-section h4 {
    font-size: clamp(20px, 2.5vw, 36px);
    /* max-width: 800px; */
    line-height: 1.2;
}

/* Features Grid Layout */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid columns */
    gap: 30px; /* Space between grid items */
    margin-top: 40px;
}

.feature-item {
    background-color: var(--secondary-current);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-current);
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hover effects */
}

.feature-item:hover {
    transform: translateY(-10px) scale(1.02); /* Lift and slight scale on hover */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); /* Stronger shadow on hover */
}

.feature-item img {
    width: 80px; /* Size of your feature icons */
    height: 80px;
    margin-bottom: 20px;
    /* Filter to make icons light in dark mode, adjust if your icons are already light */
    /* filter: invert(1) opacity(0.8); */
}


.feature-item h4 {
    font-size: 1.6em;
    color: var(--accent-current); /* Feature titles in accent color */
    margin-bottom: 10px;
}

/* Footer Styling */
.footer {
    background: var(--dark-purple-gradient); /* Apply gradient to footer */
    color: #bbb;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9em;
    transition: background-color 0.5s ease; /* Smooth transition for light mode */
}

body.light-mode .footer {
    background-color: #eee; /* Lighter solid color for light mode footer */
    background-image: none; /* Remove gradient in light mode */
    color: #333;
}


.footer .footer-links a {
    color: #bbb;
    margin: 0 10px;
    transition: color 0.3s ease;
}


body.light-mode .footer-links a {
    color: #333;
}

.footer .footer-links a:hover {
    color: var(--accent-current);
}

/* --- CSS ANIMATIONS --- */

/* Keyframe for subtle glow effect (for primary buttons and hero title) */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 10px rgba(var(--primary-color-dark-r), var(--primary-color-dark-g), var(--primary-color-dark-b), 0.5); }
    50% { box-shadow: 0 0 20px rgba(var(--primary-color-dark-r), var(--primary-color-dark-g), var(--primary-color-dark-b), 0.8), 0 0 30px rgba(var(--primary-color-dark-r), var(--primary-color-dark-g), var(--primary-color-dark-b), 0.6); }
    100% { box-shadow: 0 0 10px rgba(var(--primary-color-dark-r), var(--primary-color-dark-g), var(--primary-color-dark-b), 0.5); }
}

/* Light mode specific glow */
@keyframes pulse-glow-light {
    0% { box-shadow: 0 0 10px rgba(var(--primary-color-light-r), var(--primary-color-light-g), var(--primary-color-light-b), 0.5); }
    50% { box-shadow: 0 0 20px rgba(var(--primary-color-light-r), var(--primary-color-light-g), var(--primary-color-light-b), 0.8), 0 0 30px rgba(var(--primary-color-light-r), var(--primary-color-light-g), var(--primary-color-light-b), 0.6); }
    100% { box-shadow: 0 0 10px rgba(var(--primary-color-light-r), var(--primary-color-light-g), var(--primary-color-light-b), 0.5); }
}

/* Apply glow based on current mode */
.glow-on-hover {
    animation: pulse-glow 2s infinite alternate;
}

/* Fade In Up animation */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up:not(.container.hero-content h2) {
    opacity: 0; /* Hidden by default */
    animation: fade-in-up 0.8s ease-out forwards; /* Animation properties */
}
.fade-in-up.delay-1 { animation-delay: 0.2s; }
.fade-in-up.delay-2 { animation-delay: 0.4s; }

.container.hero-content h2.fade-in-up {
    opacity: 0; /* Hidden by default */
    animation: fade-in-up 0.8s ease-out forwards, maintitle 3s ease infinite; /* Animation properties */
}

/* Slide In Left animation */
@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    opacity: 0;
    animation: slide-in-left 0.8s ease-out forwards;
}

/* Slide In Right animation */
@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    opacity: 0;
    animation: slide-in-right 0.8s ease-out forwards;
}

/* Generic Fade In animation */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    opacity: 0;
    animation: fade-in 1s ease-out forwards;
}
.fade-in.delay-1 { animation-delay: 0.2s; }
.fade-in.delay-2 { animation-delay: 0.4s; }
.fade-in.delay-3 { animation-delay: 0.6s; }

::-webkit-scrollbar {
    width: 5px; /* Set scrollbar width */
    background-color: var(--border-current); /* Dark background for scrollbar track */
}
  
::-webkit-scrollbar-thumb {
    background-color: var(--mafia-title-current); /* Gray background for scrollbar handle */
    border-radius: 5px; /* Add rounded corners to handle */
}

::-webkit-scrollbar-thumb:hover {
    background-color: red; /* Slightly lighter gray on hover */
}


/* Terms of Service  */

#terms-of-service-page p, #terms-of-service-page li {
    font-family: sans-serif;
}

#terms-of-service-page ul {
    padding: 0;
    margin: 0;
}

#terms-of-service-page li {
    margin-bottom: 5px;
    margin-left: 20px;
}

#terms-of-service-page h3 {
    margin-top: 50px;
}


/* Patch page */

#patch-page p {
    font-family: sans-serif
}

#patch-page h3 {
    margin-top: 30px;
}

#patch-page ul li {
    font-family: sans-serif;
    margin-left: 15px;
    padding-left: 5px;
}

#patch-page ul ul li {
    margin-left: 30px;
}

#patch-page .pre {
    font-family: monospace;
    background-color: var(--border-current);
    border-radius: 8px;
    padding: 3px 4px;
    font-size: 0.9rem;
    display: inline-block;
}


#patch-page section.buttons {
    margin-top: 20px;
    margin-bottom: 20px;
}

#patch-page section.buttons a {
    margin-right: 10px;
}

/* Roles page */

.rolecard-container {
    width: 300px;
    height: 400px;
    perspective: 1000px; /* Sets the 3D perspective */
    cursor: pointer;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;

}

.rolecard-flipper {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s; /* Smooth flip animation */
    transform-style: preserve-3d; /* Key for a 3D effect */
}

.rolecard-container.flipped .rolecard-flipper {
    transform: rotateY(180deg);
}

.rolecard, .rolecard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Hide the back of the element when flipped */
    backface-visibility: hidden; /* Standard property */
    border-radius: 19.5px;
    transition: background-color 0.5s ease, background-image 0.4s ease;
    overflow: hidden; /* To keep content within rounded corners */
}

.rolecard-mafia {
    box-shadow: 0 2px 10px rgba(var(--mafia-theme), 0.3);
}

.rolecard-village {
    box-shadow: 0 2px 10px rgba(var(--villager-theme), 0.3);
}

.rolecard-neutral {
    box-shadow: 0 2px 10px rgba(var(--neutral-theme), 0.3);
}

.rolecard {
    padding: 0;
    display: flex;
    justify-self: center;
    align-items: center;
    z-index: 2;
}

.rolecard-back {
    background-color: var(--footer-bg-current);
    color: var(--text-current);
    transform: rotateY(180deg); /* Start the back face already flipped */
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    flex-direction: column;
}

.roletitle {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
}

.rolecard::before {
    background-image: url('/media/RoleCardBackground.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    position: absolute;
    z-index: -1;
    width: 100%;
    height: 100%;
    content: '';
    filter: invert(1);
    transform: rotate(180deg);
}

body.light-mode .rolecard::before {
    filter: invert(0);
}

.overlay {
    background-image: url('/media/SpillOverlayUpdated.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.overlay .tag-container h5 {
    background-color: rgb(13, 39, 123);
    color: var(--text-current);
    border-radius: 999px;
    padding: 2px 8px;
    width: fit-content;
    display: inline-block;
    margin: 0;
    margin-right: 7px;
    margin-bottom: 14px;
    font-weight: 550;
    height: 25px;
}

.tag-container {
    /* padding-bottom: 5px; */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    /* margin-right: 10px; */
    height: 25px;
}

body.light-mode .overlay .tag-container h5 {
    background-color: rgb(107, 186, 255);
}

.rolecard-logo {
    height: 150px;
}

.rolecard-logotitle {
    height: 40px;
    margin-right: 5px;
}

.rolecard-text {
    color: var(--text-color-light);
    text-align: center;
    padding: 5px 20px;
    text-wrap: balance;
    line-height: 1.25;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.roletitle b {
    line-height: normal;
    overflow: none;
    /* max-height: 40px; */
    text-wrap: pretty;
}

body.light-mode .rolecard-text h1 {
    color: #000;
    background: rgba(255, 255, 255, 0.85);
}

.rolecontainer {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

hr {
    margin-bottom: 15px;
}

.filter-button {
    background-color: var(--primary-current);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    border: none;
    box-shadow: none;
    z-index: 50;
    cursor: pointer;
    transition: transform 0.3s;
    margin: 10px;
}

.filter-button:hover {
    transform: scale(1.05);
}

.filter-panel {
    position: fixed;
    top: 78.5px;
    right: -320px;
    height: 100vh;
    width: 300px;
    background-color: var(--border-current);
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 60;
    transition: right 0.4s ease-in-out;
    padding: 0.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: none;
}

.filter-panel.active {
    right: 0;
}

.filter-content-wrapper {
    flex-grow: 1;
    padding-bottom: 2rem; /* Add some padding to the bottom for spacing */
    overflow: none;
}

.filter-panel-heading {
    display: flex;
    justify-content: space-between;
}

.filter-group {
    border: 1px solid #444;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background-color: var(--bg-current);
}

#roles-page .flexbox {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#roles-page .unfiltered {
    display: none;
}

#roles-page .category label {
    margin: 5px;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#roles-page .subcategory {
    display: flex;
    flex-direction: column;
    margin-left: 20px;
}

#close-filter-btn {
    position: absolute;
    top: 0;
    right: 0;
    margin-right: 20px;
    margin-top: 10px;
}

#roles-page div.rolecards.specifics {
    display: none;
}

#roles-page div.roleinfo-bg {
    background-color: var(--border-current);
    width: 100%;
    padding: 20px clamp(20px, 5vw, 60px);
    border-radius: 50px;
    margin-bottom: 20px;
}

#roles-page div.roleinfo-bg div.flexbox {
    flex-wrap: wrap;
    justify-content: space-around;
    margin-top: -50px;
    container-name: infogrid;
    container-type: inline-size;
    /* margin-bottom: -40px; */
}

#roles-page div.roleinfo-bg h1 {
    text-align: center;
    font-size: clamp(2em, 3.5vw, 3em);
}

#roles-page div.roleinfo-bg div img {
    height: clamp(250px, 25vw, 400px)
}

#roles-page div.roleinfo-bg div:has(img):not(:has(.section-icon)) {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

#roles-page div.roleinfo-bg .roleinfo-grid {
    /* display: grid;
    grid-auto-flow: column;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(auto, 1fr);
    grid-template-areas:
        "item1 item5"
        "item2 item6"
        "item3 item7"
        "item4 item8";
    width: fit-content;
    column-gap: 30px;
    margin: auto;
    flex-wrap: wrap; */
    column-count: 2;
    column-gap: 30px;
}

#roles-page div.roleinfo-bg .roleinfo-grid > *:nth-child(2n) {
    margin-top: -15px;
    margin-bottom: 20px;
}

#roles-page div.roleinfo-bg .flexbox div:has(.roleinfo-grid) {
    flex-grow: 1;
}

#roles-page div.roleinfo-bg p:not(.chunky) {
    font-family: sans-serif;
}

#roles-page div.roleinfo-bg .highlight {
    /* background-color: var(--accent-current); */
    padding: 3px 8px;
    border-radius: 999px;
    height: fit-content;
    text-align: center;
    font-weight: bold;
    text-wrap: wrap !important;
}

#roles-page div.roleinfo-bg .chunky {
    /* background-color: var(--accent-current); */
    padding: 3px 8px;
    border-radius: 999px;
    height: fit-content;
    text-align: center;
}

#roles-page div.roleinfo-bg .section-cont {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
}

#roles-page div.roleinfo-bg .section-cont > *:last-child {
    flex-grow: 1;
}


#roles-page div.roleinfo-bg .section-icon {
    /* float: right; */
    height: 90px;
    width: 90px;
    background: rgba(55, 55, 55, 0.6);
    border-radius: 20px;
    margin: -5px 0 0px 20px;
    justify-self: stretch;
}


body.light-mode #roles-page div.roleinfo-bg .section-icon {
    background: rgba(155, 155, 155, 0.6);
    border-radius: 20px;
}

#roles-page div.roleinfo-bg {
    .highlight { 
        color: black;
    }

    &.mafia {
        box-shadow: 0 0 10px 1px rgb(var(--mafia-theme));
        .highlight { background-color: rgba(var(--mafia-theme)); color: white; }
        h1 { color: rgba(var(--mafia-theme)); }
        .rolebox > hr { border: 1px solid rgba(var(--mafia-theme)); }
    }

    &.village {
        box-shadow: 0 0 10px 1px rgb(var(--village-theme));
        .highlight { background-color: rgba(var(--village-theme)); }
        h1 { color: rgba(var(--village-theme)); }
        .rolebox > hr { border: 1px solid rgba(var(--village-theme)); }
    }

    &.neutral {
        box-shadow: 0 0 10px 1px rgb(var(--neutral-theme));
        .highlight { background-color: rgba(var(--neutral-theme)); }
        h1 { color: rgba(var(--neutral-theme)); }
        .rolebox > hr { border: 1px solid rgba(var(--neutral-theme)); }
    }
}

body.light-mode #roles-page div.roleinfo-bg {
    &.mafia {
        h1 { text-shadow: 1px 0 10px rgb(var(--mafia-theme)); }
    }

    &.village {
        h1 { text-shadow: 1px 0 10px rgb(var(--village-theme)); }
    }

    &.neutral {
        h1 { text-shadow: 1px 0 10px rgb(var(--neutral-theme)); }
    }

    h1 { color: var(--text-current); }
}


#roles-page div.roleinfo-bg .rolebox {
    /* border: 2px solid var(--secondary-current); */
    border-radius: 25px;
    margin-bottom: 20px;
    padding: 4px 10px;
    box-shadow: 0 0 15px 1px var(--bg-current);
}

.rolebox h2 {
    font-size: 30px;
    margin-bottom: 0;
    text-align: center;
}

.rolebox p {
    text-wrap: pretty;
}






/* ------------------- SHOP PAGE ----------------- */
#shop-page #product-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

#shop-page div.item-container {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    border-radius: 1rem;
    border-width: 1px;
    position: relative;
    transition: all cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.8), 0 4px 6px -2px rgba(0, 0, 0, 0.65); 
    border: none; 
    background-color: transparent;
    min-width: 200px;
}

body.light-mode #shop-page div.item-container {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); 
}

#shop-page div.item-container:hover {
    box-shadow: 0 25px 25px -6px rgba(0, 0, 0, 1); 
}

body.light-mode #shop-page div.item-container:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); 
}

#shop-page div.item-container > div {
    position: relative;
    z-index: 3;
}

#shop-page :not(dialog) div.item-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%; 
    height: 200%;
    z-index: 1; 
    opacity: 0; 
    transition: opacity 0.6s;
    border-radius: inherit;
    background: conic-gradient(
        from 50deg, 
        #000593, 
        #0e0228
    );
}

body.light-mode #shop-page :not(dialog) div.item-container::before {
    background: conic-gradient(
        from 50deg, 
        #3e44ef, 
        #4d299b
    );
}

#shop-page :not(dialog) div.item-container::after {
    content: '';
    position: absolute;
    inset: 3px; 
    background-color: var(--secondary-current);
    z-index: 2; /* Sits above the rotating glow, but below content */
    border-radius: 0.8rem; 
    transition: background-color 0.4s;
}

#shop-page :not(dialog) div.item-container:hover::before {
    opacity: 1;
    animation: border-glow 4s ease-in infinite; /* 4s duration, repeats infinitely */
}

#shop-page div.img-container {
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    height: 10rem;
}

#shop-page div.img-container > img {
    object-fit: cover; 
    width: 100%; 
    height: 100%; 
    opacity: 0.8; 
}

#shop-page div.img-container > span {
    position: absolute; 
    top: 0.75rem; 
    right: 0.75rem; 
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border-width: 1px;
    font-size: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); 
    background-color: var(--mafia-title-current);
    color: white;
    opacity: 0.85;
}

#shop-page div.product-info {
    display: flex; 
    padding: 1rem; 
    flex-direction: column; 
    flex-grow: 1; 
}

#shop-page div.product-info > p {
    margin-top: 0.25rem; 
    flex-grow: 1; 
}

#shop-page div.product-price {
    display: flex; 
    padding-top: 0.3rem; 
    margin-top: 0.5rem; 
    justify-content: space-between; 
    align-items: center; 
    border-top: 1px;
}

#shop-page div.viewmore {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

#shop-page div.viewmore select {
    padding: 8px 8px;
    border: none;
    background-color: var(--bg-current);
    color: var(--text-current);
    border-radius: 999px;
}

#shop-page dialog {
    border: none;
    border-radius: 25px;
    background: var(--secondary-current);
    width: max(50%, 300px);
    margin: auto;
    color: var(--text-current);
}

#shop-page dialog::backdrop {
    background: rgba(0, 0, 0, 0.75);
}



/* Responsive Design Media Queries */
@media (max-width: 768px) {

    .hero-content h2 {
        font-size: 8vw;
    }

    .hero-logo {
        max-height: 8vw;
    }

    .hero-section p {
        font-size: 3vw;
    }

    .section h3 {
        font-size: 2em;
    }

    .feature-grid {
        grid-template-columns: 1fr; /* Single column for features on small screens */
    }

    .hamburger-menu {
        height: 15px;
        width: 20px;
    }

    .hamburger-menu.active span:nth-child(1) {
        transform: rotate(45deg) translate(3.33px, 3.33px);
    }

    .hamburger-menu.active span:nth-child(3) {
        transform: rotate(-45deg) translate(3.33px, -3.33px);
    }

    .top-logo {
        margin: -10px;
        height: 20px;
        padding: 0;
    }

    .logo {
        font-size: 1em;
    }

    .mode-toggle-btn {
        font-size: 0.7em;
        width: fit-content;
        padding: 5px 8px;
    }

    .navbar nav {
        width: 50%;
    }

    .first-content {
        margin-top: calc(60px + 5vh);
    }

    .filter-panel {
        top: 58px;
    }

    .rolebox h2.do-not-center {
        margin-left: 0;
    }

}


@container infogrid (width < 400px) {
    #roles-page div.roleinfo-bg .roleinfo-grid {
        /* grid-template-columns: 1fr;
        grid-auto-flow: column;
        grid-template-areas: "item1" "item2" "item3" "item4" "item5" "item6" "item7" "item8";
        column-gap: 5px;
        row-gap: 10px;
        width: max-content; */
        column-count: 1;
        column-gap: 0;
    }
}

@keyframes border-glow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes maintitle {
    0%, 100% {
        text-shadow: 0 0 10px #8b0000ce, 0 0 20px #8B0000ce; /* Subtle base glow */
    }

    50% {
        text-shadow: 0 0 40px #8B0000ce, 0 0 80px #8B0000ce; /* Intense mid-glow */
    }
}