/* works css */
@font-face {
    font-family: "MPLUS";
    src: url("../Fonts/MPLUSRounded1c-ExtraBold.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

:root {
    --bg-color: #212830;
    --text-light: #ffffff;
    --text-muted: #b8bec5;
    --accent-green: #4BCD79;
    --sidebar-bg: #1a1f26;
    --button-bg: #2f363d;
    --button-hover: #243934;
    --button-text: #979a9e;
    --button-hover-text: #41ce5c;
    --button-hover-border: #3bb054;
    --border-color: #3a4654;
    --section-bg: #2a3440;
    --badge-bg: #363d49;
    --game-bg: #1e2730;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(75,205,121,0.6) rgba(255,255,255,0.05);
}

body {
    background: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-light);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    user-select: none;
    caret-color: transparent;
}

/* Menu Toggle Button */
.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    background: var(--button-bg);
    border: none;
    color: var(--text-light);
    font-size: 28px;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.menu-toggle:hover {
    background: var(--button-hover);
    transform: scale(1.05);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1200;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    font-family: "MPLUS", sans-serif;
    color: var(--accent-green);
    font-size: 1.5rem;
}

.sidebar-header h3 i {
    margin-right: 10px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: opacity 0.3s;
}

.close-btn:hover {
    opacity: 0.7;
}

/* Navigation Buttons in Sidebar */
.nav-buttons {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 10px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--button-bg);
    color: var(--button-text);
    border: 1px solid transparent;
    padding: 15px 20px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

.nav-btn i {
    font-size: 1.2rem;
}

.nav-btn:hover {
    background: var(--button-hover);
    color: var(--button-hover-text);
    border: 1px solid var(--button-hover-border);
    transform: translateX(5px);
}

.nav-btn.active {
    background: var(--button-hover);
    color: var(--button-hover-text);
    border: 1px solid var(--button-hover-border);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.main-content {
    padding: 100px 20px 180px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    opacity: 0; /* start hidden for fade-in */
    transition: opacity 1s ease; /* fade-in duration */
}

.main-content.show {
    opacity: 1;
}


.page-exit-animation {
    opacity: 0; /* fade-out */
    transition: opacity 1s ease; /* fade-out duration */
}

.container {
    width: 100%;
}

/* Works Section */
.works-section {
    margin-bottom: 60px;
}

.section-title {
    font-family: "MPLUS", sans-serif;
    color: var(--text-light);
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 25px;
    letter-spacing: 1.5px;
}

/* Tools Grid */
.tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.tool-badge {
    background: var(--badge-bg);
    color: var(--text-light);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 6px 0 0 #00000027;
}

.tool-badge:hover {
    background: var(--button-hover);
    border-color: var(--button-hover-border);
    color: var(--accent-green);
    transform: translateY(-2px);
}

.tool-badge a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
}

/* Illustrations Grid – Pinterest Style */
.illustrations-grid {
    column-count: 4;
    column-gap: 20px;
}

.illustration-item {
    break-inside: avoid;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    aspect-ratio: auto;
    transition:
        transform 0.35s cubic-bezier(.22,.61,.36,1),
        box-shadow 0.35s ease;
    will-change: transform;
    position: relative;
}

.illustration-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #2128301e;
    transition: background 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.illustration-item:hover::before {
    background: rgba(0,0,0,0);
}

.illustration-item:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.illustration-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    will-change: transform;
    backface-visibility: hidden;
    object-position: center;
    transition: transform 0.4s ease;
}

.illustration-item:hover img {
    transform: scale(1.06);
}

@media (max-width: 1200px) {
    .illustrations-grid {
        column-count: 4;
        border-radius: 15px;
    }
}

@media (max-width: 700px) {
    .illustrations-grid {
        column-count: 3;
        column-gap: 10px;
        border-radius: 10px;
    }
}

@media (max-width: 400px) {
    .illustrations-grid {
        column-count: 2;
        overflow: hidden;
    }
}

/* See More Link */
.see-more {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.see-more a {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.see-more a:hover {
    border-bottom-color: var(--accent-green);
}

/* Games List */
.games-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 20px;
}

.witchtype-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.game-item {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    background: var(--game-bg);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.game-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to right, rgba(75, 205, 121, 0.4) 0%, rgba(75, 205, 121, 0) 100%);
    opacity: 0;
    transform: translateX(-100%);
    transition: all 0.5s ease;
    z-index: -1;
    border-radius: 12px 0 0 12px;
}

.game-item:hover {
    border-color: var(--button-hover-border);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.game-item:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.game-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--section-bg);
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-title {
    font-family: "MPLUS", sans-serif;
    color: var(--accent-green);
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.game-description {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Image Modal */
.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.image-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.image-modal img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,.6);
}

.download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10000;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.download-btn img {
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: transform 0.2s;
}

.download-btn img:hover {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 992px) {
    .game-item {
        grid-template-columns: 200px 1fr;
        gap: 20px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .games-list .game-item {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
    }

    .games-list .game-thumbnail {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .games-list .game-info {
        width: 100%;
        text-align: center;
        gap: 10px;
    }

    .main-content {
        padding: 80px 15px 150px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .illustrations-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .game-item {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .game-thumbnail {
        max-width: 250px;
        margin: 0 auto;
    }

    .menu-toggle {
        width: 45px;
        height: 45px;
        font-size: 24px;
    }

    .tool-badge {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.3rem;
    }

    .works-section {
        margin-bottom: 40px;
    }

    .tools-grid {
        gap: 10px;
    }

    .tool-badge {
        font-size: 0.85rem;
        padding: 7px 14px;
    }

    .illustrations-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }

    .game-title {
        font-size: 1.2rem;
    }

    .game-description {
        font-size: 0.9rem;
    }
}

/* ============================= */
/* Scrollbar – modern slick */
/* ============================= */

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(75,205,121,0.25);
    border-radius: 10px;
    transition: background 0.3s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(75,205,121,0.9);
}