#games-studio-page.games-studio-page {
    padding-top: 20px;
}

#games-studio-page .games-studio-container {
    max-width: 1380px;
}

#games-studio-page .games-studio-hero {
    overflow: hidden;
    margin-bottom: 24px;
    border-radius: 32px;
    background:
        radial-gradient(circle at top right, rgba(124, 121, 184, 0.16), transparent 28%),
        radial-gradient(circle at bottom left, rgba(124, 121, 184, 0.08), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f9fafe 100%);
}

#games-studio-page .games-studio-hero-body {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
    gap: 28px;
    align-items: end;
    padding: 30px 32px;
}

#games-studio-page .games-studio-header {
    margin-bottom: 0;
}

#games-studio-page .games-studio-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

#games-studio-page .games-studio-header h1 {
    margin: 0 0 12px;
    font-size: clamp(2.7rem, 4vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
    color: var(--text);
}

#games-studio-page .games-studio-header p {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.72;
}

#games-studio-page .games-studio-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

#games-studio-page .games-hero-stat {
    padding: 18px 18px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(34, 42, 70, 0.05);
}

#games-studio-page .games-hero-stat span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#games-studio-page .games-hero-stat strong {
    color: var(--text);
    font-size: 1.9rem;
    line-height: 1;
}

#games-studio-page .games-toolbar-shell {
    position: static;
    margin-bottom: 24px;
    padding-top: 0;
}

#games-studio-page .games-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 14px;
    border: 1px solid rgba(226, 230, 240, 0.92);
    border-radius: 30px;
    background: rgba(245, 247, 252, 0.72);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 22px rgba(34, 42, 70, 0.06);
}

#games-studio-page .games-filter-card,
#games-studio-page .games-search-card {
    border-radius: 24px;
    overflow: hidden;
}

#games-studio-page .games-filter-card .card-body,
#games-studio-page .games-search-card .card-body {
    height: 100%;
    padding: 22px;
    box-sizing: border-box;
}

#games-studio-page .games-filter-heading {
    margin-bottom: 14px;
}

#games-studio-page .games-filter-heading h3 {
    margin: 0 0 6px;
    display: block;
    color: var(--text);
    font-size: 1.06rem;
    font-weight: 800;
}

#games-studio-page .games-filter-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.55;
}

#games-studio-page .games-search-difficulty-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(280px, 0.95fr);
    gap: 20px;
    align-items: center;
}

#games-studio-page .games-search-panel,
#games-studio-page .games-difficulty-panel {
    min-width: 0;
}

#games-studio-page .games-search-panel {
    display: grid;
    gap: 12px;
}

#games-studio-page .games-filter-divider {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, rgba(219, 224, 239, 0.2) 0%, rgba(219, 224, 239, 0.95) 50%, rgba(219, 224, 239, 0.2) 100%);
}

#games-studio-page .games-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#games-studio-page .games-chip {
    appearance: none;
    border: 1px solid var(--border);
    background: #f4f5fb;
    color: #5f6488;
    border-radius: 999px;
    padding: 10px 15px;
    font-weight: 700;
    font-size: 0.94rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.18s ease;
}

#games-studio-page .games-chip.active,
#games-studio-page .games-chip:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 8px 18px rgba(124, 121, 184, 0.18);
}

#games-studio-page .games-summary-card {
    margin-bottom: 24px;
}

#games-studio-page .games-search-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#games-studio-page .games-summary-card .pronunciation-results-body {
    gap: 16px;
}

#games-studio-page .games-summary-card .pronunciation-results-left strong {
    font-size: 1.35rem;
    line-height: 1;
}

#games-studio-page .games-summary-card .pronunciation-results-left span {
    color: var(--muted);
    font-size: 0.96rem;
}

#games-studio-page .games-reset-button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border);
    font-weight: 700;
}

#games-studio-page .games-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

#games-studio-page .games-studio-card {
    border-radius: 28px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    height: 100%;
}

#games-studio-page .games-studio-card:hover,
#games-studio-page .games-studio-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(34, 42, 70, 0.1);
    border-color: rgba(124, 121, 184, 0.28);
}

#games-studio-page .games-studio-card:focus-visible {
    outline: 3px solid rgba(124, 121, 184, 0.2);
    outline-offset: 2px;
}

