/* ==========================================
   GENERAL STYLES & VARIABLES
========================================== */
* {
    margin: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-accent: #4A90E2;
    --primary-accent-hover: #357ABD;
    --body-bg: #121821;
    --card-bg: #1F2937;
    --border-color: #374151;
    
    --text-dark: #F3F4F6;
    --text-medium: #9CA3AF;
    --text-light: #6B7281;

    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);

    --circle-blue: #4A90E2;
    --circle-purple: #784ccb;
    --circle-yellow: #fede4a;
    --dark-cloud-color: #142636;

    --help-modal-bg: #1F2937;
    --help-text-color: #9CA3AF;
    --help-title-color: #F3F4F6;
    --help-highlight: var(--primary-accent);
    --help-border: var(--border-color);
}

body {
    background-color: var(--body-bg);
    padding: 0px 20px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ==========================================
   HEADER & LOGO
========================================== */
.headeer {
    position: sticky;
    top: 0;
    left: 0;
    width: calc(98% + 38px);
    margin-left: -15px;
    background: rgba(31, 41, 55, 0.7);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.logo img {
    width: 160px;
    height: 50px;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px var(--primary-accent));
}

.icon-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-accent), #357ABD);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn svg {
    width: 22px;
    height: 22px;
    fill: white;
    stroke: white;
    stroke-width: 2px;
}

/* ==========================================
   PAGE SLOGAN
========================================== */
.page-slogan {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Cinzel', serif;
    margin: 5px 2px 4px;
    line-height: 1.5;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #4A90E2, #8B5CF6, #F7D65B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 5px 15px rgba(74, 144, 226, 0.2);
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

@media (min-width: 768px) {
    .page-slogan {
        font-size: 2rem;
        margin: 70px 40px 50px;
    }
}

/* ==========================================
   BACKGROUND CIRCLES
========================================== */
.site-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -2;
    pointer-events: none;
}

.site-background .bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(100px);
}

.site-background .bg-circle.green-light {
    background-color: var(--circle-blue);
    width: 500px;
    height: 500px;
    top: 60%;
    left: -10%;
    opacity: 0.15;
    transform: translateY(-50%);
}

.site-background .bg-circle.purple-light {
    background-color: var(--circle-purple);
    width: 450px;
    height: 450px;
    top: 10%;
    right: -10%;
    opacity: 0.12;
    transform: translateX(50%);
}

.site-background .bg-circle.yellow-light {
    background-color: var(--circle-yellow);
    width: 300px;
    height: 300px;
    bottom: 5%;
    left: 20%;
    opacity: 0.1;
}

.site-background .bg-clouds svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    min-width: 2550px;
    opacity: 0.03;
    transform: scale(1.2);
}

.site-background .bg-clouds svg path {
    fill: var(--dark-cloud-color);
}

/* ==========================================
   DROPDOWN MENU
========================================== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: linear-gradient(145deg, #1F2937, #111827);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 10px 0;
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 99;
    overflow: hidden;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #1F2937;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 12px 20px;
    color: var(--text-medium);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.dropdown-item:hover {
    background: rgba(74, 144, 226, 0.1);
    color: var(--text-dark);
    padding-left: 25px;
}

.dropdown-item i {
    color: var(--primary-accent);
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.dropdown-item:hover i {
    transform: scale(1.2);
}

/* ==========================================
   SECTION HEADER
========================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0 20px;
    position: relative;
    z-index: 1;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.section-title .icon-wrapper {
    background-color: #f7d65b;
    color: #fff;
    padding: 9px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0px 10px #f7d65b;
}

.section-title.game .icon-wrapper {
    background-color: var(--primary-accent);
    color: white;
    box-shadow: 0 0px 10px var(--primary-accent);
}

.arrow-button {
    background-color: var(--primary-accent);
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.arrow-button:hover {
    background-color: var(--primary-accent-hover);
}

.arrow-button:active {
    transform: scale(0.95);
}

/* ==========================================
   RECOMMEND GRID & CARDS
========================================== */
.recommend-grid {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 20px;
}

.recommend-grid::-webkit-scrollbar {
    display: none;
}

.recommend-card {
    min-width: 180px;
    flex-shrink: 0;
    position: relative;
    background: linear-gradient(145deg, #1F2937, #111827);
    border-radius: 20px;
    overflow: hidden;
    padding: 20px 10px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 180px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease,
                border-color 0.3s ease;
    scroll-snap-align: start;
    
}

.recommend-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: var(--primary-accent);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.3);
}

.recommend-card::before,
.recommend-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    z-index: 0;
    opacity: 0.2;
    filter: blur(0px);
}

.recommend-card::before {
    background: #1e90ff;
    top: -30px;
    left: -40px;
}

.recommend-card::after {
    background: #f9d348;
    top: -30px;
    right: -40px;
}

.recommend-card .game-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 25%;
    background: var(--body-bg);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    margin-bottom: 15px;
}

.recommend-card .game-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    overflow: hidden;
}

.recommend-card .game-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.recommend-card:hover .game-icon img {
    transform: scale(1.05) rotate(5deg);
}

.recommend-card .game-version {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--body-bg);
    width: 25px;
    height: 40px;
    border-radius: 30px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-medium);
    z-index: 2;
}

