/* ── Bingo-specific styles ────────────────────────────────────── */

.back-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
}

.back-link:hover {
    color: white;
}

/* ── Collapsible Manage section ───────────────────────────────── */
.collapsible-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0 0 4px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #667eea;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 0.9rem;
    color: #999;
}

.collapsible-body {
    margin-top: 18px;
}

/* ── Square count hint ────────────────────────────────────────── */
.square-count {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 14px;
}

.square-count.warn {
    color: #e65100;
    font-weight: 600;
}

/* ── Add square form ──────────────────────────────────────────── */
.add-square-form {
    margin-bottom: 18px;
}

.add-square-row {
    display: flex;
    gap: 10px;
}

.add-square-row input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s;
}

.add-square-row input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-add {
    width: auto;
    padding: 12px 22px;
    font-size: 1rem;
    white-space: nowrap;
}

/* ── Square list ──────────────────────────────────────────────── */
.square-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.square-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f5f7fa;
    border-radius: 8px;
    padding: 10px 14px;
    gap: 10px;
}

.square-item span {
    flex: 1;
    font-size: 0.95rem;
    word-break: break-word;
}

.square-delete-btn {
    background: none;
    border: none;
    color: #bbb;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}

.square-delete-btn:hover {
    color: #ff5252;
    background: #ffeaea;
}

/* ── Play section ─────────────────────────────────────────────── */
.play-section h2 {
    margin-bottom: 16px;
}

.play-header {
    margin-bottom: 20px;
}

.btn-randomize {
    width: auto;
    padding: 14px 28px;
    font-size: 1rem;
}

/* ── Bingo board ──────────────────────────────────────────────── */
.board-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.bingo-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 100%;
    max-width: 460px;
}

.bingo-cell {
    aspect-ratio: 1;
    background: #f0f2ff;
    border: 2px solid #c5caf5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(0.55rem, 2.2vw, 0.78rem);
    font-weight: 600;
    color: #444;
    cursor: pointer;
    padding: 4px;
    word-break: break-word;
    hyphens: auto;
    user-select: none;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    line-height: 1.2;
}

.bingo-cell:active {
    transform: scale(0.94);
}

.bingo-cell.marked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #5567d5;
    color: white;
}

.bingo-cell.free {
    background: linear-gradient(135deg, #43c6ac 0%, #191654 100%);
    border-color: #38b2ac;
    color: white;
    cursor: default;
    font-size: clamp(0.6rem, 2.4vw, 0.85rem);
}

.bingo-cell.winning {
    box-shadow: 0 0 0 3px #ffd700, 0 0 12px rgba(255, 215, 0, 0.6);
}

/* ── Claim button ─────────────────────────────────────────────── */
.btn-claim {
    padding: 18px 40px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: pulse 1.5s infinite;
}

.btn-claim:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.5);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 147, 251, 0.5); }
    50%       { box-shadow: 0 0 0 10px rgba(240, 147, 251, 0); }
}

/* ── Not enough squares warning ───────────────────────────────── */
.not-enough {
    color: #e65100;
    font-weight: 600;
    text-align: center;
    padding: 12px;
    background: #fff3e0;
    border-radius: 8px;
    margin-top: 10px;
}

/* ── Mobile tweaks ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .bingo-board {
        gap: 4px;
    }

    .bingo-cell {
        border-radius: 5px;
        padding: 3px;
    }

    .btn-randomize {
        width: 100%;
    }
}
