* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Comic Sans MS", "Comic Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #fdfcf3 0%, #fef8e7 40%, #f7f4ff 100%);
    color: #222;
}

/* topo / conteudo / rodape acima das fotos de fundo */
.topo,
.conteudo,
.rodape {
    position: relative;
    z-index: 1;
}

.topo {
    background: linear-gradient(90deg, #0047ab, #ffcc00);
    padding: 12px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.logo img {
    height: 40px;
    display: block;
}

.subtitulo {
    font-size: 13px;
}

.conteudo {
    max-width: 1100px;
    margin: 20px auto 40px;
    padding: 0 15px;
}

.rodape {
    text-align: center;
    font-size: 12px;
    padding: 10px;
    background: #f0e4ff;
    border-top: 2px dashed #b38cff;
}

.titulo-pagina {
    font-size: 26px;
    margin-bottom: 15px;
    border-bottom: 3px solid #ffcc00;
    display: inline-block;
    padding-bottom: 4px;
}

.grid-series {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
}

.card-serie {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    border: 2px solid #ffe9a3;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card-serie:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.18);
    border-color: #ffcc00;
}

.thumb-serie img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.nome-serie {
    padding: 8px 10px 10px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

.lista-temporadas {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bloco-temporada {
    background: #fffdf3;
    border-radius: 8px;
    border: 2px dashed #ffc857;
    padding: 10px 12px;
}

.titulo-temporada {
    margin: 0 0 8px;
    font-size: 18px;
    color: #0047ab;
}

.lista-episodios {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lista-episodios li {
    padding: 4px 0;
}

.lista-episodios a {
    text-decoration: none;
    color: #222;
    background: #eaf3ff;
    border-radius: 6px;
    padding: 4px 8px;
    display: inline-block;
    font-size: 14px;
}

.lista-episodios a:hover {
    background: #cde0ff;
}

.layout-player {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.col-player {
    flex: 3;
}

.titulo-video {
    font-size: 20px;
    margin-bottom: 10px;
}

#player {
    width: 100%;
    max-height: 500px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    margin-bottom: 10px;
}

.controles-next-prev {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-nav {
    background: #ffcc00;
    color: #222;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid #e0a800;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-nav:hover {
    background: #ffe27a;
}

.comentarios {
    margin-top: 10px;
    background: #ffffff;
    border-radius: 10px;
    padding: 12px;
    border: 2px solid #e0d4ff;
}

.comentarios h2 {
    margin-top: 0;
    font-size: 18px;
    color: #4c2a85;
}

.form-comentario textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.form-comentario button {
    margin-top: 6px;
    padding: 6px 14px;
    border-radius: 18px;
    border: none;
    background: #4caf50;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.form-comentario button:hover {
    background: #66bb6a;
}

.lista-comentarios {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

.lista-comentarios li {
    background: #f8f5ff;
    border-radius: 8px;
    padding: 6px 8px;
    margin-bottom: 6px;
}

.comentario-texto {
    font-size: 14px;
}

.comentario-data {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

/* wrapper das fotos de fundo */
.bg-fotos-wrapper {
    position: fixed;
    inset: 0;
    z-index: 0;          /* antes -1, por isso ficava escondido */
    pointer-events: none;
    overflow: hidden;
}

/* cada foto de fundo */
.bg-foto {
    position: absolute;
    width: 220px;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 8px solid #fff;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    filter: grayscale(0.03) saturate(1.15);
}

/* algumas posições/rotações predefinidas pra espalhar */
.bg-foto:nth-child(1)  { top: 5%;   left: 5%;   transform: rotate(-10deg); }
.bg-foto:nth-child(2)  { top: 12%;  right: 6%;  transform: rotate(7deg); }
.bg-foto:nth-child(3)  { top: 45%;  left: 2%;   transform: rotate(5deg); }
.bg-foto:nth-child(4)  { top: 55%;  right: 3%;  transform: rotate(-6deg); }
.bg-foto:nth-child(5)  { bottom: 8%; left: 12%; transform: rotate(-3deg); }
.bg-foto:nth-child(6)  { bottom: 10%; right: 15%; transform: rotate(9deg); }
.bg-foto:nth-child(7)  { top: 25%;  left: 35%; transform: rotate(-4deg); }
.bg-foto:nth-child(8)  { top: 30%;  right: 32%; transform: rotate(3deg); }
.bg-foto:nth-child(9)  { bottom: 20%; left: 40%; transform: rotate(2deg); }
.bg-foto:nth-child(10) { bottom: 25%; right: 38%; transform: rotate(-5deg); }


.secao-jogos {
    margin-top: 35px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 2px dashed #ffb347;
    padding: 12px 14px 16px;
}

.subtitulo-jogos {
    margin: 0 0 10px;
    font-size: 20px;
    color: #e65100;
}

.grid-jogos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.card-jogo {
    text-decoration: none;
    color: inherit;
    background: #fffaf0;
    border-radius: 10px;
    border: 2px solid #ffd280;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card-jogo:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.18);
    border-color: #ffb300;
}

.thumb-jogo {
    height: 120px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.thumb-jogo-pacman {
    background-image:
        radial-gradient(circle at 20% 50%, #ffd600 0, #ffd600 35%, transparent 36%),
        radial-gradient(circle at 40% 40%, #000 0, #000 8%, transparent 9%),
        linear-gradient(90deg, #000 0, #000 100%);
}

/* pagina do jogo pacman */
.jogo-pacman-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
}

.jogo-pacman-col {
    flex: 2;
    min-width: 260px;
}

.jogo-pacman-score {
    flex: 1;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border: 2px dashed #ffb347;
    padding: 10px;
}

.jogo-pacman-score h2 {
    margin-top: 0;
    font-size: 16px;
}

.jogo-pacman-score ol {
    margin: 6px 0 0;
    padding-left: 20px;
    font-size: 13px;
}

#pacmanCanvas {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    background: #000;
}

/* overlay de game over */
.jogo-gameover {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.jogo-gameover.hidden {
    display: none;
}

.jogo-gameover-card {
    background: #fffdf3;
    border-radius: 12px;
    border: 2px solid #ffcc00;
    padding: 16px 18px;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    text-align: center;
}

.jogo-gameover-card input {
    width: 100%;
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.jogo-gameover-botoes {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* controles mobile */
.jogo-controles-mobile {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.jogo-controles-mobile .linha-meio {
    display: flex;
    gap: 6px;
}

.btn-dir {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #ffcc00;
    background: #fff7d0;
    font-size: 18px;
    cursor: pointer;
}

.btn-dir:active {
    background: #ffe88a;
}

/* responsivo */
@media (max-width: 768px) {
    .jogo-pacman-layout {
        flex-direction: column;
    }

    .jogo-pacman-score {
        order: -1;
    }
}

/* Ajustes para celular / telas pequenas */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .topo {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 12px;
    }

    .logo img {
        height: 32px;
    }

    .conteudo {
        max-width: 100%;
        margin: 12px auto 24px;
        padding: 0 10px;
    }

    .titulo-pagina {
        font-size: 20px;
    }

    .grid-series {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .nome-serie {
        font-size: 13px;
        padding: 6px 8px 8px;
    }

    .layout-player {
        gap: 12px;
    }

    #player {
        max-height: none;
    }

    .controles-next-prev {
        flex-wrap: wrap;
        gap: 6px;
    }

    .btn-nav {
        font-size: 12px;
        padding: 5px 10px;
    }

    .comentarios {
        padding: 10px;
    }

    .form-comentario textarea {
        font-size: 13px;
    }

    .bg-foto {
        width: 140px;
        height: 100px;
        opacity: 0.12;
    }
}
