* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE/Edge */
}

#gameAboutButton {
    cursor: pointer;
    color: #fff;
    margin-top: 20px;
    font-size: 12px;
}

body {
    margin: 0;
    background: #000;
    font-family: 'Segoe UI', sans-serif;
    overflow-x: hidden;
    transition: background-color 0.4s ease-in-out;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
}

.castle-tower {
    display: flex;
    justify-content: space-between;
    gap: 50px;
}

.column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 140px;
    justify-content: end;
    border-left: 3px solid #000;
    border-right: 3px solid #000;
    position: relative;
}

.top-castle {
    position: relative;
    width: 150px;
    height: 47px;
    background: url(./../images/top-castle.webp);
    z-index: 2;
}

.castle-floor {
    width: 100%;
    height: 65px;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    font-size: 18px;
    transition: background-color 0.3s ease;
    padding-left: 15px;
    padding-right: 15px;
    border-top: 1px solid #000;
}

.liberado {
    background-color: #bbf7d0;
    color: #166534;
}

table {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background: white;
}

thead {
    background: url("./../images/garden.webp");
    background-size: contain;
}


#arduinoEffect {

    display: none;
    position: fixed;
    inset: 0;
    background: #000000cc;
    z-index: 999999;
    justify-content: start;
    align-items: center;
    flex-direction: column;

}

#rainEffect {
    image-rendering: pixelated;
}

#lightningFlash {
    position: fixed;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 99998;
    transition: opacity 0.05s ease;
}


#gameAboutClose {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 18px;
    background: none;
    border: none;
    cursor: pointer;
}

#gameAboutModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.wrapper-game {

    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.wrapper-game h2 {
    margin-bottom: 15px;
}

.wrapper-game p {

    line-height: 1.5;
    padding-bottom: 10px;
}

th,
td {
    padding: 5px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

th {
    color: white;
    padding-top: 30px;
    padding-bottom: 10px;
}

tr.success {
    background-color: #e8f9e8;
    color: #27ae60;
}

tr.denied {
    background-color: #fcebea;
    color: #c0392b;
}

.emoji {
    font-size: 20px;
    padding-right: 6px;
}

.status {
    font-weight: bold;
}

.andar {
    background: url("./../images/bg-tijolo.webp");
    background-size: contain;
    position: relative;
}

.jardim:before {
    background: url(./../images/moita.webp);
    background-size: 100%;
    background-position: top;
    width: 74px;
    height: 50px;
    position: absolute;
    bottom: 0;
    right: -15px;
    content: "";
    background-repeat: no-repeat;
}

.port {
    background-color: #ca3025;
    color: #fff;
    position: absolute;
    right: -24px;
    top: 0px;
    width: 17px;
    height: 17px;
    z-index: 9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    transform: rotate(30deg);
}

.port:before {
    content: "";
    left: 0;
    width: 1px;
    height: 29px;
    position: absolute;
    background-color: black;
    top: 0;
}

.door {
    width: 45px;
    height: 55px;
    display: flex;
    align-self: end;
    border-radius: 20px 20px 0 0px;
    position: relative;
    overflow: hidden;
    background-color: #000;
}

.door:before {
    content: "";
    background: url(./../images/door.webp);
    background-size: contain;
    background-position: center;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.closed {
    width: 45px;
    height: 55px;
    display: flex;
    align-self: end;
    background: url(./../images/closed.webp);
    background-size: contain;
    background-position: center;
    border-radius: 20px 20px 0 0px;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
    transition: bottom 2s ease-in;
}

.key {
    background: url(./../images/key.webp);
    width: 14px;
    height: 22px;
    position: absolute;
    z-index: 9;
    opacity: 1;
    display: flex;
    bottom: 15px;
    right: 0;
    background-size: 100%;
    margin: 0 auto;
    left: 0;
    transition: opacity 0.5s ease-in;
}

.name {
    color: #fff;
    font-size: 12px;
    pointer-events: none;
}

.name.image {
    display: flex;
    align-items: center;
    height: 100%;
    flex-direction: column;
}

.liberado .name {
    cursor: pointer;
    pointer-events: visible;
}

.name.image img {
    width: 20px;
    position: relative;
    left: 55px;
    z-index: 2;
    opacity: 0;
    transition: all ease-in 2s;
}

.liberado .name.image img {
    opacity: 1;
    left: 0;
}


/* A base para o ::before */
.escada:before {
    content: "";
    width: 0;
    height: 9px;
    background: url(./../images/escada.webp);
    background-size: 100%;
    position: absolute;
    left: 137px;
    bottom: -8px;
    transition: width 1s ease-in-out;
}

.rain {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#servant.escada:before {
    display: none
}

/* Animação da escada */
@keyframes escadaLiberada {
    0% {
        width: 0;
    }

    100% {
        width: 41px;
        /* Definindo a largura desejada */
    }
}

.liberado .escada:before {
    animation: escadaLiberada 1s ease-in-out forwards;
    transform-origin: left;
    /* Garante que o aumento ocorra a partir da esquerda */
}

/* Para que a transição de opacidade e bottom funcionem com a classe liberado */
.liberado .key {
    opacity: 0;
    transition: opacity 1s ease;
}

.liberado .closed {
    bottom: 45px;
    transition: bottom 2s ease-in-out;
}

/* Previne o fundo de piscar */
.liberado .andar {
    background-color: transparent;
}

.liberado.escada:before {
    width: 51px;
}

#captain.liberado.escada:before,
#noble.liberado.escada:before,
#queen.liberado.escada:before,
#blacksmith.liberado.escada:before {
    display: none;
}

#guard.liberado.escada:before,
#blacksmith.liberado.escada:before,
#general.liberado.escada:before {
    width: 51px;
    right: 137px;
    left: inherit;
}

