/* ==========================================================================
   Orbi — component library
   ========================================================================== */

/* ------------------------------------------------------------------ logo */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.045em;
  color: var(--text);
  line-height: 1;
}

.brand__orb {
  position: relative;
  width: 34px;
  height: 34px;
  background: url("/static/img/logo.png?v=1.1.0") center / contain no-repeat;
  flex: none;
}

.brand__word {
  display: inline-flex;
  align-items: baseline;
}

.brand__dot {
  color: var(--primary-bright);
}

/* ------------------------------------------------------------------- nav */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition:
    background var(--dur-hover) var(--ease-hover),
    border-color var(--dur-hover) var(--ease-hover),
    backdrop-filter var(--dur-hover) var(--ease-hover);
  border-bottom: 1px solid transparent;
}

.nav::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 7, 12, 0.92), rgba(8, 7, 12, 0));
  pointer-events: none;
  opacity: 1;
  transition: opacity var(--dur-hover) var(--ease-hover);
}

.nav.is-scrolled {
  background: var(--surface-glass-strong);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-bottom-color: var(--line);
}

.nav.is-scrolled::after {
  opacity: 0;
}

.nav__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2.25rem);
  width: 100%;
}

.nav__links {
  display: none;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.5rem;
}

@media (min-width: 900px) {
  .nav__links {
    display: flex;
  }
}

.nav__link {
  position: relative;
  padding: 0.55rem 0.85rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  transition: color var(--dur-hover) var(--ease-hover), background var(--dur-hover) var(--ease-hover);
  white-space: nowrap;
}

.nav__link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav__link[aria-current="page"] {
  color: var(--text);
}

.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.1rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary-bright);
  transform: translateX(-50%);
  box-shadow: 0 0 10px var(--primary-bright);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav__search {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-width: 240px;
  height: 42px;
  padding: 0 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-faint);
  font-size: var(--fs-sm);
  transition: border-color var(--dur-2), background var(--dur-2), color var(--dur-2);
  cursor: pointer;
}

.nav__search:hover {
  border-color: var(--line-strong);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.06);
}

.nav__search kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--text-faint);
}

@media (min-width: 1100px) {
  .nav__search {
    display: inline-flex;
  }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--text-soft);
  border: 1px solid transparent;
  transition: background var(--dur-2), color var(--dur-2), border-color var(--dur-2), transform var(--dur-2);
  flex: none;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.icon-btn--outline {
  border-color: var(--line);
}

.icon-btn__dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-bright);
  box-shadow: 0 0 8px var(--primary-bright);
}

.nav__avatar {
  margin-left: 0.25rem;
}

/* avatar */
.avatar {
  --hue: 265;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background:
    linear-gradient(145deg, hsl(var(--hue) 82% 64% / 0.95), hsl(calc(var(--hue) + 46) 78% 42% / 0.95));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  flex: none;
  user-select: none;
}

.avatar--lg {
  width: 52px;
  height: 52px;
  font-size: 0.95rem;
}

.avatar--xl {
  width: 84px;
  height: 84px;
  font-size: 1.5rem;
}

.avatar--sm {
  width: 30px;
  height: 30px;
  font-size: 0.66rem;
}

.avatar__status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg);
}

/* avatar menu */
.menu {
  position: relative;
}

.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 260px;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--surface-glass-strong);
  backdrop-filter: blur(24px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity var(--dur-hover) var(--ease-hover), transform var(--dur-hover) var(--ease-hover), visibility var(--dur-2);
  z-index: var(--z-overlay);
}

.menu__panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.menu__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 0.4rem;
}

.menu__head strong {
  display: block;
  font-size: 0.9rem;
}

.menu__head span {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-size: var(--fs-sm);
  color: var(--text-soft);
  transition: background var(--dur-1), color var(--dur-1);
}

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

.menu__item svg {
  opacity: 0.7;
}

/* mobile tab bar */
.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: var(--z-nav);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: rgba(10, 9, 15, 0.86);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) {
  .tabbar {
    display: none;
  }
}

.tabbar__item {
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  padding: 0.4rem 0;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  transition: color var(--dur-2);
  position: relative;
}

