/* ═══════════════════════════════════════════════════════════════════════════
   Games screen (Home/MainWorldIndex) — calm look that matches the Dashboard:
   warm off-white, thin frames, one soft accent per training type.
   Scoped to .gp-tabs (the tabs bar) and .gp (the content), because
   GameLayout.css is shared with other pages. Loaded after GameLayout.css.
   Mockup: https://claude.ai/artifact/CXJtPGdfuAyMyNLEzcZun6
   ═══════════════════════════════════════════════════════════════════════════ */

body:has(main.gp) { background: #F7F6F3; }

/* One accent per training type: --acc text/solid, --acc-bg soft fill, --acc-line frame */
.gp-tabs .tb, .gp [data-cat="basis"]     { --acc: #5B3FC4; --acc-bg: #F3F0FC; --acc-line: #D2C8F3; }
.gp-tabs .ts, .gp [data-cat="strategy"]  { --acc: #2A5AA8; --acc-bg: #EEF3FA; --acc-line: #C5D5EE; }
.gp-tabs .tr, .gp [data-cat="retrieval"] { --acc: #1D6F62; --acc-bg: #ECF5F2; --acc-line: #BFDDD5; }
.gp-tabs .tp, .gp [data-cat="problem"]   { --acc: #8F5A0E; --acc-bg: #FAF3E6; --acc-line: #EBD5AE; }
.gp-tabs .ta                             { --acc: #1C1B22; --acc-bg: #F3F2EF; --acc-line: #DDDAD3; }

/* ── Tabs bar ─────────────────────────────────────────────────────────────── */
.gp-tabs {
    background: #FFFFFF;
    border-bottom: 1px solid #E7E4DE;
    box-shadow: none;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
}
.gp-tabs .tab.tsr, .gp-tabs .tabs-search { display: none !important; } /* search removed (user decision Nov 2026) */
.gp-tabs .tab {
    height: 52px;
    padding: 0 20px;
    gap: 10px;
    border-radius: 14px;
    border: 1.5px solid var(--acc-line);
    background: var(--acc-bg);
    color: var(--acc);
    font-size: 1.12rem;
    font-weight: 700;
    box-shadow: none;
}
.gp-tabs .tab .tab-icon { width: 24px; height: 24px; border-radius: 0; background: transparent !important; color: var(--acc) !important; }
.gp-tabs .tab .tab-icon svg { width: 22px; height: 22px; stroke: currentColor; }
.gp-tabs .tab:hover { border-color: var(--acc); background: var(--acc-bg); color: var(--acc); transform: none; }
.gp-tabs .tab.on,
.gp-tabs .tab.on:hover { background: var(--acc); border-color: var(--acc); color: #FFFFFF; box-shadow: 0 6px 14px -8px var(--acc); }
.gp-tabs .tab.on .tab-icon { color: #FFFFFF !important; }

/* ── Category header ─────────────────────────────────────────────────────── */
.gp .cat-hd {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #E7E4DE;
    border-radius: 0;
    padding: 0 0 22px;
    margin-bottom: 26px;
    gap: 18px;
}
.gp .cat-hd-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--acc-bg) !important; border: 1.5px solid var(--acc-line); }
.gp .cat-hd-icon svg { width: 32px; height: 32px; stroke: var(--acc) !important; color: var(--acc) !important; }
.gp .cat-hd-info { flex: 0 1 auto; }
.gp .cat-hd-name { color: #1C1B22 !important; font-size: 1.9rem; font-weight: 800; letter-spacing: 0; }
.gp .cat-hd-desc { color: #45424D !important; font-size: 1.1rem; font-weight: 500; }
.gp .cat-hd-pill { background: transparent !important; color: #5E5B66 !important; font-size: 1.08rem; font-weight: 600; padding: 0; margin-inline-start: 4px; align-self: flex-start; margin-top: 10px; }
.gp .cat-info-btn {
    margin-inline-start: auto;
    width: 44px; height: 44px;
    border: 1.5px solid #C9C4D8;
    background: #FFFFFF;
    color: #45424D;
    font-size: 1.2rem; font-weight: 700;
    opacity: 1;
}
.gp .cat-info-btn:hover { border-color: var(--acc); color: var(--acc); transform: none; }

/* ── Grid + card ─────────────────────────────────────────────────────────── */
.gp .grid { gap: 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gp .card {
    background: #FFFFFF;
    border: 2px solid #DCD8E6;
    border-radius: 18px;
    padding: 10px;
    overflow: visible;
    box-shadow: 0 1px 2px rgba(28,27,34,.06), 0 6px 16px -10px rgba(28,27,34,.22);
}
.gp .card:hover {
    transform: translateY(-2px);
    border-color: var(--acc, #6F68C9);
    box-shadow: 0 12px 28px -18px rgba(55,48,163,.45);
}
.gp .card-top {
    height: auto;
    aspect-ratio: 3 / 2;
    border-radius: 12px;
    overflow: hidden;
    background: #1d1a3a;
}
.gp .card-top--art::after { display: none; }
.gp .card:hover .card-art { transform: scale(1.04); }
.gp .play-btn { display: none; }

.gp .card-body { padding: 14px 8px 4px; gap: 12px; }
.gp .card-title { margin: 0; font-size: 1.38rem; font-weight: 800; color: #1C1B22; letter-spacing: 0; }

/* meta row: time · level (built by MainWorldIndex.js) */
.gp .gp-meta { display: flex; align-items: center; gap: 8px; font-size: 1.04rem; font-weight: 500; color: #5E5B66; }
.gp .gp-meta svg { width: 18px; height: 18px; flex: none; }
.gp .gp-meta .gp-level b { font-weight: 700; color: #45424D; }

/* footer: star score + achievements */
.gp .card-stats-row.gp-foot {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: auto 0 0;
    padding-top: 12px;
    border-top: 1px solid #EFEDE8;
}
.gp .gp-star {
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 12px 0 10px;
    border-radius: 10px;
    background: #F7F2E7; border: 1px solid #EADFC6;
    font-size: 1.1rem; font-weight: 800; color: #3B2F12;
}
.gp .gp-star svg { width: 22px; height: 22px; flex: none; }

.gp .cs-achv-btn.gp-achv {
    width: auto;
    margin: 0 0 0 0;
    margin-inline-start: auto;
    height: 44px;
    padding: 0 14px 0 12px;
    gap: 8px;
    border-radius: 12px;
    border: 1.5px solid var(--acc-line, #C9C4D8);
    background: var(--acc-bg, #FFFFFF);
    color: var(--acc, #3730A3);
    font-size: 1.04rem; font-weight: 700;
    letter-spacing: 0;
    text-shadow: none;
    box-shadow: none;
    animation: none;
    overflow: visible;
    transition: background .15s, border-color .15s;
}
.gp .cs-achv-btn.gp-achv::before,
.gp .cs-achv-btn.gp-achv::after { display: none; }
.gp .cs-achv-btn.gp-achv:hover { background: #FFFFFF; border-color: var(--acc); transform: none; box-shadow: none; }
.gp .cs-achv-btn.gp-achv svg { width: 24px; height: 24px; flex: none; animation: none; }

/* ── Collectible coin: smaller, minted ───────────────────────────────────── */
.gp .coin-badge,
.gp .fstl-coin-badge {
    top: 18px; right: 18px;
    width: 42px; height: 42px;
    border: 0;
    overflow: visible;
    background: radial-gradient(circle at 32% 28%, #FFF6C9 0 8%, #FFD95A 22%, #F2B21B 55%, #C98A0C 82%, #9A6406 100%);
    box-shadow:
        0 0 0 2px #FFF3C4,
        0 0 0 3.5px #B87A0A,
        0 0 14px 3px rgba(255,200,60,.55),
        0 4px 10px rgba(0,0,0,.35),
        inset 0 -3px 4px rgba(120,70,0,.45),
        inset 0 2px 3px rgba(255,255,255,.7);
    animation: gpCoinPulse 2.4s ease-in-out infinite;
}
.gp .coin-badge::before,
.gp .fstl-coin-badge::before {
    /* inner minted ring (replaces the shimmer sweep) */
    content: '';
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    width: auto; height: auto;
    border-radius: 50%;
    border: 1.5px solid rgba(140,85,0,.45);
    background: none;
    box-shadow: inset 0 1px 0 rgba(255,250,220,.6);
    animation: none;
}
.gp .coin-badge::after,
.gp .fstl-coin-badge::after {
    /* sparkle */
    content: '';
    inset: auto;
    top: -6px; left: -5px;
    width: 12px; height: 12px;
    border: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle, #fff 0 18%, transparent 20%),
        conic-gradient(from 45deg, transparent 0 10%, #fff 12% 13%, transparent 15% 35%, #fff 37% 38%, transparent 40% 60%, #fff 62% 63%, transparent 65% 85%, #fff 87% 88%, transparent 90%);
    filter: drop-shadow(0 0 3px #fff);
}
.gp .coin-badge:hover,
.gp .fstl-coin-badge:hover { filter: brightness(1.08); }
.gp .coin-badge-num,
.gp .fstl-coin-num { font-size: 1.08rem !important; font-weight: 900; color: #6B4300; text-shadow: 0 1px 0 rgba(255,240,190,.9); }
@keyframes gpCoinPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* ── Locked card (premium tier): light veil instead of the dark one ─────── */
.gp .card--locked .card-art { filter: grayscale(1) brightness(1.08); opacity: .5; }
.gp .card--locked:hover { transform: none; border-color: #DCD8E6; box-shadow: 0 1px 2px rgba(28,27,34,.06); }
.gp .card-lock-overlay {
    border-radius: 16px;
    background: rgba(247,246,243,.74);
    box-shadow: none;
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    gap: 10px;
}
.gp .card--locked .card-body > * { visibility: hidden; } /* the veil already names the game */
.gp .clo-lock { filter: none !important; font-size: 2.1rem; }
.gp .clo-name { color: #1C1B22; font-size: 1.25rem; }
.gp .clo-pts { color: #45424D; font-size: 1rem; }
.gp .clo-pts strong { color: #1C1B22; }
.gp .clo-silver .clo-tier { color: #3B4252; background: #EEF0F4; border: 1.5px solid #C9CED8; text-shadow: none; box-shadow: none; }
.gp .clo-gold   .clo-tier { color: #7A4E06; background: #FAF1DC; border: 1.5px solid #E6CC8F; text-shadow: none; box-shadow: none; }

/* ── Phone ───────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .gp .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    /* minmax(0,…) so a card's content can never push the grid wider than the screen */
    .gp .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gp .card, .gp .card-body { min-width: 0; }
    .gp .card-title { overflow-wrap: anywhere; }
    /* five tabs must all show: wrap into centred rows instead of overflowing */
    .gp-tabs { padding: 12px 12px; gap: 8px; }
    .gp-tabs .tab { height: 44px; padding: 0 13px; font-size: 1rem; gap: 6px; }
    .gp-tabs .tab .tab-icon { display: none; }

    .gp .cat-hd { gap: 12px; padding-bottom: 16px; margin-bottom: 18px; }
    .gp .cat-hd-icon { width: 52px; height: 52px; border-radius: 14px; }
    .gp .cat-hd-icon svg { width: 26px; height: 26px; }
    .gp .cat-hd-name { font-size: 1.45rem; }
    .gp .cat-hd-desc { font-size: 1rem; }
    .gp .cat-hd-pill { display: none; }

    .gp .grid { gap: 12px; }
    .gp .card { padding: 6px; border-radius: 16px; }
    .gp .card-top { height: auto; border-radius: 11px; }
    .gp .card-body { padding: 10px 4px 4px; gap: 8px; }
    .gp .card-title { font-size: 1.12rem; }
    .gp .gp-meta { font-size: .95rem; }
    .gp .gp-meta .gp-time { display: none; }
    .gp .card-stats-row.gp-foot { padding-top: 8px; gap: 6px; }
    .gp .gp-star { height: 34px; padding: 0 8px 0 7px; font-size: 1rem; gap: 4px; }
    .gp .gp-star svg { width: 18px; height: 18px; }
    .gp .cs-achv-btn.gp-achv { width: 40px; height: 40px; padding: 0; justify-content: center; }
    .gp .cs-achv-btn.gp-achv .gp-achv-label { display: none; }
    .gp .coin-badge, .gp .fstl-coin-badge { top: 12px; right: 12px; width: 34px; height: 34px; }
    .gp .coin-badge-num, .gp .fstl-coin-num { font-size: .95rem !important; }
}
@media (max-width: 380px) {
    .gp-tabs .tab { padding: 0 10px; font-size: .95rem; }
}
