/* Epic free games history + per-game pages. Builds on free-games.css, best-free.css (filter panel, drop-downs) and test-lab.css. */
.eh-filters { margin-bottom: 14px; }
.eh-search-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; }
.eh-search { flex: 1 1 260px; min-width: 0; }
.eh-search input { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 1rem; color: #e2e8f0; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); border-radius: 999px; padding: 10px 16px; }
.eh-search input:focus { outline: none; border-color: var(--accent-primary); }
.eh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Year and sort drop-downs show on every screen size (the filter drop-down only appears on phones) */
.eh-filters .eh-year-wrap, .eh-filters .eh-sort-wrap { display: flex; width: auto; flex: 0 1 190px; }
.eh-filters .eh-filter-wrap { display: none; }
.eh-status { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 0.82rem; color: var(--text-muted); }
.eh-reset { font-family: inherit; font-size: 0.78rem; font-weight: 800; color: var(--accent-primary); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.eh-reset[hidden], .eh-row[hidden], .eh-year[hidden], .eh-more-wrap [hidden] { display: none !important; }

.eh-list { list-style: none; margin: 0 0 18px 0; padding: 0; }
.eh-year { position: sticky; top: 0; z-index: 2; margin: 18px 0 4px; padding: 4px 0; background: var(--bg-main, #0b1220); }
.eh-year h3 { margin: 0; font-size: 1.15rem; color: var(--accent-primary); border-bottom: 1px solid var(--border-color); padding-bottom: 4px; }
.eh-row { display: grid; grid-template-columns: 128px 1fr; gap: 4px 14px; align-items: start; padding: 9px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.eh-row:hover { background: rgba(255, 255, 255, 0.03); }
.eh-date { font-size: 0.82rem; font-weight: 700; color: #cbd5e1; white-space: nowrap; line-height: 1.5; }
.eh-date small { display: block; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); }
.eh-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.eh-titleline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.eh-title { font-weight: 800; font-size: 1rem; color: #fff; overflow-wrap: anywhere; }
a.eh-title { color: var(--accent-primary); text-decoration: none; }
a.eh-title:hover { text-decoration: underline; }
.eh-event { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.eh-chips-row { display: flex; flex-wrap: wrap; gap: 5px; }
.eh-chip { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: #cbd5e1; white-space: nowrap; }
.eh-great { background: rgba(74, 222, 128, 0.14); color: #86efac; }
.eh-deck-verified { background: rgba(74, 222, 128, 0.14); color: #86efac; }
.eh-deck-playable { background: rgba(250, 204, 21, 0.14); color: #fde68a; }
.eh-deck-unsupported { background: rgba(248, 113, 113, 0.14); color: #fca5a5; }
.eh-rep { background: rgba(99, 102, 241, 0.2); color: #c7d2fe; }
.eh-more-wrap { text-align: center; margin: 0 0 24px 0; }
.eh-empty { margin: 0 0 25px 0; }
.eh-method { font-size: 0.9rem; line-height: 1.6; }
.eh-method li { margin-bottom: 6px; }

/* Free right now strip */
.eh-now { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 0 0 30px 0; }
.eh-now-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); text-decoration: none; color: inherit; transition: border-color 0.15s ease, transform 0.15s ease; }
.eh-now-card:hover { border-color: var(--accent-primary); transform: translateY(-2px); }
.eh-now-card img { width: 100%; height: auto; aspect-ratio: 460 / 260; object-fit: cover; border-radius: 8px; }
.eh-now-card.eh-soon { opacity: 0.8; }
.eh-now-tag { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-primary); margin-top: 4px; }
.eh-now-title { font-size: 1rem; }
.eh-now-line { font-size: 0.8rem; color: var(--text-muted); }

/* Per-game page */
.eg-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; margin: 0 0 24px 0; }
.eg-cover { width: 100%; height: auto; aspect-ratio: 460 / 215; object-fit: cover; border-radius: 12px; border: 1px solid var(--border-color); background: rgba(255, 255, 255, 0.04); }
.eg-nocover { display: flex; align-items: center; justify-content: center; aspect-ratio: 460 / 215; border-radius: 12px; border: 1px solid var(--border-color); background: rgba(255, 255, 255, 0.04); font-size: 2.2rem; }
.eg-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px 0; font-size: 0.9rem; }
.eg-facts dt { color: var(--text-muted); font-weight: 700; }
.eg-facts dd { margin: 0; color: #e2e8f0; }
.eg-status { margin: 0 0 24px 0; }
.eg-status.eg-now { border-color: rgba(74, 222, 128, 0.5); }
.eg-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.eg-table th, .eg-table td { text-align: left; padding: 8px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); vertical-align: top; }
.eg-table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.eg-also { font-size: 0.8rem; color: var(--text-muted); }
.eg-also a { color: var(--accent-primary); }
.eg-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.eg-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }

@media (max-width: 650px) {
    /* Phones: the filter drop-down replaces the chips (year and sort stay as drop-downs) */
    .eh-filters .eh-chips { display: none; }
    .eh-filters .eh-filter-wrap { display: flex; }
    .eh-filters .eh-year-wrap, .eh-filters .eh-sort-wrap { flex: 1 1 calc(50% - 6px); min-width: 0; }
    .eh-filters .bf-select-label { font-size: 0.7rem; }
    .eh-filters .eh-year-wrap .bf-select, .eh-filters .eh-sort-wrap .bf-select { padding: 8px 8px; font-size: 0.85rem; }
    .eh-filters .eh-year-wrap, .eh-filters .eh-sort-wrap { gap: 6px; }
    .eh-row { grid-template-columns: 1fr; gap: 3px; padding: 10px 2px; }
    .eh-date { font-size: 0.74rem; color: var(--text-muted); }
    .eh-date small { display: inline; margin-left: 6px; }
    .eh-now { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .eh-now-card { padding: 8px; }
    .eh-now-title { font-size: 0.92rem; }
    .eg-hero-grid { grid-template-columns: 1fr; gap: 14px; }
    .eg-table { font-size: 0.82rem; }
    .eg-table th, .eg-table td { padding: 7px 4px; }
}

@media (max-width: 360px) {
    /* Narrowest phones: year and sort get a full row each so their values aren't cut off */
    .eh-filters .eh-year-wrap, .eh-filters .eh-sort-wrap { flex: 1 1 100%; }
}
