:root {
    --primary: #c0392b; /* Holiday Red */
    --secondary: #27ae60; /* Holiday Green */
    --dark: #2c3e50;
    --light: #ecf0f1;
    --accent: #f1c40f;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: var(--dark);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden; 
}

.container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

header {
    margin-bottom: 20px;
}

h1 {
    margin: 0;
    font-size: 2.5rem;
    color: var(--primary);
}

.date-display {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-top: 5px;
}

.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 10px;
}

.status-badge.locked {
    background-color: var(--dark);
    color: white;
}

.status-badge.pending {
    background-color: var(--accent);
    color: var(--dark);
}

.bingo-card {
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.header-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background-color: var(--primary);
    color: white;
    font-weight: bold;
    font-size: 2rem;
    padding: 10px 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
}

.cell {
    aspect-ratio: 1/1;
    border: 1px solid #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    font-size: 0.9rem;
    word-wrap: break-word;
    /* Text handling for small screens */
    hyphens: auto;
    overflow: hidden;
    
    /* Marking logic */
    position: relative; 
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.cell:hover {
    background-color: #f1f2f6;
}

.cell.free-space {
    background-color: #fdfcdc;
    font-weight: bold;
    color: var(--primary);
    font-size: 0.8rem; /* Slightly smaller for the long text */
}

/* The Red X styling */
.cell.marked::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(to top left, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 45%, #c0392b 45%, #c0392b 55%, rgba(0,0,0,0) 55%, rgba(0,0,0,0) 100%),
        linear-gradient(to top right, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 45%, #c0392b 45%, #c0392b 55%, rgba(0,0,0,0) 55%, rgba(0,0,0,0) 100%);
    opacity: 0.8;
    pointer-events: none;
}

.controls {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin: 0 10px;
    transition: transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary { background-color: var(--primary); color: white; }
.btn.secondary { background-color: var(--dark); color: white; }

.archive-section {
    margin-top: 40px;
    border-top: 2px solid #ddd;
    padding-top: 20px;
}

.archive-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.archive-link {
    text-decoration: none;
    color: var(--dark);
    background: white;
    padding: 5px 15px;
    border-radius: 15px;
    border: 1px solid #ddd;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 600px) {
    body {
        padding: 10px 5px; /* Less padding on edges */
    }

    h1 {
        font-size: 1.8rem; /* Smaller title */
    }

    .header-row {
        font-size: 1.2rem; /* Smaller BINGO letters */
        padding: 5px 0;
    }

    .cell {
        font-size: 0.65rem; /* Tiny text for tiny squares */
        padding: 2px;
        border: 1px solid #eee; /* Thinner borders */
    }
    
    .cell.free-space {
        font-size: 0.6rem;
    }

    .controls {
        display: flex;
        flex-direction: column; /* Stack buttons vertically */
        gap: 10px;
        padding: 15px;
    }

    .btn {
        margin: 0;
        width: 100%; /* Full width buttons */
        padding: 12px;
    }
    
    .archive-list {
        gap: 5px;
    }
    
    .archive-link {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}