.tabbar__item svg {
  width: 22px;
  height: 22px;
}

.tabbar__item[aria-current="page"] {
  color: var(--text);
}

.tabbar__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary-bright);
  box-shadow: 0 0 12px var(--primary-bright);
}

body {
  padding-bottom: 0;
}

@media (max-width: 899px) {
  body {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  }
}

/* --------------------------------------------------------------- buttons */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  height: 46px;
  padding-inline: 1.25rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  transition:
    transform var(--dur-hover) var(--ease-hover),
    background var(--dur-hover) var(--ease-hover),
    border-color var(--dur-hover) var(--ease-hover),
    color var(--dur-hover) var(--ease-hover),
    box-shadow var(--dur-hover) var(--ease-hover);
  will-change: transform;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  --btn-bg: var(--grad-primary);
  color: #fff;
  box-shadow: 0 14px 34px -14px rgba(108, 104, 251, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 46%);
  opacity: 0.7;
  pointer-events: none;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px -16px rgba(108, 104, 251, 1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn--light {
  --btn-bg: #f6f5fb;
  color: #0b0a11;
  box-shadow: 0 10px 30px -14px rgba(255, 255, 255, 0.4);
}

.btn--light:hover {
  background: #fff;
  transform: translateY(-2px);
}

.btn--ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.26);
}

.btn--quiet {
  color: var(--text-soft);
  padding-inline: 0.85rem;
}

.btn--quiet:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn--danger {
  border-color: rgba(255, 92, 114, 0.35);
  color: #ffb3c0;
}

.btn--danger:hover {
  background: rgba(255, 92, 114, 0.12);
}

.btn--sm {
  height: 38px;
  padding-inline: 0.95rem;
  font-size: var(--fs-xs);
}

.btn--lg {
  height: 56px;
  padding-inline: 1.7rem;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: 46px;
  padding-inline: 0;
}

.btn--icon.btn--lg {
  width: 56px;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.btn__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

/* circular play */
.play-fab {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #0b0a11;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.8);
  transition: transform var(--dur-2) var(--ease-spring), background var(--dur-2);
}

.play-fab:hover {
  transform: scale(1.08);
  background: #fff;
}

.play-fab svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

/* ----------------------------------------------------------------- chips */
.chips {
  display: flex;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding-inline: 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--dur-hover) var(--ease-hover);
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.chip[aria-pressed="true"],
.chip.is-active {
  background: rgba(108, 104, 251, 0.18);
  border-color: rgba(139, 135, 255, 0.45);
  color: #e3e1ff;
}

.chip--sm {
  height: 30px;
  font-size: var(--fs-2xs);
  padding-inline: 0.75rem;
}

.chip__count {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ card */
.card {
  position: relative;
  display: block;
  border-radius: var(--radius-poster);
  isolation: isolate;
  transition: transform var(--dur-hover) var(--ease-hover);
}

.card__media {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-poster);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.9);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-hover) var(--ease-hover), filter var(--dur-3);
  filter: saturate(0.92) contrast(1.03);
}

.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 5, 10, 0) 42%, rgba(6, 5, 10, 0.72) 82%, rgba(6, 5, 10, 0.94) 100%),
    linear-gradient(150deg, color-mix(in srgb, var(--accent, #6c68fb) 30%, transparent) 0%, transparent 52%);
  opacity: 0.9;
  transition: opacity var(--dur-3);
  pointer-events: none;
}

.card__border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  pointer-events: none;
  z-index: 2;
}

.card__badges {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  right: 0.6rem;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.4rem;
  z-index: 3;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 24px;
  padding-inline: 0.5rem;
  border-radius: 7px;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(10, 9, 15, 0.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  white-space: nowrap;
}

.badge--rating {
  color: var(--rating);
}

.badge--rating svg {
  width: 11px;
  height: 11px;
}

.badge--new {
  background: rgba(108, 104, 251, 0.9);
  border-color: transparent;
  color: #fff;
}

.badge--top {
  background: rgba(247, 199, 100, 0.92);
  color: #211603;
  border-color: transparent;
}

.badge--soft {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  font-family: var(--font-body);
  font-weight: 500;
}

.card__quick {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 9, 15, 0.66);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur-2), transform var(--dur-2), background var(--dur-2);
  z-index: 4;
}

