:root {
    --black-body: #2a2a2a;
    --screen-color: #aeaeae;
    --confirm-color: #0f9311;
    --cancel-color: #d9534f;
    --help-color: #f0ad4e;
    --highlight-border: #00ffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    /* CAMBIO: Usamos 'dvh' (Dynamic Viewport Height) si es posible, 
       esto ayuda en celulares a ignorar la barra de direcciones del navegador */
    height: 100vh; 
    height: 100dvh; 
    background-color: #6e6d6d;
    font-family: Arial, sans-serif;
    overflow: hidden; 
}

.device-container {
    width: 95vw; 
    max-width: 360px; 
    height: 85vh; 
    max-height: 800px; 
    background-color: var(--black-body);
    border-radius: 35px; 
    border: 6px solid #cfcfcf;
    padding: 17px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    
    /* === EL TRUCO PARA SUBIRLO === */
    /* Esto mueve todo el control 30 pixeles hacia arriba desde el centro */
    margin-top: -10px; 
}

.screen {
    width: 100%;
    flex: 0 0 40%; 
    background-color: var(--screen-color);
    border: 5px solid #000;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}

#screen-text {
    font-size: 2rem; 
    font-weight: 900;
    color: #000;
    text-align: center;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.buttons-grid {
    width: 100%;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    grid-template-rows: repeat(3, 1fr);    
    gap: 5px; 
    padding: 5px 0;
}

.button {
    width: 100%;
    height: 100%; 
    max-height: 80px; 
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.80rem; 
    font-weight: bold;
    border-radius: 45%; 
    cursor: pointer;
    color: #fff;
    text-align: center;
    border: 2px solid rgba(0,0,0,0.4);
    box-shadow: 0 4px 0 #000;
    transition: all 0.2s;
    text-transform: uppercase;
    padding: 5px; 
}

.button:active {
    transform: translateY(8px);
    box-shadow: 0 1px 0 #000;
}

/* Colores */
.function { background-color: #434785; border-color: var(--highlight-border); }
.si { background-color: var(--confirm-color); color: #000; }
.no { background-color: var(--cancel-color); color: #fff; }
.abs { background-color: var(--help-color); color: #000; }
.exit { background-color: #2196f3; }
.quorum { background-color: #434785; font-size: 0.80rem; }
.blank { visibility: hidden; }

.footer-logo {
    color: #ede7e7;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 3px;
    margin-top: auto;
}