:root {
  --bg: #070c16;
  --bg-soft: #0c1322;
  --panel: rgba(14, 23, 40, .82);
  --panel-strong: #111b2e;
  --line: rgba(156, 203, 255, .13);
  --line-strong: rgba(106, 214, 255, .3);
  --text: #f4f8ff;
  --muted: #92a2b9;
  --cyan: #55d9ff;
  --cyan-2: #20b9f5;
  --violet: #9b7cff;
  --success: #6ef0b0;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(33, 151, 255, .08), transparent 35%),
    radial-gradient(circle at 88% 70%, rgba(151, 95, 255, .07), transparent 38%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(18px, 3vw, 42px);
  background: rgba(6, 11, 20, .94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 33px; height: 33px; display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(65,205,255,.18), rgba(135,98,255,.12));
  border: 1px solid rgba(86,213,255,.28);
  box-shadow: 0 0 25px rgba(62,200,255,.10);
}
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: var(--cyan); stroke-width: 1.4; }
.brand-copy { display: grid; min-width: 0; }
.brand-copy strong { font-size: 14px; letter-spacing: .01em; white-space: nowrap; }
.brand-copy small { color: #6f839f; font-size: 10px; margin-top: 1px; white-space: nowrap; }
.quick-nav { display: flex; align-items: center; gap: 3px; }
.nav-button {
  color: #aebcd0; background: transparent; border: 0; border-radius: 9px;
  padding: 8px 10px; cursor: pointer; font-size: 12px;
}
.nav-button:hover { color: white; background: rgba(255,255,255,.05); }

.hero {
  min-height: 300px;
  height: min(34vh, 355px);
  position: relative;
  overflow: hidden;
  background: #0a1426 url("assets/hero.webp") center 52% / cover no-repeat;
  border-bottom: 1px solid rgba(99, 191, 255, .15);
}
.hero::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(to bottom, transparent, rgba(7,12,22,.92));
  pointer-events: none;
}
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(3,10,21,.78) 0%, rgba(3,10,21,.42) 38%, rgba(3,10,21,.16) 68%, rgba(3,10,21,.4) 100%),
    linear-gradient(0deg, rgba(5,10,20,.18), rgba(5,10,20,.08));
}
.hero-grid {
  position: absolute; inset: 0; opacity: .14;
  background-image:
    linear-gradient(rgba(84,211,255,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84,211,255,.14) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.18), transparent 85%);
}
.hero-content {
  width: min(1120px, calc(100% - 36px));
  height: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-bottom: 12px;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: #b9d8ec; font-size: 11px; text-transform: uppercase; letter-spacing: .14em;
  text-shadow: 0 1px 10px rgba(0,0,0,.6);
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(82,215,255,.12), 0 0 16px rgba(82,215,255,.8);
}
.hero h1 { margin: 10px 0 4px; font-size: clamp(31px, 4.4vw, 54px); line-height: .98; letter-spacing: -.045em; text-shadow: 0 4px 28px rgba(0,0,0,.5); }
.hero p { margin: 6px 0 18px; color: #c5d3e6; font-size: clamp(13px, 1.6vw, 16px); text-shadow: 0 2px 18px rgba(0,0,0,.7); }

.search-box {
  width: min(760px, 100%);
  min-height: 54px;
  display: grid;
  grid-template-columns: 44px 1fr 34px auto;
  align-items: center;
  padding: 5px 5px 5px 4px;
  border-radius: 16px;
  background: rgba(9, 18, 32, .89);
  border: 1px solid rgba(133, 216, 255, .32);
  box-shadow: 0 14px 45px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
}
.search-box:focus-within { border-color: rgba(82,216,255,.65); box-shadow: 0 14px 45px rgba(0,0,0,.38), 0 0 0 3px rgba(67,190,255,.10); }
.search-icon { display: grid; place-items: center; color: var(--cyan); }
.search-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.search-box input {
  width: 100%; min-width: 0; color: white; background: transparent; border: 0; outline: 0;
  font-size: 15px; padding: 0 8px 0 0;
}
.search-box input::placeholder { color: #6e8099; }
.clear-button { border: 0; background: transparent; color: #73869f; cursor: pointer; font-size: 24px; line-height: 1; border-radius: 8px; display: none; }
.clear-button.visible { display: block; }
.clear-button:hover { color: white; background: rgba(255,255,255,.06); }
.search-button {
  border: 0; color: #04111b; background: linear-gradient(135deg, #6ee6ff, #4bc1ff);
  font-weight: 800; font-size: 12px; padding: 12px 20px; border-radius: 11px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(62,194,255,.2);
}
.search-button:hover { filter: brightness(1.08); }
.hero-links { margin-top: 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #7890aa; font-size: 10px; }
.hero-links button { border: 0; background: transparent; color: #b4cae0; padding: 3px 6px; border-radius: 6px; cursor: pointer; font-size: 10px; }
.hero-links button:hover { color: white; background: rgba(255,255,255,.06); }

.content-wrap { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 16px 0 44px; flex: 1; }
.category-strip {
  display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none;
  padding: 2px 0 12px; border-bottom: 1px solid var(--line);
}
.category-strip::-webkit-scrollbar { display: none; }
.category {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid transparent; background: transparent; color: #91a1b7;
  padding: 9px 12px; border-radius: 10px; font-size: 11px; cursor: pointer;
}
.category span { color: #617994; }
.category:hover { color: white; background: rgba(255,255,255,.035); }
.category.active { color: #dcf6ff; background: rgba(63,197,255,.09); border-color: rgba(75,203,255,.2); }
.category.active span { color: var(--cyan); }

.toolbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 1px 10px; }
.toolbar h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.toolbar-actions { display: flex; align-items: center; gap: 7px; }
.sort-label { color: #71839a; font-size: 10px; }
#sort-select { color: #b8c6d8; background: #0d1727; border: 1px solid var(--line); border-radius: 9px; padding: 7px 26px 7px 9px; outline: none; font-size: 10px; }
.status { min-height: 0; color: var(--muted); font-size: 11px; padding: 0 1px 8px; }
.status:empty { display: none; }

.results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.result-card {
  min-width: 0; overflow: hidden; border-radius: var(--radius); background: linear-gradient(180deg, rgba(16,27,47,.96), rgba(11,19,33,.98));
  border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0,0,0,.16); transition: transform .17s ease, border-color .17s ease, box-shadow .17s ease;
}
.result-card:hover { transform: translateY(-2px); border-color: rgba(93,206,255,.28); box-shadow: 0 14px 36px rgba(0,0,0,.24); }
.card-visual { height: 104px; position: relative; overflow: hidden; background: #101c30; }
.card-visual-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.02); }
.card-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,10,20,.04), rgba(5,10,20,.65)); }
.type-badge, .online-badge { position: absolute; z-index: 2; top: 9px; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; padding: 5px 7px; border-radius: 999px; backdrop-filter: blur(8px); }
.type-badge { left: 9px; color: #dff7ff; background: rgba(8,20,34,.7); border: 1px solid rgba(119,211,255,.24); }
.online-badge { right: 9px; color: #d8ffe9; background: rgba(10,37,29,.72); border: 1px solid rgba(94,240,169,.22); }
.online-badge i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--success); margin-right: 4px; box-shadow: 0 0 8px rgba(110,240,176,.8); }
.card-body { padding: 12px 13px 13px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-title { margin: 0; font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { margin: 3px 0 0; color: #6f829b; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favorite-button { flex: 0 0 auto; width: 26px; height: 26px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #7f91aa; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1; }
.favorite-button.active { color: #ffe18b; }
.card-description { color: #9cacc0; font-size: 10px; line-height: 1.45; min-height: 29px; margin: 9px 0 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 19px; }
.card-tag { color: #8ea4bd; background: rgba(119,158,204,.07); border: 1px solid rgba(119,158,204,.10); padding: 3px 6px; border-radius: 6px; font-size: 8px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; margin-top: 9px; border-top: 1px solid rgba(148,190,238,.08); }
.card-stats { color: #687c95; font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.primary-link { color: #aeeaff; text-decoration: none; font-size: 9px; font-weight: 700; white-space: nowrap; }
.primary-link:hover { color: white; }
.primary-link span { color: var(--cyan); }

.empty-state { text-align: center; padding: 58px 20px; border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(255,255,255,.01); }
.empty-symbol { color: var(--cyan); font-size: 38px; opacity: .8; }
.empty-state h3 { margin: 8px 0 5px; font-size: 16px; }
.empty-state p { margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.secondary-button { border: 1px solid var(--line-strong); background: rgba(55,180,235,.08); color: #ccefff; border-radius: 9px; padding: 8px 12px; cursor: pointer; font-size: 10px; }

.loading-card { height: 250px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(100deg, #0d1727 20%, #14233a 35%, #0d1727 50%); background-size: 220% 100%; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }

.footer { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #52657d; font-size: 9px; border-top: 1px solid var(--line); background: rgba(5,9,16,.75); }
.footer-sep { opacity: .6; }

@media (max-width: 900px) {
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { height: 320px; }
}
@media (max-width: 620px) {
  .topbar { height: 56px; padding: 0 13px; }
  .brand-copy small { display: none; }
  .quick-nav .nav-button:not(:first-child) { display: none; }
  .hero { min-height: 272px; height: 272px; background-position: 58% 50%; }
  .hero-content { width: calc(100% - 24px); }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 12px; margin-bottom: 14px; }
  .search-box { grid-template-columns: 38px 1fr 30px auto; min-height: 50px; border-radius: 14px; }
  .search-button { padding: 10px 12px; }
  .hero-links { display: none; }
  .content-wrap { width: calc(100% - 24px); padding-top: 10px; }
  .toolbar { align-items: flex-end; }
  .toolbar p { max-width: 220px; }
  .sort-label { display: none; }
  .results-grid { grid-template-columns: 1fr; }
  .card-visual { height: 118px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
