/* ==========================================================================
   EasyGame99 - public theme (light by default, dark on request)
   Original design. System fonts only (no external font downloads).
   Palette: paper #F5F6FA, ink #10152B, ultramarine #3D4BFF, amber #FFB020
   ========================================================================== */

:root {
  --bg: #f5f6fa;
  --bg-2: #eceef6;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --border: #e1e4ef;
  --border-strong: #cdd2e4;
  --text: #10152b;
  --muted: #5a6382;
  --accent: #3d4bff;
  --accent-hover: #2f3be0;
  --accent-ink: #ffffff;
  --accent-soft: #eceeff;
  --amber: #ffb020;
  --amber-ink: #3a2600;
  --danger: #d93a4a;
  --ok: #138a5b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 21, 43, .06), 0 1px 3px rgba(16, 21, 43, .05);
  --shadow: 0 2px 4px rgba(16, 21, 43, .05), 0 12px 28px -8px rgba(34, 44, 120, .22);
  --shadow-lg: 0 4px 8px rgba(16, 21, 43, .06), 0 28px 60px -14px rgba(34, 44, 120, .35);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1260px;
  --top: 64px;
  --side: 72px;
  --side-open: 248px;
  --gap: 14px;
  --cols: 7;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 750; }
h1 { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.3rem); }
h2 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 1000; font-weight: 600; }
.skip-link:focus { left: 8px; text-decoration: none; }

.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }
.icon-xl { width: 56px; height: 56px; stroke-width: 1.5; color: var(--muted); }


/* ============================================================ app shell */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: var(--top);
  display: flex; align-items: center; gap: 14px; padding: 0 18px 0 12px;
  background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.icon-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--text); display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .icon { width: 24px; height: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; flex: none; }
