/* EmpireGames 1.0 — game catalog layer, loaded after the legacy theme. */
:root {
    --eg-bg: #f3f5f8;
    --eg-surface: #ffffff;
    --eg-surface-2: #f7f8fb;
    --eg-surface-3: #eceff4;
    --eg-text: #20242c;
    --eg-muted: #707887;
    --eg-border: #e1e5ec;
    --eg-accent: #5b8cff;
    --eg-accent-strong: #376ff6;
    --eg-accent-soft: rgba(91, 140, 255, .12);
    --eg-success: #168b68;
    --eg-warning: #d69b2d;
    --eg-shadow: 0 12px 34px rgba(25, 34, 55, .07);
}
body.dt-is-active {
    --eg-bg: #131519;
    --eg-surface: #1b1e24;
    --eg-surface-2: #22262e;
    --eg-surface-3: #2a303a;
    --eg-text: #eceff5;
    --eg-muted: #9ba5b5;
    --eg-border: #303642;
    --eg-accent: #7da2ff;
    --eg-accent-strong: #94b3ff;
    --eg-accent-soft: rgba(125, 162, 255, .12);
    --eg-success: #4ac49e;
    --eg-warning: #efbd59;
    --eg-shadow: 0 16px 42px rgba(0, 0, 0, .24);
}
body {
    background: var(--eg-bg);
    color: var(--eg-text);
    font-weight: 400;
}
.eg-shell { min-height: 100vh; background: var(--eg-bg); color: var(--eg-text); }
.eg-shell__inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.eg-shell a { color: inherit; }
.eg-shell img { background: var(--eg-surface-3); }

/* Header */
.eg-topline { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--eg-muted); font-size: 12px; border-bottom: 1px solid var(--eg-border); }
.eg-topline__path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eg-topline__path .speedbar { color: inherit; }
.eg-topline__links { display: flex; gap: 18px; white-space: nowrap; }
.eg-topline a:hover { color: var(--eg-accent); }
.eg-header { position: relative; z-index: 20; margin-top: 16px; border: 1px solid var(--eg-border); border-radius: 16px; background: var(--eg-surface); box-shadow: var(--eg-shadow); }
.eg-header__main { min-height: 76px; padding: 14px 18px; display: grid; grid-template-columns: auto minmax(220px, 620px) auto auto; align-items: center; justify-content: space-between; gap: 18px; }
.eg-logo { display: flex; align-items: center; gap: 11px; padding: 0; background: none; white-space: nowrap; }
.eg-logo__mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, var(--eg-accent), #835de8); color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.5px; box-shadow: 0 7px 20px var(--eg-accent-soft); }
.eg-logo__text { display: flex; flex-direction: column; font-size: 18px; line-height: 1.15; }
.eg-logo__text b { color: var(--eg-accent); font-weight: 600; }
.eg-logo__text small { margin-top: 5px; color: var(--eg-muted); font-size: 11px; font-weight: 400; }
.eg-search { position: relative; width: 100%; justify-self: stretch; }
.eg-search .search-block__input,
.eg-search .search-block__input:focus { height: 44px; padding: 0 46px 0 16px; border: 1px solid var(--eg-border); border-radius: 12px; background: var(--eg-surface-2); color: var(--eg-text); box-shadow: none; }
.eg-search .search-block__btn { width: 44px; height: 44px; color: var(--eg-muted); }
.eg-icon-button { justify-self: end; }
.eg-menu-button { display: none; width: 42px; height: 42px; padding: 0; border: 1px solid var(--eg-border); border-radius: 11px; background: var(--eg-surface-2); color: var(--eg-text); font-size: 22px; }
.eg-nav { display: flex; align-items: center; gap: 4px; padding: 0 12px 12px; overflow-x: auto; }
.eg-nav a { padding: 9px 13px; border-radius: 9px; color: var(--eg-muted); font-size: 13px; white-space: nowrap; }
.eg-nav a:hover { background: var(--eg-accent-soft); color: var(--eg-accent); }