.card__quick:hover {
  background: var(--primary);
}

.card__quick svg {
  width: 14px;
  height: 14px;
}

.card__overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  padding: 0.85rem;
  display: grid;
  gap: 0.6rem;
}

.card__overlay-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.5rem;
}

.card__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.15;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

.card__sub {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.62);
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 3;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-spring);
}

.card__play span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #0b0a11;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.9);
}

.card__play svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

.card__progress {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.55rem;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
  z-index: 4;
}

.card__progress span {
  display: block;
  height: 100%;
  background: var(--primary-bright);
  border-radius: inherit;
  box-shadow: 0 0 10px var(--primary-bright);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px) scale(1.02);
  z-index: 6;
  transition: transform var(--dur-hover) var(--ease-hover);
}

.card:hover .card__media img,
.card:focus-visible .card__media img {
  transform: scale(1.04);
  filter: saturate(1.05) contrast(1.06);
  transition: transform var(--dur-hover) var(--ease-hover), filter var(--dur-hover) var(--ease-hover);
}

.card:hover .card__play,
.card:focus-visible .card__play,
.card:hover .card__quick,
.card:focus-visible .card__quick {
  opacity: 1;
  transform: none;
}

.card:hover .card__border {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 0 1px rgba(108, 104, 251, 0.25);
}

/* caption variant for grids */
.card-caption {
  padding-top: 0.65rem;
  display: grid;
  gap: 0.15rem;
}

.card-caption__title {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card-caption__meta {
  font-size: 0.72rem;
  color: var(--text-faint);
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

/* wide / landscape card */
.card--wide .card__media {
  aspect-ratio: 16 / 9;
}

.card--wide .card__media::after {
  background:
    linear-gradient(180deg, rgba(6, 5, 10, 0.05) 35%, rgba(6, 5, 10, 0.82) 100%),
    linear-gradient(120deg, color-mix(in srgb, var(--accent, #6c68fb) 34%, transparent), transparent 60%);
}

.card--wide .card__title {
  font-size: 1.02rem;
}

/* poster with big rank number */
.card--rank {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 0.2rem;
}

.card--rank .card__rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 3vw + 2rem, 6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.55);
  paint-order: stroke fill;
  transform: none;
  user-select: none;
  transition: -webkit-text-stroke-color var(--dur-hover) var(--ease-hover), color var(--dur-hover) var(--ease-hover);
}

.card--rank:hover .card__rank {
  -webkit-text-stroke-color: var(--primary-bright);
  color: rgba(108, 104, 251, 0.16);
}

/* --------------------------------------------------------------- rows */
.row {
  position: relative;
}

.row__scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: clamp(0.6rem, 0.4rem + 0.7vw, 1.1rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-block: 0.4rem 1.4rem;
  padding-inline: 2px;
  scrollbar-width: none;
}

.row__scroller::-webkit-scrollbar {
  display: none;
}

.row__scroller > * {
  scroll-snap-align: start;
}

.row__scroller--cards {
  grid-auto-columns: clamp(146px, 12.4vw, 232px);
}

.row__scroller--wide {
  grid-auto-columns: clamp(260px, 27vw, 420px);
}

.row__scroller--rank {
  grid-auto-columns: clamp(240px, 22vw, 340px);
}

.row__nav {
  display: flex;
  gap: 0.4rem;
}

.row__arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(18, 17, 27, 0.7);
  color: var(--text-soft);
  backdrop-filter: blur(10px);
  transition: all var(--dur-hover) var(--ease-hover);
}

.row__arrow:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--line-strong);
}

.row__arrow[disabled] {
  opacity: 0.28;
  pointer-events: none;
}

.row__arrow svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 720px) {
  .row__nav {
    display: none;
  }
}

/* ---------------------------------------------------------------- grid */
.title-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(132px, 15vw, 200px), 1fr));
  gap: clamp(0.9rem, 0.6rem + 1.2vw, 1.8rem) clamp(0.6rem, 0.4rem + 0.8vw, 1.1rem);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--gap-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--gap-md);
}