#games-studio-page .games-studio-card-inner {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    height: 100%;
    box-sizing: border-box;
}

#games-studio-page .games-studio-card-media {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(124, 121, 184, 0.13);
    background:
        radial-gradient(circle at 30% 25%, var(--apq-theme-from), transparent 55%),
        radial-gradient(circle at 80% 80%, var(--apq-theme-to), transparent 50%),
        linear-gradient(135deg, #ffffff 0%, #f7f8fd 100%);
}

#games-studio-page .games-studio-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#games-studio-page .games-studio-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    text-align: center;
}

#games-studio-page .games-studio-card-placeholder-emoji {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(124, 121, 184, 0.18);
    font-size: 2.4rem;
    line-height: 1;
    box-shadow: 0 12px 22px rgba(42, 48, 80, 0.08);
}

/* Topic icon on the no-poster placeholder tile (replaces the old emoji). */
#games-studio-page .games-placeholder-icon { color: var(--primary); }

#games-studio-page .games-studio-card-placeholder-label {
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(124, 121, 184, 0.16);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

#games-studio-page .games-studio-edit-button {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(124, 121, 184, 0.22);
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.82rem;
    box-shadow: 0 10px 18px rgba(42, 48, 80, 0.08);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

#games-studio-page .games-studio-edit-button:hover {
    transform: translateY(-1px);
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

#games-studio-page .games-studio-card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    flex-grow: 1;
}

#games-studio-page .games-studio-card-title {
    margin: 0;
    font-size: 1.32rem;
    line-height: 1.18;
    color: var(--text);
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

#games-studio-page .games-studio-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#games-studio-page .games-studio-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(124, 121, 184, 0.12);
    color: var(--primary);
    font-weight: 900;
    font-size: 0.95rem;
}

#games-studio-page .game-open-hint {
    margin: 0;
}

#games-studio-page .games-open-arrow {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 10px 18px rgba(124, 121, 184, 0.22);
    transition: transform 180ms ease;
}

#games-studio-page .games-studio-card:hover .games-open-arrow {
    transform: translateX(2px);
}

/* The old `games-studio-topic-tag` class is still used by some other
   templates (course builder) — keep its rule intact below in this file. */
#games-studio-page .games-studio-topic-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f1f2fb;
    border: 1px solid #d9ddea;
    color: #5f63a5;
    font-size: 0.86rem;
    font-weight: 700;
}

#games-studio-page #games-empty-state {
    margin-top: 12px;
}

@media (max-width: 1240px) {
    #games-studio-page .games-studio-hero-body,
        #games-studio-page .games-toolbar {
            grid-template-columns: 1fr;
        }

    #games-studio-page .games-search-difficulty-body {
            grid-template-columns: 1fr;
        }

    #games-studio-page .games-filter-divider {
            display: none;
        }

    #games-studio-page .games-toolbar-shell {
            position: static;
        }
}

@media (max-height: 860px) {
    #games-studio-page .games-toolbar-shell {
            position: static;
            padding-top: 0;
        }
}

@media (max-width: 1180px) {
    #games-studio-page .games-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
}

@media (max-width: 860px) {
    #games-studio-page .games-grid {
            grid-template-columns: 1fr;
        }

    #games-studio-page .games-studio-card-media {
            height: 200px;
        }
}

@media (max-width: 640px) {
    #games-studio-page .games-studio-hero-body,
        #games-studio-page .games-filter-card .card-body,
        #games-studio-page .games-search-card .card-body,
        #games-studio-page .games-studio-card-inner {
            padding: 18px;
        }

    #games-studio-page .games-studio-header h1 {
            font-size: 2.35rem;
        }

    #games-studio-page .games-studio-hero-stats {
            grid-template-columns: 1fr;
        }

    #games-studio-page .games-studio-card-media {
            height: 170px;
        }

    #games-studio-page .games-studio-card-title {
            font-size: 1.2rem;
        }

    #games-studio-page .games-studio-card-bottom {
            align-items: center;
        }
}

/* "Show more" under the windowed grid — same pattern as the Pronunciation
   Studio's load-more row. */
.games-loadmore {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 26px;
}

.games-loadmore .button-secondary {
    min-height: 46px;
    padding: 10px 26px;
    border-radius: 999px;
    font-weight: 700;
}

.games-loadmore [data-loadmore-count] {
    font-size: 0.9rem;
}