/* Layout and common sections */
.eg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 24px; margin-top: 24px; align-items: start; }
.eg-content { min-width: 0; }
.eg-sidebar { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.eg-section,
.eg-sidebox,
.eg-game { border: 1px solid var(--eg-border); border-radius: 16px; background: var(--eg-surface); box-shadow: var(--eg-shadow); }
.eg-section { margin-bottom: 24px; padding: 24px; }
.eg-section__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.eg-section__head h1,
.eg-section__head h2 { font-size: 22px; line-height: 1.2; }
.eg-section__eyebrow,
.eg-hero__eyebrow { display: block; margin-bottom: 6px; color: var(--eg-accent); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.eg-section__link { color: var(--eg-muted); font-size: 13px; white-space: nowrap; }
.eg-section__link:hover { color: var(--eg-accent); }
.eg-sidebox { padding: 18px; }
.eg-sidebox__title { margin-bottom: 15px; font-size: 15px; }
.eg-side-links { display: flex; flex-direction: column; gap: 3px; }
.eg-side-links a { padding: 8px 10px; margin: 0 -10px; border-radius: 8px; color: var(--eg-muted); font-size: 13px; }
.eg-side-links a:hover { background: var(--eg-accent-soft); color: var(--eg-accent); }
.eg-side-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.eg-side-grid .eg-card__title { font-size: 12px; }
.eg-side-grid .eg-card__meta,
.eg-side-grid .eg-card__original { display: none; }
.eg-hero { position: relative; overflow: hidden; margin-bottom: 24px; padding: 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid rgba(125, 162, 255, .22); border-radius: 18px; background: linear-gradient(120deg, var(--eg-surface), var(--eg-accent-soft)); box-shadow: var(--eg-shadow); }
.eg-hero::after { content: ''; position: absolute; width: 240px; height: 240px; right: -70px; top: -100px; border-radius: 50%; background: var(--eg-accent-soft); pointer-events: none; }
.eg-hero h1 { margin-bottom: 10px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.03em; }
.eg-hero p { max-width: 720px; color: var(--eg-muted); font-size: 14px; line-height: 1.6; }
.eg-hero > * { position: relative; z-index: 1; }

/* Game cards */
.eg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.eg-card { min-width: 0; position: relative; }
.eg-card__poster { position: relative; display: block; overflow: hidden; aspect-ratio: 215 / 310; border-radius: 12px; background: var(--eg-surface-3); box-shadow: 0 8px 22px rgba(0, 0, 0, .13); }
.eg-card__poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease, opacity .3s ease; }
.eg-card:hover .eg-card__poster img { transform: scale(1.025); }
.eg-card__badges { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.eg-badge { padding: 5px 7px; border-radius: 6px; background: rgba(18, 21, 27, .82); color: #fff; font-size: 10px; line-height: 1; backdrop-filter: blur(6px); }
.eg-badge--accent { background: var(--eg-accent-strong); }
.eg-card__body { padding-top: 11px; }
.eg-card__title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 14px; line-height: 1.35; }
.eg-card__title a:hover { color: var(--eg-accent); }
.eg-card__original { overflow: hidden; margin-top: 4px; color: var(--eg-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.eg-card__meta { min-height: 16px; margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--eg-muted); font-size: 10px; }
.eg-release { display: flex; align-items: center; gap: 12px; }
.eg-release__poster { flex: 0 0 58px; overflow: hidden; width: 58px; height: 78px; border-radius: 8px; }
.eg-release__poster img { width: 100%; height: 100%; object-fit: cover; }
.eg-release__body { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.eg-release__title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13px; line-height: 1.35; }
.eg-release__meta { color: var(--eg-muted); font-size: 11px; }

/* Buttons */
.eg-button { min-height: 40px; padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 500; line-height: 1.2; text-align: center; transition: background .2s, border-color .2s, color .2s, transform .2s; }
.eg-button:hover { transform: translateY(-1px); }
.eg-button--primary { background: var(--eg-accent-strong); color: #fff !important; }
.dt-is-active .eg-button--primary { color: #101726 !important; }
.eg-button--primary:hover { background: var(--eg-accent); }
.eg-button--secondary { border-color: var(--eg-border); background: var(--eg-surface-3); color: var(--eg-text); }
.eg-button--secondary:hover { border-color: var(--eg-accent); color: var(--eg-accent); }
.eg-button--ghost { border-color: var(--eg-border); background: transparent; color: var(--eg-muted); }
.eg-button--ghost:hover { border-color: var(--eg-accent); background: var(--eg-accent-soft); color: var(--eg-accent); }
.eg-button--partner { border-color: rgba(214, 155, 45, .35); background: rgba(214, 155, 45, .12); color: var(--eg-warning); }

/* Full game */
.eg-game { padding: 24px; }
.eg-game__header { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--eg-border); }
.eg-game__eyebrow { margin-bottom: 7px; color: var(--eg-accent); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.eg-game__heading h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.15; letter-spacing: -.025em; }
.eg-game__original { margin-top: 7px; color: var(--eg-muted); font-size: 14px; }
.eg-game__stats { display: flex; align-items: flex-start; gap: 14px; color: var(--eg-muted); font-size: 11px; white-space: nowrap; }
.eg-edit { margin-left: 8px; font-size: 15px; }
.eg-game__layout { min-width: 0; }
.eg-game .eg-section { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.eg-game-overview { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; margin-bottom: 30px; }
.eg-game-overview__poster { position: relative; overflow: hidden; align-self: start; aspect-ratio: 215 / 310; border-radius: 14px; background: var(--eg-surface-3); box-shadow: 0 14px 32px rgba(0, 0, 0, .18); }
.eg-game-overview__poster > img { width: 100%; height: 100%; object-fit: cover; }
.eg-game-overview__fav { position: absolute; left: 10px; right: 10px; bottom: 10px; border-radius: 8px; background: rgba(15, 18, 24, .8); color: #fff; text-align: center; backdrop-filter: blur(6px); }
.eg-game-overview__fav a { display: block; padding: 9px; color: #fff; font-size: 12px; }
.eg-facts { display: grid; gap: 4px; }
.eg-facts > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--eg-border); }
.eg-facts dt { color: var(--eg-muted); font-size: 12px; }
.eg-facts dd { font-size: 13px; }
.eg-rating { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; }
.eg-rating > * { display: inline-flex; align-items: center; gap: 7px; }
.eg-video { overflow: hidden; aspect-ratio: 16 / 9; border-radius: 12px; background: #000; }
.eg-video iframe { width: 100%; height: 100%; border: 0; }
.eg-screenshots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.eg-screenshots a { overflow: hidden; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--eg-surface-3); }
.eg-screenshots img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s, opacity .25s; }
.eg-screenshots a:hover img { transform: scale(1.025); opacity: .85; }
.eg-legacy-screens { margin-top: 15px; }
.eg-fulltext { color: var(--eg-text); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.eg-fulltext a { color: var(--eg-accent); }
.eg-fulltext img { height: auto; border-radius: 10px; }
.eg-sysreq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.eg-sysreq > div { padding: 18px; border: 1px solid var(--eg-border); border-radius: 12px; background: var(--eg-surface-2); }
.eg-sysreq h3 { margin-bottom: 12px; color: var(--eg-accent); font-size: 15px; }
.eg-source-links { display: flex; flex-wrap: wrap; gap: 10px; }
.eg-source-links a { padding: 9px 13px; border: 1px solid var(--eg-border); border-radius: 9px; color: var(--eg-muted); font-size: 12px; }
.eg-source-links a:hover { border-color: var(--eg-accent); color: var(--eg-accent); }
.eg-tags { margin-top: 16px; color: var(--eg-muted); font-size: 12px; line-height: 1.8; }
.eg-tags a { display: inline-block; margin: 0 6px 5px 0; padding: 4px 8px; border-radius: 6px; background: var(--eg-surface-2); }

/* Dynamic download tabs */
.eg-platform-tabs__list { display: none; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 4px; }
.js .eg-platform-tabs__list { display: flex; }
.eg-platform-tab { flex: 0 0 auto; min-height: 40px; padding: 9px 14px; border: 1px solid var(--eg-border); border-radius: 10px; background: var(--eg-surface-2); color: var(--eg-muted); font-size: 12px; }
.eg-platform-tab:hover { border-color: var(--eg-accent); color: var(--eg-accent); }
.eg-platform-tab.is-active,
.eg-platform-tab[aria-selected="true"] { border-color: var(--eg-accent); background: var(--eg-accent-soft); color: var(--eg-accent); }
.eg-platform-panel { min-width: 0; }
.eg-platform-panel + .eg-platform-panel { margin-top: 20px; }
.eg-release-card { margin-bottom: 12px; padding: 18px; border: 1px solid var(--eg-border); border-radius: 13px; background: var(--eg-surface-2); }
.eg-release-card:last-child { margin-bottom: 0; }
.eg-release-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.eg-release-card__head > div { display: flex; flex-direction: column; gap: 5px; }
.eg-release-card__head strong { font-size: 15px; }
.eg-release-card__head span { color: var(--eg-muted); font-size: 12px; }
.eg-release-card__size { flex: 0 0 auto; padding: 5px 8px; border-radius: 7px; background: var(--eg-surface-3); color: var(--eg-text) !important; }
.eg-release-card__note { margin: -3px 0 14px; color: var(--eg-muted); font-size: 12px; line-height: 1.6; }
.eg-release-card__actions { display: flex; flex-wrap: wrap; gap: 9px; }
.eg-partner { margin-top: 14px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid rgba(214, 155, 45, .25); border-radius: 10px; background: rgba(214, 155, 45, .07); }
.eg-partner > div { display: flex; flex-direction: column; gap: 4px; }
.eg-partner strong { color: var(--eg-warning); font-size: 12px; }
.eg-partner span { color: var(--eg-muted); font-size: 10px; }
.eg-legacy-downloads { display: grid; gap: 10px; }
.eg-download-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px; border: 1px solid var(--eg-border); border-radius: 11px; background: var(--eg-surface-2); }
.eg-download-row__info { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.eg-download-row__info strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.eg-download-row__info span { color: var(--eg-muted); font-size: 11px; }
.eg-empty { padding: 20px; color: var(--eg-muted); text-align: center; }

/* Footer and SEO */
.eg-seo { margin: 8px 0 24px; padding: 20px 0; border-top: 1px solid var(--eg-border); color: var(--eg-muted); }
.eg-seo h2 { margin-bottom: 10px; font-size: 16px; }
.eg-seo p { max-width: 950px; font-size: 12px; line-height: 1.7; }
.eg-footer { padding: 22px 0 30px; border-top: 1px solid var(--eg-border); color: var(--eg-muted); font-size: 12px; }
.eg-footer__links { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-bottom: 18px; }
.eg-footer__links a:hover { color: var(--eg-accent); }
.eg-footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eg-to-top { padding: 7px 11px; border: 1px solid var(--eg-border); border-radius: 8px; background: var(--eg-surface); color: var(--eg-muted); font-size: 11px; }
.eg-sort .sorter { background: var(--eg-surface-2); }

@media (max-width: 1180px) {
    .eg-layout { grid-template-columns: minmax(0, 1fr) 230px; gap: 20px; }
    .eg-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 16px; }
    .eg-header__main { grid-template-columns: auto minmax(180px, 1fr) auto auto; gap: 12px; }
}
@media (max-width: 980px) {
    .eg-layout { grid-template-columns: minmax(0, 1fr); }
    .eg-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .eg-sidebar .eg-sidebox:last-child { display: none; }
    .eg-header__main { grid-template-columns: auto minmax(160px, 1fr) auto; }
    .eg-menu-button { display: inline-flex; }
    .eg-header__main > .eg-icon-button { display: none; }
    .eg-nav { display: none; flex-wrap: wrap; }
    .eg-nav.is-open { display: flex; }
    .eg-screenshots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .eg-shell__inner { padding: 0 14px; }
    .eg-topline__links { display: none; }
    .eg-header { margin-top: 10px; }
    .eg-header__main { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; }
    .eg-logo { grid-column: 1; }
    .eg-menu-button { grid-column: 2; grid-row: 1; }
    .eg-search { grid-column: 1 / -1; grid-row: 2; }
    .eg-logo__text small { display: none; }
    .eg-layout { margin-top: 16px; }
    .eg-section,
    .eg-game { padding: 17px; border-radius: 14px; }
    .eg-section { margin-bottom: 16px; }
    .eg-hero { padding: 22px; flex-direction: column; align-items: flex-start; }
    .eg-section__head { align-items: flex-start; gap: 12px; }
    .eg-section__head h1,
    .eg-section__head h2 { font-size: 19px; }
    .eg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
    .eg-game__header { flex-direction: column; gap: 12px; }
    .eg-game__stats { flex-wrap: wrap; }
    .eg-game-overview { grid-template-columns: 165px minmax(0, 1fr); gap: 18px; }
    .eg-facts > div { grid-template-columns: 1fr; gap: 4px; }
    .eg-sysreq { grid-template-columns: 1fr; }
    .eg-release-card__actions .eg-button { flex: 1 1 auto; }
}
@media (max-width: 520px) {
    .eg-sidebar { grid-template-columns: 1fr; }
    .eg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .eg-card__title { font-size: 12px; }
    .eg-card__meta { display: none; }
    .eg-game-overview { grid-template-columns: 1fr; }
    .eg-game-overview__poster { width: min(68vw, 250px); margin: 0 auto; }
    .eg-screenshots { grid-template-columns: 1fr; }
    .eg-release-card { padding: 14px; }
    .eg-release-card__head { flex-direction: column; gap: 8px; }
    .eg-release-card__actions { flex-direction: column; }
    .eg-release-card__actions .eg-button { width: 100%; }
    .eg-partner { align-items: stretch; flex-direction: column; }
    .eg-download-row { align-items: stretch; flex-direction: column; }
    .eg-download-row .eg-button { width: 100%; }
    .eg-footer__bottom { align-items: flex-start; flex-direction: column; }
    .eg-platform-tab { flex: 1 0 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .eg-shell *, .eg-shell *::before, .eg-shell *::after { scroll-behavior: auto !important; transition: none !important; }
}
