body {
    font-family: 'Roboto', sans-serif;
    background-color: #1a1a1a;
    color: #f0f0f0;
    margin: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

h1 {
    color: #4CAF50;
    margin-top: 0;
}

h1, h2, h3, .btn, #moveset-ui {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.screen-title {
    font-weight: 900;
}

/* --- TELAS DE OVERLAY (INÍCIO E FIM) --- */
.screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    z-index: 100;
}

#start-screen {
    display: flex; 
}

#game-over {
    display: none; 
}

.screen-title {
    font-size: 3em;
    margin-bottom: 10px;
}

#final-score {
    font-size: 2.5em;
    color: #FFD700;
    margin: 10px 0;
}

.btn {
    font-size: 1.2em;
    padding: 10px 20px;
    margin-top: 20px;
    cursor: pointer;
    background-color: #4CAF50;
    font-weight: bold;
    border: none;
    color: white;
    border-radius: 5px;
    transition: background-color 0.2s, scale 0.3s ease-in;
}
.btn:hover {
    background-color: #45a049;
    scale: 1.05;
}

/* --- Instruções --- */

.instructions {
    max-width: 600px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.9em;
    
    margin-left: 20px;
    margin-right: 20px;
    padding-left: 15px;
    padding-right: 15px;
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out, margin-top 0.5s ease-out, padding 0.5s ease-out;
}

.instructions.visible {
    max-height: 600px;
    overflow: visible;
    opacity: 1;
    margin-top: 20px;
    padding-top: 15px;
    padding-bottom: 15px;
}

.instructions h3 {
    margin-top: 0;
    margin-bottom: 10px;
    padding: 0;
}

.instructions hr {
    border-color: #4CAF50;
}
.instructions p {
    margin: 5px 0;
}

/* --- CONTAINER DO JOGO --- */
#game-container {
    display: none;
    flex-direction: column;
    align-items: center;
}

#game-container h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
}

#game-ui {
    display: flex;
    justify-content: space-around;
    width: 500px;
    margin: 5px 0;
    font-size: 1em;
}

#status-ui {
    min-width: 80px;
    border-radius: 20px;
    color: #FFD700;
    background-color: #673AB7;
    padding-left: 5px;
    padding-right: 5px;
    height: 1.1em;
    margin-bottom: 3px;
    text-align: center;
    font-size: 0.9em;
}

#moveset-ui {
    margin-top: 5px;
    font-size: 1.1em;
}

#moveset-list {
    color: yellow;
    font-size: 1em;
    margin-bottom: 5px;
}

.clickable-title {
    cursor: pointer;
    transition: color 0.2s;
}
.clickable-title:hover {
    color: #FFD700;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(10, 50px);
    grid-template-rows: repeat(10, 50px);
    border: 4px solid #555;
    background-color: #333;   
    width: 500px;
    height: 500px;
}
.cell {    
    width: 50px;
    height: 50px;
    box-sizing: border-box; 
}
.cell.light { background-color: #d1d1d1; }
.cell.dark  { background-color: #7c7c7c; }

.cell.highlight {
    background-color: rgba(76, 175, 80, 0.5);
    cursor: pointer;
}
.cell.highlight-self {
    background-color: rgba(64, 150, 255, 0.5);
    cursor: pointer;
}


/* --- PEÇAS --- */
.piece {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

/* REI */
.player .geo-shape {
    width: 40px;
    height: 30px;
    background-color: #FFD700;
    position: relative;
    clip-path: polygon(0% 100%, 100% 100%, 100% 30%, 80% 50%, 50% 0%, 20% 50%, 0% 30%);
    box-shadow: 0 0 10px #FFD700;
}

/* INIMIGO: Triângulo (Peão) */
.enemy.triangle .geo-shape {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid #E53935;
}

/* INIMIGO: Losango (Cavalo) */
.enemy.losangle .geo-shape {
    width: 30px;
    height: 30px;
    background-color: #B71C1C;
    border: 2px solid #E53935;
    transform: rotate(45deg);
}
        
/* INIMIGO: Círculo (Elo) */
.enemy.link .geo-shape {
    width: 30px;
    height: 30px;
    background-color: #616161;
    border: 2px solid #9E9E9E;
    border-radius: 50%;
}

/* INIMIGO: Quadrado (Losango) */
.enemy.rook .geo-shape {
    width: 30px;
    height: 30px;
    background-color: #A1887F;
    border: 2px solid #795548;
}

/* INIMIGO: Pentágono (Bispo) */
.enemy.bishop .geo-shape {
    width: 35px;
    height: 35px;
    background-color: #673AB7;
    border: 2px solid #D1C4E9;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

/* INIMIGO: Hexágono (Rainha) */
.enemy.queen .geo-shape {
    width: 40px;
    height: 45px;
    background-color: #f44336;
    border: 2px solid #FFCDD2;
    box-shadow: 0 0 15px #f44336;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
        
/* POWERUP: Estrela (Fragmento) */
.powerup .geo-shape {
    width: 35px;
    height: 35px;
    background-color: #FFEB3B;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    box-shadow: 0 0 15px #FFEB3B;
}
 
/* EXTRAS */
.text-justify {
    text-align: justify;
}

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.padding {
    padding-top: 10px; 
    padding-bottom: 10px;
}

.margin {
    margin-top: 10px; 
    margin-bottom: 10px;
}

.margin-zero {
    margin: 0
}

.red {
    color: red;
}

.yellow {
    color: yellow;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}