#toggleSound {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 10px;
    background: #000000b3;
    color: #fff;
    border: none;
    font-size: 13px;
    cursor: pointer;
    z-index: 2;
}

.name i {

    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    align-self: center;
    font-size: 11px;
}


#dog-save img {

    width: 50px;
}

#dog-save {

    justify-content: end;
    align-items: end;
    border: none;
}

#dog-save {

    position: relative;
    background-color: #000;
    overflow: hidden;
    padding: 0;
}

#dog-save.open #grade {

    bottom: 55px;
}

#grade {
    background: url(./../images/grade.webp);
    position: absolute;
    left: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
    transition: bottom ease-in 2s;
}

.liberado .port {
    background-color: #257328;
}

.liberado .name.image .move-king {

    left: 215px;
    z-index: 5;

}

.ballon {

    background-color: #fff;
    color: #000;
    font-size: 9px;
    position: absolute;
    width: 95px;
    padding: 7px;
    text-align: center;
    z-index: 10;
    right: -84px;
    opacity: 0;
    transition: opacity ease-in 1s;
}

.access-cards {

    color: #fff8dc;
    font-size: 12px;
    text-align: center;
    padding: 10px 20px;
    max-width: 400px;
}

.cards-toggle {
  display: none;
}

.pixel-cloud {
    position: fixed;
    width: 64px;
    height: auto;
    opacity: 0.8;
    animation: cloudMove 80s linear infinite;
    z-index: 0;
    image-rendering: pixelated;
    will-change: transform;
    contain: layout;
    pointer-events: none;
}

/* Nuvem 1 */
.cloud1 {
    top: 30px;
    left: -100px;
    animation-delay: 0s;
    background: url('./../images/cloud-1.webp') no-repeat;
    background-size: contain;
    width: 64px;
    height: 34px;
}

/* Nuvem 2 */
.cloud2 {
    top: 60px;
    left: -150px;
    animation-delay: 20s;
    background: url('./../images/cloud-2.webp') no-repeat;
    background-size: contain;
    width: 48px;
    height: 21px;
}

/* Nuvem 3 */
.cloud3 {
    top: 90px;
    left: -200px;
    animation-delay: 10s;
    background: url('./../images/cloud-3.webp') no-repeat;
    background-size: contain;
    width: 56px;
    height: 26px;
}

@keyframes cloudMove {
    from {
        left: -200px;
    }

    to {
        left: 110%;
    }
}

#ballon.show-ballon {
    opacity: 1;
}

.ballon:before {
    width: 13px;
    height: 13px;
    content: "";
    position: absolute;
    right: -6px;
    top: 38px;
    background-color: #ffffff;
    transform: rotate(45deg);
    z-index: -1;
}

#cartasContainer {
    display: grid;
    grid-template-columns: repeat(5, 65px);
    grid-template-rows: repeat(2, 95px);
    gap: 10px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#leitor {
    position: relative;
    z-index: 1;
}

