:root {
  --bg: #0b0b0f;
  --panel: #14141d;
  --panel-2: #1b1b27;
  --text: #f5f5f7;
  --muted: #9ca3af;
  --accent: #e50914;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(circle at top, #1b1224 0%, var(--bg) 45%);
  overflow-x: hidden;
}

.app {
  width: 100%;
  overflow-x: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(11, 11, 15, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #272734;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}

.brand:hover,
.brand:focus-visible {
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  width: 100%;
  max-width: 460px;
}

.search {
  background: #11131b;
  border: 1px solid #292d3d;
  color: var(--text);
  border-radius: 10px;
  min-width: 120px;
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
}

.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(55vh, 360px);
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid #2f3447;
  background: #121521;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
  z-index: 40;
}

.suggest-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #23283b;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.suggest-item:last-child {
  border-bottom: 0;
}

.suggest-item:hover {
  background: #1b2133;
}

.suggest-item img {
  width: 38px;
  height: 24px;
  object-fit: contain;
  border-radius: 6px;
  background: #0d1018;
}

.suggest-title {
  font-size: 0.87rem;
  line-height: 1.2;
}

.suggest-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.btn {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  padding: 10px 5px;
  min-height: 40px;
}

.btn.ghost {
  background: #1f2330;
}

.content {
  padding: 16px 16px 88px;
}

.seo-hero {
  margin: 6px 0 14px;
  padding: 14px;
  border: 1px solid #272734;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 20, 29, 0.75), rgba(11, 11, 15, 0.35));
}

.seo-h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.seo-lead {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.seo-content {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #272734;
  border-radius: 16px;
  background: rgba(20, 20, 29, 0.55);
}

.seo-content h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.seo-content h3 {
  margin: 14px 0 8px;
  font-size: 0.95rem;
  color: #d6d6e5;
}

.seo-content p,
.seo-content li {
  color: var(--muted);
  line-height: 1.55;
}

.seo-content ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.player-wrap {
  background: linear-gradient(180deg, #1a1a28, #11111a);
  border: 1px solid #2b2b3b;
  border-radius: 16px;
  padding: 12px;
}

.player-frame {
  position: relative;
  background: black;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
}

#videoPlayer {
  width: 100%;
  height: 100%;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), transparent);
}

.overlay-title {
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(20, 20, 29, 0.9);
}

.player-meta {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.player-title-wrap {
  min-width: 0;
}

.label {
  margin: 0;
  color: var(--muted);
}

.current-title {
  margin: 4px 0 0;
  font-size: 1.1rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.player-buttons .btn {
  width: 100%;
  min-height: 42px;
  white-space: nowrap;
}

.filters {
  margin-top: 14px;
}

.ad-wrap {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #2b2b3b;
  border-radius: 14px;
  background: linear-gradient(180deg, #171728, #10101a);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.ad-wrap .adsbygoogle {
  width: 100%;
  max-width: 980px;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.mode-tabs button {
  border: 1px solid #2a2f41;
  background: #151724;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
}

.mode-tabs button.active {
  background: #0000cd;
  border-color: #313a56;
}

.result-info {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 760px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .brand {
    font-size: 1rem;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .search-wrap {
    max-width: none;
  }

  .search {
    min-width: 0;
    font-size: 16px;
  }

  #refreshBtn {
    white-space: nowrap;
    padding-inline: 12px;
  }
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
}

.category-tabs button {
  border: 1px solid #2a2f41;
  background: #151724;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
}

.category-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
}

.card {
  background: linear-gradient(180deg, #222234, #161625);
  border: 1px solid #2e2e44;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #5c5cff;
}

.card.active {
  border-color: var(--accent);
}

.logo {
  width: 100%;
  height: 90px;
  object-fit: contain;
  background: #0b0c11;
}

.info {
  padding: 8px;
}

.name {
  margin: 0;
  font-size: .9rem;
}

.meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.grid-view {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.hidden {
  display: none !important;
}

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 11, 15, 0.96);
  border-top: 1px solid #272734;
}

.mobile-nav button {
  border: 0;
  color: var(--muted);
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
}

.mobile-nav button.active {
  color: white;
  background: #0000cd;
}

@media (min-width: 1000px) {
  .content {
    max-width: 1380px;
    margin: 0 auto;
    padding-bottom: 28px;
  }
  .mobile-nav {
    display: none;
  }

  .topbar {
    flex-wrap: nowrap;
  }

  .top-actions {
    flex-wrap: nowrap;
    display: flex;
  }

  .search-wrap {
    width: 340px;
    max-width: 340px;
  }

  .player-meta {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .player-buttons {
    display: flex;
    flex-wrap: nowrap;
    width: auto;
  }

  .player-buttons .btn {
    width: 118px;
  }
}
