/* Bingo Maker Specific Styles */

/* Grid Container */
.bingo-grid-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border: 2px solid #000;
    background-color: #fff;
}

/* Bingo Header Row (B-I-N-G-O) */
.bingo-header-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Default 5x5 */
    background-color: #333;
    color: white;
    font-family: 'Comic Neue', cursive;
    font-weight: 700;
    font-size: 2rem;
    text-align: center;
}

.bingo-header-cell {
    padding: 10px 0;
    border-right: 1px solid #fff;
}

.bingo-header-cell:last-child {
    border-right: none;
}

/* Bingo Grid Body */
.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Default 5x5 */
    border-top: 2px solid #000;
}

.bingo-cell {
    aspect-ratio: 1 / 1; /* Square cells */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 5px;
    font-size: 1.2rem;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.2;
}

/* Remove right border for last column */
.bingo-cell:nth-child(5n) {
    border-right: none;
}

/* Remove bottom border for last row cells */
.bingo-cell:nth-last-child(-n+5) {
    border-bottom: none;
}

/* Free Space Styling */
.bingo-cell.free-space {
    background-color: #f0f0f0;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    position: relative;
}

.bingo-cell.free-space::after {
    content: "★";
    display: block;
    font-size: 2rem;
    color: #555;
    position: absolute;
    opacity: 0.2;
    z-index: 0;
}

.bingo-cell.free-space span {
    position: relative;
    z-index: 1;
}

/* Grid Size Variations */
.grid-3x3 .bingo-header-row,
.grid-3x3 .bingo-grid {
    grid-template-columns: repeat(3, 1fr);
}
.grid-3x3 .bingo-cell:nth-child(5n) { border-right: 1px solid #000; } /* Reset 5x5 rule */
.grid-3x3 .bingo-cell:nth-child(3n) { border-right: none; }
.grid-3x3 .bingo-cell:nth-last-child(-n+5) { border-bottom: 1px solid #000; } /* Reset 5x5 rule */
.grid-3x3 .bingo-cell:nth-last-child(-n+3) { border-bottom: none; }

.grid-4x4 .bingo-header-row,
.grid-4x4 .bingo-grid {
    grid-template-columns: repeat(4, 1fr);
}
.grid-4x4 .bingo-cell:nth-child(5n) { border-right: 1px solid #000; } /* Reset 5x5 rule */
.grid-4x4 .bingo-cell:nth-child(4n) { border-right: none; }
.grid-4x4 .bingo-cell:nth-last-child(-n+5) { border-bottom: 1px solid #000; } /* Reset 5x5 rule */
.grid-4x4 .bingo-cell:nth-last-child(-n+4) { border-bottom: none; }

/* Print Layouts */
@media print {
    /* Adjust font sizes for print */
    .display-title {
        font-size: 24pt;
    }
    
    .bingo-header-row {
        font-size: 18pt;
        background-color: #ddd !important; /* Print friendly gray */
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .bingo-cell {
        font-size: 14pt;
    }
}