#leitor.hovered {
    box-shadow: 0 0 20px 5px #ffffffaa;
    transition: box-shadow 0.3s ease-in-out;
}

.carta {
    width: 65px;
    height: 95px;
    background: #fffbe0;
    border: 2px solid #999;
    border-radius: 8px;
    text-align: center;
    line-height: 120px;
    font-weight: bold;
    cursor: grabbing;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.group-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding-top: 25px;
    overflow: hidden;
    z-index: 0;
    position: relative;
    background-color: #439aaa;
}
}

.pulse {
    animation: pulseAnim 0.3s ease-in-out infinite alternate;
}

@keyframes pulseAnim {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

.ghost-card {
    width: 65px;
    height: 95px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    opacity: 0.3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background: #fffbe0;
}

#modalAcesso {
    position: absolute;
    inset: 0;
    display: flex;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease-in-out;
}

#cartasContainer {
    position: relative;
    /* Necessário para o modal posicionar dentro */
}


.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #00000088;
    top: 0;
    left: 0;
    z-index: 1;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }

    100% {
        transform: translateX(0);
    }
}

.modal-body.shake {
    animation: shake 0.6s ease-in-out;
}


.shake {
    animation: shake 3s ease-in-out;
}

.modal-content {
    position: relative;
    z-index: 2;
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 0 20px #00000055;
    text-align: center;
    width: 90%;
    animation: slideUp 0.4s ease-out;
}

.modal-content h2 {
    margin-top: 0;
    font-size: 20px;
    color: #166534;
}

.modal-content p {
    margin-bottom: 20px;
    font-size: 16px;
}

.modal-content button {
    padding: 6px 14px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#modalAcesso.negado .modal-content {
    background-color: #fff5f5;
    border: 2px solid #dc2626;
}

#modalErro.negado .modal-content h2 {
    color: #dc2626;
}

.modal-content.shake {
    animation: slideUp 0.4s ease-out, shake 3s ease-in-out;
}


#dog-wrapper {

    position: absolute;
    left: 0;
    bottom: -7px;
}

.modalAcesso {

    display: flex;
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    z-index: 9999;
    align-items: center;
}

#toggleArduino {
    position: absolute;
    top: 5px;
    left: 5px;
    padding: 10px 16px;
    background: linear-gradient(to right, #00bcd4, #4caf50);
    color: #fff;
    border: none;
    font-size: 13px;
    cursor: pointer;
    z-index: 10;
    font-weight: bold;
    border-radius: 20px;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 0 6px #00000066;
}

#toggleArduino.arduino {
    background: linear-gradient(to right, #ff5722, #e91e63);
}

#toggleArduino:hover {
    transform: scale(1.05);
}


#leitor,
table,
#toggleSound,
body {
    transition: all 0.5s ease-in-out;
}

body.grayscale {
    background-color: #ccc;
}

body.grayscale #leitor,
body.grayscale table,
body.grayscale #toggleSound {

    filter: grayscale(0.6);
}


@keyframes flicker {
    from {
        opacity: 0.3;
        transform: scale(1);
    }

    to {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes intenseFlash {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(1);
    }

    20% {
        opacity: 1;
        transform: scale(1.05);
    }

    40% {
        opacity: 0.5;
    }

    60% {
        opacity: 1;
        transform: scale(1.1);
    }

    80% {
        opacity: 0.3;
    }
}

.drop {
    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(13, 52, 58, 1)), to(rgba(255, 255, 255, 0.6)));
    background: -moz-linear-gradient(top, rgba(13, 52, 58, 1) 0%, rgba(255, 255, 255, .6) 100%);
    width: 1px;
    height: 89px;
    position: absolute;
    top: -100px;
    /* Começa acima da tela */
    -webkit-animation: fall .63s linear infinite;
    -moz-animation: fall .63s linear infinite;

}

@keyframes fall {
    to {
        transform: translateY(120vh);
        /* Move bem abaixo da tela sem afetar layout */
    }
}

#modeMessage {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 48px;
    font-weight: bold;
    color: white;
    background-color: #000000aa;
    padding: 20px 40px;
    border-radius: 12px;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 0 10px #fff;
    transition: all 0.3s ease-in-out;
}

#modeMessage.show {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
    animation: pulseZoom 1.5s ease-in-out forwards;
}

@keyframes pulseZoom {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1);
    }

    80% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.bounceIn {
    animation: bounceIn 1s both;
}

