/* Reset e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0a0a0a;
    --secondary-color: #1a1a1a;
    --accent-color: #00ff88;
    --accent-secondary: #ff6b00;
    --accent-purple: #9d4edd;
    --accent-blue: #00d4ff;
    --accent-pink: #ff006e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #333;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-neon: linear-gradient(45deg, #00ff88, #00d4ff, #9d4edd, #ff006e);
    --gradient-game: linear-gradient(135deg, #ff006e 0%, #8338ec 50%, #3a86ff 100%);
    --shadow-glow: 0 0 20px rgba(0, 255, 136, 0.3);
    --glow-green: 0 0 30px rgba(0, 255, 136, 0.8);
    --glow-orange: 0 0 30px rgba(255, 107, 0, 0.8);
    --glow-purple: 0 0 30px rgba(157, 78, 221, 0.8);
    --glow-blue: 0 0 30px rgba(0, 212, 255, 0.8);
}

body {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    line-height: 1.6;
    background: linear-gradient(45deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    animation: backgroundPulse 15s ease-in-out infinite;
}

/* Fundo animado com efeitos visuais */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(157, 78, 221, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 255, 136, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: particleFloat 20s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.1);
    }
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 0.7;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Animações */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--accent-color); }
    50% { box-shadow: 0 0 20px var(--accent-color), 0 0 30px var(--accent-color); }
}

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

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2a2a3e 100%);
    border-bottom: 3px solid var(--accent-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3), 
                0 0 20px var(--shadow-glow);
    animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% {
        box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3), 
                    0 0 20px var(--shadow-glow);
    }
    50% {
        box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5), 
                    0 0 30px var(--glow-green);
    }
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--accent-color);
    font-size: 16px;
    text-shadow: 0 0 15px var(--accent-color),
                 0 0 30px var(--accent-color),
                 0 0 45px var(--accent-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 20px var(--accent-color),
                 0 0 40px var(--accent-color),
                 0 0 60px var(--accent-color);
}

.logo i {
    margin-right: 10px;
    animation: logoSpin 4s linear infinite;
}

@keyframes logoSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nav {
    display: flex;
    gap: 10px;
}

.sound-btn, .fullscreen-btn {
    background: linear-gradient(45deg, transparent, rgba(0, 255, 136, 0.1));
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 10px 15px;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 10px var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.sound-btn::before, .fullscreen-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.sound-btn:hover::before, .fullscreen-btn:hover::before {
    left: 100%;
}

.sound-btn:hover, .fullscreen-btn:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

/* Hero Section */
.hero {
    background: var(--gradient-neon);
    background-size: 400% 400%;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.15)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.8;
    animation: heroOverlay 12s ease-in-out infinite;
}

@keyframes heroOverlay {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05) rotate(1deg);
        opacity: 0.6;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 28px;
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                 0 0 40px rgba(0, 255, 136, 0.6),
                 2px 2px 8px rgba(0, 0, 0, 0.8);
    animation: titleGlow 2s ease-in-out infinite alternate,
               slideInUp 1s ease-out;
    background: linear-gradient(45deg, #fff, #00ff88, #fff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes titleGlow {
    from {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                     0 0 40px rgba(0, 255, 136, 0.6),
                     2px 2px 8px rgba(0, 0, 0, 0.8);
    }
    to {
        text-shadow: 0 0 30px rgba(255, 255, 255, 1),
                     0 0 60px rgba(0, 255, 136, 0.9),
                     2px 2px 12px rgba(0, 0, 0, 0.9);
    }
}

.hero-subtitle {
    font-size: 11px;
    margin-bottom: 50px;
    opacity: 0.95;
    animation: slideInUp 1s ease-out 0.2s both;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    animation: slideInUp 1s ease-out 0.4s both;
}

.stat {
    text-align: center;
    position: relative;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-10px) scale(1.05);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.stat-number {
    display: block;
    font-size: 24px;
    color: var(--accent-color);
    text-shadow: 0 0 15px var(--accent-color),
                 0 0 30px var(--accent-color);
    animation: numberPulse 2s ease-in-out infinite;
}

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

.stat-label {
    display: block;
    font-size: 9px;
    margin-top: 8px;
    opacity: 0.9;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Filtros */
.filters {
    background: var(--secondary-color);
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.filters .container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#searchInput {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: var(--primary-color);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 10px;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: var(--shadow-glow);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 8px;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: var(--shadow-glow);
}

/* Seção de Jogos */
.games-section {
    padding: 60px 0;
    background: var(--primary-color);
}

.section-title {
    text-align: center;
    font-size: 18px;
    margin-bottom: 40px;
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

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

.game-card {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #2a2a3e 100%);
    border: 3px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 255, 136, 0.2), 
        rgba(0, 212, 255, 0.2),
        transparent);
    transition: left 0.8s ease;
    z-index: 1;
}

.game-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
    opacity: 0;
    z-index: 0;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover::after {
    width: 300px;
    height: 300px;
    opacity: 0.1;
}

.game-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 30px var(--glow-green),
                0 0 60px var(--glow-green),
                0 15px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-15px) scale(1.02);
    background: linear-gradient(135deg, #2a2a3e 0%, #3a3a5e 100%);
}

