/* Arcade + embedded-game styling.
   Theme-aware: all surfaces/text use Metronic/Bootstrap CSS variables so the
   arcade follows the site's light/dark theme. Per-game flavour comes from
   --card-accent (a hex set inline per card); everything else is themed. */

/* ---------- Arcade hero ---------- */

.arcade-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    margin-bottom: 1.75rem;
    color: #fff;
    background:
        linear-gradient(125deg,
            rgba(var(--bs-primary-rgb), 1) 0%,
            rgba(var(--bs-info-rgb), 1) 55%,
            rgba(var(--bs-primary-rgb), .85) 100%);
    background-size: 200% 200%;
    animation: arcade-pan 14s ease infinite;
    box-shadow: 0 18px 45px rgba(var(--bs-primary-rgb), .35);
}

@keyframes arcade-pan {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.arcade-hero::before {
    /* drifting star field */
    content: "";
    position: absolute;
    inset: -50%;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, .9) 0 1.4px, transparent 2px),
        radial-gradient(circle, rgba(255, 255, 255, .6) 0 1.2px, transparent 2px);
    background-size: 70px 70px, 110px 110px;
    background-position: 0 0, 35px 40px;
    opacity: .35;
    animation: arcade-stars 60s linear infinite;
    pointer-events: none;
}

@keyframes arcade-stars {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-140px, -140px, 0); }
}

.arcade-hero::after {
    /* glow blob */
    content: "";
    position: absolute;
    top: -40%;
    right: -10%;
    width: 55%;
    height: 180%;
    background: radial-gradient(circle, rgba(255, 255, 255, .35) 0%, transparent 60%);
    pointer-events: none;
}

.arcade-hero > * { position: relative; z-index: 1; }

.arcade-hero h1 {
    font-weight: 800;
    letter-spacing: -.5px;
    margin: 0 0 .4rem;
    /* The hero background is always the coloured gradient, so the title is always white —
       otherwise an <h1> picks up the theme heading colour (dark in light mode = unreadable). */
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .18);
}

.arcade-hero p { margin: 0; opacity: .92; font-weight: 500; }

.arcade-hero .arcade-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.1rem;
}

.arcade-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .85rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, .25);
}

/* ---------- Card grid ---------- */

.arcade-grid {
    /* centred, gently-growing tiles: with only a couple of games a fixed left-packed grid
       left a big empty gutter on wide screens and clumped to the left on phones. Flex + wrap
       + centre keeps the cluster balanced — cards enlarge a touch on desktop (capped so the
       covers don't stretch) and fill the column, centred, on mobile. */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
}

.arcade-card {
    flex: 1 1 260px;
    max-width: 360px;
}

/* The main launcher sits in a narrow column (col-6 on desktop), where a 260px basis only
   fits one card per row. From tablets up, force a tidy 2-up grid; phones stay single-column. */
@media (min-width: 768px) {
    .arcade-grid:not(.arcade-grid-side) .arcade-card {
        flex: 1 1 calc(50% - 0.625rem);
        max-width: none;
    }
}

/* Side panel (home mini-games column): stack the cards full-width down the sidebar
   instead of the centred, max-width-capped wrap used in the main launcher. */
.arcade-grid-side { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
.arcade-grid-side .arcade-card { max-width: none; flex: 0 0 auto; }

/* On phones the cards stack into a long scroll. Turn BOTH the launcher and the
   opponent panel into horizontal swipe-sliders: cards sit side-by-side, snap to
   centre, and the next one peeks at the edge. CSS-only (native momentum scroll).
   MUST come after the .arcade-grid-side base rules above so it wins the cascade. */
@media (max-width: 767.98px) {
    .arcade-grid, .arcade-grid-side {
        flex-direction: row;            /* overrides the side panel's column stack */
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: .25rem;
        gap: .85rem;
        padding-bottom: .85rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;          /* Firefox */
    }
    .arcade-grid::-webkit-scrollbar,
    .arcade-grid-side::-webkit-scrollbar { display: none; }   /* WebKit */
    .arcade-grid .arcade-card,
    .arcade-grid-side .arcade-card {
        flex: 0 0 82%;
        max-width: 82%;
        scroll-snap-align: center;
    }
    /* full-width group label / note don't belong inside a horizontal track */
    .arcade-grid-label, .arcade-grid-note { display: none; }
}

/* Discreet "more games coming" filler — grows to fill the rest of the mini-games side panel
   below the tiles, so the shorter column reads intentional instead of just stopping short. */
.arcade-more-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 84px;
    padding: 1.25rem 1rem;
    border: 1px dashed var(--bs-border-color);
    border-radius: 1.15rem;
    color: var(--bs-text-muted);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.arcade-card {
    --card-accent: var(--bs-info);
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 1.15rem;
    overflow: hidden;
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .05);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease, border-color .2s ease;
    text-decoration: none;
    color: inherit;
}

