*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #F0FAF4;
    color: #1E3D30;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.site-header {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FFF9 100%);
    border-bottom: 2px solid #A8E0C8;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(168, 224, 200, 0.15);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 26px;
    font-weight: 900;
    color: #2D5A42;
    letter-spacing: -1px;
    flex-shrink: 0;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.search-box {
    display: flex;
    align-items: center;
    background: #E8F8EF;
    border: 2px solid #C8E8D8;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    max-width: 580px;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s, transform 0.2s;
}

.search-box:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(168, 224, 200, 0.2);
}

.search-box:focus-within {
    background: #fff;
    border-color: #88D4A8;
    box-shadow: 0 0 0 4px rgba(136, 212, 168, 0.2);
    transform: translateY(-1px);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 24px;
    font-size: 16px;
    color: #1E3D30;
    background: transparent;
    font-family: inherit;
}

.search-box input::placeholder {
    color: #6B9A80;
}

.search-box button {
    border: none;
    background: #88D4A8;
    color: #FFFFFF;
    width: 56px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    border-radius: 12px;
    margin: 4px;
    transition: background 0.2s, transform 0.15s;
}

.search-box button:hover {
    background: #68C498;
    transform: scale(1.05);
}

.search-box button:active {
    transform: scale(0.95);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px 20px;
    background: transparent;
}

.main-nav a {
    display: inline-block;
    padding: 11px 24px;
    color: #4A7A60;
    font-weight: 700;
    font-size: 14px;
    border-radius: 100px;
    transition: all 0.3s ease;
    white-space: nowrap;
    letter-spacing: -0.3px;
    border: 2px solid transparent;
    background: #F0FAF4;
}

.main-nav a:hover {
    background: #D8F4E4;
    color: #2D5A42;
    border-color: #A8E0C8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 224, 200, 0.3);
}

.main-nav a.active {
    background: linear-gradient(135deg, #88D4A8 0%, #68C498 100%);
    color: #FFFFFF;
    border-color: #68C498;
    box-shadow: 0 4px 16px rgba(136, 212, 168, 0.4);
    transform: translateY(-2px);
}

.main-nav a::after {
    display: none !important;
}

.site-main {
    padding: 52px 0 80px;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 4px;
}

.section-title {
    font-size: 26px;
    font-weight: 900;
    color: #2D5A42;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.section-title .icon {
    font-size: 30px;
}

.view-all {
    color: #E698A8;
    font-weight: 800;
    font-size: 15px;
    transition: color 0.2s, transform 0.2s;
}

.view-all:hover {
    color: #D47888;
    transform: translateX(4px);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.game-card {
    background: #FFFFFF;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid #D8F4E4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(168, 224, 200, 0.12);
}

.game-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: #88D4A8;
    box-shadow: 0 16px 40px rgba(136, 212, 168, 0.25);
}

.game-card a {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.game-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: #E8F8EF;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover img {
    transform: scale(1.08);
}

.game-card .game-title {
    position: static;
    padding: 16px 20px 20px;
    color: #2D5A42;
    font-size: 16px;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.3px;
    background: #FFFFFF;
    background-image: none;
    border-top: 2px solid #E8F8EF;
}

.load-more {
    text-align: center;
    margin-top: 56px;
}

.load-more button {
    background: #FFFFFF;
    color: #88D4A8;
    border: 3px solid #88D4A8;
    padding: 16px 64px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    letter-spacing: -0.3px;
    box-shadow: 0 4px 16px rgba(136, 212, 168, 0.15);
}

.load-more button:hover {
    background: linear-gradient(135deg, #88D4A8 0%, #68C498 100%);
    color: #FFFFFF;
    box-shadow: 0 8px 28px rgba(136, 212, 168, 0.4);
    transform: translateY(-3px);
}

.load-more button:disabled {
    background: #F0FAF4;
    color: #9BB9A8;
    border-color: #D8F4E4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.site-footer {
    background: linear-gradient(135deg, #F8FFF9 0%, #FFFFFF 100%);
    border-top: 2px solid #A8E0C8;
    color: #4A7A60;
    padding: 56px 0;
    box-shadow: 0 -4px 20px rgba(168, 224, 200, 0.1);
}

.site-footer .page-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
}

.site-footer .footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
}

.site-footer .footer-links a {
    font-weight: 700;
    font-size: 15px;
    color: #4A7A60;
    padding: 8px 0;
    border-radius: 8px;
    transition: all 0.2s;
}

.site-footer .footer-links a:hover {
    color: #88D4A8;
    background: #E8F8EF;
    padding-left: 8px;
}

.site-footer p {
    margin: 6px 0;
    font-size: 14px;
    color: #6B9A80;
}

.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 52px;
    height: 52px;
    background: #FFFFFF;
    color: #88D4A8;
    border: 3px solid #C8E8D8;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 90;
    box-shadow: 0 4px 20px rgba(136, 212, 168, 0.2);
}

