/* Gaming module styles only. Page chrome (topbar, sidebar, footer, cookiebox,
   theme variables, base reset) comes from the shared shell stylesheet served by
   account (/api/shell/css/style.css), which is loaded before this file.
   Prefix: gm- (overview); the Imposter game has its own file, imposter.css. */

.text-muted { color: var(--text-muted); }

.gaming-panel[hidden],
[data-gated][hidden] { display: none !important; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}

.card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
}
.btn:hover { filter: brightness(1.1); }

/* ---- Overview hero ------------------------------------------------------------------------ */

.gm-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    padding: 2rem 2rem 1.8rem;
    margin-bottom: 1.25rem;
    background: radial-gradient(120% 140% at 0% 0%, rgba(139, 92, 246, 0.35), transparent 55%),
        radial-gradient(120% 140% at 100% 100%, rgba(217, 70, 239, 0.25), transparent 55%), var(--bg-card);
    border: 1px solid var(--border-soft);
}

.gm-hero h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.gm-hero p {
    margin: 0;
    color: var(--text-muted);
    max-width: 38rem;
}

.gm-hero__shapes span {
    position: absolute;
    border-radius: 30%;
    opacity: 0.55;
    filter: blur(0.5px);
    animation: gm-float 9s ease-in-out infinite;
    pointer-events: none;
}
.gm-hero__shapes span:nth-child(1) { width: 46px; height: 46px; right: 8%; top: 18%; background: #22d3ee; animation-delay: -2s; }
.gm-hero__shapes span:nth-child(2) { width: 28px; height: 28px; right: 22%; top: 58%; background: #f472b6; border-radius: 50%; animation-delay: -5s; }
.gm-hero__shapes span:nth-child(3) { width: 36px; height: 36px; right: 3%; top: 62%; background: #facc15; transform: rotate(20deg); animation-delay: -1s; }
.gm-hero__shapes span:nth-child(4) { width: 20px; height: 20px; right: 32%; top: 14%; background: #a78bfa; border-radius: 50%; animation-delay: -7s; }

@keyframes gm-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-14px) rotate(14deg); }
}

/* ---- Toolbar: search, filters, sort --------------------------------------------------------- */

.gm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.9rem;
}

.gm-search {
    position: relative;
    flex: 1 1 240px;
    min-width: 0;
}

.gm-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
}

.gm-search input {
    width: 100%;
    height: 42px;
    padding: 0 38px 0 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
    color: var(--text-main);
    font: inherit;
}
.gm-search input:focus { outline: 2px solid var(--accent-purple); outline-offset: 1px; }

.gm-search__clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}
.gm-search__clear:hover { background: var(--bg-panel-hover); color: var(--text-main); }

.gm-tool-btn,
.gm-sort select {
    height: 42px;
    padding: 0 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
    color: var(--text-main);
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.gm-tool-btn:hover { border-color: var(--accent-purple); }
.gm-tool-btn[aria-expanded='true'] { border-color: var(--accent-purple); background: rgba(139, 92, 246, 0.12); }
.gm-tool-btn svg { width: 17px; height: 17px; }

.gm-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent-purple);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.gm-badge[hidden] { display: none; }

.gm-sort { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-muted); font-size: 0.85rem; }

.gm-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.4rem;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: var(--bg-card);
    animation: gm-drop 0.22s ease;
}
.gm-filters[hidden] { display: none; }

@keyframes gm-drop {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.gm-filter__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.5rem;
}

.gm-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.gm-chip {
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.gm-chip:hover { color: var(--text-main); border-color: var(--accent-purple); }
.gm-chip[aria-pressed='true'] { background: var(--accent-purple); border-color: var(--accent-purple); color: #fff; }

.gm-players {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.gm-players input[type='range'] { flex: 1; accent-color: var(--accent-purple); }
.gm-players output { min-width: 6.5rem; font-weight: 700; font-size: 0.9rem; }

.gm-filters__foot {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
}
.gm-link-btn {
    border: none;
    background: none;
    color: var(--accent-purple);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.gm-count { color: var(--text-faint); font-size: 0.85rem; margin: 0 0 0.8rem; }

/* ---- Game tiles -------------------------------------------------------------------------------- */

.gm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.1rem;
}

.gm-tile {
    --tile-a: #8b5cf6;
    --tile-b: #d946ef;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 330px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 0.25s, border-color 0.25s;
    animation: gm-tile-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.gm-tile:hover,
.gm-tile:focus-visible {
    transform: translateY(-6px) rotate(-0.6deg);
    border-color: var(--tile-a);
    box-shadow: 0 18px 40px -18px var(--tile-a);
    outline: none;
}

@keyframes gm-tile-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.gm-tile__art {
    position: relative;
    height: 170px;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.25), transparent 45%),
        linear-gradient(135deg, var(--tile-a), var(--tile-b));
    overflow: hidden;
}

.gm-tile__art::before,
.gm-tile__art::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}
.gm-tile__art::before { width: 180px; height: 180px; left: -50px; bottom: -90px; }
.gm-tile__art::after { width: 110px; height: 110px; right: -30px; top: -40px; }

.gm-tile__emoji {
    position: relative;
    font-size: 4.2rem;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.5);
}
.gm-tile:hover .gm-tile__emoji { transform: scale(1.12) rotate(-8deg); }

.gm-tile__new {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gm-tile__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem 1.15rem 1.15rem;
}

.gm-tile__name { margin: 0; font-size: 1.3rem; font-weight: 800; }
.gm-tile__tagline { margin: 0; color: var(--text-muted); font-size: 0.9rem; flex: 1; }

.gm-tile__meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.gm-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.gm-tile__play {
    margin-top: 0.4rem;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--tile-a), var(--tile-b));
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.gm-empty {
    text-align: center;
    padding: 3rem 1rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}
.gm-empty h2 { color: var(--text-main); margin: 0 0 0.3rem; font-size: 1.1rem; }
.gm-empty[hidden] { display: none; }

@media (max-width: 600px) {
    .gm-hero { padding: 1.4rem 1.2rem; }
    .gm-sort { flex: 1; }
    .gm-sort select { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .gm-hero__shapes span,
    .gm-tile,
    .gm-filters { animation: none; }
    .gm-tile,
    .gm-tile__emoji { transition: none; }
}