.arcade-card.is-available { cursor: pointer; }

.arcade-card.is-available:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--card-accent) 55%, var(--bs-border-color));
    box-shadow:
        0 18px 40px rgba(0, 0, 0, .18),
        0 0 0 1px color-mix(in srgb, var(--card-accent) 35%, transparent);
}

.arcade-card-leaders {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .38rem .65rem;
    font-size: .68rem;
    font-weight: 600;
    color: var(--bs-gray-700);
    background: color-mix(in srgb, var(--card-accent) 12%, var(--bs-card-bg));
    border-bottom: 1px solid var(--bs-border-color);
    overflow: hidden;
    white-space: nowrap;
}

.arcade-leader {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.arcade-leader .medal { font-size: .9rem; }
.arcade-leader b { color: var(--card-accent); margin-left: .15rem; }
.arcade-leader.muted { color: var(--bs-text-muted); font-weight: 500; }

.arcade-card-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(130% 120% at 50% -10%, color-mix(in srgb, var(--card-accent) 60%, transparent) 0%, transparent 58%),
        linear-gradient(160deg, color-mix(in srgb, var(--card-accent) 22%, var(--bs-card-bg)) 0%, var(--bs-card-bg) 100%);
}

.arcade-card-cover::after {
    /* subtle dotted texture */
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--card-accent) 45%, transparent) 0 1px, transparent 1.5px);
    background-size: 18px 18px;
    opacity: .25;
}

.arcade-card-glyph {
    position: relative;
    font-size: 2.9rem;
    line-height: 1;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .25));
    transition: transform .25s ease;
}

.arcade-card.is-available:hover .arcade-card-glyph { transform: scale(1.12) rotate(-4deg); }

.arcade-card-cover img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.arcade-card-body {
    padding: .8rem .9rem .95rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    flex: 1 1 auto;
}

.arcade-card-title {
    font-weight: 700;
    font-size: 1.02rem;
    margin: 0;
    color: var(--bs-heading-color, var(--bs-gray-900));
    display: flex;
    align-items: center;
    gap: .4rem;
}

.arcade-card-tagline {
    color: var(--bs-text-muted);
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.4;
    flex: 1 1 auto;
}

.arcade-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .55rem;
}

.arcade-play-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    border: 0;
    border-radius: .6rem;
    padding: .48rem .9rem;
    font-weight: 700;
    font-size: .85rem;
    color: #fff;
    background: var(--card-accent);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--card-accent) 45%, transparent);
    transition: gap .2s ease, filter .2s ease;
}

