* {
    box-sizing: border-box;
}

:root {
    --lb-navy: #1C3A76; 
    --lb-light-blue: #E6F0FA;
    --lb-white: #FFFFFF;
    --lb-gold: #FFD700;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--lb-light-blue);
    color: var(--lb-navy);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    min-height: 85vh;
    background: var(--lb-white);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 3px solid var(--lb-navy);
}

/* Left Board */
.board-container {
    flex: 2;
    padding: 20px;
    background: #f8faff;
    border-right: 3px solid var(--lb-navy);
    display: flex;
    align-items: center;
    justify-content: center;
}

.board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 900px;
}

.board .ball {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    font-weight: bold;
    background: var(--lb-white);
    border: 2px solid var(--lb-navy);
    color: var(--lb-navy);
    transition: all 0.3s ease;
}

.board .ball.called {
    background: var(--lb-navy);
    color: var(--lb-white);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Right Panel */
.panel-container {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Aligns items to the top */
}

/* Ball Animation & Display */
.main-display {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 20px; /* Keeps it closer to the top */
    margin-bottom: 50px; /* Adds space below the ball */
}

.large-ball {
    width: clamp(200px, 25vw, 260px); /* Increased size */
    height: clamp(200px, 25vw, 260px); /* Increased size */
    border-radius: 50%;
    background: var(--lb-gold);
    border: 10px solid var(--lb-navy);
    font-size: clamp(5rem, 8vw, 8.5rem); /* Increased font size */
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--lb-navy);
    box-shadow: inset -10px -10px 20px rgba(0,0,0,0.2), 0 10px 20px rgba(0,0,0,0.2);
}

.rolling {
    animation: rollAnim 0.1s infinite linear;
}

@keyframes rollAnim {
    0% { transform: scale(0.95) rotate(-10deg); background: var(--lb-white); }
    50% { transform: scale(1.05) rotate(10deg); background: var(--lb-light-blue); }
    100% { transform: scale(0.95) rotate(-10deg); background: var(--lb-white); }
}

/* Last 5 History */
.history-section {
    text-align: center;
    width: 100%;
    margin-bottom: auto; /* This forces the buttons to the very bottom, pulling this section up */
}

.history-section p {
    font-weight: bold;
    font-size: 1.4rem; /* Increased size */
    margin-bottom: 20px;
}

.last-five-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.last-five-grid .ball {
    width: 70px; /* Increased size */
    height: 70px; /* Increased size */
    border-radius: 50%;
    background: var(--lb-navy);
    color: var(--lb-white);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem; /* Increased font size */
    font-weight: bold;
    opacity: 0.8;
}

.last-five-grid .ball.empty {
    background: transparent;
    border: 2px dashed var(--lb-navy);
    color: transparent;
}

/* Controls */
.bottom-controls {
    display: flex;
    gap: 15px;
    width: 100%;
    margin-top: 40px;
}

.btn {
    flex: 1;
    padding: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    color: var(--lb-white);
}

.btn-call {
    background: #28a745;
    box-shadow: 0 6px #1e7e34;
}
.btn-call:active { transform: translateY(4px); box-shadow: 0 2px #1e7e34; }
.btn-call:disabled { background: #6c757d; box-shadow: 0 6px #5a6268; cursor: not-allowed; }

.btn-reset {
    background: #dc3545;
    box-shadow: 0 6px #bd2130;
}
.btn-reset:active { transform: translateY(4px); box-shadow: 0 2px #bd2130; }
