:root {
    --bg-main: #f8fafc;        
    --bg-panel: #ffffff;
    --text-dark: #000000;      
    --cell-unmarked: #e2e8f0;  
    --cell-marked: #dc2626;    
}

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

body {
    font-family: 'Arial Black', Gadget, sans-serif; 
    background-color: #1e293b; 
    color: var(--text-dark);
    height: 100vh;
    width: 100vw;
    overflow: hidden; 
}

.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    padding: 10px;
    gap: 10px;
}

.matrix-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    padding: 10px 20px;
    border: 3px solid var(--text-dark);
    border-radius: 8px;
    height: 12vh; 
}

.logo-space {
    display: flex;
    align-items: center;
    gap: 15px;
}

.title-block {
    display: flex;
    flex-direction: column;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

.main-subtitle {
    font-size: 1.1rem;
    font-family: Arial, sans-serif;
    font-weight: bold;
    color: #4b5563;
    margin-top: 4px;
}

#bingo-logo {
    height: 50px;
    object-fit: contain;
}

.current-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-label {
    font-size: 1.3rem;
    font-weight: 900;
}

.ball-glow-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#current-ball {
    font-size: 3.5rem;
    background: var(--text-dark);
    color: #ffffff;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #000;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.animate-ball {
    animation: popCurrentBall 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.27) forwards;
}

.ball-pulse {
    position: absolute;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: transparent;
    border: 4px solid #f59e0b; 
    z-index: 1;
    opacity: 0;
    transform: scale(1);
    pointer-events: none;
}

.animate-pulse {
    animation: shockwave 0.5s ease-out forwards;
}

@keyframes popCurrentBall {
    0% { transform: scale(0.6); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes shockwave {
    0% {
        transform: scale(1);
        opacity: 1;
        border-width: 6px;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
        border-width: 1px;
    }
}

.grid-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 6px;
    background: var(--bg-panel);
    padding: 10px;
    border: 3px solid var(--text-dark);
    border-radius: 8px;
    height: 84vh; 
}

.board-cell {
    background: var(--cell-unmarked);
    color: rgba(0, 0, 0, 0.4); 
    font-size: min(5vh, 4vw); 
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.board-cell:hover {
    border-color: var(--text-dark);
    background: #cbd5e1;
}

.board-cell.marked {
    background: var(--cell-marked);
    color: #ffffff; 
    border-color: var(--text-dark);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    animation: bounceMarker 0.4s ease-in-out;
}

@keyframes bounceMarker {
    0% { transform: scale(0.7); background: #f59e0b; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.control-zone {
    width: 280px;
    background: var(--bg-panel);
    border: 3px solid var(--text-dark);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-zone h3 { font-size: 1.2rem; text-align: center; border-bottom: 2px solid #000; padding-bottom: 5px;}

.control-box {
    display: flex;
    gap: 5px;
}

#manual-input {
    width: 60%;
    padding: 10px;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid #000;
    border-radius: 6px;
}

button {
    font-family: sans-serif;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    border: 2px solid #000;
}

.btn-go { flex: 1; background: #10b981; color: white; }

.btn-linea { padding: 12px; background: #0284c7; color: white; font-size: 1.1rem; font-family: 'Arial Black'; }
.btn-alert { padding: 12px; background: #fbbf24; color: black; font-size: 1.1rem; font-family: 'Arial Black'; }
.btn-clear { padding: 8px; background: #ef4444; color: white; }

.history-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-box h4 { font-size: 0.9rem; }

#ball-history {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr)); 
    justify-items: center; 
    gap: 8px 4px; 
    overflow-y: auto;
    overflow-x: hidden; 
    width: 100%;       
    padding-bottom: 15px; 
}

.history-ball {
    background: #000;
    color: #fff;
    width: 33px;
    height: 33px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    backface-visibility: hidden; 
    animation: popHistoryBall 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

@keyframes popHistoryBall {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.alert-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(220, 38, 38, 0.95); 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: flashScreen 0.8s infinite alternate;
}

.alert-content { text-align: center; color: white; }
.alert-content h1 { font-size: 7rem; margin: 0; text-shadow: 5px 5px 0px #000; }
.alert-content p { font-size: 2.5rem; font-weight: bold; margin-top: 10px; }

@keyframes flashScreen {
    from { background: rgba(220, 38, 38, 0.95); }
    to { background: rgba(185, 28, 28, 0.95); }
}

.hidden { display: none !important; }
