:root {
  color-scheme: dark;
  --bg: #0b0c10; --surface: #15161c; --surface-2: #1e2028; --line: #2a2c36;
  --text: #f3f3f6; --dim: #9799a8; --faint: #5d5f6d; --accent: #ff4655;
  --s1: #e60023; --s2: #1f9bff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 max(18px, env(safe-area-inset-left)); }

.hero { position: relative; overflow: hidden; padding: calc(56px + env(safe-area-inset-top)) 0 34px; background:
  radial-gradient(60% 120% at 15% 0%, rgba(230, 0, 35, .35), transparent 70%),
  radial-gradient(60% 120% at 85% 0%, rgba(31, 155, 255, .3), transparent 70%), var(--bg); }
.hero h1 { margin: 0; font-size: clamp(32px, 7vw, 60px); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 18px; }
.stats div { color: var(--dim); font-size: 14px; font-weight: 600; }
.stats b { display: block; color: var(--text); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }

.bar { position: sticky; top: 0; z-index: 10; background: rgba(11, 12, 16, .86); backdrop-filter: saturate(160%) blur(20px); -webkit-backdrop-filter: saturate(160%) blur(20px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.tabs { display: flex; gap: 22px; }
.tabs button { white-space: nowrap; padding: 14px 0 12px; font-weight: 700; color: var(--faint); border-bottom: 2px solid transparent; transition: color .15s; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.tabs button span { color: var(--faint); font-weight: 600; margin-left: 4px; font-size: 13px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 4px 0 12px; }
.search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px; background: var(--surface-2); color: var(--dim); }
.search svg, .x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; color: var(--text); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 13px; border-radius: 999px; background: var(--surface-2); color: var(--dim); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); }
select { height: 38px; padding: 0 30px 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; font-weight: 600; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }

main { padding-top: 22px; padding-bottom: 40px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; } }
.card { min-width: 0; text-align: left; content-visibility: auto; contain-intrinsic-size: 150px 210px; }
.cover { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: 0 6px 22px rgba(0, 0, 0, .4); transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.cover img.ld { opacity: 1; }
@media (hover: hover) { .card:hover .cover { transform: translateY(-4px) scale(1.02); box-shadow: 0 16px 36px rgba(0, 0, 0, .55); } }
.card:active .cover { transform: scale(.97); }
.ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; text-align: center; font-size: 13px; font-weight: 700; color: var(--dim); background: linear-gradient(135deg, #22242e, #15161c); }
.badge { position: absolute; top: 7px; left: 7px; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--s1); box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.badge.switch2 { background: var(--s2); }
.badge.switch2_edition { background: linear-gradient(90deg, var(--s1), var(--s2)); }
.t { margin-top: 8px; font-size: 13.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.s { margin-top: 2px; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) { .t { font-size: 12.5px; } .s { font-size: 11.5px; } }
.empty { text-align: center; color: var(--dim); padding: 60px 0; }
.foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 13px; padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
.foot a { color: var(--line); text-decoration: none; }

.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(5, 5, 8, .75); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .2s; }
.modal-box { position: relative; width: min(420px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 22px; padding: 22px; text-align: center; animation: pop .25s cubic-bezier(.2, .8, .2, 1); }
.modal-box .cover { width: min(300px, 100%); margin: 0 auto 18px; border-radius: 16px; }
.modal-box h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.02em; }
.modal-box .ed { color: var(--dim); margin-bottom: 12px; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pill { padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--dim); }
.pill.switch { background: rgba(230, 0, 35, .18); color: #ff6b80; }
.pill.switch2 { background: rgba(31, 155, 255, .18); color: #6cc0ff; }
.pill.switch2_edition { background: linear-gradient(90deg, rgba(230, 0, 35, .2), rgba(31, 155, 255, .2)); color: #e6e7ff; }
.x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--dim); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