.see {

    position: absolute;
    background-color: #fff;
    color: #000;
    font-size: 10px;
    width: 58px;
    text-align: center;
    line-height: 10px;
    padding: 5px;
    left: -40px;
    top: 28px;
    opacity: 0;
    z-index: 9;
    transition: opacity ease-in 1s;
}


.see:before {

    content: "";
    right: -4px;
    top: 9px;
    width: 10px;
    height: 10px;
    background-color: #fff;
    transform: rotate(45deg);
    position: absolute;
}

.shuffle {
    display: block;
    padding: 5px 20px;
    background-color: #7F4D1C;
    color: #fff;
    font-size: 12px;
    border: 4px solid #000;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    transition: all 0.1s ease-in-out;
    border-radius: 25px;
    margin-top: 10px;
}

.group-buttons .shuffle {
    background-color: #5A3A1C;
    border: 3px solid #000;
    box-shadow: 4px 4px 0 #000;
    color: #fff;
}

.group-buttons .shuffle.shuffle-numbers {
    background-color: #A6813D;
    color: #fff;
    width: 150px;
}

.group-buttons .shuffle:hover {
    background-color: #FCDC58;
    color: #000;
}

@media (min-width: 769px) {

    .intro {
        background: #4b581e url(./../images/bg-intro-game-desktop.webp);
    }
}

@media (max-width: 768px) {

  .cards-toggle {

    display: block;
  }

  .wrapper-game {

    padding: 15px;
  }

  .cards-module.toggle-hidden {

    bottom: -175px;
  }

  .hidden-legend,
  .hidden-cards-toggle {

    display: none;
  }

  .cards-toggle {

    border: none;
    position: absolute;
    right: 4px;
    top: -29px;
    background: url(./../images/check.webp);
    width: 30px;
    height: 30px;
    background-size: 100%;
    transition: transform 0.3s ease;
  }

  .cards-module.toggle-hidden {
    bottom: -175px;
  }

  .cards-module.toggle-hidden .cards-toggle {
    transform: rotate(-180deg);
  }

  .access-cards {
    font-size: 12px;
    text-align: left;
    width: 100%;
    padding-bottom: 10px;
    padding-left: 0;
  }

    .intro {
        background: #4b581e url(./../images/bg-intro-game-mobile.webp);
    }

    .group-modal {

        height: 280px;
        overflow: auto;
    }

    /* Chrome, Edge, Safari */
    .group-modal::-webkit-scrollbar {
        width: 8px;
    }

    .group-modal::-webkit-scrollbar-track {
        background: #363C10;
        border-radius: 4px;
    }

    .group-modal::-webkit-scrollbar-thumb {
        background-color: #888;
        border-radius: 4px;
        border: 2px solid #363C10;
    }

    .group-modal::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    .group-buttons .shuffle {

        padding: 10px;
    }

    .group-buttons .shuffle:hover {
        transform: none;
        box-shadow: none;
    }

    .see {
        left: inherit;
        right: 20px;
    }

    .see:before {
        right: inherit;
        left: -4px;
    }

    th {
        padding-top: 15px;
    }

    #modeMessage {
        font-size: 18px;
        padding: 12px 20px;
    }

    .modalAcesso {
        position: fixed;

        top: 0;
    }

    .group-screen {
        flex-direction: column;
    }

    #cartasContainer {
        display: flex;
        gap: 5px;
    }

    .carta,
    .ghost-card {
        width: 30px;
        height: 50px;
    }

    .cards-module {

        position: fixed;
        z-index: 22;
        bottom: 0;
        width: 100%;
        background-color: #000;
        padding: 10px;
        height: 175px;
        transition: bottom ease-in 0.5s;
    }

    .port {
        right: -19px;
        transform: none;
    }


}

#modeToggle {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    border-radius: 25px;
    overflow: hidden;
    border: 2px solid #000;
    box-shadow: 0 0 6px #00000066;
    z-index: 10;
}

#modeToggle button {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    color: white;
    background: #555;
    transition: all 0.3s ease-in-out;
    flex: 1;
}

#modeToggle button span {
    display: flex;
    width: 70px;
    justify-content: center;
    align-items: center;
}

#modeToggle button.active {
    background: linear-gradient(to right, #00bcd4, #4caf50);
    color: #fff;
}

#modeToggle button:hover {
    transform: scale(1.05);
}

