/* General Styling */
* { box-sizing: border-box; }

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f0f0;
}

/* Container (Header) */
.container {
    display: none;
}

/* Frame Styling */
.frame {
    width: 99vw;
    flex: 1;
    min-height: 0;
    border: 3px solid #000;
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 5px;
    overflow: hidden;
    position: relative;
}



/* Bingo Board Styling */
.bingo-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    height: 100%;
    padding: 5px;
    align-items: stretch;
}

.bingo-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: 100%;
    min-height: 0;
}

.bingo-column h2 {
    font-size: clamp(12px, 2.5vw, 32px);
    text-align: center;
    margin: 0 auto;
    line-height: 1.5;
    flex-shrink: 0;
}

.sub-column {
    display: grid;
    grid-template-rows: repeat(8, 1fr);
    gap: 5px;
    flex: 1;
    min-height: 0;
}

.sub-column:last-child {
    grid-template-rows: repeat(7, 1fr);
}

.bingo-column button {
    width: 100%;
    height: 100%;
    font-size: clamp(8px, 1.4vw, 20px);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2.5px solid #000;
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 0;
}

.bingo-column button.called {
    background-color: red;
    color: white;
}

/* Sidebar Styling */
.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* Pattern Box */
.pattern-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 32vh;
    border: 1px solid #000;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.9);
    margin: 10px 0;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.pattern-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* scales image inside fixed box */
}





/* Last Number */
.last-number {
    font-size: clamp(12px, 1.5vw, 20px);
    padding: 4px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
}

.last-number p {
    margin: 0 0 4px 0;
}

#lastBallImage {
    max-width: 80%;
    max-height: 16vh;
    height: auto;
    width: auto;
    display: block;
    margin: 0 auto;
}
.static-section {
    font-size: clamp(18px, 2.5vw, 28px);
    padding: 5px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
}

.static-section img.beer-image,
.static-section svg.beer-image {
    width: 90%;
    max-width: 100%;
    max-height: 22vh;
    height: auto;
    display: block;
    margin: 5px auto 0;
}



.bottom-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 90%;
    padding: 10px;
    gap: 10px;
}

.bottom-controls #ballCounter {
    font-size: clamp(10px, 1.1vw, 16px);
    font-weight: bold;
    text-align: left;
    flex: 1;
}

.bottom-controls .reset {
    font-size: clamp(10px, 1.1vw, 16px);
    padding: 10px;
    cursor: pointer;
    width: auto;
    flex-shrink: 0;
}
/* Prime Rib Ball Section 
.prime-rib-section {
    font-size: 2.2vw;
    padding: 10px;
    border: 2px solid gold;
    text-align: center;
    background-color: transparent;
    font-weight: bold;
    border-radius: 10px;
    width: 50%; */
}
/*.static-section {
    font-size: 2.5vw;
    padding: 10px;
    font-weight: bold;
    text-align: center;
}
*/

.pattern-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 4px;
}

.pattern-select-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.pattern-select-wrap label {
    font-size: clamp(9px, 1vw, 13px);
    font-weight: bold;
    margin-bottom: 2px;
}

.pattern-select-wrap select {
    width: 100%;
    font-size: clamp(9px, 1vw, 13px);
}

/* Wildcard Toggle */
.wildcard-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: clamp(11px, 1.2vw, 16px);
    font-weight: bold;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 56px;
    height: 28px;
    background: #ccc;
    border-radius: 28px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: left 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle-label input:checked + .toggle-slider {
    background: #27ae60;
}

.toggle-label input:checked + .toggle-slider::after {
    left: 31px;
}

.toggle-text {
    font-size: clamp(9px, 1vw, 12px);
    font-weight: bold;
}

.config-link {
    font-size: clamp(14px, 1.4vw, 20px);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.config-link:hover { opacity: 1; }

/* Ball History */
.ball-history {
    width: 100%;
    flex-shrink: 0;
    padding: 4px 0;
}

.ball-history-title {
    font-size: clamp(10px, 1.1vw, 14px);
    font-weight: bold;
    text-align: center;
    margin-bottom: 4px;
    color: #333;
}

#ballHistory {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    max-height: 12vh;
    overflow-y: auto;
    padding: 4px;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.1);
}

#ballHistory::-webkit-scrollbar { width: 4px; }
#ballHistory::-webkit-scrollbar-track { background: transparent; }
#ballHistory::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.history-ball {
    font-size: clamp(8px, 0.9vw, 12px);
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 4px;
    color: white;
    white-space: nowrap;
}

.history-ball.col-B { background: #1565C0; }
.history-ball.col-I { background: #C62828; }
.history-ball.col-N { background: #888; color: #fff; }
.history-ball.col-G { background: #2E7D32; }
.history-ball.col-O { background: #F9A825; color: #333; }

/* Flashing Effect */
.flashing {
    animation: flash 0.5s infinite alternate;
}

@keyframes flash {
    0% { background-color: yellow; color: black; }
    100% { background-color: red; color: white; }
}

/* Wildcard Banner */
.wildcard-banner {
    position: fixed;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 20px 40px;
    border-radius: 16px;
    z-index: 9999;
    text-align: center;
    border: 2px solid #e94560;
    box-shadow: 0 0 40px rgba(233, 69, 96, 0.5), 0 8px 32px rgba(0,0,0,0.6);
    animation: wildcardPulse 1.5s ease-in-out infinite;
    transition: opacity 0.5s ease, transform 0.5s ease;
    min-width: 320px;
    white-space: nowrap;
}

/* Spray Burst Animation */
.graffiti-spray {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at center, #ff0 0%, #f00 80%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    opacity: 1;
}

@keyframes wildcardPulse {
    0%   { box-shadow: 0 0 40px rgba(233,69,96,0.5), 0 8px 32px rgba(0,0,0,0.6); }
    50%  { box-shadow: 0 0 70px rgba(233,69,96,0.9), 0 8px 32px rgba(0,0,0,0.6); }
    100% { box-shadow: 0 0 40px rgba(233,69,96,0.5), 0 8px 32px rgba(0,0,0,0.6); }
}

/* Responsive Layout */
@media (max-width: 768px) {
    .frame {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-row: 2 / 3;
    }

    .pattern-box {
        height: 450px;
    }

    .last-number {
        font-size: 3.5vw;
    }

    button.reset {
        font-size: 1vw;
    }
}