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

:root {
    --bg-cream: #FFF7E8;
    --bg-card: #FFFAF0;
    --primary-orange: #FFB347;
    --mint-green: #6CC4A8;
    --salmon-pink: #FFA07A;
    --sky-blue: #87CEEB;
    --coral: #FF6B6B;
    --lavender: #B8A9C9;
    --sunny-yellow: #FFD93D;
    --text-dark: #5D4E37;
    --text-light: #8B7355;
    --shadow-warm: 0 8px 20px rgba(255, 180, 80, 0.15);
    --shadow-hover: 0 12px 30px rgba(255, 180, 80, 0.25);
}

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

.decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.decoration {
    position: absolute;
    opacity: 0.15;
}

.sun {
    top: 20px;
    right: 50px;
    width: 80px;
    height: 80px;
    animation: float 6s ease-in-out infinite;
}

.cloud {
    width: 100px;
    height: 60px;
    animation: float 8s ease-in-out infinite;
}

.cloud-1 { top: 80px; left: 10%; animation-delay: 0s; }
.cloud-2 { top: 150px; right: 15%; animation-delay: 2s; }
.cloud-3 { top: 60px; left: 40%; animation-delay: 4s; }

.star {
    width: 30px;
    height: 30px;
    animation: twinkle 2s ease-in-out infinite;
}

.star-1 { top: 200px; left: 5%; animation-delay: 0s; }
.star-2 { top: 100px; right: 30%; animation-delay: 0.5s; }
.star-3 { bottom: 200px; left: 8%; animation-delay: 1s; }
.star-4 { bottom: 300px; right: 5%; animation-delay: 1.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.2); }
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--bg-card) 0%, #FFF5E6 100%);
    border-radius: 32px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-warm);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 217, 61, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--sunny-yellow) 0%, var(--primary-orange) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 179, 71, 0.4);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--coral) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 280px;
    padding: 15px 50px 15px 25px;
    border: 3px solid transparent;
    border-radius: 50px;
    background: var(--bg-cream);
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 4px rgba(255, 179, 71, 0.2);
}

.search-box input::placeholder {
    color: var(--text-light);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-orange);
    font-size: 20px;
}

.home-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, var(--mint-green) 0%, #5DB899 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 196, 168, 0.4);
}

.home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 196, 168, 0.5);
}

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 25px;
    background: var(--bg-card);
    border-radius: 24px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-warm);
}

.category-tag {
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid transparent;
    white-space: nowrap;
}

.category-tag:hover {
    transform: scale(1.08);
}

