/* Light lobby: white surfaces on a cool grey page, one solid blue, squared chips, flat buttons,
   tight Inter headings. Sets the palette, then restyles the shared components and styles the
   markup of this skin's own partials (ga-*). */

:root {
    /* Surfaces */
    --bg-0:        #f6f8fc;            /* page */
    --bg-1:        #ffffff;            /* cards, menus */
    --bg-2:        #ffffff;            /* inputs, triggers */
    --bg-glass:    #ffffff;            /* top bar */
    --bg-muted:    #f1f5f9;
    --border:      #e2e8f0;
    --border-2:    #cbd5e1;
    --hover-wash:  #f1f5f9;
    --shade-rgb:   15, 23, 42;
    --hero-fallback: linear-gradient(135deg, #dbeafe, #bfdbfe);

    /* Brand */
    --accent:      #1f5fd6;
    --accent-rgb:  31, 95, 214;
    --accent-2:    #3d82f6;
    --accent-2-rgb: 61, 130, 246;
    --accent-hover: #1a50b5;
    --accent-dim:  #eff4ff;
    --accent-line: #d6e2fb;
    --accent-glow: transparent;
    --gold:        #f59e0b;
    --gold-rgb:    245, 158, 11;
    --gold-dim:    #fffbeb;
    --mark-ink:    #ffffff;
    --mark-fill:   linear-gradient(145deg, #3d82f6, #1f5fd6);

    /* Semantic */
    --good:        #16a34a;
    --bad:         #dc2626;

    /* Type */
    --text:        #0f172a;
    --text-2:      #334155;
    --text-dim:    #64748b;
    --font-ui:     'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --tracking-tight: -0.02em;

    /* Geometry */
    --r-sm:  8px;
    --r-md:  12px;
    --r-lg:  16px;
    --r-tag: 4px;
    --header-h: 64px;
    --lift-shadow: 0 14px 30px -14px rgba(15, 23, 42, .28);
    --menu-shadow: 0 16px 36px -12px rgba(15, 23, 42, .22);
}

h1, h2, h3 { letter-spacing: var(--tracking-tight); }

/* ── Top bar ─────────────────────────────────────────────────────────── */

.site-header {
    background: var(--bg-glass);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--border);
    padding: 0 clamp(1rem, 3vw, 2rem);
}

.ga-header__brand {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.logo {
    gap: .6rem;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
}

.logo__mark {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--mark-fill);
    color: var(--mark-ink);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
}

.env-badge {
    border-radius: var(--r-tag);
    background: var(--accent-dim);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    letter-spacing: .08em;
    padding: .2rem .45rem;
}

.header-tools { gap: .5rem; }

.picker__trigger,
.user-menu__trigger {
    height: 36px;
    border-radius: var(--r-sm);
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
}
.picker__trigger { padding: 0 .65rem; }
.user-menu__trigger { padding: 0 .55rem 0 .3rem; }
.picker__trigger:hover,
.user-menu__trigger:hover {
    background: var(--bg-muted);
    border-color: var(--border-2);
}
.picker.is-open .picker__trigger,
.user-menu.is-open .user-menu__trigger {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15);
}
.picker.is-open .picker__chev { color: var(--accent); }

.picker__menu {
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--menu-shadow);
}
.picker__item { color: var(--text-2); }
.picker__item.is-active { background: var(--accent-dim); color: var(--accent); }
.picker__item.is-active .picker__name { color: var(--accent); }

.user-menu__avatar {
    width: 26px; height: 26px;
    border-radius: 6px;
    background: var(--accent-dim);
    color: var(--accent);
}

/* The balance is a labelled figure, set off from the pickers by a rule. */
.balance-badge {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0 .9rem;
    margin-left: .25rem;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    background: none;
    line-height: 1.2;
}
.balance-badge__label {
    font-size: .62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-dim);
}
.balance-badge__figure {
    display: inline-flex;
    align-items: baseline;
    gap: .3rem;
}
.balance-badge__amount { color: var(--text); font-size: .98rem; font-weight: 700; }
.balance-badge__currency { color: var(--text-dim); font-size: .68rem; opacity: 1; }

