.bingo-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.bingo-hero {
    max-width: 780px;
    margin-bottom: 24px;
}

.bingo-hero h1,
.bingo-section-heading h2,
.bingo-board-toolbar h2 {
    margin: 0;
}

.bingo-hero h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1;
}

.bingo-hero > p:last-child {
    margin: 14px 0 0;
    color: #b8cbc3;
    font-size: 1.04rem;
    line-height: 1.65;
}

.bingo-eyebrow {
    margin: 0 0 7px;
    color: #62efba;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.bingo-app-shell {
    display: grid;
    gap: 22px;
}

.bingo-builder,
.bingo-play-area {
    overflow: hidden;
}

.bingo-section-heading,
.bingo-board-toolbar,
.bingo-picker-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.bingo-pool-count {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid rgba(98, 239, 186, .28);
    border-radius: 999px;
    background: rgba(98, 239, 186, .08);
    color: #bfffe5;
    font-size: .8rem;
    font-weight: 700;
}

.bingo-control-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(140px, .65fr) minmax(190px, .85fr);
    gap: 14px;
    margin-top: 20px;
}

.bingo-field {
    display: grid;
    gap: 7px;
}

.bingo-field > span,
.bingo-pool-modes legend {
    color: #dce9e4;
    font-size: .86rem;
    font-weight: 750;
}

.bingo-field small {
    color: #82998f;
    font-weight: 500;
}

.bingo-field input,
.bingo-field select {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid #285443;
    border-radius: 10px;
    background: #071510;
    color: #effbf6;
    padding: 10px 12px;
}

.bingo-field input:focus,
.bingo-field select:focus,
.bingo-character-option:focus-within {
    outline: 2px solid rgba(98, 239, 186, .65);
    outline-offset: 2px;
}

.bingo-free-space-option {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    align-self: end;
    padding: 8px 12px;
    border: 1px solid #285443;
    border-radius: 10px;
    background: #071510;
    cursor: pointer;
}

.bingo-free-space-option input {
    width: 18px;
    height: 18px;
    accent-color: #2dcf8d;
}

.bingo-free-space-option span {
    display: grid;
    gap: 2px;
    color: #eefbf6;
    font-size: .87rem;
    font-weight: 750;
}

.bingo-free-space-option small {
    color: #82998f;
    font-size: .72rem;
    font-weight: 500;
}

.bingo-pool-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 20px 0 0;
    padding: 0;
    border: 0;
}

.bingo-pool-modes legend {
    width: 100%;
    margin-bottom: 1px;
}

.bingo-pool-modes label {
    position: relative;
    cursor: pointer;
}

.bingo-pool-modes input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bingo-pool-modes span {
    display: block;
    padding: 9px 13px;
    border: 1px solid #285443;
    border-radius: 999px;
    background: #071510;
    color: #b8cbc3;
    font-size: .82rem;
    font-weight: 700;
}

.bingo-pool-modes input:checked + span {
    border-color: #2dcf8d;
    background: rgba(45, 207, 141, .14);
    color: #dffff1;
}

.bingo-pool-modes input:focus-visible + span {
    outline: 2px solid rgba(98, 239, 186, .65);
    outline-offset: 2px;
}

.bingo-picker {
    margin-top: 17px;
    padding: 16px;
    border: 1px solid rgba(67, 132, 105, .45);
    border-radius: 14px;
    background: rgba(4, 16, 12, .72);
}

.bingo-picker[hidden] {
    display: none;
}

.bingo-picker-search {
    width: min(360px, 100%);
}

.bingo-picker-actions,
.bingo-builder-actions,
.bingo-board-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.bingo-picker-instruction {
    margin: 14px 0 10px;
    color: #a8bcb3;
    font-size: .82rem;
}

.bingo-character-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 8px;
    max-height: 330px;
    overflow: auto;
    padding: 3px;
}

.bingo-character-option {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px;
    border: 1px solid #1e4537;
    border-radius: 10px;
    background: #091a14;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.bingo-character-option[hidden] {
    display: none;
}

.bingo-character-option:has(input:checked) {
    border-color: #2dcf8d;
    background: rgba(45, 207, 141, .12);
}

.bingo-character-option input {
    position: absolute;
    top: 6px;
    right: 6px;
    accent-color: #2dcf8d;
}

.bingo-character-option__image {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}

.bingo-character-option__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bingo-character-option__name {
    min-width: 0;
    overflow: hidden;
    color: #e7f5ef;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
}

.bingo-message {
    min-height: 1.35em;
    margin: 13px 0 0;
    color: #ffb7b7;
    font-size: .85rem;
}

.bingo-message.is-success {
    color: #76f2bd;
}

.bingo-builder-actions {
    margin-top: 5px;
}