/* -------------------------------------------------------------- ratings */
.stars {
  --rating: 88%;
  --size: 13px;
  position: relative;
  display: inline-block;
  height: var(--size);
  width: calc(var(--size) * 5.4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255,255,255,.22)'%3E%3Cpath d='M12 2.6l2.9 5.9 6.5.9-4.7 4.6 1.1 6.5L12 17.4 6.2 20.5l1.1-6.5L2.6 9.4l6.5-.9L12 2.6z'/%3E%3C/svg%3E");
  background-size: var(--size) var(--size);
  background-repeat: repeat-x;
  vertical-align: middle;
}

.stars::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--rating);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f7c764'%3E%3Cpath d='M12 2.6l2.9 5.9 6.5.9-4.7 4.6 1.1 6.5L12 17.4 6.2 20.5l1.1-6.5L2.6 9.4l6.5-.9L12 2.6z'/%3E%3C/svg%3E");
  background-size: var(--size) var(--size);
  background-repeat: repeat-x;
  overflow: hidden;
}

.rating-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--fs-xs);
  color: var(--text-soft);
}

.rating-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- avatars */
.person {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.person__name {
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person__meta {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- forms */
.field {
  display: grid;
  gap: 0.45rem;
}

.field__label {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.01em;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.field__label a {
  color: var(--primary-bright);
  font-weight: 500;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 50px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: var(--fs-sm);
  transition: border-color var(--dur-2), background var(--dur-2), box-shadow var(--dur-2);
  appearance: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-faint);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--line-strong);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: rgba(139, 135, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(108, 104, 251, 0.14);
}

.textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.6;
}

.field__hint {
  font-size: var(--fs-2xs);
  color: var(--text-faint);
}

.field__error {
  font-size: var(--fs-2xs);
  color: #ff9aab;
  display: none;
}

.field.has-error .input,
.field.has-error .textarea {
  border-color: rgba(255, 92, 114, 0.55);
}

.field.has-error .field__error {
  display: block;
}

.checkbox {
  display: flex;
  align-items: start;
  gap: 0.6rem;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.5;
  cursor: pointer;
}

.checkbox input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  flex: none;
  display: grid;
  place-items: center;
  transition: all var(--dur-2);
  cursor: pointer;
}

.checkbox input:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox input:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 1.6px solid #fff;
  border-bottom: 1.6px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.field-row {
  display: grid;
  gap: var(--gap-sm);
}

@media (min-width: 620px) {
  .field-row--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-alert {
  display: none;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  font-size: var(--fs-xs);
  line-height: 1.5;
  border: 1px solid rgba(255, 92, 114, 0.35);
  background: rgba(255, 92, 114, 0.1);
  color: #ffc2cc;
}

.form-alert.is-visible {
  display: block;
}

/* segmented control */
.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  position: relative;
}

.segmented__item {
  position: relative;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur-2), background var(--dur-2);
  white-space: nowrap;
}

.segmented__item:hover {
  color: var(--text);
}

.segmented__item[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------- dialog */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  display: grid;
  place-items: center;
  padding: var(--gutter);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-hover) var(--ease-hover), visibility var(--dur-3);
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 3, 8, 0.74);
  backdrop-filter: blur(8px);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow: auto;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, #15141f, #0d0c13);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.4rem, 3vw, 2.4rem);
  transform: translateY(14px) scale(0.98);
  transition: transform var(--dur-3) var(--ease-spring);
}

.modal.is-open .modal__panel {
  transform: none;
}

.modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
}

/* sheet (mobile filters) */
.sheet {
  position: fixed;
  inset: auto 0 0;
  z-index: var(--z-sheet);
  max-height: 88dvh;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: #121119;
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -30px 80px -20px rgba(0, 0, 0, 0.9);
  transform: translateY(102%);
  transition: transform var(--dur-hover) var(--ease-hover);
  display: flex;
  flex-direction: column;
}

.sheet.is-open {
  transform: none;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  border-bottom: 1px solid var(--line);
}

