@import url('./modal.css');

:root {
    /* Premium Dark Mode Palette */
    --bg-color: #050505;
    --bg-gradient: radial-gradient(circle at top center, #1a1a1a 0%, #050505 80%);
    --text-color: #e0e0e0;
    --text-muted: #888888;

    /* Accents */
    --accent-color: #ffd700;
    --accent-glow: rgba(255, 215, 0, 0.4);
    --accent-gradient: linear-gradient(135deg, #ffd700, #ffaa00);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

    /* Typography */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Layout */
    --header-height: 80px;
    --spacing-unit: 1rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.brand-title {
    display: inline-block;
    font-size: 5rem;
    letter-spacing: 0.5rem;
    font-family: var(--font-serif);
    background: linear-gradient(135deg, #fff 0%, #888 100%);
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    margin: 4rem 0;
    text-transform: uppercase;
    text-align: center;
    position: relative;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}

.brand-title .line {
    display: block;
    line-height: 1.1;
}

.brand-title .line.midas {
    color: var(--accent-color);
    background: var(--accent-gradient);
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.2);
}

/* Header (Unified) */
.site-header {
    width: 100%;
    height: var(--header-height);
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-inner {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    background: var(--accent-gradient);
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    /* Ensure alignment */
}

.main-nav>a,
.nav-item>a {
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding: 0.5rem 0;
}

.main-nav>a::after,
.nav-item>a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.main-nav>a:hover::after,
.main-nav>a.active::after,
.nav-item>a:hover::after {
    width: 100%;
}

/* Dropdown Styles */
.nav-item.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(20px);
    min-width: 200px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1100;
    flex-direction: column;
}

.nav-item.dropdown:hover .dropdown-menu {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-menu a {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
    white-space: nowrap;
    text-align: left;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent-color);
    padding-left: 1.8rem;
    /* Subtle indent on hover */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.nav-highlight {
    border: 1px solid var(--accent-color);
    padding: 0.5rem 1.2rem !important;
    border-radius: 50px;
    color: var(--accent-color) !important;
    transition: all 0.3s ease;
}

.nav-highlight::after {
    display: none;
}

.nav-highlight:hover {
    background: var(--accent-color);
    color: #000 !important;
    box-shadow: 0 0 20px var(--accent-glow);
    text-shadow: none;
}

/* Features / Link List */
ul.link-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

ul.link-list a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    height: 100%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

ul.link-list a:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Footer */
.site-footer {
    width: 100%;
    margin-top: auto;
    padding: 3rem 0;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.4);
}

.footer-links {
    text-align: center;
}

.footer-links h2 {
    font-family: var(--font-sans);
    font-size: 1rem;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    color: var(--text-color);
    opacity: 0.8;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent-gradient);
    color: #000;
    border: 0;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
    color: #000;
    text-shadow: none;
}

/* Game Canvas & Elements */
canvas {
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 30px var(--accent-glow);
    border-radius: 8px;
    background: #000;
    max-width: 100%;
    margin: 2rem 0;
    display: block;
}

/* Responsive */
/* Menu Toggle (Desktop: Hidden) */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 1rem;
    transition: transform 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --header-height: auto;
    }

    .site-header {
        position: relative;
        padding: 0.5rem 0;
    }

    .header-inner {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        /* Vertically align logo and toggle */
    }

    .brand-title {
        font-size: 3rem;
        margin: 3rem 0;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        /* Hidden by default */
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 0;
        /* Remove gap, use padding in links */
        background: rgba(0, 0, 0, 0.95);
        /* Opaque bg for mobile menu */
        /* Slightly darker bg for menu */
        margin-top: 1rem;
        border-radius: 8px;
        overflow: hidden;
        backdrop-filter: blur(20px);
    }

    .main-nav.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    .main-nav>a,
    .nav-item {
        width: 100%;
        text-align: center;
    }

    .main-nav>a,
    .nav-item>a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    .main-nav a::after,
    .nav-item>a::after {
        display: none;
        /* Create simple highlight instead of underline */
    }

    .main-nav a:hover,
    .nav-item>a:hover {
        background: rgba(255, 215, 0, 0.1);
    }

    /* Mobile Dropdown */
    .nav-item.dropdown:hover .dropdown-menu,
    .nav-item.dropdown.active .dropdown-menu {
        position: static;
        display: flex;
        transform: none;
        background: transparent;
        border: none;
        box-shadow: none;
        width: 100%;
        padding-left: 0;
    }

    .dropdown-menu a {
        background: rgba(255, 255, 255, 0.03);
        padding-left: 2rem;
    }

    .container {
        padding: 1rem;
        width: 95%;
    }

    ul.link-list {
        grid-template-columns: 1fr;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}