.bingo-primary-button {
    border: 1px solid #4fe0a5;
    border-radius: 10px;
    background: linear-gradient(135deg, #24a875, #187c59);
    color: #fff;
    padding: 11px 17px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.bingo-primary-button:hover {
    filter: brightness(1.08);
}

.bingo-builder button:disabled,
.bingo-play-area button:disabled:not(.bingo-cell) {
    opacity: .45;
    cursor: not-allowed;
}

.bingo-board-toolbar {
    align-items: center;
}

.bingo-board-scroll {
    margin-top: 18px;
    overflow-x: auto;
    padding: 4px 4px 12px;
    scrollbar-color: #2c8a67 #071510;
}

.bingo-board {
    --bingo-size: 5;
    display: grid;
    grid-template-columns: repeat(var(--bingo-size), minmax(94px, 1fr));
    gap: clamp(4px, .7vw, 8px);
    width: 100%;
    min-width: calc(var(--bingo-size) * 94px + (var(--bingo-size) - 1) * 4px);
    max-width: 1040px;
    margin: 0 auto;
}

.bingo-board--empty {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 230px;
    border: 1px dashed #315b4b;
    border-radius: 14px;
    color: #82998f;
    text-align: center;
}

.bingo-cell {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    aspect-ratio: 1 / 1;
    min-width: 0;
    overflow: hidden;
    padding: 5px 5px 7px;
    border: 1px solid #317157;
    border-radius: 11px;
    background:
        radial-gradient(circle at 50% 18%, rgba(70, 191, 139, .15), transparent 58%),
        #071711;
    color: #effbf6;
    cursor: pointer;
    isolation: isolate;
    transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.bingo-cell:hover {
    z-index: 2;
    transform: translateY(-2px);
    border-color: #65e8b2;
}

.bingo-cell:focus-visible {
    outline: 3px solid rgba(98, 239, 186, .72);
    outline-offset: 2px;
}

.bingo-cell__image {
    display: grid;
    place-items: end center;
    min-height: 0;
    overflow: hidden;
}

.bingo-cell__image img {
    width: 92%;
    height: 92%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .35));
    transition: filter .15s ease, opacity .15s ease;
}

.bingo-cell__name {
    position: relative;
    z-index: 3;
    display: -webkit-box;
    overflow: hidden;
    color: #eaf7f1;
    font-size: clamp(.58rem, 1.25vw, .78rem);
    font-weight: 800;
    line-height: 1.12;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.bingo-cell::before,
.bingo-cell::after {
    content: '';
    position: absolute;
    z-index: 4;
    top: 49%;
    left: 8%;
    width: 84%;
    height: clamp(5px, .7vw, 10px);
    border-radius: 999px;
    background: rgba(255, 76, 91, .9);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .14s ease;
}

.bingo-cell::before {
    transform: rotate(45deg);
}

.bingo-cell::after {
    transform: rotate(-45deg);
}

.bingo-cell.is-marked {
    background-color: rgba(74, 14, 20, .72);
}

.bingo-cell.is-marked::before,
.bingo-cell.is-marked::after {
    opacity: 1;
}

.bingo-cell.is-marked img {
    opacity: .7;
    filter: grayscale(.25) drop-shadow(0 5px 8px rgba(0, 0, 0, .35));
}

.bingo-cell.is-bingo {
    border-color: #ffe178;
    box-shadow: inset 0 0 0 2px rgba(255, 225, 120, .3), 0 0 16px rgba(255, 225, 120, .18);
}

.bingo-cell--free {
    place-items: center;
    grid-template-rows: 1fr;
    cursor: default;
    background:
        radial-gradient(circle at center, rgba(98, 239, 186, .25), transparent 67%),
        #0a2018;
}

.bingo-cell--free:hover {
    transform: none;
}

.bingo-cell--free .bingo-cell__name {
    color: #8ff4ca;
    font-size: clamp(.72rem, 1.7vw, 1.05rem);
    letter-spacing: .09em;
    text-transform: uppercase;
}

.bingo-win-banner {
    margin-top: 16px;
    padding: 11px 14px;
    border: 1px solid rgba(255, 225, 120, .6);
    border-radius: 11px;
    background: rgba(255, 225, 120, .09);
    color: #ffe996;
    text-align: center;
}

.bingo-win-banner[hidden] {
    display: none;
}

.bingo-save-note {
    margin: 12px 0 0;
    color: #789086;
    font-size: .77rem;
    line-height: 1.5;
    text-align: center;
}

.bingo-empty-state {
    text-align: center;
}

@media (max-width: 760px) {
    .bingo-page {
        width: min(100% - 20px, 1180px);
        padding-top: 20px;
    }

    .bingo-control-grid {
        grid-template-columns: 1fr;
    }

    .bingo-free-space-option {
        align-self: auto;
    }

    .bingo-section-heading,
    .bingo-board-toolbar,
    .bingo-picker-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .bingo-pool-count {
        align-self: flex-start;
    }

    .bingo-board-actions,
    .bingo-picker-actions {
        width: 100%;
    }

    .bingo-board-actions button,
    .bingo-picker-actions button {
        flex: 1 1 auto;
    }

    .bingo-character-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bingo-board {
        grid-template-columns: repeat(var(--bingo-size), 92px);
        width: max-content;
        min-width: 0;
    }

    .bingo-cell__name {
        font-size: .62rem;
    }
}

@media (max-width: 410px) {
    .bingo-character-list {
        grid-template-columns: 1fr;
    }
}

@media print {
    .site-banner,
    .main-nav,
    .mobile-menu-drawer,
    .site-footer,
    .bingo-builder,
    .bingo-board-actions,
    .bingo-save-note {
        display: none !important;
    }

    .bingo-page,
    .bingo-play-area {
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .bingo-board-scroll {
        overflow: visible;
    }

    .bingo-board {
        min-width: 0;
    }
}
