/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a1a;
    --bg-card: #12122a;
    --bg-header: #0d0d20;
    --neon-cyan: #00f0ff;
    --neon-magenta: #ff00ff;
    --neon-green: #39ff14;
    --neon-yellow: #f0ff00;
    --text-primary: #e0e0e0;
    --text-secondary: #8888aa;
    --border-color: #2a2a4a;
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* ===== Neon Utility Classes ===== */
.neon-cyan {
    color: var(--neon-cyan);
    text-shadow: 0 0 7px var(--neon-cyan), 0 0 20px var(--neon-cyan);
}

.neon-magenta {
    color: var(--neon-magenta);
    text-shadow: 0 0 7px var(--neon-magenta), 0 0 20px var(--neon-magenta);
}

.neon-green {
    color: var(--neon-green);
    text-shadow: 0 0 7px var(--neon-green), 0 0 20px var(--neon-green);
}

/* ===== Header ===== */
.header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--text-primary);
}

/* ===== Navigation / Auth ===== */
.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.user-name {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== Buttons ===== */
.btn {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.btn-login {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--neon-cyan);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.4rem;
}

.btn-login:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3), 0 0 30px rgba(0, 240, 255, 0.1);
    transform: translateY(-1px);
}

.btn-logout {
    background: transparent;
    color: var(--neon-magenta);
    border: 1px solid var(--neon-magenta);
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

.btn-logout:hover {
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.google-icon {
    flex-shrink: 0;
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    text-align: center;
    padding: 5rem 2rem 4rem;
    overflow: hidden;
    min-height: 340px;
    background: linear-gradient(180deg, var(--bg-dark) 0%, #0e0e28 50%, var(--bg-dark) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(0, 240, 255, 0.1) 0%, rgba(255, 0, 255, 0.06) 30%, rgba(57, 255, 20, 0.03) 50%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

/* ===== Hero Pixel Characters Row ===== */
.hero-characters {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.2rem;
}

.pixel-char {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    border-radius: 4px;
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
}

.pixel-char:hover {
    transform: scale(1.3) rotate(-5deg);
}

/* Steve (Minecraft) - pixel art via box-shadow */
.char-steve {
    background: #6b4226;
    box-shadow:
        inset 0 0 0 4px #6b4226,
        inset 12px 0 0 4px #c49a6c,
        inset -12px 0 0 4px #c49a6c,
        inset 0 12px 0 4px #3b2010,
        inset 0 -12px 0 4px #0066cc;
    border: 3px solid #4a2e14;
    animation: charBounce 2s ease-in-out infinite;
}

/* Creeper (Minecraft) */
.char-creeper {
    background: #43a047;
    box-shadow:
        inset 8px 8px 0 4px #2e7d32,
        inset -8px 8px 0 4px #2e7d32,
        inset 0 -8px 0 4px #1b5e20,
        inset 8px -4px 0 2px #000,
        inset -8px -4px 0 2px #000;
    border: 3px solid #2e7d32;
    animation: charBounce 2s ease-in-out 0.3s infinite;
}

/* Robloxian */
.char-roblox {
    background: #e8c34a;
    box-shadow:
        inset 0 -16px 0 0 #cc0000,
        inset 0 16px 0 4px #e8c34a;
    border: 3px solid #c4a83a;
    border-radius: 6px;
    animation: charBounce 2s ease-in-out 0.6s infinite;
}

/* Noob (Roblox) */
.char-noob {
    background: #f5d442;
    box-shadow:
        inset 0 -16px 0 0 #22b14c,
        inset 0 16px 0 4px #f5d442;
    border: 3px solid #d4b830;
    border-radius: 6px;
    animation: charBounce 2s ease-in-out 0.9s infinite;
}

@keyframes charBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ===== Hero Decoration Containers ===== */
.hero-deco {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 200px;
    z-index: 2;
    pointer-events: none;
}

.hero-deco-left {
    left: 5%;
}

.hero-deco-right {
    right: 5%;
}

/* ===== Minecraft 3D Blocks ===== */
.mc-block {
    width: 50px;
    height: 50px;
    position: absolute;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(30deg);
}

.mc-block-top, .mc-block-front, .mc-block-side {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(0,0,0,0.3);
}

/* Grass Block */
.mc-grass .mc-block-top {
    background: linear-gradient(135deg, #5a8f29, #7ec850);
    transform: rotateX(90deg) translateZ(25px);
}
.mc-grass .mc-block-front {
    background: linear-gradient(180deg, #5a8f29 30%, #8b6b3d 30%);
    transform: translateZ(25px);
}
.mc-grass .mc-block-side {
    background: linear-gradient(180deg, #4a7a22 30%, #7a5c30 30%);
    transform: rotateY(90deg) translateZ(25px);
}
.mc-grass { top: 20%; left: 30px; }

/* Diamond Block */
.mc-diamond .mc-block-top {
    background: linear-gradient(135deg, #5ce8e8, #40c4c4);
    transform: rotateX(90deg) translateZ(25px);
}
.mc-diamond .mc-block-front {
    background: linear-gradient(135deg, #40c4c4, #2da5a5, #5ce8e8, #40c4c4);
    transform: translateZ(25px);
    box-shadow: inset 0 0 15px rgba(92, 232, 232, 0.5);
}
.mc-diamond .mc-block-side {
    background: linear-gradient(135deg, #2da5a5, #40c4c4);
    transform: rotateY(90deg) translateZ(25px);
}
.mc-diamond { top: 55%; left: 10px; }

/* TNT Block */
.mc-tnt .mc-block-top {
    background: linear-gradient(135deg, #cc3333, #992222);
    transform: rotateX(90deg) translateZ(25px);
}
.mc-tnt .mc-block-front {
    background: #cc3333;
    transform: translateZ(25px);
    box-shadow: inset 0 10px 0 5px #222, inset 0 -10px 0 5px #222;
}
.mc-tnt .mc-block-side {
    background: #aa2222;
    transform: rotateY(90deg) translateZ(25px);
    box-shadow: inset 0 10px 0 5px #1a1a1a, inset 0 -10px 0 5px #1a1a1a;
}
.mc-tnt { top: 75%; left: 60px; }

/* Pickaxe & Sword Emojis */
.mc-pickaxe {
    position: absolute;
    font-size: 2.2rem;
    top: 40%;
    left: 90px;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
}

.mc-sword {
    position: absolute;
    font-size: 2.2rem;
    top: 10%;
    left: 100px;
    transform: rotate(-30deg);
    filter: drop-shadow(0 0 6px rgba(255, 0, 255, 0.5));
}

/* ===== Roblox-style Characters ===== */
.rblx-char {
    position: absolute;
    width: 40px;
}

.rblx-head {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    margin: 0 auto 2px;
    position: relative;
    border: 2px solid rgba(0,0,0,0.2);
}

/* Eyes on Roblox heads */
.rblx-head::before,
.rblx-head::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #111;
    border-radius: 50%;
    top: 12px;
}
.rblx-head::before { left: 7px; }
.rblx-head::after { right: 7px; }

/* Smile */
.rblx-body {
    width: 30px;
    height: 28px;
    margin: 0 auto;
    border-radius: 3px;
    border: 2px solid rgba(0,0,0,0.2);
}

/* Roblox Char 1 - Blue + Yellow */
.rblx-1 { top: 25%; right: 30px; }
.rblx-1 .rblx-head { background: #f5d442; }
.rblx-1 .rblx-body { background: #2196F3; }

/* Roblox Char 2 - Red + Green */
.rblx-2 { top: 60%; right: 60px; }
.rblx-2 .rblx-head { background: #f5d442; }
.rblx-2 .rblx-body { background: #e53935; }

/* Game Emojis */
.game-emoji {
    position: absolute;
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 0, 0.4));
}

.game-emoji:nth-child(3) { top: 15%; right: 10px; }
.game-emoji:nth-child(4) { top: 50%; right: 100px; }
.game-emoji:nth-child(5) { top: 80%; right: 30px; }

/* ===== Float Animations ===== */
.float-1 { animation: heroFloat 3s ease-in-out infinite; }
.float-2 { animation: heroFloat 3.5s ease-in-out 0.3s infinite; }
.float-3 { animation: heroFloat 4s ease-in-out 0.6s infinite; }
.float-4 { animation: heroFloat 3.2s ease-in-out 0.9s infinite; }
.float-5 { animation: heroFloat 3.8s ease-in-out 1.2s infinite; }
.float-6 { animation: heroFloat 3s ease-in-out 0.2s infinite; }
.float-7 { animation: heroFloat 3.6s ease-in-out 0.7s infinite; }
.float-8 { animation: heroFloat 4s ease-in-out 1s infinite; }
.float-9 { animation: heroFloat 3.4s ease-in-out 0.5s infinite; }

@keyframes heroFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-12px) rotate(2deg); }
    75% { transform: translateY(6px) rotate(-2deg); }
}

/* Keep 3D blocks with their own transform */
.mc-block.float-1 { animation: blockFloat 3s ease-in-out infinite; }
.mc-block.float-2 { animation: blockFloat 3.5s ease-in-out 0.3s infinite; }
.mc-block.float-3 { animation: blockFloat 4s ease-in-out 0.6s infinite; }

@keyframes blockFloat {
    0%, 100% { transform: rotateX(-20deg) rotateY(30deg) translateY(0); }
    25% { transform: rotateX(-20deg) rotateY(40deg) translateY(-15px); }
    75% { transform: rotateX(-20deg) rotateY(20deg) translateY(8px); }
}

/* ===== Particles ===== */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    opacity: 0;
}

.p1 { background: var(--neon-cyan); left: 10%; animation: sparkle 3s 0s infinite; }
.p2 { background: var(--neon-magenta); left: 25%; animation: sparkle 2.5s 0.4s infinite; }
.p3 { background: var(--neon-green); left: 40%; animation: sparkle 3.5s 0.8s infinite; }
.p4 { background: var(--neon-yellow); left: 55%; animation: sparkle 2.8s 1.2s infinite; }
.p5 { background: var(--neon-cyan); left: 70%; animation: sparkle 3.2s 0.2s infinite; }
.p6 { background: var(--neon-magenta); left: 85%; animation: sparkle 2.6s 0.6s infinite; }
.p7 { background: var(--neon-green); left: 15%; animation: sparkle 3.8s 1s infinite; }
.p8 { background: var(--neon-cyan); left: 92%; animation: sparkle 3s 1.4s infinite; }

@keyframes sparkle {
    0% { opacity: 0; top: 100%; transform: scale(0.5); }
    20% { opacity: 1; transform: scale(1); }
    80% { opacity: 0.6; }
    100% { opacity: 0; top: 0%; transform: scale(0.2); }
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem 3rem;
    width: 100%;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ===== Login Required ===== */
.login-required {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ===== Game Grid ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ===== Game Card ===== */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.35s ease;
    position: relative;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-cyan);
    box-shadow:
        0 0 15px rgba(0, 240, 255, 0.2),
        0 0 30px rgba(0, 240, 255, 0.1),
        0 8px 25px rgba(0, 0, 0, 0.4);
}

.game-card-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #1a1a3e 0%, #2a1a3e 50%, #1a2a3e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    position: relative;
    overflow: hidden;
}

.game-card-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.game-card:hover .game-card-thumbnail::after {
    left: 100%;
}

.game-card-body {
    padding: 1.2rem;
}

.game-card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.game-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.game-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tag-coming-soon {
    background: rgba(255, 0, 255, 0.15);
    color: var(--neon-magenta);
    border: 1px solid rgba(255, 0, 255, 0.3);
}

.tag-playable {
    background: rgba(57, 255, 20, 0.15);
    color: var(--neon-green);
    border: 1px solid rgba(57, 255, 20, 0.3);
}

.btn-play {
    background: linear-gradient(135deg, var(--neon-cyan), #0080ff);
    color: #000;
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-play:hover {
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
    transform: scale(1.05);
}

.btn-play:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-header);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-sub {
    margin-top: 0.3rem;
    font-size: 0.8rem !important;
    opacity: 0.6;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a5a;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.8rem 1rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .hero {
        padding: 3rem 1rem 2.5rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-deco {
        width: 80px;
        opacity: 0.5;
    }

    .hero-deco-left { left: 0; }
    .hero-deco-right { right: 0; }

    .mc-block { transform: scale(0.6) rotateX(-20deg) rotateY(30deg); }

    .hero-characters {
        gap: 1rem;
    }

    .pixel-char {
        width: 38px;
        height: 38px;
    }

    .main-content {
        padding: 1rem 1rem 2rem;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .user-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 2.5rem 1rem 2rem;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .hero-deco {
        display: none;
    }

    .pixel-char {
        width: 32px;
        height: 32px;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-card {
    animation: fadeIn 0.4s ease forwards;
}

.game-card:nth-child(1) { animation-delay: 0.05s; }
.game-card:nth-child(2) { animation-delay: 0.1s; }
.game-card:nth-child(3) { animation-delay: 0.15s; }
.game-card:nth-child(4) { animation-delay: 0.2s; }
.game-card:nth-child(5) { animation-delay: 0.25s; }
.game-card:nth-child(6) { animation-delay: 0.3s; }
