:root {
    --bg: #05070d;
    --bg-secondary: #0b1020;
    --surface: rgba(22, 27, 40, 0.88);
    --surface-hover: rgba(34, 41, 61, 0.95);
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --muted: #9ca3af;
    --accent: #f1c50e;
    --accent-hover: #d9b10d;
    --accent-text: #111111;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --glow: 0 0 25px rgba(241, 197, 14, 0.15);
}

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



body {
    font-family: Inter, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

body.page-home {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)), url('assets/img/MMFates_SeaOfFates_Keyart.webp') no-repeat center center fixed;
    background-size: cover;
}
body.page-best-decks {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('assets/img/MMFates_Ignatius_Keyart.webp') no-repeat center center fixed;
    background-size: cover;
}

body.page-tips {
    background: linear-gradient(to left, rgba(255, 0, 11, 0.64) 0%, rgba(0, 0, 0, 0.8) 21%, rgba(0, 0, 0, 0.8) 78%, rgba(0, 131, 255, 0.64) 100%), url('assets/img/MMFates_Heroes_Keyart.webp') no-repeat center center fixed;
    background-size: cover;
}

body.page-trade {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 75%, rgba(14, 241, 39, 0.7)), url('assets/img/MMFates_SANDRO_Keyart.webp') no-repeat center center fixed;
    background-size: cover;
}

body.page-privacy {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(14, 241, 39, 0.5)), url('assets/img/MMFates_SANDRO_Keyart.webp') no-repeat center center fixed;
    background-size: cover;
}

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: rgba(10, 12, 18, 0.88);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    margin-bottom: 40px;
}

.logo img {
    width: 180px;
    height: auto;
    display: block;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
    padding: 14px 16px;
    border-radius: 18px;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    font-weight: 600;
}

.sidebar-nav a:hover {
    background: var(--surface-hover);
    transform: translateX(4px);
    box-shadow: var(--glow);
}

.sidebar-nav a.active {
    background: var(--surface-hover);
    box-shadow: var(--glow);
}

.sidebar-nav img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-nav span {
    font-size: 1rem;
    font-weight: 600;
}

.language-switcher {
    margin-top: 40px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.language-switcher button {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.25s ease;
}

.language-switcher button:hover {
    background: var(--accent);
    color: var(--accent-text);
    transform: translateY(-2px);
}

.youtube-subscribe {
    margin-top: 40px;
}

.yt-sub-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ff0000;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    width: fit-content;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.yt-sub-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
}

.yt-sub-btn svg {
    flex-shrink: 0;
}

.content {
    padding: 60px;
    width: 100%;
    max-width: 1500px;
}

.hero {
    margin-bottom: 60px;
}

.hero h1 {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 18px;
    letter-spacing: -2px;
}

.hero p {
    color: var(--muted);
    font-size: 1.15rem;
    margin-bottom: 32px;
    max-width: 700px;
    line-height: 1.7;
}

#searchInput {
    width: 100%;
    max-width: 700px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px 22px;
    color: white;
    font-size: 1rem;
    outline: none;
    backdrop-filter: blur(12px);
    transition: border 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

#searchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(241, 197, 14, 0.15);
    background: rgba(255,255,255,0.06);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
}

.wiki-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 30px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, border 0.25s ease;
}

.wiki-card:hover {
    transform: translateY(-6px);
    background: var(--surface-hover);
    box-shadow: var(--shadow), var(--glow);
    border-color: rgba(241, 197, 14, 0.25);
}

.wiki-card h2 {
    margin-bottom: 16px;
    font-size: 2rem;
}

.wiki-card p {
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.7;
}

.wiki-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 16px;
    background: var(--accent);
    color: var(--accent-text);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.wiki-card a:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.page-header {
    margin-bottom: 50px;
}

.page-header h1 {
    font-size: 4rem;
    margin-bottom: 12px;
    line-height: 1;
}

.page-header p {
    color: var(--muted);
    font-size: 1.1rem;
}

.deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.deck-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    overflow: hidden;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.deck-card:hover {
    transform: translateY(-6px);
    background: var(--surface-hover);
    box-shadow: var(--shadow), var(--glow);
}

.deck-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.deck-card-content {
    padding: 24px;
}

.deck-card h3 {
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.tier-badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 14px;
    background: var(--accent);
}

.tier-s {
    background: #ff4d6d;
}

.tier-a {
    background: #7c5cff;
}

.tier-b {
    background: #3b82f6;
}

/* MOBILE MENU BUTTON */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: auto;
	right: 20px;
    z-index: 1001;
    background: rgba(10, 12, 18, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.25s ease, transform 0.25s ease;
    padding: 0;
}

.mobile-menu-btn:hover {
    background: var(--surface-hover);
    transform: scale(1.05);
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* SIDEBAR CLOSE BUTTON */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, transform 0.25s ease;
    padding: 0;
    flex-shrink: 0;
    color: var(--text);
    font-size: 20px;
    line-height: 1;
}

.sidebar-close-btn:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: scale(1.1);
}



/* MOBILE OVERLAY */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* MOBILE */
@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }

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

    .sidebar-close-btn {
        display: flex;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-overlay.active {
        pointer-events: all;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        height: 100vh;
        width: 300px;
        max-width: 85vw;
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 80px;
        overflow-y: auto; /* AGGIUNGI QUESTA */
    }

    .sidebar.open {
        transform: translateX(0); /* Arrivo a 0 */
    }

    .content {
        padding: 32px;
        padding-top: 80px;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .page-header h1 {
        font-size: 3rem;
    }
}

@media (max-width: 700px) {
    .content {
        padding: 22px;
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .page-header h1 {
        font-size: 2.4rem;
    }

    .wiki-card {
        padding: 24px;
    }

    .deck-card-content {
        padding: 20px;
    }

    .sidebar-nav img {
        width: 32px;
        height: 32px;
    }
}

.guide-content {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.site-footer {
    margin-top: 60px;
    padding: 40px 0 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer .footer-logo {
    width: 60px;
    margin-bottom: 20px;
    opacity: 0.7;
}

.site-footer p {
    margin-bottom: 12px;
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.site-footer a:hover {
    opacity: 0.8;
}

.site-footer .footer-copyright {
    margin-top: 32px;
    font-size: 0.8rem;
    opacity: 0.6;
}

@media (max-width: 1100px) {
    .sidebar .logo {
        margin-bottom: 20px;
    }
    
    .sidebar .logo img {
        width: 140px; /* ridimensiona il logo */
    }
}