/* keep the arrow the same crisp white as the label (it was picking up a stray colour) */
.arcade-play-btn > i { color: #fff; line-height: 1; }

.arcade-card.is-available:hover .arcade-play-btn { gap: .7rem; filter: brightness(1.06); }

/* Launcher tile that isn't clickable yet — the vs-opponent games before the realtime
   socket connects. site.js removes `.disabled` once connected, re-enabling the card. */
.arcade-card.disabled {
    opacity: .5;
    pointer-events: none;
    filter: grayscale(.4);
}

/* ---------- Home page ---------- */
/* force white on the coloured hero — Bootstrap's `h1 { color: var(--bs-heading-color) }`
   otherwise paints it dark and it vanishes on the light theme. */
.home-hero h1 { font-size: clamp(1.55rem, 3.6vw, 2.5rem); color: #fff; }
.home-hero p { max-width: 660px; }
.home-hero-cta { box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
/* Reclaim vertical space on phones — hide the hero subtitle (kept on desktop). */
@media (max-width: 767.98px) { .home-hero p { display: none; } }

/* "site is alive" online badge — a softly pulsing green dot + live count.
   Self-contained pill so it reads on a light card (it now lives in the vs panel). */
.home-online-badge {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .3rem .7rem; border-radius: 999px;
    font-weight: 600; font-size: .85rem;
    background: color-mix(in srgb, #36d97b 14%, var(--bs-card-bg));
    border: 1px solid color-mix(in srgb, #36d97b 38%, var(--bs-border-color));
    color: var(--bs-body-color);
}
.home-online-badge b { color: #17a558; font-weight: 800; }
.home-online-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #36d97b; display: inline-block;
    box-shadow: 0 0 0 0 rgba(54, 217, 123, .6);
    animation: home-online-pulse 1.9s ease-out infinite;
}
@keyframes home-online-pulse {
    0% { box-shadow: 0 0 0 0 rgba(54, 217, 123, .55); }
    70% { box-shadow: 0 0 0 7px rgba(54, 217, 123, 0); }
    100% { box-shadow: 0 0 0 0 rgba(54, 217, 123, 0); }
}

/* Mini-games group label + note — full-width flex items that break the launcher grid
   so the mini-games read as a clearly-separate group below the solo crosswords. */
.arcade-grid-label {
    flex: 0 0 100%;
    display: flex; align-items: center; gap: .5rem;
    margin-top: .85rem; padding-top: .95rem;
    border-top: 1px dashed var(--bs-border-color);
    font-weight: 700; font-size: .95rem;
    color: var(--bs-gray-700, var(--bs-body-color));
}
.arcade-grid-note {
    flex: 0 0 100%;
    text-align: center; margin-top: .15rem;
    color: var(--bs-text-muted); font-size: .82rem; font-weight: 500;
}
/* On phones the launcher is a horizontal slider, so the full-width label/note can't sit
   inside the track — hide them. Declared AFTER the base rules above to win the cascade. */
@media (max-width: 767.98px) {
    .arcade-grid-label, .arcade-grid-note { display: none; }
}

/* The "play vs opponent" panel — the site's signature mode, visually highlighted. */
.vs-panel {
    position: relative;
    border: 1.5px solid color-mix(in srgb, #F1416C 38%, var(--bs-border-color));
    box-shadow: 0 0 0 1px color-mix(in srgb, #F1416C 14%, transparent),
                0 22px 48px -24px color-mix(in srgb, #F1416C 55%, transparent);
}
.vs-panel::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: radial-gradient(120% 55% at 50% 0%, color-mix(in srgb, #F1416C 14%, transparent) 0%, transparent 62%);
}
.vs-panel > * { position: relative; }
.vs-panel-title { color: #F1416C; }

/* Coming-soon variant */
.arcade-card.is-soon { cursor: default; }
.arcade-card.is-soon .arcade-card-cover { filter: grayscale(.5) opacity(.85); }
.arcade-card.is-soon .arcade-card-title { color: var(--bs-gray-700); }

.arcade-soon-badge {
    position: absolute;
    top: .85rem;
    right: .85rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: rgba(var(--bs-dark-rgb, 30, 30, 45), .72);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .32rem .65rem;
    border-radius: 999px;
    text-transform: uppercase;
    backdrop-filter: blur(3px);
}

/* ---------- Embedded game stage (launch page) ---------- */

.game-stage {
    --game-accent: var(--bs-info);
    max-width: 1024px;
    margin: 0 auto;
}

.game-stage-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

.game-stage-back,
.game-stage-fs {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .9rem;
    border-radius: .7rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--bs-text-muted);
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    transition: color .15s ease, border-color .15s ease, background .15s ease;
    cursor: pointer;
}

.game-stage-back:hover,
.game-stage-fs:hover {
    color: var(--game-accent);
    border-color: color-mix(in srgb, var(--game-accent) 50%, var(--bs-border-color));
}

.game-stage-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bs-heading-color, var(--bs-gray-900));
}

.game-stage-glyph { font-size: 1.5rem; line-height: 1; }

.game-frame-wrap {
    position: relative;
    /* cap the width so the frame's height (= width / aspect) fits the viewport — this lets
       PORTRAIT games (aspect < 1) show as a centred column on desktop instead of overflowing,
       while landscape games are unaffected. On phones we fill the width (see media query). */
    width: min(100%, calc((100dvh - 9rem) * var(--game-aspect, 1.422)));
    margin-inline: auto;
    aspect-ratio: var(--game-aspect, 1.422);
    border-radius: 1.15rem;
    overflow: hidden;
    background: #0c0c12;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--game-accent) 45%, transparent),
        0 22px 60px rgba(0, 0, 0, .3);
}

.game-frame-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 2;
    box-shadow: inset 0 0 60px color-mix(in srgb, var(--game-accent) 22%, transparent);
}

.game-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    z-index: 1;
}

.game-stage-foot {
    margin-top: 1rem;
    text-align: center;
    font-size: .92rem;
    font-weight: 500;
    color: var(--bs-text-muted);
}

/* On phones/tablets fill the screen width (portrait games go edge-to-edge). */
@media (max-width: 767.98px) {
    .game-stage { max-width: 100%; }
    .game-frame-wrap { width: 100%; }
}

@media (max-width: 575.98px) {
    /* keep the game name on small screens; drop the glyph instead (it's tight up there) */
    .game-stage-glyph { display: none; }
    .game-stage-back span { display: none; }
}

/* ── Store (Κατάστημα) — prestige badges ─────────────────────────────────── */

.store-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.store-card {
    --card-accent: var(--bs-info);
    flex: 1 1 180px;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid color-mix(in srgb, var(--card-accent) 30%, var(--bs-border-color));
    background:
        radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--card-accent) 22%, transparent) 0%, transparent 60%),
        var(--bs-card-bg);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.store-card.is-equipped {
    border-color: color-mix(in srgb, var(--card-accent) 70%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-accent) 45%, transparent),
                0 12px 28px -14px color-mix(in srgb, var(--card-accent) 60%, transparent);
}

.store-card-glyph {
    font-size: 3.2rem;
    line-height: 1;
    margin-bottom: .6rem;
    filter: drop-shadow(0 3px 6px color-mix(in srgb, var(--card-accent) 50%, transparent));
}

.store-card-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--bs-text-gray-800, var(--bs-body-color));
}

