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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span { color: #f6821f; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    overflow: hidden;
    width: 0;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box.open { width: 240px; }

.search-box input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus { border-color: #f6821f; }

.nav-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 16px 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.cat-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 6px 14px;
    color: #888;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    white-space: nowrap;
}

.cat-btn:hover { color: #ccc; border-color: rgba(255,255,255,0.15); }

.cat-btn.active {
    background: rgba(246, 130, 31, 0.15);
    border-color: rgba(246, 130, 31, 0.4);
    color: #f6821f;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 10px 24px 40px;
    max-width: 1600px;
    margin: 0 auto;
}

@media (min-width: 1200px) {
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (min-width: 1600px) {
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 600px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 10px 12px 40px;
    }
    .categories { padding: 10px 12px; gap: 4px; }
    .cat-btn { padding: 5px 10px; font-size: 12px; }
    .navbar { padding: 10px 12px; }
    .search-box.open { width: 160px; }
}

.game-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 2/3;
    background: #16161e;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
    will-change: transform;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.4s;
}

.game-card .skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, #1a1a24 30%, #22223a 50%, #1a1a24 70%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.game-card .card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    pointer-events: none;
}

.game-card .card-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card .card-categories {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.game-card .card-cat-tag {
    font-size: 10px;
    background: rgba(246, 130, 31, 0.2);
    color: #f6821f;
    padding: 1px 6px;
    border-radius: 4px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 14px;
}

.no-result {
    text-align: center;
    padding: 80px 20px;
    color: #666;
    font-size: 16px;
}

.detail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
}

.detail-overlay.open {
    display: flex;
}

.game-detail {
    background: #12121a;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    position: relative;
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}

.detail-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(255,255,255,0.08);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.detail-close:hover { background: rgba(255,255,255,0.15); }

.detail-content {
    display: flex;
    flex-direction: column;
}

.detail-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.detail-info {
    padding: 20px 24px 24px;
}

.detail-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.detail-meta .meta-tag {
    font-size: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 4px 10px;
    border-radius: 6px;
    color: #aaa;
}

.detail-desc {
    font-size: 14px;
    line-height: 1.7;
    color: #aaa;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.download-btn {
    background: linear-gradient(135deg, #f6821f, #e06010);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.download-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(246,130,31,0.3); }
.download-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.cooldown-notice {
    font-size: 13px;
    color: #f44;
}

@media (max-width: 600px) {
    .detail-overlay { padding: 0; }
    .game-detail { border-radius: 0; min-height: 100vh; }
    .detail-info { padding: 16px; }
}
