:root {
  color-scheme: dark;
  --bg: #0b0d17;
  --surface: #151829;
  --surface2: #1e2238;
  --fg: #eef0ff;
  --muted: #9aa0c3;
  --accent: #5ef0ff;
  --accent2: #ff4fa3;
  --border: #2a2f4d;
  --radius: 10px;
  --font: "Inter", system-ui, sans-serif;
  --display: "Chakra Petch", "Inter", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--font); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.1; }
.wrap { max-width: 78rem; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); margin: 2px 0; font-size: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }

.top { position: sticky; top: 0; z-index: 5; background: rgba(11,13,23,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding-top: 8px; padding-bottom: 8px; gap: 8px 12px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .top-tools { order: 2; margin-left: 0; display: flex; gap: 4px; }
  .tabs { order: 3; width: 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs .tab { flex: none; }
}
.logo { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: .06em; }
.logo span { color: var(--accent); margin-left: 4px; }
.tabs { display: flex; gap: 0; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
@media (max-width: 520px) { .tabs .tab { padding: 6px 8px; font-size: 13px; } .logo { font-size: 18px; } }
.avatar { position: relative; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: none; cursor: pointer; display: grid; place-items: center; background: #3a2a6a; color: #fff; font-weight: 700; align-self: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.avatar:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
.srv { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid #ffffff1f; border-radius: 14px; background: #ffffff0a; margin-bottom: 12px; }
.srv h3 { margin: 4px 0; }
.srv-addr { word-break: break-all; color: #7df9ff; }
.link-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.link-card { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.top-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.tab.pass { border: 1px solid var(--line, #2a3150); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.tab { white-space: nowrap; align-self: center; background: none; border: 0; padding: 10px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; min-height: 44px; }
.tab.on { color: var(--fg); background: var(--surface2); }
.count { background: var(--accent2); color: #fff; border-radius: 6px; padding: 0 6px; font-size: 12px; margin-left: 4px; }

.hero { background: radial-gradient(ellipse at 80% 0%, rgba(255,79,163,.25), transparent 60%), radial-gradient(ellipse at 0% 100%, rgba(94,240,255,.15), transparent 60%); border-bottom: 1px solid var(--border); }
.hero-in { display: grid; gap: 32px; padding-top: 48px; padding-bottom: 48px; align-items: center; }
.hero h1 { font-size: clamp(44px, 8vw, 84px); margin: 8px 0 16px; }
.kicker { color: var(--accent); font-weight: 600; margin: 0; font-size: 14px; }
.lead { color: #c9cdea; max-width: 38rem; margin: 0 0 24px; }
@media (min-width: 860px) { .hero-in { grid-template-columns: 1.1fr 1fr; padding-top: 72px; padding-bottom: 72px; } }

.btn { border: 0; border-radius: 8px; padding: 12px 20px; font-weight: 600; cursor: pointer; min-height: 44px; }
.btn.primary { background: var(--accent); color: #05141a; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border: 1px solid var(--border); }

.cover { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.cover-big { aspect-ratio: 16/10; }
.cover-letter { font-family: var(--display); font-weight: 700; font-size: 96px; color: rgba(255,255,255,.85); text-shadow: 0 6px 30px rgba(0,0,0,.4); }
.cover-big .cover-letter { font-size: 160px; }
.cover-genre { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.55); padding: 2px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; }

.main { padding-top: 32px; padding-bottom: 64px; }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.search { grid-column: 1 / -1; }
@media (min-width: 700px) { .filters { grid-template-columns: 1fr 200px 160px; } .search { grid-column: auto; } }
.search, select { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; min-height: 46px; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 14px; min-height: 38px; display: inline-flex; align-items: center; }
.chip.on { border-color: var(--accent); color: var(--accent); }
.sec { font-size: 28px; margin: 24px 0 16px; display: flex; align-items: baseline; gap: 12px; }
.sec small { font-family: var(--font); font-size: 14px; color: var(--muted); font-weight: 400; }

.games { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.game { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; transition: border-color .15s; }
.game:hover { border-color: var(--accent); }
.game-open { display: block; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; }
.game-body { padding: 12px 4px 4px; }
.game h3 { font-size: 19px; }
.meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 13px; flex-wrap: wrap; }
.star { color: #ffd166; font-weight: 600; font-variant-numeric: tabular-nums; }
.plats { color: var(--muted); }
.heart { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 8px; border: 0; background: rgba(0,0,0,.6); font-size: 20px; cursor: pointer; }
.heart.on { background: var(--accent2); color: #fff; }

.foot { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: 14px; }

.modal-bg { position: fixed; inset: 0; background: rgba(3,4,10,.75); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; max-width: 560px; width: 100%; max-height: 92vh; overflow: auto; padding: 12px; }
.modal-body { padding: 16px 8px 8px; }
.modal h2 { font-size: 34px; margin: 6px 0; }
.modal .lead { margin: 16px 0 8px; }
.close { position: absolute; top: 20px; right: 20px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 8px; background: rgba(0,0,0,.6); font-size: 24px; cursor: pointer; }

.empty { text-align: center; padding: 48px 16px; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); }
.empty-title { font-weight: 600; color: var(--fg); }
.loading { display: flex; justify-content: center; padding: 32px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { padding: 12px 16px; border-radius: 8px; }
.alert-error { background: #3a1222; color: #ffb3cf; }
