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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    min-height: 100vh;
    padding: 0;
}

.container {
    width: 100%;
    height: 100vh;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    color: white;
    text-align: center;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

header h1 {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Main Layout - Three Column Design */
.main-layout {
    display: flex;
    flex: 1;
    height: calc(100vh - 70px); /* Subtract header height */
    overflow: hidden;
}

.left-panel {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: #f7fafc;
    border-right: 2px solid #e2e8f0;
    overflow-y: auto;
}

.center-panel {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 15px;
    background: white;
    overflow: hidden;
}

.right-panel {
    width: 350px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #f7fafc;
    border-left: 2px solid #e2e8f0;
    overflow-y: auto;
}

/* Current Number Display */
.current-number-section {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #3182ce, #2c5282);
    border-radius: 15px;
    color: white;
    box-shadow: 0 8px 20px rgba(49, 130, 206, 0.3);
}

.current-number-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.current-number {
    font-size: 5rem;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.current-letter {
    font-size: 5rem;
    font-weight: bold;
    color: #fbbf24;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.4);
}

.last-called {
    font-size: 1rem;
    opacity: 0.9;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(135deg, #edf2f7, #f7fafc);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.main-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.secondary-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.control-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-controls .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(49, 130, 206, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
    color: #2d3748;
    border: 1px solid #a0aec0;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(160, 174, 192, 0.3);
    background: linear-gradient(135deg, #cbd5e0, #a0aec0);
}

.btn-mute {
    background: linear-gradient(135deg, #fed7aa, #f6ad55);
    color: #2d3748;
    min-width: 45px;
    border: 1px solid #ed8936;
}

.btn-mute:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(237, 137, 54, 0.3);
}

.btn-winner {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    display: none; /* Hidden by default */
    border: 1px solid #2f855a;
}

.btn-winner.visible {
    display: inline-block;
}

.btn-winner:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(72, 187, 120, 0.4);
    animation: winnerGlow 1s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
    0% {
        box-shadow: 0 10px 20px rgba(72, 187, 120, 0.4);
    }
    100% {
        box-shadow: 0 15px 30px rgba(72, 187, 120, 0.6);
    }
}

.interval-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.interval-control label {
    font-weight: bold;
    color: #333;
    font-size: 0.8rem;
}

#intervalSelect {
    border: none;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    min-width: 100px;
}

#intervalSelect:hover {
    background: #f8f9ff;
}

#intervalSelect:focus {
    background: #f0f0ff;
}

#intervalSelect option {
    background: white;
    color: #333;
    font-weight: normal;
}

/* BINGO Table */
.bingo-grid-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bingo-table {
    width: 100%;
    height: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.bingo-table th {
    background: linear-gradient(135deg, #3182ce, #2c5282);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 6px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    width: 20%;
}

.bingo-table td {
    background: white;
    text-align: center;
    padding: 2px;
    border-radius: 4px;
    border: 1px solid #cbd5e0;
    transition: all 0.3s ease;
    position: relative;
    height: calc((100vh - 280px) / 15); /* Dynamic height based on viewport */
}

.number-cell {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    color: #2d3748;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
    min-height: 28px;
}

.number-cell:hover {
    transform: scale(1.05);
    background: #ebf8ff;
    color: #3182ce;
}

.number-cell.called {
    background: linear-gradient(135deg, #718096, #4a5568) !important;
    color: white;
    transform: scale(0.95);
}

.number-cell.current {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    color: #1a202c;
    animation: pulse 1s infinite;
    transform: scale(1.1);
    border: 3px solid #f59e0b;
}

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

/* Statistics */
.stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(135deg, #edf2f7, #e2e8f0);
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: fit-content;
    border: 1px solid #cbd5e0;
}

.stats h3 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 3px;
    font-size: 1rem;
    font-weight: bold;
}

.stat-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #2d3748;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid #e2e8f0;
}

.stat-item div:first-child {
    font-size: 0.65rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-item div:last-child {
    font-size: 1.1rem;
    font-weight: bold;
    color: #3182ce;
}

/* Call Logs */
.call-logs {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid #e2e8f0;
}

.call-logs h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #2d3748;
    text-align: center;
    font-weight: bold;
}

.logs-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    padding-right: 8px;
}

.logs-container::-webkit-scrollbar {
    width: 6px;
}

.logs-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.logs-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
}

.logs-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.log-entry {
    background: white;
    padding: 10px 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #3182ce;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
    margin-bottom: 4px;
    transition: background-color 0.2s ease;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3182ce;
}

.log-entry:nth-child(even) {
    background: #f7fafc;
}

