* { touch-action: manipulation; }

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

/* Painel superior */
#painelSuperior {
    padding: 10px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    z-index: 10;
}

/* Área do jogo */
#tabuleiro {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Lados */
.side {
    height: 100%;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.side.active {
    background-color: #e9ecef;
}

.clock-display {
    font-size: 2.8rem;
    line-height: 1;
}

.player-label {
    font-size: 1.2rem;
    margin-top: 10px;
}

/* Placar */
#placarTopo {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 15px;
    transform: rotate(180deg);
}

/* Container circular para as logos */
.logo-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid;
}

.logo-wrapper img {
    width: 100%;
    height: 100%;
}

.border-yellow { border-color: #cabd05; }
.border-green  { border-color: #33ca05; }

#placarBase {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 15px;
}

.btn-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.btn-circle i {
    font-size: 1.5rem;
}

#ladoEsquerdo {
    background: #33ca05;
    transform: rotate(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#ladoEsquerdo .button-group { order: 1; }
#ladoEsquerdo #relogioTotalEsquerda { order: 2; }
#ladoEsquerdo #relogioEsquerda { order: 3; }

#ladoDireito {
    background: #cabd05;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#ladoDireito .button-group  { order: 1; }
#ladoDireito #relogioTotalDireita   { order: 2; }
#ladoDireito #relogioDireita    { order: 3; }

.button-group {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    margin-bottom: 2px;
}

.timeout {
    background-color: #dc3545 !important;
}

#relogioTotalEsquerda, #relogioTotalDireita {
    font-size: 28px;
}

.btn-circle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#botaoIniciar:disabled {
    opacity: 0.5;
    filter: grayscale(1);
}

.move-counter {
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: 10px;
    margin-bottom: 5px;
}

#ladoEsquerdo .move-counter  { order: 0; }
#ladoDireito .move-counter { order: 0; }

.draw-highlight {
    filter: brightness(1.8);
    transition: filter 0.1s ease-in-out, filter 0.5s ease-out;
}

select:disabled, button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-height: 600px) {
    .clock-display { font-size: 2.2rem; }
    #relogioTotalEsquerda, #relogioTotalDireita { font-size: 22px; }
    .side { gap: 5px; }
}

/* ================================================
   OVERLAY DE PÊNALTIS — layout espelha o cronômetro
   ================================================ */
#sobreposicaoPenaltis {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    color: #fff;
}

#sobreposicaoPenaltis.d-none { display: none !important; }

.pen-painel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 10px;
}

.pen-painel.verde   { background: #33ca05; transform: rotate(180deg); }
.pen-painel.amarelo { background: #cabd05; }

.pen-nome {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
}

/* Retângulo ao redor das bolas */
.bolas-container {
    display: flex;
    gap: 8px;
    font-size: 1.6rem;
    padding: 8px 16px;
    border: 2px solid rgba(255,255,255,0.75);
    border-radius: 12px;
    background: rgba(0,0,0,0.18);
    justify-content: center;
    flex-wrap: wrap;
}

.pen-placar {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.pen-acoes {
    display: flex;
    gap: 20px;
}

.pen-acoes button {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    transition: transform 0.12s, opacity 0.2s;
}

.pen-acoes button:active   { transform: scale(0.9); }
.pen-acoes button:disabled { opacity: 0.3; cursor: not-allowed; }

.pen-gol  { background: #1a7a2e; color: #fff; }
.pen-erro { background: #b71c1c; color: #fff; }

/* Faixa central */
.pen-centro {
    flex-shrink: 0;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    color: #222;
}

.pen-titulo {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.5;
    margin: 0;
}

.pen-turno {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    background: #f0f0f0;
    padding: 4px 16px;
    border-radius: 20px;
    line-height: 1.3;
    color: #222;
}

.pen-rodada {
    font-size: 0.8rem;
    opacity: 0.55;
    text-align: center;
    color: #333;
}

#resultadoPenaltis {
    font-size: 1rem;
    font-weight: 800;
    color: #c47800;
    letter-spacing: 1px;
    text-align: center;
    display: none;
    line-height: 1.4;
}

#botaoReiniciarPenaltis {
    display: none;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    background: #343a40;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.12s;
}

#botaoReiniciarPenaltis:active { transform: scale(0.95); }

@media (max-height: 600px) {
    .pen-placar       { font-size: 2rem; }
    .bolas-container  { font-size: 1.3rem; padding: 6px 10px; }
    .pen-painel       { gap: 8px; padding: 10px; }
    .pen-acoes button { width: 48px; height: 48px; font-size: 1.2rem; }
}

.pen-draw-highlight {
    filter: brightness(1.85);
    transition: filter 0.08s ease-in-out;
}

/* ================================================
   SISTEMA DE CARTÕES — estilos novos
   ================================================ */
.indicador-cartoes {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.cartao-item {
    position: relative;
    width: 14px;
    height: 21px;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.45);
    flex-shrink: 0;
}

.cartao-amarelo-cor { background: #f5c400; }
.cartao-vermelho-cor { background: #cc0000; }

.contador-cartao {
    position: absolute;
    top: -6px;
    right: -7px;
    background: #fff;
    color: #111;
    border: 1.5px solid #444;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    font-size: 9px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}