/* --- VARIABLES --- */
:root {
    --primary-grad: linear-gradient(135deg, #ff4757, #ff6b81);
    --accent-grad: linear-gradient(135deg, #6c5ce7, #a29bfe);
    --bg-body: #f1f3f6;
    --white: #ffffff;
    --text-dark: #2f3542;
    --text-muted: #a4b0be;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Google Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
}

/* --- HEADER --- */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.logo { font-weight: 800; font-size: 24px; color: #ff4757; text-decoration: none; }
.logo span { color: var(--text-dark); }


/* --- LAYOUT WRAPPER (SIDEBAR ON RIGHT) --- */
.wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    max-width: 1450px;
    margin: 30px auto;
    gap: 30px;
    padding: 0 20px;
    align-items: start;
}

/* --- MAIN CONTENT & GRID --- */
main h2 { font-weight: 800; margin-bottom: 25px; }
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.game-card {
    background: var(--white); border-radius: 20px; overflow: hidden;
    box-shadow: var(--shadow); transition: var(--transition);
    text-decoration: none; color: inherit;
}

.game-card:hover .static-img {
        transform: scale(1.1);
    }

    .thumb.has-gif:hover .hover-gif {
        opacity: 1 !important;
    }

    .thumb.no-gif:hover .static-img {
        filter: brightness(1.1);
    }

    .game-card h3:hover {
        color: var(--primary) !important;
    }

/* --- SIDEBAR --- */
aside {
    background: var(--white); border-radius: 25px;
    padding: 25px; box-shadow: var(--shadow);
    position: sticky; top: 100px;
}
.nav-group { margin-bottom: 25px; }
.nav-group h4 { font-size: 11px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 15px; }

.category-sidebar-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pill {
    background: #f1f2f6; padding: 6px 12px; border-radius: 50px;
    text-decoration: none; color: var(--text-dark); font-size: 12px; font-weight: 600;
}
.cat-pill.active, .cat-pill:hover { background: var(--primary-grad); color: #fff; }

.nav-link {
    display: flex; align-items: center; padding: 10px;
    text-decoration: none; color: var(--text-dark); border-radius: 10px;
    font-size: 14px; transition: 0.3s;
}
.nav-link i { width: 25px; color: #ff4757; }
.nav-link:hover { background: #f8f9fa; transform: translateX(5px); }

/* --- NEW PROFESSIONAL FOOTER (3 COLUMNS) --- */
.main-footer { 
    background-color: #111; 
    color: #a4b0be; 
    padding: 80px 0 30px; 
    margin-top: 60px; 
}

.footer-content {
    max-width: 1400px; 
    margin: 0 auto; 
    display: flex;
    justify-content: space-between;
    gap: 60px; 
    padding: 0 5%;
}

.footer-logo { 
    font-size: 28px; 
    font-weight: 800; 
    color: #fff; 
    text-decoration: none; 
    margin-bottom: 20px; 
    display: block; 
}

.footer-logo span { color: #ff4757; }

.footer-col { flex: 1; }

.footer-col:first-child { 
    flex: 2; 
    max-width: 500px;
}

.footer-col p {
    font-size: 14px;
    line-height: 1.8;
}

.footer-col h4 { 
    color: #fff; 
    margin-bottom: 25px; 
    position: relative; 
    font-size: 18px;
}

.footer-col h4::after { 
    content: ''; 
    position: absolute; 
    left: 0; 
    bottom: -8px; 
    width: 35px; 
    height: 3px; 
    background: #ff4757; 
}

.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a { 
    color: #a4b0be; 
    text-decoration: none; 
    font-size: 14px; 
    transition: 0.3s; 
}

.footer-col ul li a:hover { 
    color: #ff4757; 
    padding-left: 8px; 
}

.social-links { display: flex; gap: 15px; margin-top: 25px; }
.social-links a { 
    width: 40px; 
    height: 40px; 
    background: #222; 
    color: #fff; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 12px; 
    text-decoration: none; 
    transition: 0.3s;
}

.social-links a:hover { 
    background: #ff4757; 
    transform: translateY(-5px); 
}

.footer-bottom { 
    text-align: center; 
    margin-top: 60px; 
    padding-top: 30px; 
    border-top: 1px solid #222; 
    font-size: 13px; 
}

/* --- RESPONSIVE UPDATE --- */
@media (max-width: 1024px) {
    .footer-content {
        flex-wrap: wrap;
        gap: 40px;
    }
    .footer-col {
        flex: 1 1 40%;
    }
    .footer-col:first-child {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .footer-col:first-child {
        max-width: 100%;
    }
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .social-links { justify-content: center; }
}

/* --- GAME PLAYER SPECIFIC --- */
.game-display { 
    background: #000; 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: var(--shadow); 
    margin-top: 20px;
    width: 100%;
}

.iframe-container { 
    position: relative; 
    width: 100%;
    aspect-ratio: 16 / 9; 
    min-height: 300px;
}

@media (max-width: 480px) {
    .iframe-container {
        aspect-ratio: 1 / 1;
        min-height: 350px;
    }
}

.iframe-container iframe { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; 
    height: 100%; 
    border: none; 
}

/* --- ACTION BAR --- */
.action-bar {
    background: #fff; padding: 20px 30px; display: flex;
    justify-content: space-between; align-items: center;
}
.rating-engine { display: flex; align-items: center; gap: 15px; }
.vote-btn { 
    border: none; background: #f1f2f6; padding: 10px 18px; 
    border-radius: 12px; cursor: pointer; font-weight: 600; transition: 0.3s; 
}
.vote-btn:hover { background: #e1e2e6; color: #ff4757; }
.avg-display { text-align: center; min-width: 60px; }
.avg-percent { display: block; font-weight: 800; font-size: 18px; color: #2ecc71; }

.player-utils { display: flex; gap: 12px; }
.util-icon { 
    width: 45px; height: 45px; border-radius: 12px; border: none; 
    background: #f1f2f6; cursor: pointer; transition: 0.3s; display: flex;
    align-items: center; justify-content: center; font-size: 18px;
}
.util-icon:hover { background: var(--primary-grad); color: #fff; transform: translateY(-3px); }

/* --- REVIEWS --- */
.comment-box { 
    background: #fff; border-radius: 25px; padding: 30px; 
    margin-top: 30px; box-shadow: var(--shadow); 
}
.comment-field { 
    width: 100%; border: 1px solid #eee; background: #f9f9f9; 
    padding: 15px; border-radius: 15px; margin-bottom: 15px; font-family: inherit; resize: none;
}
.post-btn { 
    background: var(--primary-grad); color: #fff; border: none; 
    padding: 12px 30px; border-radius: 12px; font-weight: 600; cursor: pointer; 
}

/* --- CATEGORY HERO CARD --- */
.cat-hero-card {
    position: relative;
    width: 100%;
    height: 260px;
    background: var(--white);
    border-radius: 25px;
    overflow: hidden;
    display: flex;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.cat-hero-bg {
    position: absolute;
    inset: 0;
    background: #ff4757 url('') center/cover;
    z-index: 1;
}

.cat-hero-char {
    position: absolute;
    right: 40px;
    bottom: -10px;
    height: 115%;
    z-index: 2;
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cat-hero-char img { height: 100%; object-fit: contain; }

.cat-hero-card:hover .cat-hero-char { transform: scale(1.08) rotate(-2deg); }

.cat-hero-content {
    position: relative;
    z-index: 3;
    padding: 50px;
    color: #fff;
    background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cat-hero-content h1 { font-size: 42px; margin: 0; font-weight: 800; text-shadow: 2px 2px 10px rgba(0,0,0,0.3); }
.cat-hero-content p { font-size: 15px; margin: 12px 0; max-width: 450px; opacity: 0.9; line-height: 1.6; }
.cat-count { font-weight: 700; font-size: 12px; background: rgba(255,255,255,0.25); width: fit-content; padding: 5px 15px; border-radius: 50px; backdrop-filter: blur(5px); }

.control-icons-list div {
    background: #f1f2f6;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2f3542;
}
.control-icons-list div i { color: #ff4757; }

.vote-btn {
    cursor: pointer;
    transition: transform 0.2s;
}
.vote-btn:active {
    transform: scale(1.2);
}
.vote-btn.voted {
    opacity: 0.7;
    cursor: default;
}
.vote-btn.voted {
    pointer-events: none;
}
.vote-btn i {
    pointer-events: none;
}

.comment-form input[type="text"], 
.comment-form input[type="email"] {
    width: 48%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #eee;
    margin-bottom: 15px;
    margin-right: 2%;
}

.comment-field {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #eee;
    background: #f8f9fa;
    font-family: inherit;
    margin-bottom: 15px;
    outline: none;
    resize: none;
}

.comment-avatar img {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.comment-reply-link {
    font-size: 12px;
    color: #ff4757;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    display: inline-block;
}

.comment-form-cookies-consent {
    background: #fdfdfd;
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed #eee;
}

.comment-form-cookies-consent input[type="checkbox"] {
    cursor: pointer;
    accent-color: #ff4757;
    transform: scale(1.2);
}

.comment-form-cookies-consent label a:hover {
    text-decoration: underline;
}

.game-card .thumb {
    position: relative;
    overflow: hidden;
    height: 140px;
}

.game-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Modal Background */
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0,0,0,0.6);
}

/* Modal Content Box */
.modal-content {
    background-color: #fff; margin: 15% auto; padding: 25px;
    border-radius: 20px; width: 320px; text-align: center; position: relative;
}

.close-modal {
    position: absolute; right: 20px; top: 15px; font-size: 24px; cursor: pointer; color: #aaa;
}

/* Social Icons */
.social-icons { display: flex; justify-content: center; gap: 15px; margin: 20px 0; }
.share-icon { 
    width: 50px; height: 50px; border-radius: 50%; display: flex; 
    align-items: center; justify-content: center; color: #fff; font-size: 20px; text-decoration: none;
}
.wa { background: #25D366; } .fb { background: #1877F2; } .tw { background: #1DA1F2; }

/* Copy Area */
.copy-link-area { display: flex; background: #f1f2f6; padding: 5px; border-radius: 10px; }
.copy-link-area input { 
    border: none; background: transparent; padding: 10px; width: 100%; font-size: 12px; outline: none; 
}
#copyBtn { 
    background: #ff4757; color: #fff; border: none; padding: 8px 15px; border-radius: 8px; cursor: pointer; 
}

.header-right {
    display: flex;
    align-items: center;
}

.fav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: var(--text-dark);
    padding: 10px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: 1.5px solid #eee; /* Light border for professional look */
    transition: var(--transition);
}

.fav-link i {
    color: #ff4757;
    font-size: 16px;
}

.fav-link:hover {
    border-color: #ff4757;
    background: #fff0f1;
    transform: translateY(-2px);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .fav-text { display: none; }
    .fav-link { padding: 8px 12px; border: none; background: transparent; }
}

@media (max-width: 768px) {
    .game-card:hover { transform: none !important; }
}

.site-logo {
    max-height: 55px;
    width: auto;
    display: block;
    transition: var(--transition);
}

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

@media (max-width: 600px) {
    .site-logo {
        max-height: 40px;
    }
}

.footer-site-logo {
    max-height: 50px;
    width: auto;
    display: block;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}


@media (max-width: 1024px) {
    .wrapper { 
        grid-template-columns: 1fr;
    }
    aside { 
        position: static;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    header { 
        height: auto; 
        padding: 15px 5%; 
        flex-wrap: wrap; 
    }
    .search-container { 
        order: 3; 
        flex: 1 1 100%; 
        margin: 10px 0 0 0; 
    }
    .game-grid { 
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px; 
    }
    .footer-content { 
        flex-direction: column; 
        text-align: center; 
    }
    .footer-col h4::after { 
        left: 50%; 
        transform: translateX(-50%); 
    }
    .social-links { justify-content: center; }
}

/* --- Single Post & Comments Mobile Fix --- */
@media (max-width: 768px) {
    .comment-form input[type="text"], 
    .comment-form input[type="email"] {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    .comment-box {
        padding: 20px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
    .action-bar {
        flex-direction: column;
        gap: 20px;
        padding: 20px 15px;
        text-align: center;
    }

    .rating-engine {
        justify-content: center;
        width: 100%;
    }

    .player-utils {
        justify-content: center;
        width: 100%;
    }

    .cat-hero-content h1 {
        font-size: 28px;
    }
    .cat-hero-content p {
        font-size: 13px;
    }
    .cat-hero-char {
        display: none; 
    }
}

.game-breadcrumb nav {
    background: transparent;
    padding: 0;
}

.game-breadcrumb a {
    color: #ff4757;
    text-decoration: none;
    font-weight: 600;
}

.game-breadcrumb a:hover {
    text-decoration: underline;
}

.game-breadcrumb .last {
    color: var(--text-muted);
    font-weight: normal;
}

.game-breadcrumb .separator {
    margin: 0 8px;
    color: #ccc;
}
/* --- AJAX COMMENT FORM CUSTOM STYLING --- */
#commentform {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

/* Input & Textarea Styling */
#commentform input[type="text"], 
#commentform input[type="email"], 
#commentform textarea {
    width: 100% !important;
    padding: 15px !important;
    border: 1px solid #eee !important;
    border-radius: 15px !important;
    background: #f9f9f9 !important;
    font-family: inherit !important;
    font-size: 14px !important;
    transition: var(--transition) !important;
    outline: none !important;
}

#commentform input:focus, 
#commentform textarea:focus {
    background: #fff !important;
    border-color: #ff4757 !important;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.05) !important;
}

/* Post Review Button (Using your Primary Gradient) */
#commentform #submit {
    background: var(--primary-grad) !important;
    color: #fff !important;
    border: none !important;
    padding: 15px 30px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    font-size: 16px !important;
    transition: var(--transition) !important;
    box-shadow: var(--shadow) !important;
    width: 100% !important; /* Full width button */
    display: block !important;
}

#commentform #submit:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 30px rgba(255, 71, 87, 0.2) !important;
    opacity: 0.9;
}

/* AJAX Message Box */
#ajax-msg {
    padding: 15px;
    border-radius: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    box-shadow: var(--shadow);
}

/* reCAPTCHA Alignment */
.g-recaptcha {
    margin: 10px 0 !important;
}

/* Responsive Fixes */
@media (max-width: 768px) {
    #commentform #submit {
        width: 100% !important;
    }
}
/* --- MOBILE HAMBURGER CUSTOM --- */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: #fff;
    z-index: 10001;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
}

.mobile-sidebar.active {
    right: 0;
}
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.sidebar-title { font-weight: 800; font-size: 18px; color: #ff4757; }

.close-btn {
    background: #f1f2f6;
    border: none;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}
.sidebar-content::-webkit-scrollbar { width: 5px; }
.sidebar-content::-webkit-scrollbar-thumb { background: #eee; border-radius: 10px; }
/* --- DESKTOP FIX FOR HAMBURGER --- */
.mobile-menu-toggle {
    display: none !important;
}
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: #f1f2f6;
        border: none;
        width: 42px;
        height: 42px;
        border-radius: 10px;
        color: #2f3542;
        font-size: 20px;
        cursor: pointer;
    }
}

/* --- SEARCH BAR UPDATED --- */
.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f1f3f6;
    border-radius: 50px;
    padding: 2px 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    background: #fff;
    border-color: #ff4757;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.1);
}

.search-icon {
    color: #a4b0be;
    margin-right: 10px;
}

.search-field {
    width: 100%;
    border: none;
    background: transparent;
    padding: 10px 5px;
    font-size: 14px;
    outline: none;
    color: #2f3542;
}

.search-submit {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: 0.3s;
    margin-left: 5px;
}

.search-submit:hover {
    background: #ff6b81;
    transform: scale(1.05);
}

/* --- MOBILE SEARCH & HEADER FIX --- */
@media (max-width: 768px) {
    header {
        display: flex;
        flex-wrap: wrap;
        height: auto !important;
        padding: 15px 5% !important;
        justify-content: space-between;
    }

    .logo {
        order: 1;
        flex: 0 1 auto;
    }

    .header-right {
        order: 2;
        flex: 0 1 auto;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .search-container {
        order: 3;
        flex: 1 1 100%;
        margin: 15px 0 5px 0;
        display: flex;
        justify-content: center;
    }

    .search-form {
        width: 100%;
    }

    .search-input-wrapper {
        width: 100%;
        margin: 0 auto;
    }

    .search-submit {
        display: none;
    }
}