.back-to-top.show {
    display: flex;
    animation: bounceIn 0.4s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.back-to-top:hover {
    background: linear-gradient(135deg, #88D4A8 0%, #68C498 100%);
    color: #FFFFFF;
    border-color: #88D4A8;
    box-shadow: 0 8px 28px rgba(136, 212, 168, 0.4);
    transform: translateY(-4px) scale(1.05);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 250, 244, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 100001;
    transition: opacity 0.3s;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #88D4A8;
    animation: bounce 0.6s infinite alternate;
    box-shadow: 0 2px 8px rgba(136, 212, 168, 0.3);
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
    background: #68C498;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
    background: #88D4A8;
    opacity: 0.7;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-20px); }
}

.category-title {
    font-size: 40px;
    font-weight: 900;
    color: #2D5A42;
    margin-bottom: 40px;
    text-align: left;
    letter-spacing: -1.5px;
    padding: 0 4px;
}

.no-results {
    text-align: center;
    padding: 100px 20px;
    color: #6B9A80;
    font-size: 18px;
}

.no-results-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.game {
    max-width: 1200px;
    margin: 0 auto;
    padding: 52px 32px 80px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.game-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: none;
    background: linear-gradient(135deg, #E8F8EF 0%, #F0FAF4 100%);
    border: 3px solid #C8E8D8;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(168, 224, 200, 0.18);
}

.game-preview-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 32px;
    text-align: center;
    z-index: 2;
}

.game-preview-icon {
    position: relative;
    display: inline-block;
}

.game-preview-icon img {
    width: 140px;
    height: 140px;
    border-radius: 24px;
    object-fit: cover;
    border: 4px solid #FFFFFF;
    box-shadow: 0 12px 40px rgba(136, 212, 168, 0.25);
}

.game-preview-title {
    color: #2D5A42;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    max-width: 90%;
    line-height: 1.2;
}

.play-game-btn {
    border: none;
    background: linear-gradient(135deg, #88D4A8 0%, #68C498 100%);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 800;
    padding: 16px 60px;
    border-radius: 100px;
    cursor: pointer;
    letter-spacing: -0.3px;
    box-shadow: 0 6px 24px rgba(136, 212, 168, 0.4);
    transition: all 0.3s ease;
}

.play-game-btn:hover {
    background: linear-gradient(135deg, #68C498 0%, #48B488 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 36px rgba(136, 212, 168, 0.5);
}

.game-iframe-wrap {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #000;
    border-radius: 24px;
    overflow: hidden;
}

.game-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.game-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: #2D5A42;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    box-shadow: 0 4px 16px rgba(136, 212, 168, 0.2);
    transition: all 0.2s;
}

.game-close-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.game-actions-bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: none;
    margin: 0;
    padding: 0;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #FFFFFF;
    border: 2px solid #C8E8D8;
    border-radius: 16px;
    padding: 18px 28px;
    font-size: 16px;
    font-weight: 700;
    color: #2D5A42;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    letter-spacing: -0.3px;
    box-shadow: 0 2px 12px rgba(168, 224, 200, 0.1);
}

.action-btn:hover {
    background: #E8F8EF;
    border-color: #88D4A8;
    box-shadow: 0 6px 24px rgba(136, 212, 168, 0.2);
    transform: translateY(-2px);
}

.action-btn .icon {
    font-size: 20px;
}

.game-intro {
    background: #FFFFFF;
    border: 2px solid #C8E8D8;
    border-radius: 16px;
    padding: 28px 32px;
    max-width: none;
    margin: 0;
    box-shadow: 0 2px 12px rgba(168, 224, 200, 0.1);
}

.game-intro h2 {
    font-size: 20px;
    font-weight: 900;
    color: #2D5A42;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.game-intro p {
    font-size: 15px;
    color: #4A7A60;
    line-height: 1.8;
}

.game-detail-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.install-btn {
    display: none;
}

.game .game-actions-bar + .game-intro {
    margin-top: 0;
}

.game > .similar-games-section {
    grid-column: 1 / -1;
    margin-top: 48px;
    max-width: none;
    padding: 0;
}

.similar-games-section {
    max-width: 1200px;
    margin: 64px auto 0;
    padding: 0 32px;
}

.similar-games-section .section-title {
    font-size: 24px;
    font-weight: 900;
    color: #2D5A42;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.similar-games-section .section-title .icon {
    font-size: 30px;
}

.similar-games-scroll-wrap {
    position: relative;
}

.similar-games-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 4px 28px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #A8E0C8 transparent;
}

.similar-games-scroll::-webkit-scrollbar {
    height: 8px;
}

.similar-games-scroll::-webkit-scrollbar-track {
    background: #E8F8EF;
    border-radius: 10px;
}

.similar-games-scroll::-webkit-scrollbar-thumb {
    background: #A8E0C8;
    border-radius: 10px;
}

.similar-games-scroll::-webkit-scrollbar-thumb:hover {
    background: #88D4A8;
}

