/* Home page. Shared pieces (sky, Nayla, wordmark) come from ui.css,
   colours from theme.css. */

.sky { padding-bottom: 72px; }
.sky .mascot { margin-top: 28px; }

.player-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: var(--r-pill);
    background: var(--chip-bg);
    font-size: .9rem;
    font-weight: 500;
    min-width: 0;
}
.player-chip:hover { background: var(--chip-hover); }
.player-chip .avatar { display: inline-flex; border-radius: 50%; overflow: hidden; }
.player-chip .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 9em; }
.player-chip .balance { color: var(--balance); white-space: nowrap; }
.signin-chip { padding: 8px 14px; }

.lang-picker { display: flex; gap: 4px; flex-shrink: 0; }
.lang-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--chip-bg);
    font-size: 1.05rem;
    cursor: pointer;
    line-height: 1;
    opacity: .65;
    transition: opacity .15s, border-color .15s;
}
.lang-btn:hover  { opacity: 1; }
.lang-btn.active { opacity: 1; border-color: var(--sky-text); }

/* ── Category filter (hidden until there are enough games per category) ── */

.cat-filter {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.cat-btn {
    padding: 6px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    font: inherit;
    font-size: .85rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
}
.cat-btn.active { background: var(--deep); border-color: var(--deep); color: var(--on-deep); }

/* ── Game tiles ─────────────────────────────────────────────── */

.tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 600px) {
    .tiles { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

.tile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-bottom: 5px solid var(--ledge);
    border-radius: var(--r-tile);
    transition: transform .08s, border-bottom-width .08s;
}
.tile:active {
    transform: translateY(3px);
    border-bottom-width: 2px;
    margin-bottom: 3px;
}
.tile:hover { border-color: var(--ledge); }

.tile-glyph {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--accent-tint);
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--accent);
}
.tile-glyph--emoji {
    font-family: inherit;
    font-size: 1.3rem;
    background: var(--page);
}

.tile-text { min-width: 0; }
.tile-text > * { display: block; }

.tile-name {
    font-weight: 600;
    font-size: .92rem;
    line-height: 1.25;
    /* Long names (Soustractions) break with a hyphen instead of overflowing */
    hyphens: auto;
    overflow-wrap: anywhere;
}
.tile-desc {
    font-size: .8rem;
    color: var(--muted);
}
.tile-best {
    margin-top: 2px;
    font-size: .76rem;
    font-weight: 500;
    color: var(--muted);
}
.tile-best.has-best { color: var(--good); }

/* More room on tablets and desktops */
@media (min-width: 600px) {
    .tile { gap: 12px; padding: 12px 14px; }
    .tile-glyph { width: 44px; height: 44px; font-size: 1.6rem; }
    .tile-name { font-size: 1rem; }
}

/* Non-arithmetic games: full width on phones, so there is room for a description */
.tiles-wide {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}
@media (min-width: 600px) {
    .tiles-wide { grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 14px; }
}

/* ── Class race ─────────────────────────────────────────────── */

.race {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--r-tile);
    background: var(--deep);
    color: var(--deep-muted);
}
.race:hover { background: var(--deep-hover); }
.race-icon { font-size: 2rem; line-height: 1; }
.race-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1.1;
    color: var(--on-deep);
}
.race-label { font-size: .85rem; margin-top: 2px; }
