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

:root {
    --primary-color: #ff0099;
    --secondary-color: #9d00ff;
    --accent-color: #ff3169;
    --dark-bg: #0b0a10;
    --darker-bg: #07060d;
    --light-text: #e7e2ff;
    --medium-text: #a79acb;
    --card-bg: rgba(23, 20, 35, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --success-color: #4CAF50;
}

body {
    background-color: var(--dark-bg);
    color: var(--light-text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--darker-bg) 0%, #2a0b2d 100%);
    padding: 20px;
    overflow-x: hidden;
}

/* Efeito de partículas no fundo */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 0, 153, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(157, 0, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 49, 105, 0.05) 0%, transparent 50%);
    pointer-events: none;
    animation: backgroundMove 20s infinite alternate;
    z-index: 0;
}

@keyframes backgroundMove {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(50px, 30px) scale(1.1);
    }
}

/* Conteúdo Principal */
.main-container {
    text-align: center;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    z-index: 1;
    position: relative;
}

.logo {
    width: 150px;
    height: 150px;
    margin: 0 auto 25px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 60px rgba(255, 0, 153, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.15);
    animation: float 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    padding: 10px;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.logo::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shine 3s infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    50% { 
        transform: translateY(-15px) rotate(2deg); 
    }
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.main-title {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 900;
    letter-spacing: -1px;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: titleGlow 2s infinite alternate;
}

@keyframes titleGlow {
    0% {
        filter: brightness(1);
    }
    100% {
        filter: brightness(1.2);
    }
}

.subtitle {
    color: var(--medium-text);
    font-size: 1.3rem;
    margin-bottom: 40px;
    line-height: 1.5;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.subtitle .highlight {
    color: var(--accent-color);
    font-weight: 600;
}

/* Seção do Jogo */
.game-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    margin: 30px 0;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-section h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--light-text);
    text-align: center;
}

.game-description {
    color: var(--medium-text);
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Tabuleiro do Jogo da Velha */
.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    max-width: 400px;
    margin: 0 auto 25px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.cell {
    aspect-ratio: 1;
    background: rgba(11, 10, 16, 0.8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    user-select: none;
    color: var(--light-text);
}

.cell:hover:not(.occupied) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.cell.x {
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(255, 0, 153, 0.7);
}

.cell.o {
    color: var(--secondary-color);
    text-shadow: 0 0 20px rgba(157, 0, 255, 0.7);
}

.cell.win {
    animation: winCell 0.5s ease 3;
    background: rgba(255, 255, 255, 0.1);
}

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

.occupied {
    cursor: not-allowed;
}

/* Controles do Jogo */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.game-btn {
    padding: 12px 25px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    min-width: 150px;
}

.game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 0, 153, 0.4);
}

.game-btn:active {
    transform: translateY(-1px);
}

.game-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
}

.game-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Estatísticas do Jogo */
.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background: rgba(11, 10, 16, 0.8);
    border-radius: 10px;
    min-width: 120px;
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--medium-text);
}

/* Seção CTA */
.cta-section {
    margin: 30px 0;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    animation: fadeIn 0.5s ease;
    display: none;
}

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

.result-message {
    margin-bottom: 25px;
}

.result-message h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--light-text);
    text-align: center;
}

.result-message p {
    color: var(--medium-text);
    font-size: 1.1rem;
    line-height: 1.5;
    max-width: 600px;
    margin: 0 auto;
}

/* Botão Principal */
.main-btn {
    padding: 20px 40px;
    font-size: 1.3rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 60px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 30px rgba(255, 0, 153, 0.4),
        0 0 50px rgba(157, 0, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin: 20px auto;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: 100%;
    max-width: 500px;
}

.main-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: 0.5s;
}

