* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #080818;
    color: white;
    font-family: Arial, sans-serif;
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    text-align: center;
    padding: 20px;
}

h1 {
    color: #ffd900;
    font-size: 32px;
    margin-bottom: 15px;
    text-shadow: 0 0 15px #ffd900;
}

.info {
    width: 520px;
    max-width: 95vw;

    display: flex;
    justify-content: space-between;

    margin: auto;
    margin-bottom: 10px;

    font-size: 20px;
    font-weight: bold;
}

#vidas {
    color: #ff4040;
}

#pontos {
    color: #00eaff;
}

#mensagem {
    height: 30px;
    color: #00ff88;
    font-size: 18px;
    font-weight: bold;
}

#game {
    display: grid;

    grid-template-columns: repeat(19, 28px);
    grid-template-rows: repeat(19, 28px);

    gap: 1px;

    margin: 10px auto;

    background: #000;
    padding: 5px;

    border: 4px solid #2222ff;
    border-radius: 10px;

    box-shadow:
        0 0 15px #2222ff,
        inset 0 0 20px #000;
}

.cell {
    width: 28px;
    height: 28px;

    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;
}

.wall {
    background: #1616a8;
    border: 2px solid #3333ff;
    border-radius: 4px;
}

.floor {
    background: #050505;
}

.dot::after {
    content: "";
    width: 6px;
    height: 6px;

    background: white;
    border-radius: 50%;

    box-shadow: 0 0 6px white;
}

.power::after {
    content: "";
    width: 15px;
    height: 15px;

    background: #00eaff;
    border-radius: 50%;

    box-shadow:
        0 0 8px #00eaff,
        0 0 15px #00eaff;
}

.player {
    width: 22px;
    height: 22px;

    background: #ffd900;

    border-radius: 50%;

    box-shadow:
        0 0 8px #ffd900,
        0 0 15px #ffd900;

    z-index: 5;
}

.player::after {
    content: "";
    position: absolute;

    width: 0;
    height: 0;

    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid #050505;

    right: 1px;
    top: 7px;
}

.ghost {
    width: 22px;
    height: 22px;

    border-radius: 50% 50% 20% 20%;

    position: relative;

    z-index: 4;
}

.ghost::before,
.ghost::after {
    content: "";
    position: absolute;

    width: 5px;
    height: 7px;

    background: white;

    border-radius: 50%;

    top: 5px;
}

.ghost::before {
    left: 4px;
}

.ghost::after {
    right: 4px;
}

.ghost-red {
    background: #ff3030;
    box-shadow: 0 0 10px #ff3030;
}

.ghost-pink {
    background: #ff65d4;
    box-shadow: 0 0 10px #ff65d4;
}

.ghost-green {
    background: #35ff75;
    box-shadow: 0 0 10px #35ff75;
}

.frightened {
    background: #2673ff !important;
    box-shadow: 0 0 12px #2673ff !important;
    animation: assustado 0.4s infinite alternate;
}

@keyframes assustado {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(0.75);
    }
}

.controles {
    margin-top: 10px;
    color: #aaa;
    font-size: 14px;
}

.controles p {
    margin: 5px;
}

#reiniciar {
    margin-top: 15px;

    padding: 12px 25px;

    border: none;
    border-radius: 8px;

    background: #ffd900;
    color: #111;

    font-size: 16px;
    font-weight: bold;

    cursor: pointer;

    box-shadow: 0 0 10px #ffd900;

    transition: 0.2s;
}

#reiniciar:hover {
    transform: scale(1.05);
    background: #fff000;
}

@media (max-width: 650px) {

    h1 {
        font-size: 24px;
    }

    #game {
        transform: scale(0.85);
        transform-origin: top center;
        margin-bottom: -80px;
    }

    .info {
        width: 95%;
        font-size: 16px;
    }
}