:root {
    /* Standard Theme (Vibrant) */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --text-color: #ffffff;
    --primary-btn: #ff0080;
    --primary-btn-hover: #d9006c;
    --cell-active: rgba(255, 255, 255, 0.3);
    --cell-hover: rgba(255, 255, 255, 0.15);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --input-bg: rgba(0, 0, 0, 0.2);
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-gradient: #121212;
    --glass-bg: #1e1e1e;
    --glass-border: #333;
    --glass-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --text-color: #e0e0e0;
    --primary-btn: #333;
    --primary-btn-hover: #444;
    --cell-active: #e0e0e0;
    /* Inverse for active in dark mode */
    --cell-hover: #2c2c2c;
    --input-bg: rgba(255, 255, 255, 0.05);
}

/* Specific fix for active cell text color in dark mode */
[data-theme="dark"] .bingo-cell.active {
    color: #121212;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 2rem;
    width: 100%;
    max-width: 800px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

h1 {
    font-weight: 800;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] h1 {
    text-shadow: none;
}

h2 {
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    opacity: 0.9;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.5rem;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

/* Readable Dropdowns */
select option {
    background-color: #222;
    color: #fff;
}

small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.85rem;
}

.btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: var(--primary-btn);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background: var(--primary-btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Bingo Grid Styles */
.bingo-board {
    display: grid;
    /* Columns defined inline based on PHP */
    gap: 8px;
    margin-top: 2rem;
    width: 100%;
    aspect-ratio: 1;
    /* Keep it square */
}

.bingo-cell {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    word-break: break-word;
    hyphens: auto;
    position: relative;
    overflow: hidden;
    line-height: 1.2;
}

.bingo-cell:hover {
    background: var(--cell-hover);
}

.bingo-cell.active {
    background: var(--cell-active);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .bingo-cell.active {
    box-shadow: none;
    border-color: var(--glass-border);
}

/* Cross animation for active cells */
.bingo-cell.active::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>') no-repeat center center;
    background-size: 60%;
    opacity: 0.4;
    pointer-events: none;
}

[data-theme="dark"] .bingo-cell.active::before {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>') no-repeat center center;
}


.bingo-header {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.bingo-letter {
    text-align: center;
    font-size: 2rem;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.share-link-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 600px) {
    .bingo-cell {
        font-size: 0.7rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .bingo-letter {
        font-size: 1.5rem;
    }
}