@keyframes wobble {
    0% {
        transform: translateX(0) rotate(0deg);
    }

    5% {
        transform: translateX(-12px) rotate(-3deg);
    }

    10% {
        transform: translateX(12px) rotate(3deg);
    }

    15% {
        transform: translateX(-10px) rotate(-2.5deg);
    }

    20% {
        transform: translateX(10px) rotate(2.5deg);
    }

    25% {
        transform: translateX(-8px) rotate(-2deg);
    }

    30% {
        transform: translateX(8px) rotate(2deg);
    }

    35% {
        transform: translateX(-6px) rotate(-1.5deg);
    }

    40% {
        transform: translateX(6px) rotate(1.5deg);
    }

    45% {
        transform: translateX(-5px) rotate(-1deg);
    }

    50% {
        transform: translateX(5px) rotate(1deg);
    }

    55% {
        transform: translateX(-4px) rotate(-1deg);
    }

    60% {
        transform: translateX(4px) rotate(1deg);
    }

    65% {
        transform: translateX(-3px) rotate(-0.8deg);
    }

    70% {
        transform: translateX(3px) rotate(0.8deg);
    }

    75% {
        transform: translateX(-2px) rotate(-0.5deg);
    }

    80% {
        transform: translateX(2px) rotate(0.5deg);
    }

    85% {
        transform: translateX(-1px) rotate(-0.3deg);
    }

    90% {
        transform: translateX(1px) rotate(0.3deg);
    }

    95% {
        transform: translateX(0px) rotate(0deg);
    }

    100% {
        transform: translateX(0) rotate(0deg);
    }
}


.wobble {
    animation: wobble 1.8s ease-in-out;
}


.intro {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 222;
    background-size: cover;
    background-position: bottom;
    flex-direction: column;
}

.intro img {

    width: 270px;
    aspect-ratio: 0.6667;
}

#start-game {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 30px;
    background-color: #fcdc58;
    color: #000;
    font-size: 16px;
    border: 4px solid #000;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 4px 4px 0 #000;
    transition: all 0.1s ease-in-out;
    border-radius: 25px;
}

#start-game:hover {
    background-color: #fff;
    color: #000;
    transform: translate(2px, 2px);
    /* afunda */
    box-shadow: 0 0 0 #000;
    /* remove sombra para parecer pressionado */
}

.hidden-game .group-screen,
.hidden-game #logTable,
.hidden-game #modeToggle,
.hidden-game #btnLimparLog,
.hidden-game .cards-module,
.hidden-game #toggleSound,
.hidden-game #arduinoEffect,
.hidden-game #lightningFlash {
    display: none !important;
}

#vortex-overlay {
    position: fixed;
    inset: 0;
    background-color: #000;
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    overflow: hidden;
}

@keyframes buttonPress {
    0% {
        transform: scale(1);
        box-shadow: 4px 4px 0 #000;
    }

    100% {
        transform: translate(2px, 2px);
        box-shadow: 0 0 0 #000;
    }
}

.button-press {
    animation: buttonPress 0.15s forwards;
}


#vortex-overlay::before {
    content: "";
    position: absolute;
    width: 1px;
    height: 1px;
    box-shadow:
        20px 30px #fff,
        60px 80px #ffffcc,
        110px 40px #fff,
        150px 90px #ddd,
        200px 120px #fff,
        250px 180px #ffee99,
        300px 220px #fff,
        400px 160px #ffffcc,
        480px 90px #eeeeee,
        600px 200px #fff,
        700px 100px #fff;
    animation: twinkle 2s infinite alternate;
}


#vortex-overlay img {
    width: 150px;
    height: 150px;
    image-rendering: pixelated;
    filter: brightness(1.2);
    animation: none;
}

.vortex-animate {
    display: flex !important;
}

.vortex-animate img {
    animation: galaxyVortex 2s ease-out forwards;
}

@keyframes galaxyVortex {
    0% {
        transform: scale(0.1) rotate(0deg);
        opacity: 1;
        clip-path: circle(5% at 50% 50%);
    }

    50% {
        transform: scale(3) rotate(360deg);
        clip-path: circle(70% at 50% 50%);
    }

    100% {
        transform: scale(10) rotate(720deg);
        opacity: 0;
        clip-path: circle(150% at 50% 50%);
    }
}

#btnLimparLog {
    display: block;
    position: absolute;
    right: 15px;
    background: #c00;
    color: #fff;
    border: none;
    padding: 8px;
    font-size: 12px;
    z-index: 10;
    cursor: pointer;
    bottom: 15px;
}