.similar-game-card {
    flex: 0 0 auto;
    width: 180px;
    background: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #D8F4E4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(168, 224, 200, 0.1);
}

.similar-game-card:hover {
    transform: translateY(-6px);
    border-color: #88D4A8;
    box-shadow: 0 12px 32px rgba(136, 212, 168, 0.22);
}

.similar-game-card a {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.similar-game-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #E8F8EF;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.similar-game-card:hover img {
    transform: scale(1.05);
}

.similar-game-card .game-title {
    position: static;
    padding: 12px 14px 16px;
    color: #2D5A42;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #FFFFFF;
    background-image: none;
    border-top: 2px solid #E8F8EF;
}

.app-module {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 99999;
}

.app-module iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.app-module .game-close-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: #2D5A42;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 4px 20px rgba(136, 212, 168, 0.25);
}

@media (max-width: 1100px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .game {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 960px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .page-wrapper {
        padding: 0 24px;
    }

    .header-top {
        padding: 20px 24px;
    }

    .category-title {
        font-size: 32px;
        margin-bottom: 28px;
    }

    .game {
        padding: 40px 24px 60px;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        gap: 16px;
    }

    .search-box {
        order: 3;
        max-width: 100%;
        margin-top: 4px;
    }

    .main-nav {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 10px 12px 16px;
        gap: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        font-size: 13px;
        padding: 10px 18px;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .game-card {
        border-radius: 14px;
    }

    .game-card .game-title {
        font-size: 14px;
        padding: 12px 14px 16px;
    }

    .section-title {
        font-size: 22px;
    }

    .game {
        grid-template-columns: 1fr;
        padding: 28px 20px 48px;
    }

    .game-preview {
        border-radius: 18px;
    }

    .game-preview-icon img {
        width: 110px;
        height: 110px;
    }

    .game-preview-title {
        font-size: 24px;
    }

    .play-game-btn {
        font-size: 15px;
        padding: 14px 48px;
    }

    .action-btn {
        font-size: 14px;
        padding: 16px 24px;
    }

    .game-intro {
        padding: 24px;
    }

    .similar-games-section {
        padding: 0 24px;
        margin-top: 48px;
    }

    .similar-game-card {
        width: 155px;
    }

    .site-footer .page-wrapper {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .site-footer .footer-links {
        align-items: center;
    }
}

@media (max-width: 600px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .logo {
        font-size: 22px;
    }

    .logo img {
        height: 34px;
    }

    .search-box input {
        padding: 14px 18px;
        font-size: 15px;
    }

    .search-box button {
        width: 46px;
        height: 42px;
    }

    .game-card {
        border-radius: 12px;
    }

    .game-card img {
        aspect-ratio: 4 / 3;
    }

    .game-card .game-title {
        font-size: 13px;
        padding: 10px 12px 14px;
    }

    .category-title {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .load-more button {
        padding: 14px 48px;
        font-size: 15px;
    }

    .back-to-top {
        bottom: 24px;
        right: 24px;
        width: 46px;
        height: 46px;
    }

    .game {
        padding: 20px 16px 40px;
        gap: 24px;
    }

    .game-preview {
        border-radius: 14px;
        aspect-ratio: auto;
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .game-preview-inner {
        position: static;
        gap: 12px;
        padding: 12px 0 0;
    }

    .game-preview-icon img {
        width: 160px;
        height: 160px;
        border-radius: 28px;
    }

    .play-game-btn {
        position: absolute;
        left: 50%;
        bottom: 12px;
        transform: translateX(-50%);
        font-size: 14px;
        padding: 10px 36px;
    }

    .install-btn {
        position: absolute;
        top: -8px;
        right: -8px;
        width: 42px;
        height: 42px;
        border: none;
        border-radius: 50%;
        background: linear-gradient(135deg, #88D4A8 0%, #68C498 100%);
        color: #FFFFFF;
        font-size: 26px;
        font-weight: 800;
        line-height: 1;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(136, 212, 168, 0.4);
        transition: transform 0.2s;
        z-index: 5;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .install-btn:hover {
        transform: scale(1.1);
    }

    .game-preview-title {
        font-size: 22px;
        margin-top: 8px;
        color: #2D5A42;
    }

    .game-actions-bar {
        margin-top: 0;
    }

    .action-btn {
        font-size: 14px;
        padding: 14px 20px;
    }

    .game-intro {
        padding: 20px;
        border-radius: 14px;
    }

    .game-intro h2 {
        font-size: 18px;
        color: #2D5A42;
    }

    .game-intro p {
        font-size: 14px;
        color: #4A7A60;
    }

    .similar-games-section {
        padding: 0 16px;
        margin-top: 40px;
    }

    .similar-games-section .section-title {
        font-size: 18px;
        color: #2D5A42;
    }

    .similar-games-scroll {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        overflow-x: visible;
        padding: 0;
    }

    .similar-game-card {
        width: 100%;
    }

    .similar-game-card .game-title {
        font-size: 12px;
        padding: 8px 10px 12px;
    }
}