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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    min-height: 100vh;
}

/* Modal de login */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
}

.modal-content h1 {
    font-size: 3em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ffeb3b, #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content h3 {
    color: #ccc;
    margin-bottom: 30px;
    font-weight: 300;
}

#passwordInput {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 2px solid #444;
    border-radius: 10px;
    background-color: #111;
    color: #fff;
    font-size: 16px;
    transition: border-color 0.3s;
}

#passwordInput:focus {
    outline: none;
    border-color: #667eea;
}

#loginBtn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

#loginBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.error {
    color: #ff5252;
    margin-top: 15px;
    font-size: 14px;
}

/* Header */
.header {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 2.5em;
    background: linear-gradient(45deg, #ffeb3b, #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

#logoutBtn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s;
}

#logoutBtn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main content */
.main-content {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Games grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.game-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-card:hover:not(.coming-soon) {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.game-card.coming-soon {
    opacity: 0.6;
}

.game-thumbnail {
    height: 120px;
    border-radius: 15px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pacman thumbnail */
.pacman-thumb {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    position: relative;
}

.pacman-icon {
    font-size: 3em;
    animation: chomp 1s infinite;
}

@keyframes chomp {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(45deg); }
}

.ghosts {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
}

.ghost.red { color: #ff4444; }
.ghost.blue { color: #00bcd4; }
.ghost.pink { color: #ff69b4; }

.dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    color: #ffeb3b;
    font-size: 1.5em;
}

/* Snake thumbnail */
.snake-thumb {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
}

.snake-icon {
    font-size: 4em;
    animation: slither 2s ease-in-out infinite;
}

@keyframes slither {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(10px) rotate(5deg); }
    50% { transform: translateX(0) rotate(0deg); }
    75% { transform: translateX(-10px) rotate(-5deg); }
}

.apple {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2em;
    animation: bounce 1s ease-in-out infinite;
}

.power-ups {
    position: absolute;
    bottom: 20px;
    display: flex;
    gap: 10px;
}

.power-up {
    font-size: 1.5em;
    animation: float 3s ease-in-out infinite;
}

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

/* Tetris thumbnail */
.tetris-thumb {
    background: linear-gradient(135deg, #1e1e1e, #2d2d2d);
}

.tetris-pieces {
    display: flex;
    gap: 10px;
    animation: fall 3s ease-in-out infinite;
}

.piece {
    font-size: 2em;
}

@keyframes fall {
    0% { transform: translateY(-20px) rotate(0deg); }
    50% { transform: translateY(0) rotate(180deg); }
    100% { transform: translateY(-20px) rotate(360deg); }
}

/* Pong thumbnail */
.pong-thumb {
    background: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.paddle {
    font-size: 3em;
    color: #fff;
}

.paddle.left {
    animation: paddleMove 2s ease-in-out infinite;
}

.paddle.right {
    animation: paddleMove 2s ease-in-out infinite reverse;
}

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

.ball {
    font-size: 1.5em;
    position: absolute;
    animation: ballBounce 2s linear infinite;
}

@keyframes ballBounce {
    0% { left: 20%; top: 30%; }
    25% { left: 70%; top: 60%; }
    50% { left: 80%; top: 40%; }
    75% { left: 30%; top: 70%; }
    100% { left: 20%; top: 30%; }
}

/* Disc thumbnail */
.disc-thumb {
    background: linear-gradient(135deg, #ff6f00, #ff8f00);
    position: relative;
}

.disc-icon {
    font-size: 3em;
    position: absolute;
    animation: discFly 3s ease-in-out infinite;
}

@keyframes discFly {
    0% { left: 20%; transform: rotate(0deg); }
    50% { left: 60%; transform: rotate(720deg); }
    100% { left: 20%; transform: rotate(1440deg); }
}

.player {
    font-size: 2em;
    position: absolute;
    bottom: 20px;
}

.player-left { left: 20px; }
.player-right { right: 20px; }

.sparks {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spark {
    position: absolute;
    font-size: 1em;
    animation: sparkle 1s ease-out infinite;
}

.spark:nth-child(1) { animation-delay: 0s; }
.spark:nth-child(2) { animation-delay: 0.3s; }
.spark:nth-child(3) { animation-delay: 0.6s; }

@keyframes sparkle {
    0% { opacity: 0; transform: scale(0) translate(0, 0); }
    50% { opacity: 1; transform: scale(1) translate(10px, -10px); }
    100% { opacity: 0; transform: scale(0) translate(20px, -20px); }
}

/* Tank thumbnail */
.tank-thumb {
    background: linear-gradient(135deg, #795548, #5d4037);
    position: relative;
}

.tank {
    position: absolute;
    font-size: 1.5em;
}

.explosions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.explosion {
    position: absolute;
    font-size: 2em;
    animation: explode 2s ease-out infinite;
}

.explosion:nth-child(1) { animation-delay: 0s; }
.explosion:nth-child(2) { animation-delay: 1s; }

@keyframes explode {
    0% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}

/* Game info */
.game-card h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.game-card p {
    color: #ccc;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.players-online {
    color: #4caf50;
}

.difficulty {
    color: #ffeb3b;
}

.play-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #4caf50, #45a049);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

.coming-soon .play-btn {
    background: #666;
    cursor: not-allowed;
}

/* Leaderboard */
.leaderboard {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard h2 {
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
}

.ranking-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s;
}

.tab-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: transparent;
}

.tab-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ranking-list {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: background 0.3s;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rank {
    font-size: 1.2em;
    font-weight: bold;
    width: 40px;
    text-align: center;
}

.rank.first { color: #ffd700; }
.rank.second { color: #c0c0c0; }
.rank.third { color: #cd7f32; }

.player-name {
    flex: 1;
    margin-left: 20px;
    font-weight: 500;
}

.score {
    font-weight: bold;
    color: #4caf50;
}

.date {
    font-size: 0.8em;
    color: #999;
    margin-left: 20px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .header h1 {
        font-size: 2em;
    }

    .main-content {
        padding: 20px;
    }

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

    .ranking-tabs {
        flex-wrap: wrap;
    }

    .ranking-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .rank {
        width: auto;
    }
}

/* Space Race Thumbnail */
.race-thumb {
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a0a 100%);
    position: relative;
    overflow: hidden;
}

.race-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.planet {
    position: absolute;
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

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

.ship {
    position: absolute;
    font-size: 20px;
    animation: orbit 10s linear infinite;
}

.asteroid {
    position: absolute;
    font-size: 15px;
    animation: asteroidMove 5s linear infinite;
}

@keyframes asteroidMove {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, 50px) rotate(360deg); }
}

.portal {
    position: absolute;
    font-size: 25px;
    animation: spin 3s linear infinite;
}

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

/* Rescue Squad Thumbnail */
.rescue-thumb {
    background: linear-gradient(135deg, #424242, #303030);
    position: relative;
}

.rescue-scene {
    width: 100%;
    height: 100%;
    position: relative;
}

.robot {
    position: absolute;
    font-size: 20px;
    bottom: 30%;
    animation: walk 2s ease-in-out infinite;
}

.robot-1 {
    left: 20%;
}

.robot-2 {
    left: 40%;
    animation-delay: 0.5s;
}

.robot-3 {
    left: 60%;
    animation-delay: 1s;
}

.tool-icon {
    position: absolute;
    font-size: 15px;
    top: 30%;
    animation: float 3s ease-in-out infinite;
}

.tool-1 {
    left: 25%;
}

.tool-2 {
    left: 50%;
    animation-delay: 0.7s;
}

.tool-3 {
    left: 75%;
    animation-delay: 1.4s;
}

.exit-door {
    position: absolute;
    right: 10%;
    bottom: 40%;
    font-size: 30px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes walk {
    0% { transform: translateX(0); }
    100% { transform: translateX(20px); }
}

/* Super Pang Thumbnail */
.superpang-thumb {
    background: linear-gradient(135deg, #87CEEB, #98D8E8);
    position: relative;
}

.superpang-scene {
    width: 100%;
    height: 100%;
    position: relative;
}

.bubble {
    position: absolute;
    font-size: 25px;
    animation: bubbleBounce 3s ease-in-out infinite;
}

.bubble-1 {
    left: 20%;
    top: 30%;
}

.bubble-2 {
    left: 50%;
    top: 20%;
    animation-delay: 1s;
}

.bubble-3 {
    right: 20%;
    top: 40%;
    animation-delay: 0.5s;
}

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

.harpoon {
    position: absolute;
    bottom: 40%;
    left: 45%;
    font-size: 20px;
    transform: rotate(-90deg);
    animation: shootUp 2s ease-in-out infinite;
}

@keyframes shootUp {
    0%, 100% { transform: translateY(0) rotate(-90deg); }
    50% { transform: translateY(-20px) rotate(-90deg); }
}

.player-icon {
    position: absolute;
    bottom: 20%;
    left: 40%;
    font-size: 25px;
}

.platform {
    position: absolute;
    bottom: 50%;
    left: 30%;
    font-size: 20px;
    color: #8B4513;
}

.power-icon {
    position: absolute;
    top: 60%;
    right: 30%;
    font-size: 20px;
    animation: powerGlow 1s ease-in-out infinite alternate;
}

@keyframes powerGlow {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.2); opacity: 1; }
}

/* Space Duel Thumbnail */
.spaceduel-thumb {
    background: #000;
    position: relative;
    overflow: hidden;
}

.spaceduel-scene {
    width: 100%;
    height: 100%;
    position: relative;
}

.spaceduel-scene .stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, #eee, transparent),
        radial-gradient(1px 1px at 50px 50px, #eee, transparent),
        radial-gradient(1px 1px at 80px 10px, #eee, transparent),
        radial-gradient(2px 2px at 90px 40px, #eee, transparent);
    background-repeat: repeat;
    background-size: 100px 100px;
}

.spaceship {
    position: absolute;
    font-size: 25px;
}

.ship-1 {
    left: 20%;
    top: 50%;
    transform: rotate(90deg);
    animation: shipFloat1 4s ease-in-out infinite;
}

.ship-2 {
    right: 20%;
    top: 50%;
    transform: rotate(-90deg);
    animation: shipFloat2 4s ease-in-out infinite;
}

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

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

.laser {
    position: absolute;
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff0000, transparent);
}

.laser-1 {
    left: 35%;
    top: 50%;
    animation: laserShoot1 2s linear infinite;
}

.laser-2 {
    right: 35%;
    top: 50%;
    animation: laserShoot2 2s linear infinite;
}

@keyframes laserShoot1 {
    0% { left: 35%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: 65%; opacity: 0; }
}

@keyframes laserShoot2 {
    0% { right: 35%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { right: 65%; opacity: 0; }
}

.asteroid {
    position: absolute;
    font-size: 20px;
}

.ast-1 {
    top: 20%;
    left: 50%;
    animation: asteroidFloat 8s linear infinite;
}

.ast-2 {
    bottom: 20%;
    left: 50%;
    animation: asteroidFloat 6s linear infinite reverse;
}

@keyframes asteroidFloat {
    0% { transform: translateX(-50px) rotate(0deg); }
    100% { transform: translateX(50px) rotate(360deg); }
}

/* Chess Openings Thumbnail */
.chess-thumb {
    background: linear-gradient(135deg, #8B4513, #D2691E);
    position: relative;
    overflow: hidden;
}

.chess-scene {
    width: 100%;
    height: 100%;
    position: relative;
}

.chess-piece {
    position: absolute;
    font-size: 30px;
    animation: chessPieceMove 4s ease-in-out infinite;
}

.piece-1 {
    left: 20%;
    top: 20%;
    color: #fff;
}

.piece-2 {
    right: 30%;
    top: 30%;
    color: #000;
    animation-delay: 1s;
}

.piece-3 {
    left: 40%;
    bottom: 30%;
    color: #fff;
    animation-delay: 0.5s;
}

.piece-4 {
    right: 20%;
    bottom: 20%;
    color: #000;
    animation-delay: 1.5s;
}

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

.chess-board-mini {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: rgba(255, 255, 255, 0.3);
}

.board-row {
    letter-spacing: -5px;
}

.opening-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Courier New', monospace;
    animation: fadeInOut 3s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}