* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', 'Poppins', 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Container principal - LAYOUT HORIZONTAL PADRÃO (PC) */
.urna-container {
    display: flex;
    flex-direction: row; /* Horizontal no PC */
    gap: 25px;
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    padding: 25px;
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 750px; /* Mais estreito que o original */
    width: 100%;
}

/* Tela - versão PC (horizontal) */
.tela-urna {
    width: 420px; /* Mais estreita */
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.8);
    flex-shrink: 0;
}

.tela-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 12px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 2px;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tela-conteudo {
    min-height: 420px;
    padding: 20px;
    background: #ffffff;
}

/* Estilo do voto - PC */
.instrucoes-voto {
    text-align: center;
}

.titulo-voto {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 5px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cargo-display {
    font-size: 26px;
    font-weight: 800;
    color: #1e3c72;
    margin: 12px 0;
    background: linear-gradient(135deg, #f0f2f5 0%, #e9ecef 100%);
    padding: 10px;
    border-radius: 12px;
    text-transform: uppercase;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 1px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05), 0 1px 0 rgba(255,255,255,0.8);
}

/* Dígitos - PC */
.digitos-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.digito {
    width: 55px;
    height: 70px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    color: #212529;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.07);
}

.digito.preenchido {
    border-color: #28a745;
    background: linear-gradient(145deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #155724;
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(40,167,69,0.2);
}

/* Card do candidato - PC */
.info-candidato {
    margin: 18px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 20px -5px rgba(0,0,0,0.1), 0 6px 8px -6px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05);
}

.info-candidato-content {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.candidato-dados {
    flex: 1;
}

.candidato-nome,
.candidato-partido,
.candidato-numero,
.candidato-vice {
    margin: 8px 0;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
    color: #495057;
    font-family: 'Segoe UI', sans-serif;
}

.candidato-nome strong,
.candidato-partido strong,
.candidato-numero strong,
.candidato-vice strong {
    color: #1e3c72;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 65px;
}

.candidato-nome span,
.candidato-partido span,
.candidato-numero span {
    font-weight: 500;
    color: #212529;
}

/* Área da foto - PC */
.candidato-foto-area {
    text-align: center;
    min-width: 110px;
}

.candidato-foto-area .label {
    font-size: 10px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.candidato-foto {
    width: 100px;
    height: 130px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.candidato-foto:hover {
    transform: scale(1.02);
}

.candidato-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.candidato-foto .no-photo {
    font-size: 11px;
    color: #6c757d;
    text-align: center;
    padding: 5px;
}

/* Mensagem de voto - PC */
.mensagem-voto {
    margin: 20px 0;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    animation: pulse 0.5s ease;
}

.mensagem-voto span {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
}

/* Animações */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Rodapé - PC */
.tela-footer {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 10px;
    text-align: center;
}

.tela-footer div {
    font-size: 12px;
    color: #ffd700;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Teclado - PC (ao lado da tela) */
.teclado-urna {
    background: #3a3a3a;
    padding: 15px;
    border-radius: 15px;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.1), 0 10px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 220px;
}

/* Grid 3x3 para os números 1-9 */
.teclado-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

/* Botões numéricos - PC */
.tecla-numerica {
    width: 100%;
    height: 50px;
    background: linear-gradient(145deg, #3a3a3a 0%, #2a2a2a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 3px 0 #1a1a1a;
    font-family: 'Courier New', monospace;
    position: relative;
}

.tecla-numerica:hover {
    background: linear-gradient(145deg, #4a4a4a 0%, #3a3a3a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #1a1a1a;
}

.tecla-numerica:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #1a1a1a;
}

/* Zero - centralizado */
.teclado-zero {
    display: flex;
    justify-content: center;
    margin-top: 5px;
}

.tecla-zero {
    width: 33%;
    max-width: 80px;
    height: 50px;
}

/* Botões de função - PC */
.teclas-funcao {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.tecla-funcao {
    flex: 1;
    padding: 10px 5px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s ease;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

/* Botão BRANCO */
.tecla-branco {
    background: #e9ecef;
    color: #495057;
    border: 1px solid #adb5bd;
    box-shadow: 0 3px 0 #adb5bd;
}

.tecla-branco:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #adb5bd;
}

/* Botão CORRIGE */
.tecla-corrige {
    background: #dc3545;
    color: white;
    box-shadow: 0 3px 0 #8b0000;
}

.tecla-corrige:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #8b0000;
}

/* Botão CONFIRMA */
.tecla-confirma {
    background: #28a745;
    color: white;
    box-shadow: 0 3px 0 #155724;
}

.tecla-confirma:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #155724;
}

.tecla-funcao:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #1a1a1a;
}

/* Tela final - PC */
.tela-final {
    text-align: center;
    padding: 50px 15px;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tela-final h1 {
    font-size: 68px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 800;
}

.tela-final p {
    font-size: 18px;
    color: #495057;
    margin: 10px 0;
}

.tela-final hr {
    margin: 20px 0;
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #dee2e6, transparent);
}

/* Footer invisível - PC */
.footer-invisivel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: auto;
    min-width: 50px;
    height: auto;
    min-height: 35px;
    opacity: 0.9 !important;
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px 15px;
    z-index: 9999;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
}

.footer-invisivel a {
    color: #333 !important;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 15px;
    background: rgba(108, 92, 231, 0.08);
    display: inline-block !important;
    font-weight: bold;
    transition: all 0.2s ease;
}

.footer-invisivel a:hover {
    background: rgba(108, 92, 231, 0.2);
    color: #6c5ce7;
    transform: scale(1.05);
}

.footer-invisivel span {
    font-size: 16px;
    color: #666;
}

/* ============================================ */
/* RESPONSIVIDADE PARA CELULAR - LAYOUT VERTICAL */
/* ============================================ */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    /* Muda para layout VERTICAL apenas no celular */
    .urna-container {
        flex-direction: column; /* Vertical no celular */
        gap: 12px;
        padding: 15px;
        max-width: 420px;
        border-radius: 20px;
    }
    
    /* Tela ocupa toda a largura no celular */
    .tela-urna {
        width: 100%;
        border-radius: 15px;
    }
    
    .tela-header {
        padding: 10px;
        font-size: 14px;
        letter-spacing: 1px;
    }
    
    .tela-conteudo {
        min-height: 320px;
        padding: 15px;
    }
    
    .titulo-voto {
        font-size: 10px;
    }
    
    .cargo-display {
        font-size: 22px;
        padding: 8px;
        margin: 8px 0;
    }
    
    .digitos-container {
        gap: 6px;
        margin: 15px 0;
    }
    
    .digito {
        width: 45px;
        height: 60px;
        font-size: 28px;
        border-radius: 10px;
    }
    
    .info-candidato {
        padding: 10px;
        margin: 10px 0;
    }
    
    .info-candidato-content {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .candidato-dados {
        text-align: center;
        width: 100%;
    }
    
    .candidato-nome,
    .candidato-partido,
    .candidato-numero,
    .candidato-vice {
        font-size: 12px;
        margin: 5px 0;
    }
    
    .candidato-nome strong,
    .candidato-partido strong,
    .candidato-numero strong,
    .candidato-vice strong {
        font-size: 11px;
        min-width: 50px;
    }
    
    .candidato-foto-area {
        min-width: 80px;
    }
    
    .candidato-foto {
        width: 80px;
        height: 105px;
        border-radius: 10px;
    }
    
    .candidato-foto-area .label {
        font-size: 9px;
    }
    
    .mensagem-voto span {
        font-size: 20px;
    }
    
    /* Teclado se adapta para mobile */
    .teclado-urna {
        padding: 12px;
        border-radius: 12px;
        min-width: unset;
    }
    
    .teclado-grid {
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .tecla-numerica {
        height: 48px;
        font-size: 22px;
        border-radius: 7px;
    }
    
    .tecla-zero {
        height: 48px;
        max-width: 70px;
    }
    
    .teclas-funcao {
        gap: 6px;
        margin-top: 8px;
    }
    
    .tecla-funcao {
        font-size: 11px;
        padding: 10px 4px;
        border-radius: 7px;
    }
    
    .tela-final h1 {
        font-size: 52px;
    }
    
    .tela-final p {
        font-size: 16px;
    }
    
    /* Footer menor no celular */
    .footer-invisivel {
        bottom: 10px;
        right: 10px;
        padding: 4px 10px;
        gap: 6px;
    }
    
    .footer-invisivel a {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .footer-invisivel span {
        font-size: 14px;
    }
}

/* Ajuste adicional para celulares muito pequenos */
@media (max-width: 380px) {
    .urna-container {
        padding: 10px;
        gap: 8px;
    }
    
    .tela-conteudo {
        min-height: 280px;
        padding: 12px;
    }
    
    .digito {
        width: 38px;
        height: 52px;
        font-size: 24px;
    }
    
    .cargo-display {
        font-size: 18px;
    }
    
    .tecla-numerica {
        height: 42px;
        font-size: 20px;
    }
    
    .tecla-zero {
        height: 42px;
        max-width: 60px;
    }
    
    .tecla-funcao {
        font-size: 10px;
        padding: 8px 3px;
    }
}