.store-card-price {
    margin: .15rem 0 .9rem;
    font-weight: 600;
    color: var(--card-accent);
}
.store-card-price i { color: var(--card-accent); }

.store-action {
    width: 100%;
    font-weight: 700;
    color: #fff;
    border: none;
}
.store-action.store-buy {
    background: var(--card-accent);
}
.store-action.store-buy i { color: #fff; }
.store-action.store-buy:hover { filter: brightness(1.06); color: #fff; }
.store-action.store-equip {
    background: color-mix(in srgb, var(--card-accent) 16%, var(--bs-secondary));
    color: var(--bs-body-color);
}
.store-action.store-equip:hover { background: color-mix(in srgb, var(--card-accent) 30%, var(--bs-secondary)); }
.store-action.store-on {
    background: color-mix(in srgb, var(--card-accent) 22%, transparent);
    color: var(--card-accent);
    cursor: default;
}

/* ── Home members showcase — the "who owns badges" strip ──────────────────── */
.store-showcase {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.showcase-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .9rem;
    background: color-mix(in srgb, var(--bs-info) 10%, var(--bs-card-bg));
    border: 1px solid var(--bs-border-color);
}
.showcase-chip .chip-glyph { font-size: 1.15rem; line-height: 1; }
.showcase-chip .chip-name { color: var(--bs-text-gray-800, var(--bs-body-color)); }