.recommend-card .game-version i {
    font-size: 16px;
    margin-bottom: 2px;
    margin-left: 6px;
    color: var(--primary-accent);
}

.recommend-card .game-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: auto;
    text-align: center;
    line-height: 1.3;
    z-index: 1;
}

/* ==========================================
   ALL GAMES GRID & CARDS
========================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding-bottom: 80px;
}

.app-card {
    background: linear-gradient(145deg, #1F2937, #111827);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease,
                border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.app-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-accent);
    box-shadow: 0 15px 40px rgba(74, 144, 226, 0.3);
}

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2px 8px;
    transform: translateZ(0);
    transition: transform 0.3s ease, background 0.3s ease;
}

.badge.update {
    color: var(--primary-accent);
    background: rgba(74, 144, 226, 0.15);
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.app-card:hover .badge {
    transform: translateY(-3px);
}

.app-icon-container {
    width: 110px;
    height: 110px;
    border-radius: 25px;
    overflow: hidden;
    margin: 30px auto 7px;
    position: relative;
    box-shadow: none;
}

.app-icon-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 25px;
    transition: transform 0.4s ease;
}

.app-card:hover .app-icon-container img {
    transform: scale(1.1);
}

.mod-tag {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(55, 65, 81, 0.9);
    color: var(--text-dark);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(0.5px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 2;
    transition: all 0.3s ease;
}

.app-card:hover .mod-tag {
    transform: translateX(-50%) translateY(-3px);
    background: rgba(74, 144, 226, 0.9);
}

.app-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0px 0 5px;
    line-height: 1.3;
}

.app-genre {
    font-size: 0.85rem;
    color: var(--primary-accent);
    font-weight: 500;
    margin-bottom: 1px;
}

.app-details {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: var(--text-medium);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: auto;
    margin-bottom: 1px;
}

.app-details i {
    font-size: 1rem;
    color: var(--primary-accent);
}

.divider {
    width: 1px;
    height: 25px;
    background-color: var(--border-color);
}

/* ==========================================
   FOOTER
========================================== */
.footer {
    background: linear-gradient(to top, #0F172A, #1F2937);
    color: var(--text);
    padding: 40px 20px 20px;
    margin-top: 40px;
    margin-bottom: -20px;
    width: calc(100% + 40px);
    margin-left: -20px;
    border-radius: 30px 30px 0 0;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(74, 144, 226, 0.2);
}

.footer::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3 {
    color: var(--primary-accent);
    font-size: 1.1rem;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-accent);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--text-medium);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 3px 0;
}

.footer-links a:hover {
    color: var(--primary-accent);
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--text-medium);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-accent);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-medium);
}

/* ==========================================
   HELP BUTTON
========================================== */
.help-button-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 100;
    filter: drop-shadow(0 5px 15px rgba(74, 144, 226, 0.4));
}

.help-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-accent), #357ABD);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(74, 144, 226, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 144, 226, 0); }
}

.help-button:hover {
    transform: scale(1.1) rotate(10deg);
    animation: none;
}

.help-button:active {
    transform: scale(0.95);
}

span i {
    font-size: 1.1rem;
    margin-right: 6px;
    color: var(--primary-accent);
    vertical-align: middle;
}

/* ==========================================
   HELP MODAL
========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.help-center-modal {
    background: linear-gradient(145deg, #1F2937, #111827);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    color: var(--help-text-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.modal-overlay.active .help-center-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(74, 144, 226, 0.3);
}

.modal-header h2 {
    color: var(--help-title-color);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-accent), #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--help-text-color);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    transform: rotate(90deg);
}

.modal-content h3 {
    color: var(--help-title-color);
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.modal-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 20px;
}

.modal-content ul li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.modal-content ul li::before {
    content: '•';
    color: var(--help-highlight);
    position: absolute;
    left: 0;
    font-size: 1.2em;
    line-height: 1;
}

.modal-content .highlight {
    color: var(--help-highlight);
    font-weight: 500;
}

.modal-content strong {
    color: var(--help-title-color);
}

.modal-footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--help-border);
    text-align: center;
}

.modal-footer .thanks-button {
    background-color: var(--help-highlight);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.modal-footer .thanks-button:hover {
    background-color: var(--primary-accent-hover);
}

.modal-footer .thanks-button:active {
    transform: scale(0.98);
}

/* ==========================================
   SKELETON LOADING
========================================== */
.skeleton .skeleton-icon,
.skeleton .skeleton-text,
.skeleton .skeleton-badge {
    background: linear-gradient(90deg, #1F2937 25%, #374151 50%, #1F2937 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.skeleton .skeleton-badge {
    width: 50px;
    height: 20px;
    border-radius: 12px;
    position: absolute;
    top: 15px;
    left: 15px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
========================================== */
@media (max-width: 767px) {
    body {
        padding: 0px 15px 20px;
    }
    
    .page-slogan {
        font-size: 1.1rem;
        padding: 0 10px;
    }
    
    .recommend-card {
        min-width: 150px;
        height: 160px;
    }
    
    .app-card {
        padding: 15px;
    }
    
    .app-icon-container {
        width: 90px;
        height: 90px;
        margin: 20px auto 10px;
    }
    
    .help-button {
        width: 55px;
        height: 55px;
        font-size: 2rem;
    }
}

@media (min-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .recommend-card {
        min-width: 200px;
    }
}