#arduinoEffect img {
    animation: flashRain 0.15s steps(1) infinite;
}

@keyframes flashRain {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }

    100% {
        opacity: 1;
    }
}


.shuffle:hover {
    background-color: #fff;
    color: #000;
    transform: translate(2px, 2px);
    box-shadow: 0 0 0 #000;
}

.group-buttons {

    display: flex;
    gap: 10px;
    justify-content: center;
}


.flip-card {
    width: 335px;
    height: 265px;
    perspective: 1000px;
}

.flip-card-inner {
    width: 100%;
    height: 100%;
    transition: transform 1s;
    transform-style: preserve-3d;
    position: relative;
}

.flip-card-front,
.flip-card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
}

.flip-card-front {
    background-color: #fff;
    display: flex;
    align-items: start;
    justify-content: center;
    flex-direction: column;
    text-align: left;
    padding: 10px;
    font-size: 12px;
}

.flip-card-front code {

    background-color: #dbdbdb;
    color: #333;
    font-size: inherit;
}

.flip-card-back {
    background-color: #bbf7d0;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes flipInX {
    0% {
        transform: perspective(800px) rotateX(90deg);
        opacity: 0;
    }

    40% {
        transform: perspective(800px) rotateX(-20deg);
    }

    60% {
        transform: perspective(800px) rotateX(10deg);
        opacity: 1;
    }

    80% {
        transform: perspective(800px) rotateX(-5deg);
    }

    100% {
        transform: perspective(800px) rotateX(0deg);
    }
}

.flip-animate-x {
    animation: flipInX 1s ease-out forwards;
}

.items-permitio li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;

}

.title-game {

    padding: 4px 8px;
    background-color: rgb(248, 241, 238);
    border-radius: 4px;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 19px;
    color: rgb(132, 99, 88);
}

.items-permitio li:last-child {
    margin-bottom: 0;
}

.items-permitio li:before {

    content: "";
    left: 0;
    top: 0;
    position: absolute;
    width: 18px;
    height: 18px;
}

.items-permitio li.has:before {
    background: url(./../images/has.webp);
}

.items-permitio {

    overflow: auto;
    height: 100%;
}

.items-permitio li.no-has:before {
    background: url(./../images/no-has.webp);
}

.items-permitio li.no-has span {

    opacity: 0.4;
}

.modal-content h2.title-permitio {
    border-radius: 25px;
    padding: 6px 15px;
    display: flex;
    align-items: center;
    background-color: rgb(249, 216, 236);
    gap: 10px;
    justify-content: center;

    font-weight: normal;
    height: 32px;
}

.modal-content h2.title-permitio span {
    color: rgb(205, 29, 141);
    line-height: 1;
    font-size: 17px;
}

.items-permitio::-webkit-scrollbar {
    width: 8px;
}

.items-permitio::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.items-permitio::-webkit-scrollbar-thumb {
    background-color: purple;
    border-radius: 10px;
    border: 2px solid #f0f0f0;
    /* efeito de 'padding' interno */
}

/* Scrollbar para Firefox */
.items-permitio {
    scrollbar-color: purple #f0f0f0;
    scrollbar-width: thin;
}

.group-buttons-modal {

    display: flex;
    margin-bottom: 10px;
    gap: 10px;
    align-items: center;
}

.no-before {

    width: 90px;
    background-color: #000;
    color: #fff;
    left: 0;
    border: 1px dashed #ccc;
}

/* Esconde o triângulo do balão se a classe no-before estiver presente */
.see.no-before:before {
    display: none;
}

.modal-content button.close-modal {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 3;
    background: #fff;
    border: 2px solid #000;
    color: #000;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-content button.close-modal.visible {
    opacity: 1;
}

.modal-content button.close-modal:hover {
    background-color: #fceaea;
}

.flicker-strong {
    animation: flickerEffect 0.4s ease-in-out;
}

@keyframes flickerEffect {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    20% {
        opacity: 0.2;
        transform: scale(1.05) rotate(-2deg);
    }

    40% {
        opacity: 0.8;
        transform: scale(1.1) rotate(2deg);
    }

    60% {
        opacity: 0.1;
        transform: scale(0.95) rotate(-3deg);
    }

    80% {
        opacity: 1;
        transform: scale(1.03) rotate(1deg);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}