@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-color: #050505;
    --card-bg: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    --text-main: #ffffff;
    --text-muted: #9ca3af;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

nav {
    position: fixed; top: 0; width: 100%; z-index: 100;
    padding: 1.5rem 0;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    background: rgba(5, 5, 5, 0.8);
}

.nav-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 2rem;
    display: flex; justify-content: space-between; align-items: center;
}

.logo { font-weight: 800; font-size: 1.5rem; color: white; text-decoration: none; letter-spacing: -0.5px; }
.nav-links a { color: var(--text-muted); text-decoration: none; margin-left: 2rem; font-weight: 500; transition: 0.3s; }
.nav-links a:hover { color: white; }

.hero { padding-top: 180px; padding-bottom: 80px; text-align: center; position: relative; }
.hero::before {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: -1; pointer-events: none;
}

.hero h1 { font-size: 4rem; font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; }
.gradient-text { background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--text-muted); font-size: 1.2rem; margin: 0 auto 3rem auto; max-width: 600px; }

.search-container { max-width: 500px; margin: 0 auto; }
.search-input {
    width: 100%; background: var(--card-bg); border: 1px solid var(--border-color);
    padding: 1rem 1.5rem; border-radius: 12px; color: white; font-size: 1rem; outline: none; transition: 0.3s;
}
.search-input:focus { border-color: #6366f1; box-shadow: 0 0 20px rgba(99, 102, 241, 0.2); }

.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.section-title { margin-bottom: 2rem; font-size: 1.5rem; font-weight: 700; border-left: 4px solid #6366f1; padding-left: 1rem; }

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

.game-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer; 
}

.game-card:hover {
    transform: translateY(-5px); border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

.card-media-wrapper {
    height: 160px; width: 100%; background: #151515;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

.card-img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
}
.game-card:hover .card-img { transform: scale(1.1); }

.card-emoji { font-size: 4rem; }

.card-content { padding: 1.5rem; }
.card-content h3 { color: white; font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.card-content p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.4; }

.play-container {
    margin-top: 100px;
    width: 100%;
    min-height: 100vh; 
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 50px;
}
.controls-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.btn {
    background: var(--card-bg); border: 1px solid var(--border-color); color: white;
    padding: 0.6rem 1.2rem; border-radius: 8px; text-decoration: none; font-size: 0.9rem;
    cursor: pointer; transition: 0.3s; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { background: rgba(255,255,255,0.1); border-color: white; }
.game-frame-wrapper {
    width: 100%;
    height: 80vh; 
    min-height: 600px;
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0; 
}
iframe { width: 100%; height: 100%; border: none; }

.desc-link {
    color: #a855f7;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.desc-link:hover {
    color: #d48aff;
    text-decoration: underline;
}

.game-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    animation: fadeIn 1s ease;
}

.detail-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-line; 
}

.detail-box h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.group-card {
    border-color: rgba(251, 191, 36, 0.3);
}

.group-card:hover {
    border-color: rgba(251, 191, 36, 0.8);
    box-shadow: 0 10px 40px -10px rgba(251, 191, 36, 0.2);
}

.back-card {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.3);
}

.back-card .card-content h3 {
    color: var(--accent);
}

.back-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.error-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 100px;
}

.error-content {
    max-width: 600px;
    padding: 2rem;
}

.error-code {
    font-size: 10rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: float 6s ease-in-out infinite;
}

.error-title {
    font-size: 2rem;
    color: white;
    margin-bottom: 1rem;
}

.error-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.btn-large {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

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

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

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
     
    .nav-inner {
        padding: 0 1.5rem; 
    }

    .game-details {
        grid-template-columns: 1fr;
    }

    .error-code {
        font-size: 6rem;
    }
}