/* Pages "Hry jako {hra}" (own stylesheet, tokens from hh.css, prefix hj-) */

/* ---------- Head + target game ---------- */
.hj-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: var(--gap);
    align-items: start;
}
.hj-head__text { min-width: 0; }
.hj-target {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    overflow: hidden;
}
.hj-target__media {
    display: block;
    aspect-ratio: 510 / 200;
    background: linear-gradient(135deg, var(--bg-subtle), color-mix(in srgb, var(--brand) 18%, var(--bg-subtle)));
    overflow: hidden;
}
.hj-target__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hj-target__media .card__play { display: none; }
.hj-target__body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; min-width: 0; }
.hj-target__label { color: var(--text-muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hj-target__name { font-size: 1.1rem; line-height: 1.25; overflow-wrap: anywhere; }
.hj-target__name a { color: var(--text); }
.hj-target__name a:hover { color: var(--link); text-decoration: none; }
.hj-target__facts { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
    .hj-head { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Similar games ---------- */
.hj-list { list-style: none; margin: 0; padding: 0; }
.hj-list__item { display: flex; min-width: 0; }
.hj-list__item > .card { flex: 1; }
.hj-card__rank {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    min-width: 2.4em;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    font-size: .85rem;
    font-weight: 800;
    text-align: center;
    pointer-events: none;
}
.hj-list__item:nth-child(-n+3) .hj-card__rank { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.hj-card .card__title { overflow-wrap: anywhere; }
.hj-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text);
    font-size: .75rem;
    font-weight: 700;
}
.hj-badge--very { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 16%, var(--bg-elevated)); }
.hj-card__reason { margin: 0; color: var(--text); font-size: .88rem; line-height: 1.4; }
.hj-card__reason span { color: var(--text-muted); }

/* ---------- Same series ---------- */
.hj-series { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px var(--gap); }
.hj-series a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text);
    font-weight: 600;
}
.hj-series a:hover { border-color: var(--brand); color: var(--link); text-decoration: none; }
.hj-series__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hj-series small { color: var(--text-muted); font-weight: 500; }

/* ---------- Index ---------- */
.hj-tiles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
    gap: var(--gap);
}
.hj-tile {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    color: var(--text);
}
.hj-tile:hover { border-color: var(--brand); color: var(--link); text-decoration: none; }
.hj-tile__media {
    display: block;
    aspect-ratio: 510 / 200;
    background: linear-gradient(135deg, var(--bg-subtle), color-mix(in srgb, var(--brand) 18%, var(--bg-subtle)));
    overflow: hidden;
}
.hj-tile__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hj-tile__media .card__play { display: none; }
.hj-tile__name { padding: 10px 12px 12px; font-weight: 700; font-size: .95rem; line-height: 1.3; overflow-wrap: anywhere; }

.hj-letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.hj-group { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); }
.hj-group[open] { grid-column: 1 / -1; padding-bottom: 10px; }
.hj-group summary { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; cursor: pointer; }
.hj-group summary small { color: var(--text-muted); }
.hj-group__letter { font-size: 1.15rem; font-weight: 800; }
.hj-az { list-style: none; margin: 0; padding: 0 12px; columns: 16em auto; column-gap: var(--gap); }
.hj-az li { break-inside: avoid; padding: 4px 0; border-bottom: 1px solid var(--border); }
.hj-az a { color: var(--text); font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.hj-az a:hover { color: var(--link); }