.log-entry:nth-child(odd) {
    background: white;
}

.log-entry.latest {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
    border-left: 4px solid #2196f3;
    box-shadow: 0 3px 8px rgba(33, 150, 243, 0.2);
    transform: scale(1.02);
}

.log-entry.latest .log-number {
    color: #1976d2;
}

.log-entry.latest .log-sequence {
    background: #2196f3;
    color: white;
}

.log-number {
    font-weight: bold;
    font-size: 1.4rem;
    color: #3182ce;
}

.log-sequence {
    font-size: 0.75rem;
    color: #4a5568;
    opacity: 0.9;
    text-align: right;
    font-weight: bold;
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e0;
}

.no-logs {
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 0.85rem;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
        max-height: 300px;
        border-right: none;
        border-bottom: 2px solid #e9ecef;
    }

    .center-panel {
        flex: 1;
    }

    .right-panel {
        width: 100%;
        max-height: 200px;
        border-left: none;
        border-top: 2px solid #e9ecef;
    }

    .stats {
        flex-direction: row;
        padding: 20px;
    }

    .stat-item {
        flex: 1;
    }

    .controls {
        padding: 15px;
    }

    .main-controls {
        flex-direction: row;
        gap: 8px;
    }

    .main-controls .btn {
        width: auto;
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .secondary-controls {
        margin-top: 12px;
        padding-top: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .container {
        height: 100vh;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .left-panel, .right-panel {
        padding: 15px;
    }
    
    .center-panel {
        padding: 15px;
    }
    
    .current-number {
        font-size: 3.5rem;
    }
    
    .current-letter {
        font-size: 4rem;
    }
    
    .current-number-display {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }
    
    .center-panel {
        padding: 15px;
    }
    
    .bingo-table {
        padding: 15px;
    }
    
    .bingo-table th {
        font-size: 1.2rem;
        padding: 12px 8px;
    }
    
    .bingo-table td {
        height: calc((100vh - 240px) / 15);
    }
    
    .number-cell {
        font-size: 1.2rem;
        min-height: 35px;
    }
    
        .stats {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .stats h3 {
        font-size: 1.1rem;
    }

    .stat-item {
        padding: 12px;
        font-size: 0.9rem;
    }

    .stat-item div:last-child {
        font-size: 1.3rem;
    }

    .call-logs {
        margin-top: 15px;
        padding: 12px;
    }

    .call-logs h3 {
        font-size: 0.95rem;
    }

    .log-entry {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .log-number {
        font-size: 1.2rem;
    }

    .log-sequence {
        font-size: 0.7rem;
        padding: 1px 4px;
        min-width: 20px;
    }

    .logs-container {
        padding-right: 6px;
    }
}

@media (max-width: 480px) {
    .left-panel, .right-panel, .center-panel {
        padding: 10px;
    }
    
    .current-number {
        font-size: 2.8rem;
    }
    
    .current-letter {
        font-size: 3.2rem;
    }
    
    .center-panel {
        padding: 10px;
    }
    
    .bingo-table {
        padding: 8px;
    }
    
    .bingo-table th {
        font-size: 1rem;
        padding: 8px 4px;
    }
    
    .bingo-table td {
        padding: 2px;
        height: calc((100vh - 200px) / 15);
    }
    
    .number-cell {
        font-size: 1rem;
        min-height: 30px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.7rem;
    }
}

/* Confetti Animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    animation: confetti-fall linear infinite;
}

.confetti-piece:nth-child(odd) {
    background: #ffd700;
    border-radius: 50%;
}

.confetti-piece:nth-child(3n) {
    background: #00b09b;
    transform: rotate(45deg);
}

.confetti-piece:nth-child(4n) {
    background: #ff9a9e;
    border-radius: 50%;
}

.confetti-piece:nth-child(5n) {
    background: #a8edea;
}

.confetti-piece:nth-child(6n) {
    background: #fed6e3;
    transform: rotate(45deg);
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Winner Message */
.winner-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #333;
    padding: 30px 50px;
    border-radius: 20px;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: winnerPop 0.5s ease-out;
    border: 5px solid #fff;
}

@keyframes winnerPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Settings Button */
.btn-settings {
    background: linear-gradient(135deg, #e0e0e0, #9e9e9e);
    color: #333;
    min-width: 45px;
}

.btn-settings:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(158, 158, 158, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.setting-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item label {
    min-width: 120px;
    color: #666;
}

.setting-item input[type="range"] {
    flex: 1;
}

.setting-item input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.value-display {
    min-width: 40px;
    text-align: right;
    color: #666;
} 