/*
Bingo 2025: the rewards, the 4x4 bingo card and a note.
Layout ranges: phone up to 600px, tablet 601-950px, desktop from 951px.
The whole card is always visible; on small phones the text is small, so people zoom in to read it.
*/

/* Frame: 32px side margins, at most 1200px wide, content starts 64px below the 80px header (48px on phones) */
.bingo-page {
    position: relative;
    box-sizing: border-box;
    width: min(calc(100% - 64px), 1200px);
    margin: calc(5rem + 64px) auto 0;
}

.bingo-scroll {
    /* Room for the focus outline of the edge squares, without moving the card. */
    margin: -6px;
    padding: 6px;
}

/* The card fits the page width (at most 1120px); everything inside scales with it (cqi = 1% of the card width) */
.bingo-cells {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 1120px;
    margin: 0 auto;
    border: 1px solid black;
    container-type: inline-size;
}

.bingo-cell {
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    min-width: 0;
    aspect-ratio: 3 / 2;
    margin: 0;
    padding: 0;
    border: 1px solid black;
    border-radius: 0;
    background: white;
    color: black;
    /* 19.75px on the full 1120px card, 13.4px at 760px, as before */
    font: 700 1.763cqi/1.2 "Trebuchet MS", Arial, sans-serif;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color .3s ease-in-out;
}

.bingo-cell[aria-pressed="true"] {
    background: #ffffff59;
}

.bingo-cell:focus-visible {
    outline: 2px solid black;
    outline-offset: 3px;
    z-index: 1;
}

.bingo-cell-icon {
    position: absolute;
    display: block;
    object-fit: contain;
    mix-blend-mode: multiply;
    opacity: .4;
    pointer-events: none;
}

.bingo-cell-text {
    position: absolute;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.116667% 4.233333%;
    overflow-wrap: break-word;
    pointer-events: none;
}

.bingo-copy {
    display: block;
    width: 100%;
}

.bingo-rewards {
    max-width: 850px;
    margin: 0 auto 3rem;
    color: white;
    text-align: center;
}


.bingo-reward-list {
    display: grid;
    /* Same gap between all statements; each statement's space fits its text and its "achieved" version */
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bingo-reward {
    position: relative;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    padding: 0;
    color: inherit;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.5;
}

.bingo-reward-copy, .bingo-reward-completion {
    grid-area: 1 / 1;
    min-width: 0;
}

/* The first line's own line spacing counts toward the space below the header */
.bingo-reward:first-child {
    margin-top: -.25em;
}

/* If a statement's space is taller than what it shows (e.g. a short "achieved" line), the top statement sits at the
   bottom of its space, the bottom one at the top and the middle one in the centre: the two gaps always stay equal. */
.bingo-reward:first-child > * {
    align-self: end;
}

.bingo-reward:last-child > * {
    align-self: start;
}

.bingo-reward-copy {
    transition: opacity .3s ease-in-out;
}

.bingo-reward-completion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    box-sizing: border-box;
    max-width: 100%;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(.95);
    pointer-events: none;
    transition: opacity .3s ease-in-out, transform .3s ease-in-out, visibility .3s;
}

/* "Achieved" version: check icon one line tall and text at the statement's size (bold), so it takes no more room */
.bingo-reward-check {
    flex-shrink: 0;
    width: 1.5em;
    height: 1.5em;
}

.bingo-reward-claim {
    font-size: 1em;
    font-weight: 800;
    line-height: 1.5;
    text-align: left;
}

.bingo-reward[data-earned="true"] .bingo-reward-copy {
    opacity: 0;
}