.category-tag.active {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.cat-all { background: linear-gradient(135deg, var(--sunny-yellow) 0%, var(--primary-orange) 100%); color: white; }
.cat-io { background: linear-gradient(135deg, var(--sky-blue) 0%, #6BB3D9 100%); color: white; }
.cat-action { background: linear-gradient(135deg, var(--coral) 0%, #FF5252 100%); color: white; }
.cat-puzzle { background: linear-gradient(135deg, var(--mint-green) 0%, #5DB899 100%); color: white; }
.cat-racing { background: linear-gradient(135deg, var(--salmon-pink) 0%, #FF8A65 100%); color: white; }
.cat-sports { background: linear-gradient(135deg, #64B5F6 0%, #42A5F5 100%); color: white; }
.cat-adventure { background: linear-gradient(135deg, var(--lavender) 0%, #9B8AC4 100%); color: white; }
.cat-casual { background: linear-gradient(135deg, #81C784 0%, #66BB6A 100%); color: white; }
.cat-arcade { background: linear-gradient(135deg, #FFB74D 0%, #FFA726 100%); color: white; }
.cat-default { background: linear-gradient(135deg, #E0E0E0 0%, #BDBDBD 100%); color: var(--text-dark); }

.game-count {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: var(--bg-card);
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-warm);
    font-size: 18px;
    font-weight: 700;
}

.game-count-icon {
    font-size: 24px;
    animation: wiggle 1s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.game-card {
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-warm);
    position: relative;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.game-card:hover .game-thumb img {
    transform: scale(1.05);
}

.game-thumb {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #FFE4B5 0%, #FFDAB9 100%);
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-thumb .loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFE4B5 0%, #FFDAB9 100%);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 179, 71, 0.3);
    border-top-color: var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.game-category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.game-info {
    padding: 18px;
}

.game-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.game-tag {
    padding: 4px 10px;
    background: var(--bg-cream);
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--shadow-warm);
}

.no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.no-results p {
    font-size: 16px;
    color: var(--text-light);
}

.detail-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-cream);
    z-index: 100;
    overflow-y: auto;
}

.detail-view.active {
    display: block;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 30px;
    background: var(--bg-card);
    box-shadow: var(--shadow-warm);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-orange) 0%, #FFA333 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 179, 71, 0.4);
    text-decoration: none;
}

.back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(255, 179, 71, 0.5);
}

.detail-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
}

.detail-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.detail-image {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-warm);
    border: 4px dashed var(--primary-orange);
    background: var(--bg-card);
}

.detail-image img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-warm);
}

.info-card h3 {
    font-size: 14px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card p {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.6;
}

.instructions-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #FFF5E6 100%);
    position: relative;
}

.instructions-card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    right: 20px;
    height: 20px;
    background: var(--primary-orange);
    border-radius: 10px 10px 0 0;
    opacity: 0.3;
}

.play-btn {
    padding: 20px 40px;
    background: linear-gradient(135deg, var(--sunny-yellow) 0%, var(--primary-orange) 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 20px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 179, 71, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: pulse 2s ease-in-out infinite;
    text-decoration: none;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 179, 71, 0.5);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-tag {
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--mint-green) 0%, #5DB899 100%);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.similar-games {
    grid-column: 1 / -1;
    margin-top: 20px;
}

.similar-games h2 {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.similar-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.similar-game-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-warm);
    text-decoration: none;
    display: block;
}

.similar-game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.similar-game-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.similar-game-info {
    padding: 12px;
}

.similar-game-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.similar-game-category {
    font-size: 12px;
    color: var(--text-light);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 25px;
    align-items: start;
}

.trending-sidebar {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow-warm);
    position: sticky;
    top: 20px;
}

.trending-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px dashed var(--primary-orange);
}

.trending-icon {
    font-size: 28px;
    animation: flame 0.5s ease-in-out infinite alternate;
}

@keyframes flame {
    from { transform: scale(1) rotate(-5deg); }
    to { transform: scale(1.1) rotate(5deg); }
}

.trending-header h2 {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--coral) 0%, var(--primary-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-cream);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.trending-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-warm);
    background: #FFF5E6;
}

.trending-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sunny-yellow) 0%, var(--primary-orange) 100%);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.trending-item:nth-child(1) .trending-rank {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

.trending-item:nth-child(2) .trending-rank {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.5);
}

.trending-item:nth-child(3) .trending-rank {
    background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.5);
}

.trending-thumb {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--primary-orange);
}

.trending-info {
    flex: 1;
    min-width: 0;
}

.trending-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: white;
}

@media (max-width: 900px) {
    .detail-content {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .header-right {
        width: 100%;
        flex-direction: column;
    }

    .search-box input {
        width: 100%;
    }

    .home-btn {
        width: 100%;
        justify-content: center;
    }

    .logo-text {
        font-size: 22px;
    }

    .categories {
        justify-content: center;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .trending-sidebar {
        position: static;
        order: -1;
    }

    .trending-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .category-tag {
        padding: 8px 16px;
        font-size: 12px;
    }

    .detail-content {
        padding: 15px;
    }
}

.site-footer {
    margin-top: 40px;
    padding: 30px 20px;
    background: var(--bg-card);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 20px rgba(255, 180, 80, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.footer-links a:hover {
    color: var(--primary-orange);
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-orange);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-copyright {
    color: var(--text-light);
    font-size: 13px;
}

.page-content {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-warm);
}

.page-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--coral) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-update {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px dashed var(--primary-orange);
}

.page-section {
    margin-bottom: 30px;
}

.page-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-section p {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 15px;
}

.page-section ul {
    margin-left: 25px;
    margin-bottom: 15px;
}

.page-section li {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 8px;
}

.page-section a {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-section a:hover {
    color: var(--coral);
    text-decoration: underline;
}

.contact-card {
    background: linear-gradient(135deg, var(--bg-cream) 0%, #FFF5E6 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    margin: 30px 0;
    box-shadow: var(--shadow-warm);
    border: 3px dashed var(--primary-orange);
}

.contact-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.contact-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.contact-card p {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 15px;
}

.contact-email {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--sunny-yellow) 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 179, 71, 0.4);
}

.contact-email:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 179, 71, 0.5);
}

@media (max-width: 600px) {
    .page-content {
        padding: 25px;
    }
    
    .page-title {
        font-size: 28px;
    }
    
    .page-section h2 {
        font-size: 18px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}
