/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --gold:    #FFD700;
    --blue:    #003399;
    --purple:  #6A0DAD;
    --light:   #FFF8E7;
    --dab:     #2979FF;
    --dab-bg:  #E3F2FD;
    --bingo:   #FF4081;
    --radius:  10px;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #1a0050 0%, #003399 50%, #1a0050 100%);
    min-height: 100vh;
    color: #fff;
}

/* ===== Header ===== */
header {
    background: rgba(0,0,0,0.4);
    border-bottom: 3px solid var(--gold);
    padding: 12px 20px;
    text-align: center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.header-logo { font-size: 2rem; }

.header-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
}

@media (max-width: 600px) {
    .header-title { font-size: 1.1rem; letter-spacing: 1px; }
}

/* ===== Main ===== */
main { padding: 24px 16px 40px; max-width: 1400px; margin: 0 auto; }

/* ===== Join Page ===== */
.join-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.join-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.join-stars { font-size: 2rem; margin-bottom: 12px; }

.join-card h2 {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 8px;
}

.join-card p {
    color: #ddd;
    margin-bottom: 24px;
    font-size: 1rem;
}

.name-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.1rem;
    border: 2px solid var(--gold);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.15);
    color: #fff;
    outline: none;
    margin-bottom: 16px;
    transition: border-color 0.2s, background 0.2s;
}

.name-input::placeholder { color: rgba(255,255,255,0.5); }
.name-input:focus { border-color: #fff; background: rgba(255,255,255,0.25); }

.join-btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold), #FFA500);
    color: #1a0050;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 4px 16px rgba(255,215,0,0.4);
}

.join-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,215,0,0.6); }
.join-btn:active { transform: translateY(0); }

.player-count { margin-top: 20px; color: #ccc; font-size: 0.9rem; }

.error-msg {
    background: rgba(255,60,60,0.25);
    border: 1px solid #ff6b6b;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    color: #ffaaaa;
    font-size: 0.9rem;
}

/* ===== Bingo Page ===== */
.bingo-page { display: flex; flex-direction: column; gap: 32px; }

/* My Card */
.my-card-section {}

.my-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.my-card-header h2 { font-size: 1.4rem; color: var(--gold); }

.bingo-banner {
    background: var(--bingo);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 900;
    padding: 6px 18px;
    border-radius: 30px;
    animation: pulse 0.8s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); box-shadow: 0 0 8px var(--bingo); }
    to   { transform: scale(1.05); box-shadow: 0 0 20px var(--bingo); }
}

.hidden { display: none !important; }

/* Main bingo grid — 5 columns × 5 rows */
.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.bingo-cell {
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,215,0,0.3);
    border-radius: var(--radius);
    padding: 14px 8px;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    user-select: none;
}

.bingo-cell:hover {
    background: rgba(255,255,255,0.22);
    border-color: var(--gold);
    transform: scale(1.03);
}

.bingo-cell.dabbed {
    background: var(--dab-bg);
    border-color: var(--dab);
    color: #003399;
}

.cell-text {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.bingo-cell.dabbed .cell-text { color: #003399; }

.dab-mark {
    font-size: 1.8rem;
    margin-top: 6px;
    line-height: 1;
}

/* Other players section */
.others-section {}

.others-title {
    font-size: 1.3rem;
    color: var(--gold);
    margin-bottom: 16px;
}

.others-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.other-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,215,0,0.25);
    border-radius: var(--radius);
    padding: 12px;
}

.other-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.other-name {
    font-weight: 700;
    color: var(--gold);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.other-bingo {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bingo);
    white-space: nowrap;
    animation: pulse 0.8s infinite alternate;
}

/* Mini grid — 5 cols × 5 rows */
.mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}

.mini-cell {
    aspect-ratio: 1;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    cursor: default;
    transition: background 0.2s;
}

.mini-cell.dabbed { background: var(--dab); }

.other-card-footer {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #aaa;
    text-align: right;
}

.no-others {
    color: #aaa;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 700px) {
    .bingo-grid { gap: 5px; }
    .bingo-cell { min-height: 70px; padding: 8px 4px; }
    .cell-text { font-size: 0.62rem; }
    .dab-mark { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .bingo-cell { min-height: 60px; }
    .cell-text { font-size: 0.55rem; }
}
