/* ============================================================================
 * BloodCrimes Arcade — hub, game shells and the Vynumo page.
 *
 * Built on the existing BloodCrimes design tokens (--bc-crimson, --bc-gold,
 * --bc-surface, --bc-border…). Nothing here redefines the palette: the Arcade
 * must read as one more room in the same building, not a bolted-on mini-site.
 *
 * Animation is restrained and every effect is opt-out via
 * prefers-reduced-motion. Readability of the game board always wins.
 * ==========================================================================*/

/* ------------------------------------------------------------------- hub */

.bc-arcade-hero {
    position: relative;
    overflow: hidden;
}

.bc-arcade-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(60% 120% at 12% 0%, rgba(159, 18, 57, .22), transparent 70%),
        radial-gradient(50% 100% at 92% 10%, rgba(212, 168, 83, .12), transparent 70%);
}

.bc-arcade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.bc-arcade-card {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1rem 1.05rem;
    background: var(--bc-surface);
    border: 1px solid var(--bc-border);
    border-radius: .75rem;
    color: var(--bc-text);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.bc-arcade-card:hover,
.bc-arcade-card:focus-visible {
    background: var(--bc-surface-hover);
    border-color: var(--bc-border-glow);
    color: var(--bc-text);
    text-decoration: none;
    transform: translateY(-2px);
}

.bc-arcade-card--soon {
    opacity: .72;
    cursor: default;
}

.bc-arcade-card--soon:hover {
    transform: none;
    background: var(--bc-surface);
    border-color: var(--bc-border);
}

.bc-arcade-card__top {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.bc-arcade-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: .6rem;
    background: rgba(159, 18, 57, .18);
    border: 1px solid var(--bc-border-glow);
    color: var(--bc-gold);
    font-size: 1.1rem;
}

.bc-arcade-card__title {
    margin: 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.4rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.bc-arcade-card__tagline {
    margin: 0;
    color: var(--bc-text-secondary);
    font-size: .9rem;
}

.bc-arcade-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .75rem;
    font-size: .82rem;
    color: var(--bc-text-secondary);
}

.bc-arcade-card__stats b {
    color: var(--bc-gold);
    font-weight: 600;
}

.bc-arcade-card__cta {
    margin-top: auto;
    align-self: flex-start;
    padding: .4rem 1rem;
    border-radius: .5rem;
    background: var(--bc-crimson);
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 1rem;
}

.bc-arcade-badge {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: rgba(212, 168, 83, .14);
    border: 1px solid rgba(212, 168, 83, .35);
    color: var(--bc-gold);
}

/* ------------------------------------------------------------ game shell */

.bc-arcade-frame-panel {
    position: relative;
    padding: .5rem;
}

.bc-arcade-frame-wrap {
    position: relative;
    width: 100%;
    border-radius: .6rem;
    overflow: hidden;
    background: var(--bc-bg);
    border: 1px solid var(--bc-border);
}

.bc-arcade-frame {
    display: block;
    width: 100%;
    border: 0;
    height: min(88vh, 940px);
    min-height: 620px;
    background: var(--bc-bg);
}

.bc-arcade-frame-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}

.bc-arcade-frame-actions .btn {
    min-height: 38px;
}

/* ------------------------------------------------------- daily + boards */

.bc-arcade-daily {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
}

.bc-arcade-daily__goal {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bc-gold);
}

.bc-arcade-daily__meta {
    font-size: .85rem;
    color: var(--bc-text-secondary);
}

.bc-arcade-countdown {
    font-variant-numeric: tabular-nums;
    color: var(--bc-text);
}

.bc-arcade-tabs {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.bc-arcade-tabs .btn {
    min-height: 36px;
}

.bc-arcade-board {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: arcade-rank;
}

.bc-arcade-board li {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .45rem .25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    font-size: .95rem;
}

.bc-arcade-board li:last-child {
    border-bottom: 0;
}

.bc-arcade-board li::before {
    counter-increment: arcade-rank;
    content: counter(arcade-rank);
    flex: 0 0 1.6rem;
    text-align: right;
    color: var(--bc-text-disabled);
    font-variant-numeric: tabular-nums;
}

.bc-arcade-board li.is-you {
    background: rgba(212, 168, 83, .06);
    border-radius: .35rem;
}

.bc-arcade-board li.is-you::before {
    color: var(--bc-gold);
}

.bc-arcade-board__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bc-arcade-board__score {
    flex: 0 0 auto;
    color: var(--bc-gold);
    font-variant-numeric: tabular-nums;
}

/* "Where do I stand?" line, shown only when the player is outside the
   returned rows. Reuses the score styling, so it reads as part of the board. */
.bc-arcade-board__mine {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    margin: .35rem 0 0;
    padding: .45rem .25rem 0;
    border-top: 1px solid rgba(212, 168, 83, .25);
    font-size: .95rem;
    color: var(--bc-text-secondary);
}

/* Guests are not ranked (a run is only signed when a player owns it). Say so
   instead of letting an empty board look broken. */
.bc-arcade-board__note {
    margin: .5rem 0 0;
    font-size: .8rem;
    color: var(--bc-text-disabled);
}

/* Pager for the ranking tables (10 rows per page). */
.bc-arcade-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .75rem;
}

