/* --- corpo --- */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;  /* empurra tudo pra baixo */
    padding-top: 40px;
    perspective: 1000px;
    background-color: #e0e0e0;
    margin: 0;
    min-height: 100vh;
    position: relative;
}

/* Logo */
#logo {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(calc(-50% - 85px));
    background-color: #0077be;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 20px;
    padding: 5px 10px;
    border-radius: 4px;
    z-index: 100;
}

#board {
    width: 400px;
    height: 400px;
    background-color: #f0f0f0;
    border: 2px solid #333;
    position: relative;
    overflow: hidden;
    transform: perspective(1000px) rotateX(0deg);
    transform-origin: center center;
    transition: transform 0.1s ease;
}

#ball {
    width: 20px;
    height: 20px;
    background-color: #0077be;
    border-radius: 50%;
    position: absolute;
    transition: all 0.05s linear;
}

#control {
    position: relative;
    margin: 0;
    width: 150px;
    height: 150px;
    background-color: #005f8f;
    border-radius: 50%;
    cursor: pointer;
    align-self: center;
}

.control-label {
    position: absolute;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    pointer-events: none;
}
#top-label    { top: 5px;    left: 50%; transform: translateX(-50%); }
#right-label  { right: 5px;  top: 50%; transform: translateY(-50%); }
#bottom-label { bottom: 5px; left: 50%; transform: translateX(-50%); }
#left-label   { left: 5px;   top: 50%; transform: translateY(-50%); }

.play-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-family: Arial, sans-serif;
    color: white;
    pointer-events: none;
}

#start {
    width: 50px;
    height: 50px;
    background-color: #4CAF50;
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 16px;
}

#finish {
    width: 45px;
    height: 40px;
    background-color: #4169E1;
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.wall {
    background-color: #333;
    position: absolute;
}

#wall1 { width: 100px; height: 10px; top: 90px;  left: 10px; }
#wall2 { width: 10px;  height: 150px; top: 60px;  left: 300px; }
#wall3 { width: 150px; height: 10px;  top: 200px; left: 100px; }
#wall4 { width: 10px;  height: 100px; top: 100px; left: 60px;  }
#wall5 { width: 100px; height: 10px;  top: 330px; left: 290px; }

#stage {
    font-family: Arial, sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: #333;
    margin-bottom: 10px;
    user-select: none;
    position: relative;
    transform: translateX(-85px);
    z-index: 50;
}

#left-buttons {
    position: absolute;
    top: -50px;
    left: 0;
    width: 400px;
    display: flex;
    justify-content: space-between;
    z-index: 20;
}

#btn-restart-all,
#btn-restart-phase {
    background-color: #0077be;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

footer {
    margin-top: 10px;
    padding: 20px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    background-color: #f8f8f8;
}

#game-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 60px auto 20px;
}

.reset-wall {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: yellow;
    z-index: 0;
}

.reset-wall .danger-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    font-size: 8px;
    color: black;
    font-weight: bold;
    font-family: Arial, sans-serif;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
}

.reset-wall.vertical .danger-text {
    transform: translate(-50%, -50%) rotate(90deg);
}

#temp-message {
    width: 100%;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 20px 0;
}

/* Ajustes apenas para celulares */
@media (max-width: 480px) {
    /* Amplia o tabuleiro */
    #board {
        width: 400px;
        height: 400px;
        border-width: 1px;
    }

    /* Reorganiza game-area para coluna e alinha o control à direita */
    #game-area {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
        margin: 60px auto;
    }

    /* Ajusta o botão de controle: menor e com espaço acima */
    #control {
        width: 120px;
        height: 120px;
        margin-top: 10px;
    }

    /* Ajusta reinício para nova largura */
    #left-buttons {
        top: -40px;
        width: 360px;
    }

    /* Mantém o footer no rodapé */
    footer {
        margin-top: auto;
    }
}

#enableMotion { display: none; } /* não mostra em outros aparelhos o botão */
