:root {
  color-scheme: dark;
}

.search-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 112px;
}


.search-panel {
  display: grid;
  width: min(760px, 100%);
  gap: 16px;
}

.search-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
}

.search-form input {
  min-width: 0;
  height: 46px;
  border: 0;
  border-radius: 13px;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.search-form button {
  display: grid;
  width: 52px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  cursor: pointer;
}

.search-form svg {
  width: 22px;
  height: 22px;
}

.trending-players {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.trending-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 32px;
  align-items: center;
  width: 100%;
  gap: 10px;
  min-height: 42px;
  padding: 0 7px 0 13px;
  color: var(--text);
}

.trending-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.trending-top {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-top span {
  color: #7ab5ff;
}

.trending-players.is-expanded .trending-top {
  display: none;
}

.trending-players.is-expanded .trending-toggle {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.trending-players.is-expanded .trending-label {
  grid-column: 1;
}

.trending-players.is-expanded .trending-expand {
  grid-column: 2;
  justify-self: end;
}

.trending-top.is-rotating {
  animation: trending-rise 260ms ease both;
}

@keyframes trending-rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.trending-expand {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.trending-expand:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.trending-chevron {
  color: currentColor;
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease;
}

.trending-players.is-expanded .trending-chevron {
  transform: rotate(180deg);
}

.trending-list {
  display: grid;
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height 240ms ease, opacity 180ms ease, transform 220ms ease, border-color 180ms ease;
}

.trending-players.is-expanded .trending-list {
  max-height: 220px;
  border-top-color: var(--line);
  opacity: 1;
  transform: translateY(0);
}

.trending-player-link {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  color: inherit;
  text-decoration: none;
}

.trending-player-link + .trending-player-link {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.trending-player-link span {
  color: #7ab5ff;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.trending-player-link strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-player-link:hover {
  background: rgba(255, 255, 255, 0.055);
}

.search-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.search-filters {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-select {
  width: 120px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 13px;
  outline: 0;
  cursor: pointer;
}

.search-reset-button {
  display: grid;
  place-items: center;
  margin-left: auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 180ms ease;
}

.search-reset-button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  transform: rotate(-30deg);
}

[hidden] {
  display: none !important;
}

.search-select:focus {
  border-color: rgba(255, 255, 255, 0.2);
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-result {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  color: inherit;
  text-decoration: none;
}

.search-result,
.search-empty {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 240ms ease;
  transition-delay: var(--search-result-delay, 0ms);
}

.search-result.is-visible,
.search-empty.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.search-favorite-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.search-favorite-btn:hover {
  color: var(--text);
}
.search-favorite-btn.is-active {
  color: #ffd700;
}
.search-favorite-btn svg {
  width: 20px;
  height: 20px;
}
.search-favorite-btn.is-active svg {
  fill: currentColor;
}

.search-result-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.075);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.search-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.search-result h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-empty {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 700px) {
  .search-page {
    width: 100%;
    padding: 14px 12px 112px;
  }

  .search-panel {
    width: 100%;
  }

  .search-filters {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
  }

  .search-select {
    width: 94px;
    height: 38px;
    padding: 0 6px;
    font-size: 11px;
    border-radius: 10px;
  }

  .search-reset-button {
    margin-left: auto;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-result,
  .search-empty,
  .trending-list,
  .trending-chevron {
    transition: none;
  }

  .trending-top.is-rotating {
    animation: none;
  }

  .search-result,
  .search-empty {
    opacity: 1;
    transform: none;
  }
}
