/* ============================================================
   HOME PAGE — rules only / uses
   ============================================================
   Loaded after gaming-theme.css, and before the first paint only on
   that page (Helpers/PageStyles.cs). A rule belongs here while every
   class it needs is used by this page alone; once another page uses
   one, the rule moves to gaming-theme.css (PageStylesTests).
   ============================================================ */

/* --- Hero ------------------------------------------------- */
.gn-hero {
    position: relative;
    padding: 5rem 2rem 4rem;
    text-align: center;
    overflow: hidden;
}

.gn-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(124, 58, 237, 0.35) 0%, transparent 70%),
        radial-gradient(ellipse 40% 30% at 80% 60%, rgba(6, 182, 212, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

/* ============================================================
   HOME PAGE
   ============================================================ */

/* --- Hero ------------------------------------------------- */
/* The home hero: copy and search on the left, the "right now" board on the
   right. The board is the one bold element of the page: three real games with
   their covers, one per thing the catalogue answers (a deal, a release date,
   what people play). Everything below it is the quiet grid the rest of the
   site already uses. */
.gh-hero {
    padding: 4.5rem 2rem 3.5rem;
    text-align: left;
    overflow: visible;      /* the search suggestions drop below the hero */
}

.gh-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 3.5rem;
    align-items: center;
}

.gh-hero-copy { min-width: 0; }

.gh-hero .gn-hero-title {
    font-size: clamp(2.25rem, 4.2vw, 3.4rem);
    max-width: 20ch;
    margin-bottom: 1rem;
}

.gh-hero .gn-hero-subtitle {
    margin: 0 0 1.75rem;
    max-width: 52ch;
}

.gh-hero-search {
    max-width: 560px;
    margin: 0 0 1rem;
}

.gh-hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* --- The board -------------------------------------------- */
.gh-board {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-width: 0;
}

.gh-board-title {
    margin: 0 0 0.125rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.gh-tile {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 0.875rem;
    align-items: center;
    padding: 0.75rem 1rem 0.75rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.gh-tile:hover { border-color: var(--border-bright); background: var(--bg-card); }
.gh-tile:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

.gh-tile-cover {
    width: 56px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg-card);
    flex: none;
}

.gh-tile-cover-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: var(--text-muted);
}

.gh-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.gh-tile-kicker { font-size: 0.75rem; color: var(--text-muted); }

.gh-tile-name {
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gh-tile-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gh-tile-big {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-align: right;
}

.gh-tile-deal { color: var(--score-great); }
.gh-tile-rank { color: var(--accent-cyan); }

.gh-tile .rl-date { width: 3.5rem; height: 3.5rem; }
.gh-tile .rl-date-num { font-size: 1.6rem; }

.gh-upcoming { margin: 0; }
.gh-browse-platforms { margin-top: 2.5rem; }

/* --- Row (game card grid) --------------------------------- */
.gh-row {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

@media (min-width: 900px) {
    .gh-row {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* --- Genre grid ------------------------------------------- */
.gh-genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.875rem;
}

.gh-genre-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.125rem 1.25rem;
    min-height: 92px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.gh-genre-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%, var(--accent-glow) 0%, transparent 55%);
    opacity: 0.35;
    transition: opacity var(--transition);
    z-index: -1;
}

.gh-genre-card:hover {
    border-color: var(--border-bright);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.gh-genre-card:hover::before { opacity: 0.9; }

.gh-genre-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.gh-genre-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

/* --- Platform chips --------------------------------------- */
.gh-platform-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.gh-platform-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-bright);
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.8375rem;
    transition: var(--transition);
}

.gh-platform-chip:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.gh-platform-name { font-weight: 500; }

.gh-platform-count {
    color: var(--text-muted);
    font-size: 0.75rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-bright);
}