.game-thumbnail {
    width: 100%;
    height: 180px;
    background: var(--gradient-game);
    background-size: 300% 300%;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: white;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    animation: thumbnailGradient 6s ease-in-out infinite;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.3);
}

@keyframes thumbnailGradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.game-thumbnail i {
    z-index: 2;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                 0 0 40px rgba(255, 255, 255, 0.6);
    animation: iconFloat 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.game-card:hover .game-thumbnail i {
    transform: scale(1.2) rotate(10deg);
    text-shadow: 0 0 30px rgba(255, 255, 255, 1),
                 0 0 60px rgba(0, 255, 136, 0.8);
}

.game-title {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--accent-color);
    text-shadow: 0 0 15px var(--accent-color);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.game-card:hover .game-title {
    transform: scale(1.05);
    text-shadow: 0 0 20px var(--accent-color),
                 0 0 40px var(--accent-color);
}

.game-description {
    font-size: 9px;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.5;
    position: relative;
    z-index: 2;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.game-card:hover .game-description {
    color: #fff;
    opacity: 1;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 7px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.difficulty {
    padding: 4px 8px;
    background: var(--accent-secondary);
    color: white;
    border-radius: 2px;
}

.play-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, var(--accent-color), #00cc6a);
    color: var(--primary-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.4);
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.play-btn:hover::before {
    left: 100%;
}

.play-btn:hover {
    background: linear-gradient(45deg, #00ff88, #00d4ff);
    box-shadow: 0 0 25px var(--glow-green),
                0 0 50px var(--glow-green),
                0 10px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px) scale(1.02);
}

.play-btn:active {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 0 15px var(--glow-green);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: var(--secondary-color);
    margin: 15% auto;
    padding: 30px;
    border: 2px solid var(--accent-color);
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    animation: slideInUp 0.3s ease-out;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
}

.close:hover {
    color: var(--accent-color);
}

/* Footer */
.footer {
    background: var(--secondary-color);
    border-top: 2px solid var(--accent-color);
    padding: 20px 0;
    text-align: center;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer p {
    font-size: 8px;
    color: var(--text-secondary);
}

.ranking-btn {
    background: var(--accent-secondary);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 8px;
    transition: all 0.3s ease;
}

.ranking-btn:hover {
    background: #e55a00;
    box-shadow: 0 0 10px var(--accent-secondary);
}

/* Responsividade */
@media (max-width: 768px) {
    .hero-title {
        font-size: 18px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .filters .container {
        padding: 0 10px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 7px;
        padding: 8px 12px;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer .container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 14px;
    }
    
    .hero-title {
        font-size: 16px;
    }
    
    .hero-subtitle {
        font-size: 9px;
    }
    
    .section-title {
        font-size: 16px;
    }
}

/* Otimizações adicionais para mobile */
@media (max-width: 768px) {
    /* Melhora a experiência touch */
    button, .btn, .control-btn, .filter-btn {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Previne zoom em inputs */
    input, textarea, select {
        font-size: 16px !important;
    }
    
    /* Melhora layout dos cards */
    .game-card {
        padding: 20px 15px;
    }
    
    .game-title {
        font-size: 14px;
        line-height: 1.2;
    }
    
    .game-description {
        font-size: 8px;
        line-height: 1.4;
        margin: 10px 0;
    }
    
    /* Estatísticas mais legíveis */
    .stat-card .number {
        font-size: 20px;
    }
    
    .stat-card h3 {
        font-size: 10px;
    }
    
    /* Modal otimizado */
    .modal-content {
        margin: 10px;
        padding: 20px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .achievement-item, .ranking-item {
        padding: 12px;
        font-size: 9px;
    }
    
    /* Search box melhorado */
    .search-box {
        padding: 15px;
        font-size: 14px;
        border-radius: 8px;
    }
}

/* Suporte para dispositivos com tela muito pequena */
@media (max-width: 320px) {
    .hero-title {
        font-size: 14px;
    }
    
    .games-grid {
        gap: 15px;
    }
    
    .game-card {
        padding: 15px 10px;
    }
    
    .filter-btn {
        font-size: 6px;
        padding: 6px 10px;
    }
}

/* Orientação landscape em mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 30px 0;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Otimizações para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .game-card {
        padding: 25px;
    }
    
    .filter-btn {
        font-size: 9px;
        padding: 10px 16px;
    }
}

/* Efeitos visuais adicionais */
.section-title {
    position: relative;
    text-align: center;
    margin: 40px 0;
    font-size: 18px;
    color: var(--accent-color);
    text-shadow: 0 0 15px var(--accent-color);
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    box-shadow: 0 0 10px var(--accent-color);
}

/* Animações de entrada */
.games-section {
    animation: fadeInUp 1s ease-out;
}

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

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Loading animation para cards */
.game-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.game-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Efeito de estrelas no fundo */
.hero::after {
    content: '✦ ✧ ★ ✦ ✧ ★ ✦ ✧ ★ ✦ ✧ ★';
    position: absolute;
    top: 20%;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.3);
    animation: starTwinkle 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Melhoria nos filtros */
.filters {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    border-top: 1px solid rgba(0, 255, 136, 0.2);
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

/* Footer melhorado */
.footer {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1a1a2e 100%);
    border-top: 2px solid var(--accent-color);
    padding: 30px 0;
    text-align: center;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    box-shadow: 0 0 10px var(--accent-color);
}