/* Single-player bingo game styles. Side-by-side card + caller on desktop,
   stacked on mobile. Tiles get clear marked/unmarked states and the
   winning line(s) get a yellow ribbon overlay. */

:root {
    --bingo-cell-bg: #ffffff;
    --bingo-cell-bg-marked: #d2f3d4;
    --bingo-cell-bg-mistake: #fde3e1;
    --bingo-cell-border: #d8dde2;
    --bingo-cell-border-marked: #4caf50;
    --bingo-win-line: #ffd54f;
    --bingo-free-bg: #fff8e1;
}

.bingo-play-app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}

.bingo-play-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bingo-play-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.bingo-play-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 880px) {
    .bingo-play-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Card ─────────────────────────────────────────────────────── */
.bingo-play-card { position: relative; }

.bingo-card-toolbar {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.bingo-card {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.4rem;
    position: relative;
}

.bingo-cell {
    aspect-ratio: 1;
    background: var(--bingo-cell-bg);
    border: 2px solid var(--bingo-cell-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0.35rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
    overflow: hidden;
    position: relative;
    text-align: center;
}

.bingo-cell:hover:not(.bingo-cell-free) {
    transform: scale(1.02);
    border-color: #b9c2cc;
}

.bingo-cell.bingo-cell-marked {
    background: var(--bingo-cell-bg-marked);
    border-color: var(--bingo-cell-border-marked);
}

.bingo-cell.bingo-cell-mistake {
    background: var(--bingo-cell-bg-mistake);
    border-color: #e57373;
}

.bingo-cell-free {
    background: var(--bingo-free-bg);
    border-color: #f1c40f;
    cursor: default;
}

.bingo-cell img {
    width: 100%;
    max-height: 60%;
    object-fit: contain;
    background: transparent;
}

.bingo-cell-name {
    font-size: 0.72rem;
    line-height: 1.1;
    margin-top: 0.2rem;
    word-break: break-word;
}

.bingo-cell-check {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 1.05rem;
    color: var(--bingo-cell-border-marked);
    opacity: 0;
    transition: opacity 0.12s;
}
.bingo-cell-marked .bingo-cell-check { opacity: 1; }
.bingo-cell-mistake .bingo-cell-check { color: #e57373; opacity: 1; }
.bingo-cell-free .bingo-cell-check { opacity: 1; color: #f1c40f; }

/* Winning line ribbon: full-card SVG overlay */
.bingo-card-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.bingo-card-overlay line {
    stroke: var(--bingo-win-line);
    stroke-width: 8;
    stroke-linecap: round;
    opacity: 0.7;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.bingo-card-status {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    text-align: center;
    color: #4a5560;
}

/* ── Caller ───────────────────────────────────────────────────── */
.bingo-play-caller {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #e6e9ec;
}

.bingo-current {
    background: #ffffff;
    border-radius: 10px;
    padding: 1rem;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    text-align: center;
    border: 1px solid #e6e9ec;
}

.bingo-current-empty {
    color: #8a9099;
    font-style: italic;
}

.bingo-current-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 0.5rem;
}
.bingo-current-img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
}
.bingo-current-audio {
    width: 100%;
    margin-top: 0.6rem;
}

.bingo-history {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.4rem;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.25rem;
}

.bingo-history-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid #e6e9ec;
    border-radius: 8px;
    padding: 0.25rem;
    cursor: pointer;
    transition: transform 0.1s;
    font-size: 0.7rem;
    text-align: center;
}
.bingo-history-item:hover { transform: scale(1.05); border-color: #b9c2cc; }
.bingo-history-item img { width: 100%; height: 38px; object-fit: contain; }
.bingo-history-item span {
    line-height: 1.05;
    margin-top: 0.15rem;
    word-break: break-word;
}

.bingo-win-emoji { font-size: 3rem; }

/* Multiplayer share + nameless history (so the guessing-game spirit
   carries over to the synced view). */
.bingo-history-item--nameless img {
    height: 48px;
}

/* Variant 1 (printed cards) layout: caller + verification panel side-by-side. */
.bingo-play-grid--multiplayer {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
@media (max-width: 760px) {
    .bingo-play-grid--multiplayer { grid-template-columns: minmax(0, 1fr); }
}

.bingo-play-verify {
    background: #fffdf3;
    border: 1px solid #f0e4b8;
    border-radius: 12px;
    padding: 1rem;
}
.bingo-verify-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 460px;
    overflow-y: auto;
    padding: 0.25rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #f1e7c2;
}
.bingo-verify-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.1s;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.92rem;
}
.bingo-verify-item:hover { background-color: #fdf0d0; }
.bingo-verify-item.marked {
    background-color: #d2f3d4;
    text-decoration: line-through;
    text-decoration-color: rgba(0,0,0,0.3);
}
.bingo-verify-item img {
    width: 32px; height: 32px;
    object-fit: contain;
}
.bingo-verify-item .order {
    font-variant-numeric: tabular-nums;
    color: #8a9099;
    font-size: 0.8rem;
    min-width: 1.6em;
}

/* "Roep bingo" claim button is intentionally large + bright — it's the
   pivotal action in variants 2a/2b. */
.bingo-claim-row .btn { min-width: 220px; }

/* Broadcast banner that pops in when any participant claims a win. */
.bingo-claim-banner {
    position: sticky;
    top: 0;
    z-index: 1040;
    margin: -1rem -1rem 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, #fff8e1 0%, #ffe1a8 100%);
    color: #5a4500;
    border-bottom: 2px solid #f0c040;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    animation: bingoBannerPop 0.25s ease-out;
}
.bingo-claim-banner--big {
    background: linear-gradient(90deg, #d8f3d2 0%, #98e090 100%);
    color: #1f5a18;
    border-bottom-color: #4caf50;
    font-size: 1.15rem;
}
.bingo-claim-banner--huge {
    background: linear-gradient(90deg, #ffd34d 0%, #ff9c2a 100%);
    color: #5a2900;
    border-bottom-color: #cc6a00;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
}
@keyframes bingoBannerPop {
    from { transform: translateY(-8px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Print: hide the whole interactive game; the existing /bingo/ page is
   what should be printed. */
@media print {
    .bingo-play-app { display: none; }
}