/* ── Buttons: solid, flat ────────────────────────────────────────────── */

.btn { border-radius: var(--r-sm); }
.btn:hover { filter: none; }

.btn-play,
.btn-signin {
    background: var(--accent);
    color: #fff;
    box-shadow: none;
}
.btn-play:hover,
.btn-signin:hover { background: var(--accent-hover); }

.btn-signin {
    border-radius: var(--r-sm);
    padding: .5rem 1rem;
    font-size: .85rem;
}

.btn-demo {
    background: var(--bg-1);
    border: 1px solid var(--border-2);
    color: var(--text);
}
.btn-demo:hover { background: var(--bg-muted); }

.btn-outline {
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline:hover { background: var(--accent-dim); }

/* ── Page ────────────────────────────────────────────────────────────── */

.main {
    max-width: 1240px;
    padding-top: 2rem;
}

/* ── Hero: split card ────────────────────────────────────────────────── */

.ga-hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 1.5rem;
    padding: 1.25rem;
    margin-bottom: 2rem;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}

.ga-hero__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: .6rem;
    padding: 1.25rem .5rem 1.25rem 1rem;
}

.ga-hero__eyebrow {
    border-radius: var(--r-tag);
    background: var(--accent-dim);
    color: var(--accent);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .25rem .5rem;
}

.ga-hero__title {
    font-size: clamp(1.7rem, 3.2vw, 2.5rem);
    font-weight: 800;
    line-height: 1.08;
    color: var(--text);
}

.ga-hero__provider {
    color: var(--text-dim);
    font-size: .95rem;
    margin-bottom: .6rem;
}

.ga-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}
.ga-hero__actions .btn { padding: .7rem 1.3rem; font-size: .9rem; }

.ga-hero__art {
    min-height: 240px;
    display: grid;
    place-items: center;
    border-radius: var(--r-md);
    background-color: var(--bg-muted);
    background-size: cover;
    background-position: center;
}

/* A game without a backdrop shows its cover framed on the gradient. */
.ga-hero__cover {
    display: block;
    width: min(190px, 55%);
    aspect-ratio: 1;
    border-radius: var(--r-md);
    box-shadow: 0 18px 40px -16px rgba(var(--shade-rgb), .45);
}

/* ── Categories: squared chips ───────────────────────────────────────── */

.ga-categories {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    margin-bottom: 1.25rem;
}

.ga-categories__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.ga-categories__list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.ga-chip {
    border-radius: var(--r-tag);
    border: 1px solid var(--border);
    background: var(--bg-1);
    color: var(--text-2);
    font: inherit;
    font-size: .84rem;
    font-weight: 600;
    padding: .45rem .8rem;
    cursor: pointer;
    transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.ga-chip:hover { border-color: var(--accent); color: var(--accent); }
.ga-chip.is-on {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── Toolbar ─────────────────────────────────────────────────────────── */

.toolbar__search input {
    border-radius: var(--r-sm);
    border-color: var(--border);
    background: var(--bg-1);
}
.toolbar__search input:focus { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.toolbar__clear { border-radius: var(--r-tag); background: var(--bg-muted); color: var(--text-2); }
.toolbar__count { color: var(--text-dim); }

/* ── Game tiles: art on top, details below ───────────────────────────── */

.game-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.game-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.game-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-2);
    box-shadow: var(--lift-shadow);
}

.ga-tile__media {
    position: relative;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    background-color: var(--bg-muted);
    border-bottom: 1px solid var(--border);
}

.ga-tile__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .75rem;
    padding: .8rem .85rem .9rem;
}