@media (max-width: 900px) {
    .gn-hero    { padding: 3.5rem 1.25rem 3rem; }
    .gh-hero    { padding: 3rem 1.25rem 2.5rem; }
    .gh-hero-inner { grid-template-columns: 1fr; gap: 2rem; }
    .gh-hero .gn-hero-title { max-width: none; }
    .gh-row     { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
    .gh-genre-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 640px) {

    /* Hero */
    .gn-hero,
    .gh-hero {
        padding: 2.5rem 1rem 2rem;
    }
    .gh-hero-links .gn-btn { flex: 1 1 calc(50% - 0.5rem); justify-content: center; }
    .gh-tile { gap: 0.75rem; padding: 0.625rem 0.75rem 0.625rem 0.625rem; }
    .gh-tile-big { font-size: 1.6rem; }
    .gh-tile .rl-date { width: 3rem; height: 3rem; }
    .gh-tile .rl-date-num { font-size: 1.35rem; }   /* the header keeps title and link only */
    .gh-upcoming { display: flex; overflow-x: auto; gap: 0.6rem; padding-bottom: 0.25rem; scrollbar-width: none; }
    .gh-upcoming::-webkit-scrollbar { display: none; }
    .gh-upcoming > li { flex: 0 0 78%; }

    /* Row of cards already becomes 2-col via .gn-grid override */
    .gh-row { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

    /* Genre/Platform grids */
    .gh-genre-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.625rem;
    }
    .gh-genre-card { padding: 0.875rem 1rem; min-height: 78px; }
    .gh-genre-name { font-size: 1rem; }

    .gh-platform-grid { gap: 0.5rem; }
    .gh-platform-chip { padding: 0.5rem 0.875rem; font-size: 0.8rem; }
}

/* Small phones (≤ 380px) */
@media (max-width: 380px) {
    .gh-hero-links .gn-btn { flex: 1 1 auto; width: 100%; }
    .gh-genre-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Home: most played on Steam today ──
   A chart, not a card row: ten ranked lines in two columns (1 to 5, then 6 to 10),
   each with a bar that is its 24-hour peak against the leader's. One column on a phone. */
.mp-list { list-style:none; margin:0; padding:0; counter-reset:mp; display:grid; grid-auto-flow:column; grid-template-rows:repeat(var(--mp-rows, 5), auto); grid-template-columns:repeat(2, minmax(0, 1fr)); column-gap:2.5rem; }
.mp-item { counter-increment:mp; border-bottom:1px solid var(--border); }
/* The count column keeps its width when a game has no recent count, so every bar starts and ends on the same lines. */
.mp-link { display:grid; grid-template-columns:2rem 45px minmax(0,1fr) 6.25rem; column-gap:.9rem; align-items:center; padding:.6rem 0; color:inherit; text-decoration:none; }
.mp-link::before { content:counter(mp); font-family:'Rajdhani', sans-serif; font-size:1.5rem; font-weight:700; line-height:1; color:var(--text-muted); text-align:right; font-variant-numeric:tabular-nums; }
.mp-item:nth-child(-n+3) .mp-link::before { color:var(--text-primary); }
.mp-cover { display:block; width:45px; height:60px; border-radius:5px; object-fit:cover; background:var(--bg-elevated); }
.mp-body { min-width:0; }
.mp-name { display:block; font-family:'Rajdhani', sans-serif; font-size:1.15rem; font-weight:700; line-height:1.2; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mp-link:hover .mp-name { color:var(--accent-cyan); }
.mp-link:focus-visible { outline:2px solid var(--accent-cyan); outline-offset:2px; border-radius:4px; }
.mp-bar { display:block; height:4px; margin-top:.45rem; border-radius:999px; background:rgba(255,255,255,.07); overflow:hidden; }
.mp-bar > span { display:block; height:100%; min-width:3px; border-radius:inherit; background:#66c0f4; }
.mp-count { font-family:'Rajdhani', sans-serif; font-size:1.15rem; font-weight:700; line-height:1.15; color:var(--text-primary); text-align:right; font-variant-numeric:tabular-nums; }
.mp-count-note { display:block; font-family:'Inter', 'Inter Fallback', 'Inter Fallback Roboto', system-ui, sans-serif; font-size:.68rem; font-weight:400; color:var(--text-muted); }
@media (max-width: 760px) {
    .mp-list { grid-auto-flow:row; grid-template-rows:none; grid-template-columns:minmax(0, 1fr); }
    .mp-link { grid-template-columns:1.5rem 45px minmax(0,1fr) 5.5rem; column-gap:.7rem; }
    .mp-link::before { font-size:1.25rem; }
    .mp-name { font-size:1.05rem; }
}
