* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: #0b1a0e;
    color: #ffffff;
    overflow: hidden;
}

#app-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- TELAS E PAINÉIS --- */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #1a3c21 0%, #08120a 100%);
    padding: 1rem;
}

.screen.active {
    display: flex;
}

.menu-card {
    background: rgba(18, 38, 22, 0.9);
    border: 2px solid #2e6939;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    text-align: center;
    max-width: 480px;
    width: 100%;
    backdrop-filter: blur(8px);
}

.menu-card.wide {
    max-width: 850px;
}

.game-title {
    font-size: 2.5rem;
    color: #4caf50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    margin-bottom: 0.5rem;
}

.game-subtitle {
    color: #a5d6a7;
    margin-bottom: 1.8rem;
    font-style: italic;
    font-size: 1rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* --- BOTÕES --- */
.btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn.primary {
    background-color: #2e7d32;
    color: #ffffff;
}

.btn.primary:hover {
    background-color: #388e3c;
}

.btn.secondary {
    background-color: #1b5e20;
    color: #e8f5e9;
}

.btn.secondary:hover {
    background-color: #2e7d32;
}

.btn.danger {
    background-color: #c62828;
    color: #ffffff;
}

.btn.danger:hover {
    background-color: #d32f2f;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 1.2rem;
    cursor: pointer;
    color: #ffffff;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- TELA DE CONFIGURAÇÕES --- */
.form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    font-size: 0.95rem;
    color: #c8e6c9;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #4caf50;
    background: #0d2112;
    color: #ffffff;
    width: 50%;
    outline: none;
}

.form-group input[type="range"] {
    width: 50%;
    accent-color: #4caf50;
    cursor: pointer;
}

.form-group input[type="color"] {
    border: none;
    width: 45px;
    height: 32px;
    cursor: pointer;
    background: transparent;
}

.button-row {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

/* --- TELA COMO JOGAR --- */
.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.step-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #2e6939;
}

.step-num {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: #4caf50;
    color: #000000;
    font-weight: bold;
    border-radius: 50%;
    line-height: 32px;
    margin-bottom: 0.5rem;
}

.step-card h3 {
    font-size: 1rem;
    color: #a5d6a7;
    margin-bottom: 0.4rem;
}

.step-card p {
    font-size: 0.85rem;
    color: #d1e7dd;
    line-height: 1.3;
}

/* --- TELA DO JOGO & PLACAR --- */
#screen-game {
    justify-content: flex-start;
    padding: 10px;
    gap: 10px;
}

#scoreboard {
    width: 100%;
    max-width: 1000px;
    height: 65px;
    background: #0d2112;
    border: 2px solid #2e6939;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.team-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.score {
    font-size: 2rem;
    color: #ffeb3b;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.1rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 235, 59, 0.3);
}

.center-info {
    text-align: center;
}

#timer {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
}

#turn-indicator {
    font-size: 0.85rem;
    color: #81c784;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 2px;
}

#canvas-container {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

canvas {
    background-color: #2e7d32;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
    touch-action: none;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- MODAIS DE PAUSA E FIM DE JOGO --- */
.modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-card {
    background: #122616;
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 320px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.8);
}

#gameover-stats {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 6px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.95rem;
}