:root {
    --bgOpacity: 0.8;
}

/* ===== Background ===== */
.viewport-frame {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.viewport-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/assets/bg.png") center / cover no-repeat;
    opacity: var(--bgOpacity);
    z-index: -1;
    pointer-events: none;
}

.viewport-frame>* {
    position: relative;
    z-index: 1;
}

/* ===== Make header + its buttons always clickable ===== */
.bno-header-row {
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

.bno-hcol-left,
.bno-hcol-mid,
.bno-hcol-right {
    position: relative;
    z-index: 101;
    pointer-events: auto;
}

/* ===== Scrolling region ===== */
.bottom-scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ===== Markers ===== */
.cell-star input.form-control {
    color: #2fa36b !important;
}

.cell-dollar input.form-control {
    color: #ff2d2d !important;
    font-weight: 600 !important;
}

/* ===== Visibility defaults ===== */
.bno-portrait-only {
    display: none !important;
}

.bno-landscape-only {
    display: block !important;
}

/* ===== Center title default (landscape) ===== */
.bno-center-line {
    font-size: 48px;
    line-height: 1;
    text-align: center;
}

/* ===== Portrait ===== */
@media (orientation: portrait) {
    .bno-portrait-only {
        display: block !important;
    }

    .bno-landscape-only {
        display: none !important;
    }

    .bno-header-row>.bno-hcol-mid {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
    }

    .bno-header-row>.bno-hcol-mid>div {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .bno-center-line {
        font-size: 22px !important;
        line-height: 1.1 !important;
    }

    .bno-hcol-mid div[style*="border-radius"] {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }
}

/* portrait column letter: plain text, no box */
.bno-col-letter {
    font-family: "Pacifico", cursive;
    font-size: 34px;
    /* shrink */
    line-height: 1;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    height: auto !important;
    padding: 0 !important;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ===== Small phones ===== */
@media (max-width: 420px) {
    .bno-center-line {
        font-size: 18px !important;
    }

    .bno-hcol-mid div[style*="border-radius"] {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
    }

    .bno-col-letter {
        font-size: 16px;
    }
}

/* ===== Fix: backdrop eating clicks ===== */
.modal-backdrop {
    pointer-events: none !important;
}

.modal,
.modal-dialog,
.modal-content {
    pointer-events: auto !important;
}

/* center footer row in all orientations */
#selected-game-text {
    text-align: center !important;
    width: 100%;
    margin: 0 auto;
}