.ga-tile__name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ga-tile__provider {
    margin-top: .1rem;
    font-size: .78rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ga-tile__actions {
    display: flex;
    gap: .45rem;
}
.ga-tile__actions .btn {
    padding: .45rem .75rem;
    font-size: .8rem;
}
.ga-tile__actions .btn-play { flex: 1; }

.fav-btn {
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--border);
    color: var(--text-dim);
}
.fav-btn:hover { background: #fff; color: var(--gold); }
.fav-btn.is-on {
    background: var(--gold-dim);
    border-color: #fde68a;
    color: var(--gold);
}

.badge { border-radius: var(--r-tag); }
.badge--demo {
    background: rgba(var(--shade-rgb), .78);
    text-shadow: none;
    font-size: .6rem;
    letter-spacing: .08em;
}
.play-bar__title .badge--demo { background: var(--accent-dim); color: var(--accent); }

/* ── Pagination, banners, empty state ────────────────────────────────── */

.pagination__btn {
    background: var(--bg-1);
    border-color: var(--border);
}
.pagination__btn:hover { border-color: var(--accent); color: var(--accent); }

.error-banner {
    background: #fef2f2;
    border-color: #fecaca;
    border-radius: 10px;
}
.error-banner__icon { border-radius: var(--r-sm); }
.error-banner strong { color: #991b1b; }

/* ── Play page: the same light bar over the game ─────────────────────── */

.play-stage { background: #0b1120; }

.play-bar {
    height: 48px;
    background: var(--bg-1);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
}
.play-bar__exit {
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-2);
}
.play-bar__exit:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}
.play-bar__action { border-color: var(--border); border-radius: var(--r-sm); }
.play-bar__action:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

.play-stage__error { background: var(--bg-0); }

.error-card {
    border-radius: var(--r-md);
    box-shadow: var(--lift-shadow);
}
.error-card .icon { border-radius: var(--r-md); background: #fef2f2; }

/* ── Sign-in: split screen ───────────────────────────────────────────── */

.auth-body {
    display: block;
    place-items: normal;
    padding: 0;
    background: var(--bg-1);
}

.ga-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

.ga-auth__brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2.5rem;
    padding: clamp(2rem, 5vw, 3.5rem);
    color: #fff;
    background-color: #0b2566;
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(160deg, #143f9a 0%, #0b2566 58%, #081a48 100%);
    background-size: 32px 32px, 32px 32px, auto;
}

.ga-auth__mark {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    align-self: flex-start;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
    text-decoration: none;
}
.ga-auth__mark .logo__mark {
    width: 36px; height: 36px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.ga-auth__headline {
    max-width: 14ch;
    font-size: clamp(1.9rem, 3.4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.08;
}

.ga-auth__lead {
    max-width: 36ch;
    margin-top: .9rem;
    color: rgba(255, 255, 255, .74);
    font-size: 1rem;
}

.ga-auth__foot {
    color: rgba(255, 255, 255, .55);
    font-size: .78rem;
}

.ga-auth__panel {
    display: grid;
    place-items: center;
    padding: 2.5rem 1.5rem;
}

.ga-auth__form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ga-auth__title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text);
}

.ga-auth__form .auth-card__sub {
    text-align: left;
    color: var(--text-dim);
}
.ga-auth__form .auth-card__sub code {
    background: var(--bg-muted);
    border-color: var(--border);
    border-radius: var(--r-tag);
    color: var(--accent);
}
.ga-auth__form .auth-card__error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
    text-align: left;
}

.auth-field__label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-2);
}
.auth-field input {
    background: var(--bg-1);
    border-color: var(--border-2);
    padding: .7rem .85rem;
}
.auth-field input:focus { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }

.ga-auth__submit {
    width: 100%;
    margin-top: .25rem;
    padding: .78rem 1rem;
    font-size: .95rem;
}

.ga-auth__hint {
    color: var(--text-dim);
    font-size: .78rem;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 860px) {
    .ga-hero { grid-template-columns: 1fr; }
    .ga-hero__art { order: -1; min-height: 180px; }
    .ga-hero__copy { padding: .25rem .25rem .5rem; }

    .ga-auth { grid-template-columns: 1fr; }
    .ga-auth__brand { gap: 1.25rem; padding: 1.5rem; }
    .ga-auth__headline { font-size: 1.6rem; max-width: none; }
    .ga-auth__foot { display: none; }
}

@media (max-width: 640px) {
    :root { --header-h: 56px; }
    .ga-header__brand .env-badge,
    .balance-badge__label { display: none; }
    .balance-badge { padding: 0 .5rem; }
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
}
