/* ─── Shared styles for all player-facing pages (Game, Ranking, PlayGame…) ─ */

/* ─── Page shell ──────────────────────────────────────────────── */
.game-page {
    min-height: 100dvh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 45%, #0f3460 100%);
    padding: 0;
}

.game-scroll-area {
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
}

/* ─── Header ──────────────────────────────────────────────────── */
.event-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,.4);
    margin-bottom: .25rem;
}

.event-subtitle {
    font-size: .85rem;
    color: rgba(255,255,255,.6);
}

/* ─── Glass card ──────────────────────────────────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    padding: 1.25rem;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.glass-card-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.55);
    margin-bottom: .75rem;
}

/* ─── Score summary card ──────────────────────────────────────── */
.score-card {
    background: linear-gradient(135deg,
        rgba(99, 179, 237, 0.25) 0%,
        rgba(66, 153, 225, 0.15) 100%);
    border-color: rgba(99, 179, 237, 0.35);
}

.score-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.55);
    margin-bottom: .25rem;
}

.score-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 30px rgba(99,179,237,.6);
}

.score-name {
    margin-top: .35rem;
    font-size: .9rem;
    color: rgba(255,255,255,.7);
}

/* ─── Score list ──────────────────────────────────────────────── */
.score-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.score-list-item {
    padding: .6rem 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.score-list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.score-description {
    font-size: .875rem;
    color: rgba(255,255,255,.85);
}

.score-time {
    font-size: .72rem;
    color: rgba(255,255,255,.4);
    margin-top: .15rem;
}

.score-points {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}

.score-points.positive { color: #68d391; }
.score-points.negative { color: #fc8181; }

/* ─── Score type badges ───────────────────────────────────────── */
.score-type-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .15rem .45rem;
    border-radius: .35rem;
}

.badge-bingo   { background: rgba(159,122,234,.35); color: #d6bcfa; }
.badge-bonus   { background: rgba(104,211,145,.25); color: #9ae6b4; }
.badge-penalty { background: rgba(252,129,129,.25); color: #feb2b2; }
.badge-chore   { background: rgba(246,173, 85,.25); color: #fbd38d; }
.badge-game    { background: rgba( 99,179,237,.25); color: #bee3f8; }
.badge-default { background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); }

/* ─── Bingo grid ──────────────────────────────────────────────── */
.bingo-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* negative margin + padding so the scrollbar sits flush with the card edge */
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: .25rem;   /* space for the scrollbar on desktop */
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(var(--bingo-cols, 5), var(--bingo-cell-size, 8rem));
    gap: .5rem;
    /* width is exactly as wide as all cells — parent wrapper scrolls */
    width: max-content;
    min-width: 100%;
}

.bingo-cell {
    position: relative;
    width: var(--bingo-cell-size, 8rem);
    height: var(--bingo-cell-size, 8rem);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem;
    cursor: pointer;
    transition: background .15s, transform .1s;
    overflow: hidden;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.bingo-cell:active {
    transform: scale(.94);
}

.bingo-cell.completed {
    background: linear-gradient(135deg,
        rgba(104,211,145,.45) 0%,
        rgba(56,178,172,.35) 100%);
    border-color: rgba(104,211,145,.55);
}

.bingo-cell-text {
    font-size: .95rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
    display: block;
    width: 100%;
}

.bingo-cell.completed .bingo-cell-text {
    color: rgba(255,255,255,.5);
    text-decoration: line-through;
}

.bingo-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #68d391;
    opacity: .9;
}

/* ─── Games list ──────────────────────────────────────────────── */
.game-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.game-list-item {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .65rem .75rem;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: .75rem;
    text-decoration: none;
    color: #fff;
    transition: background .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}

.game-list-item:active {
    transform: scale(.97);
    background: rgba(255,255,255,.13);
}

.game-list-img {
    width: 48px;
    height: 48px;
    border-radius: .5rem;
    object-fit: cover;
    flex-shrink: 0;
}

.game-list-img-placeholder {
    width: 48px;
    height: 48px;
    border-radius: .5rem;
    background: rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: rgba(255,255,255,.4);
    flex-shrink: 0;
}

.game-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.game-list-title {
    font-size: .95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-list-meta {
    font-size: .72rem;
    color: rgba(255,255,255,.5);
}

.game-list-chevron {
    font-size: .8rem;
    color: rgba(255,255,255,.3);
    flex-shrink: 0;
}

/* ─── Standalone colour utilities ────────────────────────────── */
.positive { color: #68d391; }
.negative { color: #fc8181; }

/* ─── Podium ──────────────────────────────────────────────────── */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: .5rem;
    padding: 0 .5rem;
}

.podium-place {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    max-width: 33%;
}

.podium-crown {
    font-size: 1.4rem;
    line-height: 1;
}

.podium-name {
    font-size: .78rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.podium-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .6rem .6rem 0 0;
}

.podium-block--1 {
    height: 80px;
    background: linear-gradient(180deg, rgba(246,224,94,.45) 0%, rgba(246,224,94,.2) 100%);
    border: 1px solid rgba(246,224,94,.4);
    border-bottom: none;
}

.podium-block--2 {
    height: 56px;
    background: linear-gradient(180deg, rgba(203,213,224,.3) 0%, rgba(203,213,224,.12) 100%);
    border: 1px solid rgba(203,213,224,.3);
    border-bottom: none;
}

.podium-block--3 {
    height: 40px;
    background: linear-gradient(180deg, rgba(221,155,119,.3) 0%, rgba(221,155,119,.12) 100%);
    border: 1px solid rgba(221,155,119,.3);
    border-bottom: none;
}

.podium-rank {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.podium-gold   .podium-rank { color: #f6e05e; text-shadow: 0 0 12px rgba(246,224,94,.6); }
.podium-silver .podium-rank { color: #cbd5e0; }
.podium-bronze .podium-rank { color: #dd9b77; }

.podium-pts {
    font-size: .8rem;
    font-weight: 700;
}

/* ─── Leaderboard list ────────────────────────────────────────── */
.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.ranking-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ranking-item--me {
    background: rgba(99,179,237,.12);
    border-radius: .5rem;
    padding-left: .5rem;
    padding-right: .5rem;
}

.ranking-pos {
    font-size: 1rem;
    font-weight: 700;
    min-width: 1.75rem;
    text-align: center;
}

.rank-gold   { color: #f6e05e; text-shadow: 0 0 8px rgba(246,224,94,.5); }
.rank-silver { color: #cbd5e0; }
.rank-bronze { color: #dd9b77; }

.ranking-name {
    flex: 1;
    font-size: .95rem;
    color: rgba(255,255,255,.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-score {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}