.sheet__body {
  padding: var(--gutter);
  overflow: auto;
  display: grid;
  gap: var(--gap-md);
}

.sheet__foot {
  padding: 1rem var(--gutter) calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.6rem;
}

/* ----------------------------------------------------------------- toast */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: grid;
  gap: 0.5rem;
  width: min(92vw, 440px);
  pointer-events: none;
}

@media (max-width: 899px) {
  .toasts {
    bottom: calc(var(--tabbar-h) + 1rem + env(safe-area-inset-bottom));
  }
}

.toast {
  display: flex;
  align-items: start;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: rgba(20, 19, 29, 0.94);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  color: var(--text-soft);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  animation: toast-in var(--dur-hover) var(--ease-hover);
}

.toast--success {
  border-color: rgba(74, 222, 128, 0.32);
}

.toast--error {
  border-color: rgba(255, 92, 114, 0.4);
}

.toast svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* --------------------------------------------------------------- tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs__item {
  position: relative;
  padding: 0.9rem 0.2rem;
  margin-right: 1.4rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--dur-2);
}

.tabs__item:hover {
  color: var(--text);
}

.tabs__item[aria-selected="true"] {
  color: var(--text);
}

.tabs__item[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--grad-primary);
  border-radius: 2px;
}

.tab-panel[hidden] {
  display: none;
}

/* ---------------------------------------------------------------- misc */
.empty-state {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  text-align: center;
  padding: clamp(2.5rem, 6vw, 5rem) 1rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.015);
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-bright);
}

.empty-state h3 {
  font-size: var(--fs-h4);
}

.empty-state p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  max-width: 44ch;
}

.kv {
  display: grid;
  gap: 0.4rem;
}

.kv__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-sm);
}

.kv__row:last-child {
  border-bottom: 0;
}

.kv__row dt {
  color: var(--text-muted);
}

.kv__row dd {
  text-align: right;
}

.panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  padding: clamp(1.1rem, 2.2vw, 1.8rem);
}

.panel--flush {
  padding: 0;
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel__head h2,
.panel__head h3 {
  font-size: var(--fs-h4);
}

.panel__head p {
  font-size: var(--fs-xs);
  color: var(--text-faint);
}

.notice {
  display: flex;
  align-items: start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-size: var(--fs-xs);
  line-height: 1.55;
  border: 1px solid rgba(247, 199, 100, 0.28);
  background: rgba(247, 199, 100, 0.08);
  color: #f3dfae;
}

.notice svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 2px;
}

.notice--info {
  border-color: rgba(111, 216, 255, 0.28);
  background: rgba(111, 216, 255, 0.08);
  color: #bfeaff;
}

.notice--danger {
  border-color: rgba(255, 92, 114, 0.3);
  background: rgba(255, 92, 114, 0.08);
  color: #ffc2cc;
}

/* --------------------------------------------------------------- footer */
.footer {
  position: relative;
  padding-top: clamp(3rem, 4vw, 5rem);
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(8, 7, 12, 0), rgba(5, 4, 9, 0.7));
}

.footer__top {
  display: grid;
  gap: var(--gap-lg);
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

@media (min-width: 860px) {
  .footer__top {
    grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  }
}

.footer__brand {
  display: grid;
  gap: 1rem;
  max-width: 34ch;
}

.footer__brand p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.footer__col h3 {
  font-family: var(--font-display);
  font-size: var(--fs-2xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.footer__col ul {
  display: grid;
  gap: 0.55rem;
}

.footer__col a {
  font-size: var(--fs-sm);
  color: var(--text-soft);
  transition: color var(--dur-2);
}

.footer__col a:hover {
  color: var(--text);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.4rem;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-xs);
  color: var(--text-faint);
}

.footer__socials {
  display: flex;
  gap: 0.4rem;
}

.footer__socials a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--text-muted);
  transition: all var(--dur-2);
}

.footer__socials a:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

/* ----------------------------------------------------------- breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  padding-top: calc(var(--nav-h) + 1.2rem);
}

.breadcrumbs a:hover {
  color: var(--text);
}

.breadcrumbs span {
  opacity: 0.5;
}