.main-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(255, 0, 153, 0.5),
        0 0 70px rgba(157, 0, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

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

.main-btn:active {
    transform: translateY(-2px) scale(1.02);
}

/* Contador de Usuários Ativos */
.users-active {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 25px;
    padding: 15px;
    background: rgba(11, 10, 16, 0.6);
    border-radius: 50px;
    border: 1px solid var(--border-color);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.users-active .live-dot {
    width: 12px;
    height: 12px;
    background: var(--success-color);
    border-radius: 50%;
    position: relative;
    animation: pulseDotActive 1.5s infinite;
}

.users-active .live-dot::after {
    content: "";
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid var(--success-color);
    animation: rippleGreen 2s infinite;
}

@keyframes pulseDotActive {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.3);
    }
}

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

.small-text {
    color: var(--medium-text);
    font-size: 0.95rem;
}

.small-text .user-count {
    color: var(--success-color);
    font-weight: bold;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    text-align: center;
    color: var(--medium-text);
    font-size: 0.9rem;
    padding: 20px;
    margin-top: 30px;
    opacity: 0.7;
    width: 100%;
    border-top: 1px solid var(--border-color);
}

.footer-link {
    color: var(--medium-text);
    text-decoration: none;
    transition: color 0.3s;
    margin: 0 10px;
}

.footer-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Efeitos extras */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    background: linear-gradient(45deg, rgba(255, 0, 153, 0.1), rgba(157, 0, 255, 0.1));
    border-radius: 50%;
    animation: floatAround 20s infinite linear;
}

.shape:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: -5s;
}

.shape:nth-child(3) {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
}

@keyframes floatAround {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(100px, 50px) rotate(90deg);
    }
    50% {
        transform: translate(50px, 100px) rotate(180deg);
    }
    75% {
        transform: translate(-50px, 50px) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* Mensagens do Jogo */
.game-message {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    animation: messageAppear 0.5s ease;
    text-align: center;
    color: var(--light-text);
}

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

.win-message {
    color: var(--primary-color);
    background: rgba(255, 0, 153, 0.1);
    border: 1px solid rgba(255, 0, 153, 0.3);
}

.draw-message {
    color: var(--light-text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.draw-message small {
    color: var(--medium-text);
    font-weight: normal;
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .main-container {
        padding: 20px;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .logo {
        width: 120px;
        height: 120px;
    }
    
    .game-board {
        max-width: 300px;
    }
    
    .cell {
        font-size: 2.5rem;
    }
    
    .main-btn {
        padding: 18px 30px;
        font-size: 1.1rem;
        max-width: 100%;
    }
    
    .game-stats {
        gap: 15px;
    }
    
    .stat-item {
        min-width: 100px;
        padding: 12px 20px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .game-btn {
        width: 100%;
        max-width: 250px;
        min-width: auto;
    }
    
    .users-active {
        padding: 12px 20px;
        flex-direction: column;
        gap: 8px;
        border-radius: 20px;
    }
    
    .result-message h3 {
        font-size: 1.5rem;
    }
    
    .result-message p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .logo {
        width: 100px;
        height: 100px;
    }
    
    .game-board {
        max-width: 250px;
    }
    
    .cell {
        font-size: 2rem;
    }
    
    .main-btn {
        padding: 16px 25px;
        font-size: 1rem;
    }
    
    .game-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        width: 100%;
        max-width: 200px;
    }
    
    .game-section {
        padding: 20px;
    }
    
    .cta-section {
        padding: 20px;
    }
    
    .footer {
        font-size: 0.8rem;
        padding: 15px;
    }
    
    .footer-link {
        display: block;
        margin: 5px 0;
    }
}

/* Animações extras para feedback */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* Efeito de brilho para elementos importantes */
.glow {
    animation: glowEffect 2s infinite alternate;
}

@keyframes glowEffect {
    from {
        box-shadow: 0 0 10px rgba(255, 0, 153, 0.5),
                    0 0 20px rgba(157, 0, 255, 0.3);
    }
    to {
        box-shadow: 0 0 15px rgba(255, 0, 153, 0.8),
                    0 0 30px rgba(157, 0, 255, 0.5);
    }
}

/* Estilo para o texto em vermelho (Você não vai ganhar!) */
.red-warning {
    color: #ff3169 !important;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 49, 105, 0.3);
}

/* Container do jogo */
.game-container {
    position: relative;
    margin-bottom: 20px;
}