.brand:hover { text-decoration: none; }
.brand-sm { font-size: 1.1rem; }
.brand-mark { flex: none; border-radius: 10px; box-shadow: 0 4px 12px -2px rgba(61, 75, 255, .5); }
.search { flex: 1 1 auto; max-width: 620px; margin: 0 auto; position: relative; }
.search input {
  width: 100%; height: 44px; padding: 0 52px 0 20px; border-radius: 999px;
  border: 1px solid transparent; background: var(--surface-2); color: var(--text); font: inherit;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:hover { background: #e7eaf6; }
.search input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(61, 75, 255, .14); }
.search button { position: absolute; right: 5px; top: 5px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.search button:hover { background: var(--accent-hover); }
.top-links { display: flex; gap: 4px; flex: none; }
.top-links a { display: inline-flex; align-items: center; gap: 7px; color: var(--text); padding: 9px 14px; border-radius: 12px; font-weight: 650; font-size: .93rem; }
.top-links a:hover { background: var(--surface-2); text-decoration: none; }
.top-links .icon { color: var(--accent); }

.sidebar {
  position: fixed; z-index: 55; top: var(--top); bottom: 0; left: 0; width: var(--side);
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
  transition: width .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s, transform .25s cubic-bezier(.2, .7, .2, 1);
}
.sidebar::-webkit-scrollbar { display: none; }
.side-nav { padding: 10px 12px 20px; display: flex; flex-direction: column; gap: 2px; }
.ri { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 2px; border-radius: 14px; color: var(--text); font-weight: 650; font-size: .93rem; white-space: nowrap; }
.ri:hover { background: var(--surface-2); text-decoration: none; }
.ri-ic { flex: none; width: 40px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: hsl(var(--h) 92% 95%); color: hsl(var(--h) 62% 40%); }
.ri-ic .icon { width: 19px; height: 19px; }
.ri.is-active { background: var(--text); color: #fff; }
.ri.is-active .ri-ic { background: #fff; color: var(--text); }
.ri-lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .12s; }
.ri-ct { flex: none; font-size: .74rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 8px; margin-right: 6px; opacity: 0; transition: opacity .12s; }
.ri.is-active .ri-ct { background: rgba(255, 255, 255, .18); color: #fff; }
.rail-sep { height: 1px; background: var(--border); margin: 10px 4px; position: relative; flex: none; }
.rail-sep span { position: absolute; left: 0; top: 50%; transform: translateY(-50%); background: var(--surface); padding-right: 8px; font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); opacity: 0; }
.side-open .sidebar, .sidebar.peek { width: var(--side-open); }
.side-open .ri-lb, .side-open .ri-ct, .side-open .rail-sep span,
.sidebar.peek .ri-lb, .sidebar.peek .ri-ct, .sidebar.peek .rail-sep span { opacity: 1; }
.sidebar.peek { box-shadow: var(--shadow-lg); }
.scrim { position: fixed; inset: 0; z-index: 54; background: rgba(16, 21, 43, .45); }

.shell { margin-left: var(--side); padding-top: var(--top); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s cubic-bezier(.2, .7, .2, 1); min-width: 0; }
.side-open .shell { margin-left: var(--side-open); }
.page { flex: 1 0 auto; width: 100%; padding: 18px clamp(14px, 1.6vw, 28px) 40px; min-width: 0; }

.cat-bar { display: none; background: var(--surface); border-bottom: 1px solid var(--border); }
.cat-scroll { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cat-scroll::-webkit-scrollbar { display: none; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.pill:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pill.is-active { background: var(--text); color: #fff; border-color: var(--text); }

/* ------------------------------------------------------------- headings */
.hero { padding: 10px 0 4px; }
.hero h1 { margin-bottom: .3em; }
.hero-sm { padding-top: 10px; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 70ch; }
.crumbs { margin: 4px 0 0; font-size: .88rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--accent); font-weight: 600; }

/* --------------------------------------------------------------- welcome */
.welcome {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap;
  padding: 18px clamp(18px, 2.4vw, 34px); border-radius: 18px; color: #fff;
  background: linear-gradient(105deg, #3d4bff 0%, #5a3df5 45%, #8b3df0 75%, #c23ff0 100%); box-shadow: var(--shadow);
}
.welcome::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255, 255, 255, .1); pointer-events: none; }
.welcome h1 { margin: 0 0 4px; font-size: clamp(1.35rem, 1rem + 1.4vw, 2.1rem); font-weight: 850; letter-spacing: -.035em; }
.welcome p { margin: 0; color: rgba(255, 255, 255, .85); font-size: .98rem; }
.welcome-btn { position: relative; z-index: 1; background: #fff; color: var(--accent); font-weight: 750; padding: 11px 20px; }
.welcome-btn:hover { background: #ffe9a8; color: #3a2400; }
.btn.welcome-btn { background: #fff; color: var(--accent); }
.btn.welcome-btn:hover { background: #ffe9a8; color: #3a2400; }

.welcome-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px !important; position: relative; z-index: 1; }
.welcome-links a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); color: #fff; font-size: .86rem; font-weight: 700; }
.welcome-links a:hover { background: rgba(255, 255, 255, .28); text-decoration: none; }
.welcome-links .icon { width: 16px; height: 16px; }
.ri-install { display: none; }
.can-install .ri-install { display: flex; }

/* ------------------------------------------------- guide, FAQ, landing pages */
.guide { margin: 44px 0 0; }
.guide > h2 { font-size: clamp(1.2rem, 1rem + .8vw, 1.6rem); letter-spacing: -.02em; margin: 0 0 16px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.guide-card { position: relative; padding: 22px 22px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; }
.guide-card h3 { margin: 4px 0 0; font-size: 1.12rem; letter-spacing: -.01em; }
.guide-card p { margin: 0; color: var(--muted); line-height: 1.6; flex: 1; }
.guide-card > a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; margin-top: 6px; }
.guide-card > a .icon { width: 16px; height: 16px; }
.gc-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: hsl(var(--h) 92% 95%); color: hsl(var(--h) 62% 42%); }
.gc-ic .icon { width: 23px; height: 23px; }
.faq { margin: 28px 0 0; padding: 24px clamp(18px, 3vw, 30px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.faq h2 { margin: 0 0 10px; font-size: 1.25rem; letter-spacing: -.01em; }
.faq details { border-top: 1px solid var(--border); }
.faq details:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 34px 14px 0; position: relative; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .15s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: 0 0 14px; color: var(--muted); line-height: 1.6; max-width: 80ch; }
.faq-page { margin-top: 34px; }

.off-panel { margin: 18px 0 0; padding: 22px clamp(18px, 3vw, 30px); border-radius: 18px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #2f3df0 0%, #1f2a9e 45%, #141a5c 100%); box-shadow: var(--shadow); }
.off-head { display: flex; align-items: center; gap: 16px; }
.off-head h2 { margin: 0 0 4px; font-size: 1.25rem; color: #fff; }
.off-ic { flex: none; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); }
.off-ic .icon { width: 28px; height: 28px; }
.off-status { margin: 0; color: rgba(255, 255, 255, .85); }
.off-bar { height: 10px; margin: 16px 0 0; border-radius: 999px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.off-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #43e0a0, #b8ffda); transition: width .25s; }
.off-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.off-panel .btn-primary { background: #fff; color: var(--accent); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5); }
.off-panel .btn-primary:hover { background: #ffe9a8; color: #3a2400; }
.off-panel .btn-primary[disabled] { opacity: .55; cursor: default; }
.off-panel .btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .3); }
.off-panel .btn-ghost:hover { background: rgba(255, 255, 255, .22); color: #fff; border-color: #fff; }
.off-note { margin: 12px 0 0; font-size: .9rem; color: rgba(255, 255, 255, .85); }
.off-note.muted { color: rgba(255, 255, 255, .62); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 18px 0 0; }
.step { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.step b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .95rem; }
.step h3 { margin: 10px 0 4px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); line-height: 1.55; }
.off-h { margin: 34px 0 14px; font-size: 1.3rem; letter-spacing: -.01em; }
.off-item { position: relative; min-width: 0; }
.off-badge { position: absolute; left: 8px; top: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px 4px 6px; border-radius: 999px; background: rgba(19, 138, 91, .94); color: #fff; font-size: .74rem; font-weight: 800; box-shadow: 0 4px 10px rgba(0, 0, 0, .25); pointer-events: none; }
.off-badge .icon { width: 14px; height: 14px; }
.off-badge[hidden] { display: none; }
.guide-plain { margin-top: 36px; }

/* ------------------------------------------------------------------ tiles */
.tile {
  position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 14px;
  background: var(--surface-2); box-shadow: var(--shadow-sm); color: #fff; isolation: isolate;
  transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(16, 21, 43, .07); pointer-events: none; transition: box-shadow .2s; }
.tile-title {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 26px 11px 9px;
  background: linear-gradient(to top, rgba(10, 14, 38, .88), rgba(10, 14, 38, 0));
  font-size: .9rem; font-weight: 700; line-height: 1.25; letter-spacing: -.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s;
}
.tile:hover, .tile:focus-visible { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.tile:hover::after, .tile:focus-visible::after { box-shadow: inset 0 0 0 3px var(--accent); }
.tile:hover img { transform: scale(1.05); }
.tile:hover .tile-title, .tile:focus-visible .tile-title { opacity: 1; transform: none; }
.tile-big .tile-title { font-size: 1.15rem; padding: 40px 16px 14px; }
.badge { position: absolute; z-index: 2; left: 8px; top: 8px; background: var(--amber); color: var(--amber-ink); font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
@media (hover: none) { .tile-title { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------- rows */
.row { margin-top: 22px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.row-head h2 { margin: 0; font-size: 1.22rem; display: flex; align-items: center; gap: 9px; }
.row-head h2 a { color: var(--text); display: inline-flex; align-items: center; gap: 9px; }
.row-head h2 a:hover { color: var(--accent); text-decoration: none; }
.row-head h2 .icon { color: var(--accent); }
.row-head .chev { color: var(--muted); width: 1em; height: 1em; transition: transform .15s; }
.row-head h2 a:hover .chev { transform: translateX(3px); color: var(--accent); }
.shelf-ctl { display: flex; align-items: center; gap: 6px; }
.shelf-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); display: grid; place-items: center; transition: border-color .15s, color .15s, opacity .15s; }
.shelf-btn:hover { border-color: var(--accent); color: var(--accent); }
.shelf-btn[disabled] { opacity: .3; pointer-events: none; }
.shelf-track {
  display: grid; grid-auto-flow: column; gap: var(--gap);
  grid-auto-columns: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 6px 4px 10px; margin: -6px -4px -10px; -webkit-overflow-scrolling: touch;
}
.shelf-track::-webkit-scrollbar { display: none; }
.shelf-track > .tile { scroll-snap-align: start; }
.picks { grid-template-rows: repeat(2, auto); grid-auto-flow: column dense; }
.picks .tile-big { grid-row: span 2; grid-column: span 2; aspect-ratio: auto; height: 100%; }

/* ------------------------------------------------------- listing grids */
.block { margin-top: clamp(30px, 4vw, 48px); }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.block-head h2 { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 1.35rem; }
.block-head h2 .icon { box-sizing: content-box; width: 1.05em; height: 1.05em; padding: .42em; border-radius: 12px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.more { font-size: .92rem; font-weight: 650; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; }
.more:hover { background: var(--accent-soft); text-decoration: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px 16px; }
.grid-mosaic { grid-auto-flow: dense; }
.grid-side { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }

.card { display: flex; flex-direction: column; gap: 9px; color: var(--text); min-width: 0; }
.card:hover { text-decoration: none; }
.card-thumb {
  position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius);
  background: var(--surface-2); box-shadow: var(--shadow-sm);
  transition: transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(16, 21, 43, .06); pointer-events: none; }
.card:hover .card-thumb, .card:focus-visible .card-thumb { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-title { font-size: .92rem; font-weight: 650; line-height: 1.3; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding-inline: 2px; }
.card:hover .card-title { color: var(--accent); }
.card-big { grid-column: span 2; grid-row: span 2; }
.card-big .card-thumb { flex: 1; aspect-ratio: auto; }
.card-big .card-title { font-size: 1.1rem; }
.badge { position: absolute; z-index: 1; left: 10px; top: 10px; background: var(--amber); color: var(--amber-ink); font-size: .74rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; margin-top: 20px; }
.cat-tile { display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--border); color: var(--text); transition: transform .2s, box-shadow .2s, border-color .2s; }
.cat-tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.cat-name { font-weight: 750; font-size: 1.08rem; letter-spacing: -.01em; }
.cat-count { color: var(--muted); font-size: .88rem; }

.empty { text-align: center; padding: 72px 16px; color: var(--muted); }
.empty h2 { color: var(--text); margin-top: 8px; }


.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--gap); }

/* -------------------------------------------------------------- game page */
.game-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.stage-box { border-radius: 18px; box-shadow: var(--shadow-lg); background: #151a3d; }
.player-wrap { border-radius: 18px 18px 0 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, #2c3594 0%, #141a48 55%, #0c1030 100%); display: flex; justify-content: center; }
.player {
  position: relative; width: 100%; aspect-ratio: var(--w) / var(--h);
  max-width: min(100%, calc((100vh - var(--top) - 96px) * var(--w) / var(--h)));
  margin-inline: auto; background: #0b1020; overflow: hidden;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-cover { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.player-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(24px) brightness(.6) saturate(1.2); transform: scale(1.15); }
.player-front { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 16px; max-width: 90%; }
.player-thumb { width: min(320px, 55%); border-radius: var(--radius); border: 3px solid rgba(255, 255, 255, .35); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.play-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 15px 38px; border: 0; border-radius: 999px;
  background: #fff; color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform .15s, background .15s, color .15s;
}
.play-btn:hover { background: var(--accent); color: #fff; transform: scale(1.04); }
.player-msg { margin: 0; padding: 12px 18px; border-radius: 14px; background: rgba(10, 14, 38, .78); color: #fff; font-weight: 650; text-align: center; max-width: 420px; }
.play-btn .icon { width: 1.3em; height: 1.3em; }
.player-resume { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(8, 11, 32, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* Full-screen player: edge to edge with a slim bar (top in portrait, left in landscape). */
html.eg-playing, html.eg-playing body { overflow: hidden; overscroll-behavior: none; }
html.eg-playing .consent { display: none; }
.play-bar { display: none; }
.player.is-immersive {
  position: fixed; inset: 0; z-index: 3000; width: 100%; height: 100%; height: 100dvh; max-width: none; aspect-ratio: auto;
  margin: 0; border-radius: 0; background: #070a1c; --bt: calc(46px + env(safe-area-inset-top)); --bl: 0px;
}
.player.is-immersive iframe { top: var(--bt); left: var(--bl); width: calc(100% - var(--bl)); height: calc(100% - var(--bt)); }
.player.is-immersive .play-bar {
  position: absolute; left: 0; top: 0; right: 0; height: var(--bt); z-index: 3; display: flex; align-items: center; gap: 10px;
  padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  background: linear-gradient(180deg, #161c46, #0b0f2b); border-bottom: 1px solid rgba(255, 255, 255, .08); touch-action: none; -webkit-user-select: none; user-select: none;
}
.pb-exit {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 15px 0 11px; border: 0; border-radius: 999px; cursor: pointer;
  color: #fff; font-weight: 800; font-size: .92rem; letter-spacing: .01em;
  background: linear-gradient(180deg, #8475ff, #5b4cf0); box-shadow: 0 6px 16px -6px rgba(110, 90, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .12s, filter .12s;
}
.pb-exit:hover { filter: brightness(1.08); }
.pb-exit:active { transform: scale(.95); }
.pb-exit .icon { width: 19px; height: 19px; stroke-width: 2.4; }
.pb-title { flex: 1; min-width: 0; color: rgba(255, 255, 255, .82); font-weight: 750; font-size: .92rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-report { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(255, 255, 255, .1); color: #fff; transition: background .15s; }
.pb-report:hover { background: rgba(255, 255, 255, .2); }
.pb-report .icon { width: 19px; height: 19px; }
@media (orientation: landscape) {
  .player.is-immersive { --bt: 0px; --bl: calc(58px + env(safe-area-inset-left)); }
  .player.is-immersive .play-bar {
    right: auto; bottom: 0; width: var(--bl); height: auto; flex-direction: column; gap: 12px;
    padding: max(10px, env(safe-area-inset-top)) 0 max(10px, env(safe-area-inset-bottom)) env(safe-area-inset-left);
    border-bottom: 0; border-right: 1px solid rgba(255, 255, 255, .08); background: linear-gradient(90deg, #0b0f2b, #161c46);
  }
  .play-bar .pb-title { display: none; }
  .play-bar .pb-exit { flex-direction: column; justify-content: center; gap: 2px; width: 46px; height: 52px; padding: 0; border-radius: 15px; font-size: .68rem; }
  .play-bar .pb-report { margin-top: auto; }
}
.rotate-hint {
  position: absolute; z-index: 4; inset: var(--bt, 0) 0 0 var(--bl, 0); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 24px; text-align: center; color: #fff; background: radial-gradient(120% 80% at 50% 30%, rgba(44, 53, 148, .96), rgba(7, 10, 28, .97));
}
.rotate-hint[hidden] { display: none; }
.rotate-hint p { margin: 0; max-width: 300px; font-weight: 700; font-size: 1.05rem; line-height: 1.4; }
.rot-ic { width: 96px; height: 96px; color: #a9b3ff; animation: egRotate 2.2s ease-in-out infinite; }
@keyframes egRotate { 0%, 20% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }


.game-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 10px 14px; color: #fff; border-radius: 0 0 18px 18px; background: linear-gradient(180deg, #1b2152, #151a3d); }
.gb-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.gb-title img { width: 44px; height: 33px; object-fit: cover; border-radius: 8px; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); }
.game-title { margin: 0; font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; color: #fff; line-height: 1.2; }
.gb-stats { display: flex; gap: 12px; font-size: .78rem; color: rgba(255, 255, 255, .62); }
.gb-stats strong { color: #fff; }
.gb-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ib { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; min-width: 40px; padding: 0 11px; border: 0; border-radius: 11px; background: rgba(255, 255, 255, .09); color: #fff; font-weight: 700; font-size: .85rem; cursor: pointer; transition: background .15s; }
.ib:hover { background: rgba(255, 255, 255, .2); text-decoration: none; }
.ib .icon { width: 19px; height: 19px; }
.ib.is-on { background: var(--accent); }
.ib-fs { background: var(--accent); }
.ib-fs:hover { background: var(--accent-hover); }
.share summary { list-style: none; }
.share { position: relative; }
.share summary { list-style: none; cursor: pointer; }
.share summary::-webkit-details-marker { display: none; }
.share-panel { position: absolute; z-index: 20; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.share-panel a, .share-panel button { display: flex; align-items: center; gap: 8px; text-align: left; background: none; border: 0; color: var(--text); padding: 10px 12px; border-radius: 9px; font-size: .92rem; }
.share-panel a:hover, .share-panel button:hover { background: var(--surface-2); text-decoration: none; }

.game-desc { margin-top: 26px; padding: 26px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-width: none; box-shadow: var(--shadow-sm); }
.game-desc h2:first-child { margin-top: 0; }
.game-desc p { max-width: 70ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 15px; border-radius: 999px; background: var(--accent-soft); border: 1px solid transparent; color: var(--accent); font-size: .88rem; font-weight: 600; }
.chip:hover { border-color: var(--accent); text-decoration: none; }


.game-main .crumbs { margin-top: 16px; }
.game-desc { margin-top: 12px; padding: 22px 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; max-width: none; box-shadow: var(--shadow-sm); }
.game-desc h2:first-child { margin-top: 0; }
.game-desc p { max-width: 80ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 15px; border-radius: 999px; background: var(--accent-soft); border: 1px solid transparent; color: var(--accent); font-size: .88rem; font-weight: 600; }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.similar { margin-top: 26px; }
.similar h2 { display: flex; align-items: center; gap: 9px; font-size: 1.22rem; }
.similar h2 .icon { color: var(--accent); }
.game-side { position: sticky; top: calc(var(--top) + 14px); max-height: calc(100vh - var(--top) - 28px); overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }
.game-side .ad { margin-top: 0; }
.side-h { font-size: 1.05rem; margin: 0 0 10px; }
.next-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ------------------------------------------------------------------ prose */
.prose { max-width: 78ch; }
.prose h1 { margin-top: 18px; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: .35em; }
.page-article { padding-top: 6px; }
.page-article.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px clamp(20px, 4vw, 44px) 30px; margin-top: 18px; box-shadow: var(--shadow-sm); }
.about-box { margin: 48px 0 0; padding: 30px clamp(20px, 4vw, 40px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-width: none; color: var(--muted); box-shadow: var(--shadow-sm); }
.about-box h2 { color: var(--text); margin-top: 0; }
.about-box p { max-width: 80ch; }

/* ------------------------------------------------------------- forms/btns */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 17px; border-radius: 999px;
  border: 1px solid transparent; font-weight: 650; font-size: .92rem; line-height: 1.2; color: var(--text); background: var(--surface-2); text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; background: #e3e6f4; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -4px rgba(61, 75, 255, .55); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }

.form { display: grid; gap: 16px; max-width: 580px; margin-top: 14px; }
.field { display: grid; gap: 7px; font-weight: 650; font-size: .92rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 400;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(61, 75, 255, .14); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 13px 16px; border-radius: var(--radius-sm); margin: 14px 0; border: 1px solid; }
.notice-ok { background: #e9f8f1; border-color: #9fdcc3; color: #0b5b3b; }
.notice-err { background: #fdeceE; border-color: #f0b4ba; color: #8f1f2c; }
.form-msg { min-height: 1.4em; font-size: .9rem; color: var(--muted); }

.dialog { border: 0; border-radius: 20px; background: var(--surface); color: var(--text); padding: 26px; width: min(460px, 92vw); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(16, 21, 43, .5); backdrop-filter: blur(3px); }
.dialog form { display: grid; gap: 14px; }
.dialog h2 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ------------------------------------------------------------------- pager */
.pager { margin: 36px 0 8px; }
.pager ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0; margin: 0; }
.pager a, .pager .current { display: inline-block; min-width: 40px; text-align: center; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; }
.pager a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pager .current { background: var(--text); color: #fff; border-color: var(--text); }
.pager .gap { padding: 8px 4px; color: var(--muted); }

/* --------------------------------------------------------------------- ads */
.ad { display: none; margin: 24px 0; text-align: center; }
.ads-on .ad { display: block; }
.ad-label { display: block; font-size: .72rem; letter-spacing: .02em; color: var(--muted); margin-bottom: 4px; }
.ad ins.adsbygoogle { min-height: 90px; }
.ad-sidebar ins.adsbygoogle, .ad-incontent ins.adsbygoogle, .ad-below_game ins.adsbygoogle { min-height: 250px; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none !important; }
.ad-footer { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

/* ------------------------------------------------------------------ footer */
.site-footer { margin-top: 24px; background: var(--surface); border-top: 1px solid var(--border); padding: 32px clamp(14px, 1.6vw, 28px) 0; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
.footer-grid p { max-width: 44ch; margin-top: 10px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 26px; }
.footer-links a { color: var(--muted); font-size: .94rem; font-weight: 500; }
.footer-links a:hover { color: var(--accent); }
.copyright { color: var(--muted); font-size: .85rem; padding-block: 26px; margin-top: 8px; border-top: 1px solid var(--border); }

/* ----------------------------------------------------------------- consent */
.consent {
  position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 1500; max-width: 780px; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px 20px; box-shadow: var(--shadow-lg);
}
.consent[hidden] { display: none; }
.consent p { margin: 0; font-size: .9rem; flex: 1 1 320px; color: var(--muted); }
.consent-actions { display: flex; gap: 8px; }

/* -------------------------------------------------------------- error page */
.err-page { text-align: center; padding-top: 12vh; display: flex; flex-direction: column; align-items: center; }


/* ---------------------------------------------------------- category pages */
.cat-hero { display: flex; align-items: flex-start; gap: 16px; }
.cat-hero > div { min-width: 0; }
.cat-hero-ic { flex: none; width: 56px; height: 56px; margin-top: 4px; border-radius: 16px; display: grid; place-items: center; background: hsl(var(--h) 92% 95%); color: hsl(var(--h) 62% 42%); }
.cat-hero-ic .icon { width: 28px; height: 28px; }
.cat-hero h1 { margin-bottom: .25em; }
.cat-hero .lead { margin-bottom: .55em; max-width: 86ch; }
.cat-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; color: var(--muted); font-size: .86rem; font-weight: 650; }
.cat-meta .icon { color: var(--accent); }
.cat-guide { margin: clamp(30px, 4vw, 46px) 0 0; display: grid; gap: 18px; }
.cg-block { padding: 24px clamp(18px, 3vw, 32px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.cg-block h2, .cg-types-wrap h2, .cg-related h2 { font-size: clamp(1.12rem, 1rem + .55vw, 1.42rem); letter-spacing: -.015em; margin: 0 0 12px; }
.cg-text p, .cg-text li { color: var(--muted); line-height: 1.7; max-width: 84ch; }
.cg-text p:last-child { margin-bottom: 0; }
.cg-text ul { margin: 0; padding-left: 1.2em; }
.cg-text li { margin-bottom: .4em; }
.cg-text li::marker { color: var(--accent); }
.cg-text h2, .cg-text h3 { color: var(--text); margin-top: 1.1em; }
.cg-text h2:first-child, .cg-text h3:first-child { margin-top: 0; }
.cg-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.cg-types[data-n="3"], .cg-types[data-n="5"], .cg-types[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cg-types[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.more-btn { display: none; border: 0; background: none; padding: 0; margin: -4px 0 12px; color: var(--accent); font-weight: 700; font-size: .92rem; cursor: pointer; }
.cg-type { position: relative; overflow: hidden; padding: 18px 18px 16px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.cg-type::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: hsl(var(--h) 75% 55%); }
.cg-type h3 { margin: 0 0 6px; font-size: 1.02rem; letter-spacing: -.01em; }
.cg-type p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.cg-games { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 4px 26px; }
.cg-games li { display: flex; flex-direction: column; gap: 5px; padding: 11px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.cg-games a { display: flex; align-items: center; gap: 11px; color: var(--text); font-weight: 750; min-width: 0; }
.cg-games a:hover { color: var(--accent); text-decoration: none; }
.cg-games img { width: 64px; height: 48px; object-fit: cover; border-radius: 9px; flex: none; box-shadow: var(--shadow-sm); }
.cg-games span { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.cg-cats { padding: 18px clamp(18px, 3vw, 32px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.cg-cats .ri-ic { width: 36px; height: 36px; }
.cg-rel { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.cg-rel-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s; }
.cg-rel-item:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.cg-rel-item b { display: block; font-size: .95rem; line-height: 1.25; }
.cg-rel-item small { display: block; color: var(--muted); font-size: .8rem; font-weight: 600; }
.cat-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cat-teaser { color: var(--muted); font-size: .88rem; line-height: 1.45; }

/* --------------------------------------------------------- light / dark switch */
.theme-btn { width: auto; min-width: 44px; height: 40px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-weight: 700; font-size: .88rem; }
.theme-btn .icon { width: 20px; height: 20px; }
.theme-btn .tb-moon { color: #4b57ff; }
.theme-btn .tb-sun { display: none; color: #ffc53d; }
html[data-theme="dark"] .theme-btn .tb-sun { display: block; }
html[data-theme="dark"] .theme-btn .tb-moon { display: none; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .35s ease, color .35s ease, border-color .35s ease !important; }

/* ------------------------------------------------------------- dark theme */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1022;
  --bg-2: #12162c;
  --surface: #161a33;
  --surface-2: #1f2444;
  --border: #282e52;
  --border-strong: #38406d;
  --text: #edf0ff;
  --muted: #a6add3;
  --accent: #8a94ff;
  --accent-hover: #a2aaff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 135, 255, .16);
  --danger: #ff6b7a;
  --ok: #3ddc97;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .25);
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 12px 28px -8px rgba(0, 0, 0, .65);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, .35), 0 28px 60px -14px rgba(0, 0, 0, .75);
}
html[data-theme="dark"] ::selection { background: rgba(124, 135, 255, .4); }
html[data-theme="dark"] .topbar { background: rgba(13, 16, 34, .9); }
html[data-theme="dark"] .search input:hover { background: #262c51; }
html[data-theme="dark"] .search input:focus { box-shadow: 0 0 0 4px rgba(124, 135, 255, .22); }
html[data-theme="dark"] .btn:hover { background: #29305a; }
html[data-theme="dark"] .btn-ghost:hover { background: var(--surface); }
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .search button, html[data-theme="dark"] .step b,
html[data-theme="dark"] .ib.is-on, html[data-theme="dark"] .ib-fs, html[data-theme="dark"] .skip-link { background: #5b67f5; color: #fff; }
html[data-theme="dark"] .btn-primary:hover, html[data-theme="dark"] .search button:hover, html[data-theme="dark"] .ib-fs:hover { background: #6e79ff; }
html[data-theme="dark"] .btn-primary { box-shadow: 0 6px 16px -4px rgba(91, 103, 245, .55); }
html[data-theme="dark"] .ri-ic, html[data-theme="dark"] .gc-ic, html[data-theme="dark"] .cat-hero-ic { background: hsl(var(--h) 42% 22%); color: hsl(var(--h) 92% 78%); }
html[data-theme="dark"] .ri.is-active, html[data-theme="dark"] .pill.is-active, html[data-theme="dark"] .pager .current { background: #5b67f5; border-color: #5b67f5; color: #fff; }
html[data-theme="dark"] .ri.is-active .ri-ic { background: rgba(255, 255, 255, .18); color: #fff; }
html[data-theme="dark"] .pill:hover { color: var(--accent); }
html[data-theme="dark"] .play-btn { color: #10152b; }
html[data-theme="dark"] .play-btn:hover { background: #5b67f5; color: #fff; }
html[data-theme="dark"] .welcome { background: linear-gradient(105deg, #2c38d2 0%, #462dcc 45%, #6e2fc6 75%, #9a2ec0 100%); }
html[data-theme="dark"] .btn.welcome-btn { background: #fff; color: #2f3bd6; }
html[data-theme="dark"] .btn.welcome-btn:hover { background: #ffe9a8; color: #3a2400; }
html[data-theme="dark"] .tile::after, html[data-theme="dark"] .card-thumb::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
html[data-theme="dark"] .notice-ok { background: #0f2a20; border-color: #1f6b4a; color: #9ff0c9; }
html[data-theme="dark"] .notice-err { background: #2e1218; border-color: #7a2a35; color: #ffb3bd; }
html[data-theme="dark"] .scrim { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .cg-type::before { background: hsl(var(--h) 85% 64%); }
html[data-theme="dark"] .theme-btn { border-color: var(--border-strong); }
html[data-theme="dark"] .ad ins.adsbygoogle { background: transparent; }

/* ------------------------------------------------------------- responsive */
@media (min-width: 1800px) { :root { --cols: 8; } }
@media (max-width: 1500px) { :root { --cols: 6; } }
@media (max-width: 1250px) { :root { --cols: 5; } .game-page { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 1100px) { .top-links span { display: none; } .top-links a { padding: 10px; } .theme-btn { padding: 0; width: 40px; min-width: 40px; } .theme-btn .tb-label { display: none; } }
@media (max-width: 1000px) {
  .cg-types[data-n] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root { --cols: 4; }
  .game-page { grid-template-columns: minmax(0, 1fr); }
  .game-side { position: static; max-height: none; overflow: visible; }
  .next-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 900px) {
  :root { --side: 0px; }
  .sidebar { width: 270px; transform: translateX(-100%); box-shadow: none; }
  .side-open .sidebar { width: 270px; transform: none; box-shadow: var(--shadow-lg); }
  .sidebar .ri-lb, .sidebar .ri-ct, .sidebar .rail-sep span { opacity: 1; }
  .side-open .shell { margin-left: 0; }
  .cat-bar { display: block; }
  .shelf-btn { display: none; }
}
@media (max-width: 700px) {
  :root { --cols: 2.6; --gap: 10px; --top: 112px; }
  .topbar { flex-wrap: wrap; height: auto; min-height: var(--top); padding: 8px 10px; gap: 8px; align-content: center; }
  .brand { font-size: 1.12rem; margin-right: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .page { padding: 12px 12px 32px; }
  .welcome { padding: 16px; }
  .welcome-btn { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 10px; }
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .stage-box { margin-inline: -12px; border-radius: 0; }
  .player-wrap, .game-bar { border-radius: 0; }
  .player { max-width: 100%; aspect-ratio: auto; height: max(420px, calc(100svh - var(--top) - 104px)); }
  .player.is-immersive { height: 100%; height: 100dvh; }
  .gb-actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .gb-actions::-webkit-scrollbar { display: none; }
  .gb-actions .share-panel { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; }
  .game-desc { padding: 18px; }
  .btn { padding: 9px 14px; }
  .picks .tile-big .tile-title { font-size: .98rem; padding: 30px 12px 10px; }
  .cat-hero { gap: 12px; }
  .cat-intro.clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: .4em; }
  .more-btn:not([hidden]) { display: inline-block; }
  .cat-hero-ic { width: 44px; height: 44px; border-radius: 13px; }
  .cat-hero-ic .icon { width: 22px; height: 22px; }
  .cg-block { padding: 18px; }
  .top-links { gap: 0; }
  .top-links a { padding: 8px; }
  .topbar .menu-btn { width: 40px; height: 40px; }
  .topbar .brand { gap: 8px; }
  .topbar .brand-mark { width: 30px; height: 30px; }
  .theme-btn { width: 36px; min-width: 36px; height: 36px; }
}
@media (max-width: 400px) { .top-links a:first-child { display: none; } .brand { font-size: 1.04rem; } }
@media (max-width: 420px) { :root { --cols: 2.2; } }
@media (max-width: 560px) { .cg-types[data-n] { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, html.theme-anim * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------------------------------------------------- Learning Zone links */
.top-links .tl-learn .icon { color: #0b9f8f; }
.top-links .tl-learn.is-on { background: var(--surface-2); }
.pill-learn { border-color: transparent; color: #fff; background: linear-gradient(105deg, #0aa292, #1f86ff); box-shadow: 0 4px 12px -4px rgba(16, 140, 200, .55); }
.pill-learn .icon { width: 17px; height: 17px; }
.pill-learn:hover { color: #fff; border-color: transparent; filter: brightness(1.07); }
html[data-theme="dark"] .pill-learn, html[data-theme="dark"] .pill-learn:hover { color: #fff; }
html[data-theme="dark"] .top-links .tl-learn .icon { color: #4fe0cf; }
@media (max-width: 700px) { .top-links .tl-learn { display: none; } }

.lz-promo {
  position: relative; overflow: hidden; margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); align-items: center; gap: 18px 28px;
  padding: 22px clamp(18px, 2.4vw, 32px); border-radius: 18px; color: #fff; box-shadow: var(--shadow);
  background: radial-gradient(90% 140% at 100% 0%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 55%), linear-gradient(110deg, #0b9e8e 0%, #1683ec 52%, #4b45ea 100%);
}
.lz-promo::before { content: ""; position: absolute; left: -70px; bottom: -110px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.lz-promo > * { position: relative; }
.lz-eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); font-size: .74rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.lz-eyebrow .icon { width: 15px; height: 15px; }
.lz-promo h2 { margin: 10px 0 6px; color: #fff; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 850; letter-spacing: -.03em; }
.lz-promo p { margin: 0; color: rgba(255, 255, 255, .88); max-width: 52ch; }
.lz-promo .btn { margin-top: 14px; background: #fff; color: #0d63c9; font-weight: 750; }
.lz-promo .btn:hover { background: #ffe9a8; color: #3a2400; }
.lz-promo-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.lz-pl { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 15px 8px 13px; border-radius: 16px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .24); color: #fff; font-weight: 750; font-size: .9rem; line-height: 1.2; text-align: center; transition: background .15s, transform .15s; }
.lz-pl:hover { background: rgba(255, 255, 255, .24); transform: translateY(-3px); text-decoration: none; }
.lz-pl small { display: block; font-size: .74rem; font-weight: 650; color: rgba(255, 255, 255, .78); margin-top: 2px; }
.lz-pl-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: #fff; color: hsl(var(--h) 72% 44%); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .45); }
.lz-pl-ic .icon { width: 24px; height: 24px; }
html[data-theme="dark"] .lz-promo { background: radial-gradient(90% 140% at 100% 0%, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 55%), linear-gradient(110deg, #08786c 0%, #105fb0 52%, #3532b4 100%); }
html[data-theme="dark"] .lz-pl-ic { background: rgba(255, 255, 255, .92); }
@media (max-width: 1100px) { .lz-promo { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 620px) {
  .lz-promo-links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lz-pl { padding: 12px 4px 10px; font-size: .82rem; }
  .lz-pl small { display: none; }
  .lz-pl-ic { width: 42px; height: 42px; border-radius: 13px; }
}

.lz-sr { margin: 6px 0 26px; }
.lz-sr h2 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin: 0 0 12px; }
.lz-sr h2 .icon { color: #0b9f8f; }
.lz-sr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.lz-sr-item { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: var(--text); transition: border-color .15s, transform .15s; }
.lz-sr-item:hover { border-color: hsl(var(--h) 70% 60%); transform: translateY(-2px); text-decoration: none; }
.lz-sr-item > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.lz-sr-item small { color: var(--muted); font-size: .74rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.lz-sr-item b { font-size: .95rem; line-height: 1.3; }
.lz-sr-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: hsl(var(--h) 92% 95%); color: hsl(var(--h) 62% 42%); }
.lz-sr-ic .icon { width: 20px; height: 20px; }
html[data-theme="dark"] .lz-sr-ic { background: hsl(var(--h) 42% 22%); color: hsl(var(--h) 92% 78%); }

[hidden] { display: none !important; }
