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

body {
    background:
        linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
        url('https://i.ibb.co/LX5rD8WY/Design-sem-nome-3.png');
/*background-image: url('https://i.ibb.co/8LHnnVKs/Design-sem-nome-1.png');*/
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    font-family: Arial, sans-serif;
    min-height: 100vh;
    padding: 20px 0;
    margin: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.topo-geral {
    background: #0f3460;
    padding: 1.5rem;
    border-radius: 20px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 800px;
}

.topo-conteudo {
    background: #16213e;
    border: 2px solid #e94560;
    border-radius: 20px;
    padding: 18px 30px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.topo-conteudo .status {
    margin-bottom: 0;
}

.topo-geral .status {
    margin-bottom: 0;
}

/* CONTAINER PRINCIPAL - CENTRALIZADO */
.container {
    display: grid !important;
    grid-template-columns: 380px 650px 380px !important;
    gap: 25px !important;
    max-width: 1510px !important;
    width: 100% !important;
    background: #0f3460;
    padding: 1.5rem;
    border-radius: 20px;
    margin: 0 auto !important;
    position: relative;
}


/* ===== COLUNA 1 - BOTÕES ===== */
.coluna-botoes {
    background: #16213e;
    border-radius: 20px;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border: 3px solid #e94560;
    height: 100%;
    width: 100%;
}

.botoes-modo {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.modo-btn {
    background: #0f3460;
    color: white;
    border: 4px solid #4a6fa5;
    border-radius: 30px;
    padding: 25px 15px;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    letter-spacing: 2px;
    box-shadow: 0 8px 0 #0a1a2a;
}

.modo-btn:hover {
    background: #4a6fa5;
    border-color: #e94560;
    transform: scale(1.05);
    box-shadow: 0 15px 0 #0a1a2a;
}

.modo-btn.ativo {
    background: #e94560;
    border-color: white;
    box-shadow: 0 0 30px #e94560, 0 10px 0 #8a2a3a;
}

/* ===== COLUNA 2 - JOGO ===== */
.jogo-principal {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.topo-fixo {
    background: #16213e;
    border: 2px solid #e94560;
    border-radius: 20px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

h1 {
    color: #e94560;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-size: 1.8rem;
    text-align: center;
    width: 100%;
}

.subtitulo {
    color: #fff;
    margin-bottom: 15px;
    font-style: italic;
    font-size: 1rem;
    text-align: center;
    width: 100%;
}

.status {
    background: #16213e;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.2em;
    border: 2px solid #e94560;
    width: auto;
    min-width: 260px;
    max-width: 400px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* ===== BASE FIXA COM CENTRALIZAÇÃO PERFEITA ===== */
.base-fixa {
    background: #323232

; /*aqui*/
    border: 2px solid #e94560;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin-top: 0;
}

/* ===== CARD DO JOGO ===== */
.card-jogo {
    background: #1e2a4a;
    border-radius: 25px;
    padding: 20px;
    border: none;
    box-shadow: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.3s ease;
}

/* ===== SUPER TABULEIRO ===== */
.super-tabuleiro {
    display: grid;
    gap: 2px;
    background: transparent;
    padding: 10px;
    width: 100%;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
}

.tabuleiro {
    background: #facf61;
    padding: 4px;
    border-radius: 6px;
}

.grade-interna {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: #0f3460;
    padding: 8px;
    border-radius: 5px;
}

.celula {
    aspect-ratio: 1;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2em;
    font-weight: bold;
    transition: all 0.2s;
    border-radius: 6px;
    width: 50px;
    height: 50px;
}

.celula.X {
    color: #e94560;
    background: #ffe5e5;
}

.celula.O {
    color: #4a6fa5;
    background: #e5f0ff;
}

.celula.preview-X,
.celula.preview-O {
    opacity: 0.45;
    transform: scale(0.95);
    border: 2px dashed rgba(255, 255, 255, 0.8);
}

.celula.preview-X {
    color: #e94560;
    background: #ffe5e5;
}

.celula.preview-O {
    color: #4a6fa5;
    background: #e5f0ff;
}


/* ===== MODO CLÁSSICO (1 TABULEIRO) ===== */
.modo-classico-ativo .card-jogo {
    max-width: 620px;
    aspect-ratio: 1;
    padding: 25px;
}

.modo-classico-ativo .super-tabuleiro {
    display: flex !important;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 0;
}

.modo-classico-ativo .tabuleiro {
    width: auto;
    max-width: none;
    padding: 12px;
    border-radius: 14px;
}

.modo-classico-ativo .grade-interna {
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
}

.modo-classico-ativo .celula {
    width: 130px;
    height: 130px;
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    border-radius: 12px;
}

/* ===== MODO CILINDRO E MÖBIUS (3 TABULEIROS) ===== */
.modo-cilindro-ativo .card-jogo,
.modo-mobius-ativo .card-jogo {
    max-width: 750px;
    padding: 20px;
}

.modo-cilindro-ativo .super-tabuleiro,
.modo-mobius-ativo .super-tabuleiro {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    max-width: 750px;
}

/* ===== MODO TORO E KLEIN (9 TABULEIROS) ===== */
.modo-toro-ativo .card-jogo,
.modo-klein-ativo .card-jogo {
    max-width: 650px;
    padding: 15px;
}

.modo-toro-ativo .super-tabuleiro,
.modo-klein-ativo .super-tabuleiro {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 650px;
}

.modo-toro-ativo .celula,
.modo-klein-ativo .celula {
    width: 52px;
    height: 52px;
    font-size: 2em;
}

/* ===== COLUNA 3 - PLACAR ===== */
.painel-lateral {
    background: #16213e;
    border-radius: 20px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    border: 2px solid #e94560;
    width: 100%;
    height: 100%;
}

.placar-grande h2 {
    color: white;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 3px solid #e94560;
    padding-bottom: 12px;
}

.pontuacao {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.jogador, .empate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f3460;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1.2rem;
    color: white;
}

.jogador .icone, .empate .icone {
    font-size: 1.8rem;
}

.jogador .label, .empate .label {
    font-weight: bold;
    margin: 0 10px;
}

.jogador .numero, .empate .numero {
    font-size: 2rem;
    padding: 8px 15px;
    border-radius: 8px;
    min-width: 60px;
    text-align: center;
}

.acoes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(233, 69, 96, 0.5);
}

.acoes button {
    padding: 15px 18px;
    font-size: 1.1rem;
    background: #e94560;
    border: none;
    border-radius: 40px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
}

.acoes button:hover {
    background: #0f3460;
    border: 2px solid #e94560;
}

/* ESCONDER COISAS ANTIGAS */
.placar, .dica, .info-tabuleiro {
    display: none !important;
}

/* ===== PALETA FINAL: ESCURA COM ACENTOS ===== */

:root {
    --fundo-externo: #0f3460;
    --fundo-interno: #323232
;
    --fundo-bloco: #123f73;

    --rosa-contorno: #f78dd4;
    --rosa-claro: #fbc6e9;

    --laranja: #f95e3e;
    --laranja-hover: #f95e3e;

    --azul-forte: #092bec;
    --azul-medio: #3856f8;

    --amarelo: #f8ba1b;
    --branco: #ffffff;
    --creme: #fefcec;
}

/* NÃO MEXE NO BACKGROUND DO BODY */

/* Molduras externas */
.container,
.topo-geral {
    background: var(--fundo-externo);
}

/* Displays internos */
.topo-conteudo,
.coluna-botoes,
.painel-lateral,
.card-jogo,
.status {
    background: var(--fundo-interno);
    border-color: var(--rosa-contorno);
}

/* Coluna do tabuleiro */
.tabuleiro {
    background: var(--fundo-bloco);
}

.grade-interna {
    background: var(--fundo-bloco);
}

/* Título */
h1 {
    color: var(--rosa-contorno);
}

.subtitulo {
    color: var(--branco);
}

/* Status */
.status {
    color: var(--branco);
    border-color: var(--amarelo);
}

/* Botões de modo */
.modo-btn {
    background: var(--fundo-bloco);
    color: var(--branco);
    border-color: var(--azul-forte);
    box-shadow: 0 8px 0 #071c38;
}

.modo-btn:hover {
    background: var(--azul-medio);
    color: var(--branco);
    border-color: var(--rosa-contorno);
    transform: scale(1.05);
}

.modo-btn.ativo {
    background: var(--laranja);
    color: var(--branco);
    border-color: var(--amarelo);
    box-shadow: 0 0 20px rgba(248, 72, 37, 0.7), 0 10px 0 #9f2c1d;
}

/* Placar */
.placar-grande h2 {
    color: var(--branco);
    border-bottom-color: var(--rosa-contorno);
}

.jogador,
.empate {
    background: var(--fundo-bloco);
    color: var(--branco);
}

.jogador .numero,
.empate .numero {
    background: var(--azul-forte);
    color: var(--branco);
}

/* Botões de ação */
.acoes {
    border-top-color: rgba(247, 141, 212, 0.6);
}

.acoes button {
    background: var(--laranja);
    color: var(--branco);
}

.acoes button:hover {
    background: var(--laranja-hover);
    border: none;
    color: var(--branco);
}

/* Células */
.celula {
    background: var(--branco);
    color: #000000;
}

/* X e O */
.celula.X {
    color: var(--laranja);
    background: var(--creme);
}

.celula.O {
    color: var(--azul-forte);
    background: #eef1ff;
}

/* Prévia da jogada */
.celula.preview-X {
    color: var(--laranja);
    background: var(--creme);
}

.celula.preview-O {
    color: var(--azul-forte);
    background: #eef1ff;
}

.celula.preview-X,
.celula.preview-O {
    opacity: 0.55;
    transform: scale(0.95);
    border: 2px dashed var(--rosa-contorno);
}

.jogo-principal .base-fixa {
    border-color: #f78dd4 !important;
}

/* ===== IMAGEM DO DISPLAY SUPERIOR ===== */

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
}

.logo-icon {
    width: 187px;
    height: 121px;
    background-image: url('https://i.ibb.co/ym45sbnY/logocompleto.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* Cor do título PLACAR */
.placar-grande h2 {
    color: #f78dd4;
}

/* Box "Vez do jogador" sempre laranja */
.status {
    background: #f95e3e !important;
    border-color: #f78dd4 !important;
    color: #ffffff !important;
}

.status #jogadorAtual {
    color: #ffffff !important;
}

/* Título "JOGO DA VELHA" */
.logo-texto h1 {
    font-size: 3rem;
    color: #f78dd4;
    line-height: 1;
    margin-bottom: 8px;
}

/* Bordo externo dos displays em rosa */
.container,
.topo-geral {
    background: #facf61
 !important;
}
/* Azul principal atualizado */
:root {
    --azul-forte: #7589fa;
    --azul-medio: #7589fa;
}
/* Aumenta o título PLACAR */
.placar-grande h2 {
    font-size: 2.4rem !important;
}

/* ===== AZUL DO TABULEIRO, BOTÕES E PLACAR ===== */

:root {
    --azul-suave: #3856f8;
}

/* Azul dos tabuleiros */
.tabuleiro,
.grade-interna {
    background: var(--azul-suave) !important;
}

/* Botões de modo não ativos */
.modo-btn {
    background: var(--azul-suave) !important;
    border-color: #7589fa !important;
}

/* Hover dos botões */
.modo-btn:hover {
    background: #3856f8 !important;
    border-color: #f78dd4 !important;
}

/* Placar */
.jogador,
.empate {
    background: var(--azul-suave) !important;
}

/* Números do placar */
.jogador .numero,
.empate .numero {
    background: #7589fa !important;
}

/* Botão do modo selecionado em laranja */
.modo-btn.ativo {
    background: #f84825 !important;
    border-color: #facf61 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(248, 72, 37, 0.7), 0 10px 0 #9f2c1d !important;
}

/* Hover do botão ativo */
.modo-btn.ativo:hover {
    background: #f95e3e !important;
    border-color: #facf61 !important;
    color: #ffffff !important;
}



/* ===== CORREÇÃO PARA MODO DESKTOP EM TELAS ESTREITAS ===== */

@media (min-width: 769px) {
    body {
        overflow-x: auto;
    }

    .container {
        width: max-content !important;
        min-width: 1510px !important;
        max-width: none !important;
    }
}

/* ===== MOBILE SEGURO ===== */

@media (max-width: 768px) {

    body {
        padding: 10px;
        justify-content: flex-start;
        overflow-x: hidden;
    }

    .topo-geral {
        width: 100%;
        max-width: 430px;
        padding: 12px;
        margin-bottom: 16px;
    }

    .topo-conteudo {
        padding: 14px;
    }

    .logo-area {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .logo-icon {
        width: 150px;
        height: auto;
    }

    .logo-texto {
        align-items: center;
    }

    .logo-texto h1 {
        font-size: 2.1rem !important;
        text-align: center;
    }

    .subtitulo {
        text-align: center;
        margin-bottom: 10px;
    }

    .status {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        font-size: 1rem;
        padding: 10px;
    }

    .container {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 430px !important;
        padding: 12px;
    }

    .coluna-botoes,
    .jogo-principal,
    .painel-lateral {
        width: 100%;
        height: auto;
    }

    .coluna-botoes {
        padding: 16px;
    }

    .botoes-modo {
        gap: 10px;
    }

    .modo-btn {
        font-size: 1.1rem;
        padding: 14px 10px;
        border-radius: 24px;
    }

    .base-fixa {
        height: auto;
        padding: 12px;
    }

    .card-jogo {
        width: 100%;
        max-width: 100%;
        padding: 10px;
    }

    .super-tabuleiro {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    .grade-interna {
        gap: 4px;
        padding: 5px;
    }

    .celula {
        width: 28px;
        height: 28px;
        font-size: 1.1rem;
    }

    /* Clássico no celular */
    .modo-classico-ativo .card-jogo {
        max-width: 100%;
        aspect-ratio: auto;
        padding: 10px;
    }

    .modo-classico-ativo .tabuleiro {
        padding: 8px;
    }

    .modo-classico-ativo .grade-interna {
        gap: 8px;
        padding: 10px;
    }

    .modo-classico-ativo .celula {
        width: 82px;
        height: 82px;
        font-size: 3rem;
    }

    /* Cilindro e Möbius no mobile — dentro da área segura */
.modo-cilindro-ativo .card-jogo,
.modo-mobius-ativo .card-jogo {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    overflow: hidden;
}

.modo-cilindro-ativo .super-tabuleiro,
.modo-mobius-ativo .super-tabuleiro {
    grid-template-columns: repeat(3, auto);
    gap: 4px;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
}

.modo-cilindro-ativo .tabuleiro,
.modo-mobius-ativo .tabuleiro {
    padding: 3px;
}

.modo-cilindro-ativo .grade-interna,
.modo-mobius-ativo .grade-interna {
    gap: 4px;
    padding: 5px;
}

.modo-cilindro-ativo .celula,
.modo-mobius-ativo .celula {
    width: clamp(25px, 7vw, 30px);
    height: clamp(25px, 7vw, 30px);
    font-size: 1.15rem;
}


/* Toro e Klein no mobile — dentro da área segura */
.modo-toro-ativo .card-jogo,
.modo-klein-ativo .card-jogo {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    overflow: hidden;
}

.modo-toro-ativo .super-tabuleiro,
.modo-klein-ativo .super-tabuleiro {
    grid-template-columns: repeat(3, auto);
    gap: 4px;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
}

.modo-toro-ativo .tabuleiro,
.modo-klein-ativo .tabuleiro {
    padding: 3px;
}

.modo-toro-ativo .grade-interna,
.modo-klein-ativo .grade-interna {
    gap: 3px;
    padding: 4px;
}

.modo-toro-ativo .celula,
.modo-klein-ativo .celula {
    width: clamp(23px, 6.4vw, 28px);
    height: clamp(23px, 6.4vw, 28px);
    font-size: 1rem;
}
    .painel-lateral {
        padding: 16px;
    }

    .placar-grande h2 {
        font-size: 2rem !important;
    }

    .jogador,
    .empate {
        font-size: 1rem;
        padding: 12px;
    }

    .jogador .numero,
    .empate .numero {
        font-size: 1.5rem;
        min-width: 45px;
    }

    .acoes button {
        font-size: 1rem;
        padding: 12px;
    }
}

/* ===== TORO/KLEIN AJUSTADO SOMENTE NO DESKTOP ===== */

@media (min-width: 769px) {
    .modo-toro-ativo .card-jogo,
    .modo-klein-ativo .card-jogo {
        width: fit-content !important;
        height: fit-content !important;
        min-height: 0 !important;
        max-width: none !important;
        padding: 20px !important;
        margin: 0 auto !important;
    }

    .modo-toro-ativo .super-tabuleiro,
    .modo-klein-ativo .super-tabuleiro {
        width: fit-content !important;
        height: fit-content !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 auto !important;
        display: grid !important;
        grid-template-columns: repeat(3, auto) !important;
        gap: 6px !important;
    }

    .modo-toro-ativo .tabuleiro,
    .modo-klein-ativo .tabuleiro {
        padding: 4px !important;
    }

    .modo-toro-ativo .grade-interna,
    .modo-klein-ativo .grade-interna {
        gap: 5px !important;
        padding: 6px !important;
    }

    .modo-toro-ativo .celula,
    .modo-klein-ativo .celula {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.8em !important;
    }
}

/* ===== DESTAQUE DAS CÉLULAS VENCEDORAS ===== */

.celula.vitoria {
    background: #facf61 !important;
    color: #f84825 !important;
    border: 4px solid #ffffff !important;
    box-shadow:
        0 0 12px #facf61,
        0 0 22px #f84825;
    transform: scale(1.08);
    z-index: 2;
    position: relative;
    animation: pulso-vitoria 0.8s ease-in-out infinite alternate;
}

@keyframes pulso-vitoria {
    from {
        transform: scale(1.04);
        box-shadow:
            0 0 10px #facf61,
            0 0 18px #f84825;
    }

    to {
        transform: scale(1.12);
        box-shadow:
            0 0 18px #facf61,
            0 0 30px #f84825;
    }
}

/* ===== CRÉDITO / PROPRIEDADE INTELECTUAL ===== */

.credito-codigo {
    position: fixed;
    right: 18px;
    bottom: 14px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: 2px solid #f78dd4;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: bold;
    z-index: 9999;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