.bingo-reward[data-earned="true"] .bingo-reward-completion {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.bingo-reward-note {
    margin: 1.5rem 0 0;
    color: white;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
}

.bingo-reward-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Phone */
@media (max-width: 600px) {
    .bingo-page {
        margin-top: calc(5rem + 48px);
    }

    .bingo-reward {
        font-size: 1.0625rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bingo-cell, .bingo-reward-copy, .bingo-reward-completion {
        transition: none;
    }
}

/* Positions of the individual items. They live here instead of in the page
so the content security policy can block all inline styles. */

.bingo-cell-icon.bingo-spot-1 {
    left: 10.176157%;
    top: 11.896319%;
    width: 25%;
    height: 37.5%;
}

.bingo-cell-text.bingo-spot-2 {
    left: 18.541296%;
    top: 27.682292%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-3 {
    left: 67.642593%;
    top: 56.964028%;
    width: 28.333333%;
    height: 42.5%;
}

.bingo-cell-text.bingo-spot-4 {
    left: -1.152407%;
    top: 0.523472%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-5 {
    left: 59.485741%;
    top: -3%;
    width: 38.333333%;
    height: 57.5%;
}

.bingo-cell-text.bingo-spot-6 {
    left: -13.251343%;
    top: 33.326389%;
    width: 111.376713%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-7 {
    left: 12.46213%;
    top: 48.825139%;
    width: 30%;
    height: 45%;
}

.bingo-cell-text.bingo-spot-8 {
    left: 21.658009%;
    top: 0.824861%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-9 {
    left: 59.076065%;
    top: 47.988681%;
    width: 25%;
    height: 37.5%;
}

.bingo-cell-text.bingo-spot-10 {
    left: -10.266204%;
    top: -0.993403%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-11 {
    left: 9.316852%;
    top: 7.009444%;
    width: 30%;
    height: 45%;
}

.bingo-cell-text.bingo-spot-12 {
    left: 17.228009%;
    top: 30.621389%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-13 {
    left: 7.84713%;
    top: 54.525556%;
    width: 25%;
    height: 37.5%;
}

.bingo-cell-text.bingo-spot-14 {
    left: 14.732269%;
    top: -0.993403%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-15 {
    left: 65.567361%;
    top: 9.966944%;
    width: 25%;
    height: 37.5%;
}

.bingo-cell-text.bingo-spot-16 {
    left: -2.180926%;
    top: 31.174861%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-17 {
    left: 4.120648%;
    top: 32.295139%;
    width: 43.333333%;
    height: 65%;
}

.bingo-cell-text.bingo-spot-18 {
    left: 19.877454%;
    top: -5.4375%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-19 {
    left: 66.671019%;
    top: 9.75%;
    width: 25%;
    height: 37.5%;
}

.bingo-cell-text.bingo-spot-20 {
    left: -4.16662%;
    top: 20.769444%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-21 {
    left: 68.578472%;
    top: 53.826389%;
    width: 25%;
    height: 37.5%;
}

.bingo-cell-text.bingo-spot-22 {
    left: -2.180926%;
    top: 0%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-23 {
    left: 4.564444%;
    top: 9.75%;
    width: 28.333333%;
    height: 42.5%;
}

.bingo-cell-text.bingo-spot-24 {
    left: 16.666667%;
    top: 29.541806%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-25 {
    left: 61.815185%;
    top: 12.5%;
    width: 30%;
    height: 45%;
}

.bingo-cell-text.bingo-spot-26 {
    left: -10.266204%;
    top: 12.440972%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-27 {
    left: 6.27787%;
    top: 57.074861%;
    width: 25%;
    height: 37.5%;
}

.bingo-cell-text.bingo-spot-28 {
    left: 15.770648%;
    top: 1.071944%;
    width: 88.025694%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-29 {
    left: 12.061898%;
    top: 12.440972%;
    width: 25%;
    height: 37.5%;
}

.bingo-cell-text.bingo-spot-30 {
    left: 18.796343%;
    top: 24.192917%;
    width: 83.333333%;
    height: 75%;
}

.bingo-cell-icon.bingo-spot-31 {
    left: 57.351157%;
    top: 46.409722%;
    width: 30%;
    height: 45%;
}

.bingo-cell-text.bingo-spot-32 {
    left: -10.982176%;
    top: -3.564097%;
    width: 83.333333%;
    height: 75%;
}

:lang(de) .bingo-cell-text.bingo-spot-4 {
    left: 0.295139%;
    top: 0.824861%;
    width: 83.333333%;
    height: 75%;
}

:lang(de) .bingo-cell-text.bingo-spot-6 {
    left: -16.371528%;
    top: 34.432639%;
    width: 111.376713%;
    height: 75%;
}

:lang(de) .bingo-cell-text.bingo-spot-22 {
    left: -5.092083%;
    top: 1.071944%;
    width: 83.333333%;
    height: 75%;
}

:lang(de) .bingo-cell-text.bingo-spot-28 {
    left: 16.666667%;
    top: 0%;
    width: 83.333333%;
    height: 75%;
}

:lang(de) .bingo-cell-text.bingo-spot-32 {
    left: -6.524213%;
    top: -1.820972%;
    width: 83.333333%;
    height: 75%;
}