.bc-arcade-pager__label {
    color: var(--bc-text-secondary);
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

.bc-arcade-pager .btn {
    min-height: 34px;
}

.bc-arcade-pager .btn[disabled] {
    opacity: .4;
    cursor: default;
}

.bc-arcade-empty {
    padding: 1rem;
    color: var(--bc-text-secondary);
    text-align: center;
    font-size: .9rem;
}

/* Daily Challenge summary: participants, your own result, today's top rows. */
.bc-arcade-daily__summary {
    margin-top: .85rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.bc-arcade-board--compact li {
    padding: .3rem .25rem;
    font-size: .9rem;
}


/* ---------------------------------------------------------------- feed -- */
/* Social proof. Milestones (512+) and daily-lead changes only — an ordinary
   run never lands here (see worker/src/services/arcade-social.ts). */

.bc-arcade-feed {
    margin: 0;
    padding: 0;
    list-style: none;
}

.bc-arcade-feed__item {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .5rem .25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    font-size: .92rem;
    line-height: 1.35;
}

.bc-arcade-feed__item:last-child { border-bottom: 0; }

.bc-arcade-feed__item i {
    flex: 0 0 auto;
    width: 1rem;
    text-align: center;
    color: var(--bc-gold);
}

.bc-arcade-feed__item span {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--bc-text);
}

.bc-arcade-feed__item strong { color: #F2E4C4; }

.bc-arcade-feed__item em {
    flex: 0 0 auto;
    font-style: normal;
    font-size: .78rem;
    color: var(--bc-text-disabled);
}

.bc-arcade-feed__item--lead i { color: #E0BD73; }
.bc-arcade-feed__item--empire i { color: #E11D2A; }

/* ------------------------------------------------------------- events -- */
/* Scheduled window (Double Arcade Points, Weekend Tournament, 2048 Hunt). */

.bc-arcade-event {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .85rem;
    border-radius: .5rem;
    border: 1px solid rgba(225, 29, 42, .38);
    background: linear-gradient(90deg, rgba(181, 18, 32, .18), rgba(11, 11, 14, .2));
    font-size: .92rem;
    color: var(--bc-text);
}

.bc-arcade-event[hidden] { display: none; }

.bc-arcade-event i { flex: 0 0 auto; color: #E0BD73; }
.bc-arcade-event span { flex: 1 1 auto; min-width: 0; }
.bc-arcade-event strong { color: #F2E4C4; }
.bc-arcade-event em {
    flex: 0 0 auto;
    font-style: normal;
    font-size: .78rem;
    color: var(--bc-text-disabled);
}
/* -------------------------------------------------------------- helpers */

.bc-arcade-rewards {
    margin: 0 0 .75rem;
    padding: .65rem .85rem;
    border-radius: .5rem;
    border: 1px solid rgba(212, 168, 83, .32);
    background: rgba(212, 168, 83, .07);
}

.bc-arcade-rewards__title {
    margin: 0 0 .25rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.15rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--bc-gold);
}

.bc-arcade-rewards__list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .92rem;
}

.bc-arcade-rewards__note {
    margin: .35rem 0 0;
    font-size: .8rem;
    color: var(--bc-text-secondary);
}

.bc-arcade-alert {
    padding: .6rem .85rem;
    border-radius: .5rem;
    background: rgba(159, 18, 57, .16);
    border: 1px solid var(--bc-border-glow);
    color: var(--bc-text);
    font-size: .9rem;
}

/* Legacy Vynumo-internal strip: not used by the BC shell, kept harmless. */
.bc-arcade-strip {
    display: none;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 575.98px) {
    .bc-arcade-grid {
        grid-template-columns: 1fr;
    }

    /* The board has to fit a 360×640 viewport without horizontal scroll. */
    .bc-arcade-frame {
        height: 78vh;
        min-height: 520px;
    }

    /* Keep iOS Safari from scrolling the page under a swipe on the board. */
    .bc-arcade-frame-wrap {
        overscroll-behavior: contain;
    }

    .bc-arcade-frame-panel {
        padding: .25rem;
    }

    .bc-arcade-daily {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bc-arcade-card,
    .bc-arcade-card:hover {
        transition: none;
        transform: none;
    }
}
