/* ===================== TOKENS & RESET ===================== */
:root {
  --bg: #101d31;
  --bg-deep: #0b1422;
  --surface: #142847;
  --surface-2: #1b3a5f;
  --surface-3: #224d7a;
  --orange: #55c7ff;
  --orange-hover: #8de1ff;
  --yellow: #b9f3ff;
  --blue: #4dc6ff;
  --blue-strong: #2e9adf;
  --cyan: #96ebff;
  --text: #edf8ff;
  --text-muted: #bfd7ee;
  --text-dim: #8bacd1;
  --border: rgba(150, 214, 255, 0.18);
  --radius: 10px;
  --header-h: 68px;
  --max: 1440px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
*:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

html {
  background:
    radial-gradient(circle at top, rgba(77, 198, 255, 0.25), transparent 30%),
    linear-gradient(180deg, #0d1c2f 0%, var(--bg) 100%);
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at top, rgba(85, 199, 255, 0.18), transparent 25%),
    linear-gradient(180deg, #0c1c2a 0%, #0d1b2c 100%);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ===================== HEADER ===================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 16, 27, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}
.header--scrolled { background: rgba(9, 16, 27, 0.95); }

.header__inner {
  max-width: var(--max);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.header__left { display: flex; align-items: center; gap: 36px; }

.logo { display: flex; align-items: center; gap: 9px; color: var(--orange); }
.logo__mark {
  width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden;
  border: 1px solid rgba(141, 225, 255, 0.7); border-radius: 50%;
  filter: drop-shadow(0 0 12px rgba(85, 199, 255, 0.32));
}
.logo__mark img { width: 100%; height: 100%; object-fit: cover; }
.logo__text {
  font-size: 22px; font-weight: 900; letter-spacing: -0.04em; color: var(--text);
  text-transform: lowercase;
}
.logo__text span {
  color: var(--orange);
  text-shadow: 0 0 16px rgba(85, 199, 255, 0.45);
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav__link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav__link--active { color: var(--text); }
.nav__link--active::after {
  content: ""; display: block; height: 2px; width: 20px; margin: 4px auto 0;
  background: linear-gradient(90deg, var(--orange), var(--yellow)); border-radius: 2px;
}
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
  padding: 0 4px; margin-left: 5px; border-radius: 999px; background: var(--orange); color: #1a1204;
  font-size: 10px; font-weight: 800; vertical-align: middle;
}

.header__right { display: flex; align-items: center; gap: 8px; }
.header__auth { display: flex; align-items: center; }

/* ---------- Menu do avatar (dropdown) ---------- */
.avatar-menu { position: relative; }
.avatar-menu__toggle {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px;
  background: transparent; transition: background 0.2s ease;
}
.avatar-menu__toggle:hover { background: rgba(255, 255, 255, 0.06); }
.avatar-menu__avatar {
  width: 34px; height: 34px; border-radius: 24%; overflow: hidden; border: 2px solid var(--border); flex: 0 0 auto;
}
.avatar-menu__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-menu__name {
  font-size: 13px; font-weight: 600; color: var(--text); max-width: 110px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.avatar-menu__caret { color: var(--text-dim); transition: transform 0.2s ease; }
.avatar-menu.open .avatar-menu__caret { transform: rotate(180deg); }

.avatar-menu__panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 150;
  width: min(220px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease;
}
.avatar-menu.open .avatar-menu__panel { opacity: 1; transform: translateY(0); pointer-events: auto; }

.avatar-menu__link {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--text); text-align: left;
  transition: background 0.15s ease;
}
.avatar-menu__link:hover { background: rgba(255, 255, 255, 0.06); }
.avatar-menu__link svg { color: var(--text-muted); flex: 0 0 auto; }
.avatar-menu__link--danger { color: #f87171; }
.avatar-menu__link--danger svg { color: #f87171; }
.avatar-menu__divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- Sino de notificações ---------- */
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--orange); color: #1a1204;
  font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg);
}
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 150;
  width: min(320px, calc(100vw - 32px)); max-height: 420px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease;
}
.notif-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.notif-panel__head { font-size: 13px; font-weight: 700; padding: 14px 16px 10px; color: var(--text-muted); }
.notif-list { display: flex; flex-direction: column; padding: 0 8px 8px; }
.notif-item { display: flex; gap: 10px; padding: 10px 8px; border-radius: 8px; }
.notif-item:hover { background: rgba(255, 255, 255, 0.06); }
.notif-item--unread { background: rgba(85, 199, 255, 0.08); }
.notif-item__icon { font-size: 16px; flex: 0 0 auto; }
.notif-item__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-item__msg { font-size: 13px; color: var(--text); }
.notif-item__time { font-size: 11px; color: var(--text-dim); }
.notif-list .empty-state { padding: 20px 8px; }

/* ---------- Resultados de busca online (Jikan API) ---------- */
.online-search { margin-top: 22px; }
.online-search__title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim); margin-bottom: 10px;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.icon-btn--profile { padding: 0; overflow: hidden; border: 2px solid var(--border); border-radius: 24%; }
.icon-btn--profile img { width: 100%; height: 100%; object-fit: cover; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px; align-items: center; justify-content: center; }
.menu-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.25s ease; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; flex-direction: column; padding: 8px 16px 16px;
  border-top: 1px solid var(--border); background: rgba(10, 11, 14, 0.98);
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav__link { padding: 12px; border-radius: 8px; }
.mobile-nav .nav__link--active::after { margin: 4px 0 0; }

/* ===================== HERO ===================== */
.hero { position: relative; width: 100%; }
.hero__track { position: relative; height: min(96vh, 832px); }

/* Crossfade por opacidade (em vez de transform+translateX): todo slide já nasce
   na posição final, só alternando opacidade — evita bug de pintura do navegador em
   elementos que começam fora da tela e são "revelados" via transform. */
.slide {
  position: absolute; inset: 0;
  height: min(96vh, 832px);
  display: flex;
  align-items: flex-end;
  opacity: 0; visibility: hidden;
  transition: opacity 0.6s ease;
  z-index: 0;
}
.slide--active { opacity: 1; visibility: visible; z-index: 1; }
.slide__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 3%, rgba(16,29,49,0.72) 28%, rgba(16,29,49,0.08) 68%, transparent 82%),
    linear-gradient(to right, rgba(9,16,27,0.94) 0%, rgba(9,16,27,0.64) 36%, rgba(9,16,27,0.12) 72%, transparent 100%);
}
.slide__content {
  position: relative; z-index: 2;
  max-width: var(--max); width: 100%; margin: 0 auto;
  padding: 0 24px 72px;
}
.slide__inner { max-width: 560px; }
.slide__kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--orange); margin-bottom: 14px;
}
.slide__title {
  font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.05;
  letter-spacing: -0.02em; margin-bottom: 16px; text-wrap: balance;
}
.slide__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.tag {
  font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.1); color: var(--text);
}
.tag--rating { background: var(--orange); color: #1a1204; font-weight: 700; }
.tag--outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.slide__synopsis {
  font-size: 15px; color: var(--text-muted); margin-bottom: 26px;
  max-width: 500px; text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.slide__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 700; padding: 13px 22px; border-radius: 8px;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: linear-gradient(135deg, var(--orange), var(--yellow)); color: #1a1204; }
.btn--primary:hover { background: linear-gradient(135deg, var(--orange-hover), #ffd160); }
.btn--ghost { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.18); }
.btn--icon { padding: 13px; }

.hero__empty {
  height: min(50vh, 420px); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 24px; background: var(--surface);
}
.hero__empty-title { font-size: 22px; font-weight: 800; }
.hero__empty-text { font-size: 14px; color: var(--text-muted); max-width: 420px; }
.hero__empty-text a { color: var(--orange); text-decoration: underline; }

.hero__dots {
  position: absolute; left: 0; right: 0; bottom: 22px; z-index: 3;
  display: flex; justify-content: center; gap: 8px;
}
.dot {
  width: 28px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.28);
  transition: background 0.25s ease, width 0.25s ease;
}
.dot--active { background: var(--orange); width: 40px; }

/* ===================== BANNER DE PÁGINA (Populares / Categorias) ===================== */
.page-banner {
  background:
    radial-gradient(circle at 82% 18%, rgba(85,199,255,0.16), transparent 28%),
    linear-gradient(160deg, rgba(34,77,122,0.92) 0%, var(--bg) 68%);
  border-bottom: 1px solid var(--border);
}
.page-banner__inner {
  max-width: var(--max); margin: 0 auto; padding: 62px 24px 42px;
}
.page-banner__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px;
}
.page-banner__subtitle {
  font-size: 15px; color: var(--text-muted); max-width: 560px;
}

/* ===================== BARRA DE FILTROS (Populares) ===================== */
.filter-bar {
  max-width: var(--max); margin: 0 auto; padding: 18px 24px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.filter-bar .chips__track { flex: 1; padding-bottom: 2px; }
.filter-bar__sort { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.filter-bar__sort label { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.filter-bar__sort select {
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text);
  background: rgba(20,40,71,0.92); border: 1px solid rgba(141,225,255,0.28); border-radius: 8px;
  padding: 9px 12px; cursor: pointer;
}
.filter-bar__sort select:focus { outline: 2px solid var(--orange); outline-offset: 1px; }

/* ===================== GRADE DE CATEGORIAS ===================== */
.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px;
  padding: 8px 2px 24px;
}
.category-tile {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background-size: cover; background-position: center;
  border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 12px 26px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.category-tile:hover { transform: translateY(-5px); border-color: rgba(141,225,255,0.72); box-shadow: 0 18px 34px rgba(0,0,0,0.32); }
.category-tile--active { border-color: var(--orange); }
.category-tile__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,21,25,0.12) 0%, rgba(10,11,14,0.9) 100%);
}
.category-tile__name {
  position: absolute; left: 16px; bottom: 14px; z-index: 1;
  font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--text);
  text-shadow: 0 2px 12px rgba(0,0,0,0.72);
}

/* ===================== CHIPS DE GÊNERO ===================== */
.chips {
  max-width: var(--max); margin: 0 auto; padding: 28px 24px 0;
}
.chips__track {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px;
  scrollbar-width: none;
}
.chips__track::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--text-muted);
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }
.chip--active { background: var(--orange); border-color: var(--orange); color: #1a1204; }

/* ===================== ROWS / CARDS ===================== */
.row { max-width: var(--max); margin: 0 auto; padding: 44px 24px 10px; }
.row__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.row__title { font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 700; letter-spacing: -0.01em; }
.row__controls { display: flex; gap: 8px; }
.scroll-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: background 0.2s ease, transform 0.15s ease;
}
.scroll-btn:hover { background: var(--orange); color: #1a1204; }
.scroll-btn:active { transform: scale(0.92); }

.cards {
  display: flex; gap: 18px; overflow-x: auto; scroll-behavior: smooth;
  padding: 6px 2px 22px; scroll-snap-type: x mandatory;
}
.cards::-webkit-scrollbar { height: 8px; }
.cards::-webkit-scrollbar-track { background: transparent; }
.cards::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 8px; }
.cards::-webkit-scrollbar-thumb:hover { background: var(--orange); }
.cards { scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent; }

.cards--grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 20px;
  overflow: visible; scroll-snap-type: none;
}
.cards--grid .card { width: auto; }

.empty-state { color: var(--text-dim); font-size: 14px; padding: 24px 2px; }

.card {
  display: block; position: relative; flex: 0 0 auto; width: 200px; scroll-snap-align: start;
  border-radius: var(--radius); cursor: pointer;
  transition: transform 0.25s ease, filter 0.25s ease;
}
.card__poster {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 2 / 3; background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08); transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-6px); }
.card:hover .card__poster { border-color: rgba(141,225,255,0.72); box-shadow: 0 14px 30px rgba(0,0,0,0.28); }
.card__poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card__badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 5px; background: var(--orange); color: #1a1204;
}
.card__badge--ai { background: #7c5cff; color: #fff; }
.card__badge--fav { background: #ec4899; color: #fff; }
.fav-btn { transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease; }
.fav-btn:active { transform: scale(0.9); }
.fav-btn--active { color: var(--orange); }
.card__fav {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text);
  background: rgba(10, 11, 14, 0.55); backdrop-filter: blur(4px);
}
.card__fav:hover { background: rgba(10, 11, 14, 0.8); }
.card__progress {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  height: 4px; background: rgba(0, 0, 0, 0.5);
}
.card__progress-bar { height: 100%; background: var(--orange); }
.card__episode { font-size: 12px; color: var(--text-muted); }
.card__play {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  opacity: 0; transition: opacity 0.25s ease;
  background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0.1));
}
.card__play span {
  width: 52px; height: 52px; border-radius: 50%; background: var(--orange); color: #1a1204;
  display: grid; place-items: center;
}
/* hover overlay com sinopse */
.card__hover {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 14px;
  opacity: 0; transform: translateY(8px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.card__hover-synopsis {
  font-size: 12px; color: var(--text); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.card:hover { transform: translateY(-6px); }
.card:hover .card__poster { border-color: var(--orange); box-shadow: 0 14px 34px rgba(0,0,0,0.5); }
.card:hover .card__poster img { transform: scale(1.06); }
.card:hover .card__play { opacity: 1; }
.card:hover .card__hover { opacity: 1; transform: translateY(0); }

.card__info { padding: 12px 2px 0; }
.card__title {
  font-size: 15px; font-weight: 600; margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card__langs { display: flex; gap: 6px; margin-bottom: 8px; }
.pill {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-muted);
}
.pill--dub { border-color: rgba(85,199,255,0.4); color: var(--orange); }
.card__rating { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.card__stars { color: var(--orange); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.card__seasons { font-size: 12px; color: var(--text-dim); }

/* ===================== SKELETON (loading) ===================== */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.skeleton {
  background: var(--surface-2); border-radius: 6px;
  animation: skeleton-pulse 1.3s ease-in-out infinite;
}
.card--skeleton { cursor: default; }
.card--skeleton .card__poster { background: var(--surface-2); animation: skeleton-pulse 1.3s ease-in-out infinite; }
.card--skeleton .card__info { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.skeleton--line { height: 12px; }

/* ===================== OVERLAY DE PESQUISA ===================== */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6, 6, 8, 0.88); backdrop-filter: blur(6px);
  display: flex; justify-content: center;
  padding: 10vh 20px 40px; overflow-y: auto;
}
.search-overlay__panel {
  width: 100%; max-width: 720px; height: fit-content;
}
.search-overlay__bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; color: var(--text-muted);
}
.search-overlay__input {
  flex: 1; background: none; border: none; outline: none;
  font-family: inherit; font-size: 17px; color: var(--text);
}
.search-overlay__input::placeholder { color: var(--text-dim); }
.search-overlay__results { margin-top: 22px; }
.search-overlay .cards--grid { gap: 16px; }
body.no-scroll { overflow: hidden; }

/* ===================== PÁGINA DO ANIME ===================== */
.anime-hero {
  position: relative; z-index: 0; background: linear-gradient(180deg, rgba(8, 13, 22, 0.88), rgba(16, 29, 49, 0.98));
  border-bottom: 1px solid var(--border);
}
.anime-hero__bg {
  position: absolute; inset: 0; height: 380px; z-index: -1;
  background-size: cover; background-position: center;
  filter: saturate(1.15) contrast(1.06);
}
.anime-hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,11,14,0.42) 0%, rgba(10,11,14,0.78) 60%, rgba(16,29,49,0.96) 100%);
}
.anime-hero__inner {
  max-width: var(--max); margin: 0 auto; padding: 108px 24px 42px;
  display: flex; gap: 26px; align-items: flex-end; flex-wrap: wrap;
}
.anime-poster {
  width: 190px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 18px;
  border: 1px solid rgba(141,225,255,0.42); box-shadow: 0 24px 50px rgba(0,0,0,0.5), 0 0 0 7px rgba(85,199,255,0.05); flex: 0 0 auto;
}
.anime-info {
  flex: 1; min-width: 240px; padding: 18px 20px 14px; border-radius: 18px;
  background: rgba(9, 14, 20, 0.48); border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px); box-shadow: 0 18px 44px rgba(0,0,0,0.18);
}
.anime-info__title { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 12px; }
.anime-info__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.anime-info__meta .tag,
.anime-info__meta .pill {
  backdrop-filter: blur(6px);
}
.anime-info__seasons { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }

.rating-widget {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 10px 14px;
  background: rgba(17, 24, 36, 0.9); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  width: fit-content; max-width: 100%; box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.rating-widget__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }
.rating-widget__stars { display: flex; gap: 2px; }
.rating-widget__star {
  color: var(--text-dim); padding: 5px; border-radius: 8px;
  transition: color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.rating-widget__star svg { width: 22px; height: 22px; }
.rating-widget__star:hover { transform: scale(1.15); background: rgba(255, 255, 255, 0.06); }
.rating-widget__star--filled { color: var(--orange); }
.rating-widget__summary { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.anime-info__synopsis {
  font-size: 15px; color: rgba(237, 248, 255, 0.82); max-width: 680px; margin-bottom: 18px; line-height: 1.7;
  text-wrap: pretty;
}
.anime-info__actions { display: flex; gap: 12px; align-items: center; }

/* ---------- Player de vídeo ---------- */
.video-container {
  max-width: 100%; background: #000; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(141,225,255,0.18); box-shadow: 0 22px 48px rgba(0,0,0,0.28);
}
.video-wrapper {
  position: relative; width: 100%; padding-top: 56.25%; background: #000;
}
.video-wrapper video {
  position: absolute; inset: 0; width: 100%; height: 100%; background: #000; cursor: pointer;
}

.player-loading {
  position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}
.player-gate {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; text-align: center; padding: 24px; backdrop-filter: blur(6px);
  background: rgba(10, 10, 12, 0.82); color: var(--text);
}
.player-gate__title { font-size: 18px; font-weight: 800; }
.player-gate__text { font-size: 13px; color: var(--text-muted); max-width: 380px; }
#playerGateBtn { margin-top: 6px; }

.spinner {
  width: 44px; height: 44px; border: 4px solid rgba(255, 255, 255, 0.15); border-top-color: var(--orange);
  border-radius: 50%; animation: player-spin 0.8s linear infinite;
}
@keyframes player-spin { to { transform: rotate(360deg); } }

.player-center-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 4;
  width: 68px; height: 68px; border-radius: 50%; background: rgba(85, 199, 255, 0.92); color: #fff;
  display: grid; place-items: center; transition: transform 0.15s ease, opacity 0.15s ease;
}
.player-center-play:hover { transform: translate(-50%, -50%) scale(1.08); }

.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 10px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  opacity: 0; transition: opacity 0.2s ease;
}
.video-wrapper:hover .player-controls,
.video-wrapper:focus-within .player-controls,
.video-wrapper.controls-visible .player-controls { opacity: 1; }

.progress-container { position: relative; height: 14px; display: flex; align-items: center; margin-bottom: 6px; cursor: pointer; }
.progress-buffer, .progress-filled {
  position: absolute; left: 0; height: 4px; border-radius: 2px; pointer-events: none;
}
.progress-container::before {
  content: ""; position: absolute; left: 0; right: 0; height: 4px; background: rgba(255, 255, 255, 0.25); border-radius: 2px;
}
.progress-buffer { background: rgba(255, 255, 255, 0.4); }
.progress-filled { background: var(--orange); }
.progress-bar {
  position: relative; width: 100%; height: 14px; margin: 0; -webkit-appearance: none; appearance: none;
  background: transparent; cursor: pointer;
}
.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--orange);
  margin-top: 0; box-shadow: 0 0 0 4px rgba(85, 199, 255, 0.15);
}
.progress-bar::-moz-range-thumb { width: 13px; height: 13px; border: none; border-radius: 50%; background: var(--orange); }
.progress-bar::-moz-range-track { background: transparent; }

.controls-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.controls-left, .controls-right { display: flex; align-items: center; gap: 12px; }
.control-btn {
  color: #fff; opacity: 0.85; transition: opacity 0.15s ease; display: grid; place-items: center;
}
.control-btn:hover { opacity: 1; }
.time-display { color: #fff; font-size: 12px; font-weight: 600; display: flex; gap: 4px; }
.volume-slider {
  width: 70px; height: 4px; -webkit-appearance: none; appearance: none; background: rgba(255, 255, 255, 0.3); border-radius: 2px;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #fff;
}
.volume-slider::-moz-range-thumb { width: 11px; height: 11px; border: none; border-radius: 50%; background: #fff; }
.player-demo-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-dim); background: rgba(255, 255, 255, 0.1); padding: 4px 8px; border-radius: 999px;
}
.quality-btn {
  font-size: 11px; font-weight: 800; color: #fff; background: rgba(255, 255, 255, 0.14);
  padding: 5px 10px; border-radius: 999px; transition: background 0.15s ease, color 0.15s ease;
}
.quality-btn:hover { background: rgba(255, 255, 255, 0.24); }
.quality-btn:disabled { opacity: 0.7; cursor: default; }
.quality-btn--lite { background: rgba(85, 199, 255, 0.28); color: var(--orange); }

.player-title {
  display: flex; align-items: center; gap: 16px; text-align: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 18px;
}
.player-title::before, .player-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.player-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.player-layout__main { min-width: 0; }

.player-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.player-toolbar__btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-weight: 700; color: var(--text-muted); text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.player-toolbar__btn:hover { background: var(--surface-2); color: var(--text); }
.player-toolbar__btn--primary { margin-left: auto; background: var(--orange); color: #101d31; border-color: var(--orange); }
.player-toolbar__btn--primary:hover { background: var(--orange-hover); }
.player-toolbar__btn--reaction.player-toolbar__btn--active { color: var(--orange); border-color: rgba(85, 199, 255, 0.6); background: rgba(85, 199, 255, 0.12); }

.player-layout__sidebar {
  background: linear-gradient(180deg, rgba(17, 24, 36, 0.94), rgba(18, 28, 38, 0.9));
  border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 16px;
  box-shadow: 0 18px 38px rgba(0,0,0,0.2);
}
.player-sidebar__title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim); margin-bottom: 14px;
}
.next-episodes {
  display: flex; flex-direction: column; gap: 3px;
  max-height: 640px; overflow-y: auto; padding-right: 4px; margin-right: -4px;
  scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent;
}
.next-episodes::-webkit-scrollbar { width: 6px; }
.next-episodes::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 8px; }

/* ---------- Player no celular: alvos de toque maiores, sem :hover pra depender ---------- */
@media (max-width: 680px) {
  .player-controls { padding: 8px 10px 10px; }
  .progress-container { height: 22px; margin-bottom: 2px; }
  .control-btn { padding: 6px; }
  .control-btn svg { width: 22px; height: 22px; }
  .player-center-play { width: 56px; height: 56px; }
  /* iOS ignora video.volume via JS, e a maioria dos celulares já tem botão físico de
     volume — a barra só ocupa espaço à toa; mantém só o botão de mudo. */
  .volume-slider { display: none; }
  .controls-bottom { gap: 8px; }
  .time-display { font-size: 11px; }
  .quality-btn, .player-demo-badge { font-size: 10px; padding: 4px 8px; }
  .player-toolbar__btn { padding: 10px 12px; font-size: 12px; }
}

/* ---------- Lista de episódios empilhada (coluna larga, fora do player) ---------- */
.ep-list { display: flex; flex-direction: column; gap: 10px; }
.ep-list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(180deg, rgba(19, 26, 37, 0.96), rgba(17, 23, 31, 0.96));
  border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 14px 18px;
  text-decoration: none; color: inherit; transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.ep-list-row:hover {
  background: linear-gradient(180deg, rgba(29, 36, 46, 0.98), rgba(17, 23, 31, 0.96));
  border-color: rgba(85, 199, 255, 0.35); transform: translateY(-1px);
}
.ep-list-row__link { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.ep-list-row__num { font-size: 14px; font-weight: 600; color: var(--text); }
.ep-list-row__watched {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
  color: var(--text-dim); display: grid; place-items: center;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.ep-list-row__watched:hover { color: var(--text); border-color: var(--text-muted); }
.ep-list-row__watched--done { color: #1a1204; background: var(--orange); border-color: var(--orange); }

.sidebar-ep-row {
  display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; cursor: pointer;
  text-decoration: none; color: inherit; transition: background 0.15s ease;
}
.sidebar-ep-row:hover { background: var(--surface-2); }
.sidebar-ep-row--current { background: rgba(85, 199, 255, 0.12); }
.sidebar-ep-row__play {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 6px;
  background: var(--surface-2); color: var(--text); display: grid; place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-ep-row__play:hover { background: var(--orange); color: #1a1204; }
.sidebar-ep-row--current .sidebar-ep-row__play { background: var(--orange); color: #1a1204; }
.sidebar-ep-row__label {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-ep-row--current .sidebar-ep-row__label { color: var(--orange); }
.sidebar-ep-row__watched {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border);
  color: var(--text-dim); display: grid; place-items: center; transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.sidebar-ep-row__watched:hover { color: var(--text); border-color: var(--text-muted); }
.sidebar-ep-row__watched--done { color: #1a1204; background: var(--orange); border-color: var(--orange); }

.watch-back-link {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px;
  font-size: 13px; font-weight: 700; color: var(--text-muted); text-decoration: none;
}
.watch-back-link:hover { color: var(--orange); }

.comment-form { display: flex; align-items: flex-start; gap: 12px; padding: 6px 2px 20px; }
.comment-form--stacked { flex-direction: column; }
.comment-form__avatar { width: 38px; height: 38px; border-radius: 24%; overflow: hidden; flex: 0 0 auto; }
.comment-form__field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.comment-form__input {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; min-height: 46px; resize: vertical;
}
.comment-form__input:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.topic-post__image { display: block; max-width: min(100%, 520px); max-height: 420px; margin-top: 12px; border-radius: 10px; border: 1px solid var(--border); object-fit: contain; }
.topic-opening-post { display: flex; gap: 14px; align-items: flex-start; margin: 18px 0 24px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.topic-opening-post__body { flex: 1; min-width: 0; }
.topic-opening-post .topic-post__content { flex: 1; min-width: 0; margin: 10px 0; }
.topic-opening-post__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-dim); }
.topic-opening-post__avatar { width: 24px; height: 24px; border-radius: 24%; overflow: hidden; flex: 0 0 auto; }
.topic-opening-post__author { color: var(--text); font-weight: 700; }
.topic-opening-post__author:hover { text-decoration: underline; }
.topic-opening-post__title { font-size: 24px; font-weight: 850; line-height: 1.3; margin-top: 8px; }
.topic-opening-post__stats { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }

.comment-composer { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.comment-composer__avatar { width: 36px; height: 36px; border-radius: 24%; overflow: hidden; flex: 0 0 auto; margin-top: 4px; }
.comment-composer__form { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; transition: border-color 0.15s ease; }
.comment-composer__form:focus-within { border-color: var(--orange); }
.comment-composer__input {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text); resize: vertical;
  background: transparent; border: none; padding: 12px 14px; min-height: 46px;
}
.comment-composer__input:focus { outline: none; }
.comment-composer__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 8px; }
.comment-composer__image-btn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  color: var(--text-dim); cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.comment-composer__image-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.comment-composer__image-btn--active { color: var(--orange); background: rgba(85,199,255,0.12); }

.topic-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 14px; font-weight: 700; color: var(--text-muted); flex-wrap: wrap; }
.comment-form__footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.comment-form__counter { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.comment-form__counter--warn { color: var(--orange); }
.comment-form__counter--limit { color: #f87171; }

.comment-list { display: flex; flex-direction: column; gap: 20px; padding: 0 2px 22px; }
.comment-list--loading { padding: 4px 2px; }
.comment-thread { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 12px; }
.comment--reply { margin-left: 50px; }
.comment__avatar { width: 38px; height: 38px; border-radius: 24%; overflow: hidden; flex: 0 0 auto; }
.comment-list--narrow .comment--reply { margin-left: 18px; }
.comment-list--narrow .comment__avatar { width: 30px; height: 30px; }
.comment__body { flex: 1; min-width: 0; }
.comment__meta { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.comment__author { color: var(--text); font-weight: 700; }
.comment__text { font-size: 14px; color: var(--text-muted); line-height: 1.55; margin-bottom: 8px; }
.comment__actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.comment-list--narrow .comment__actions { gap: 10px; }
.comment__action {
  display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-dim);
  transition: color 0.15s ease;
}
.comment__action:hover { color: var(--text); }
.comment__action--active { color: var(--orange); }
.comment-reply-form { display: flex; gap: 10px; margin-top: 10px; align-items: flex-start; }
.comment-edit-form { display: flex; gap: 10px; margin-bottom: 8px; align-items: flex-start; }
.comment-reply-form .comment-form__input,
.comment-edit-form .comment-form__input { min-height: 38px; }

/* ===================== PERFIL ===================== */
.profile-banner {
  position: relative; z-index: 0; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 608px; padding: 104px 24px 0; overflow: hidden;
}
.profile-banner__bg {
  position: absolute; inset: 0; height: 608px; z-index: -1;
  background-size: cover !important; background-position: center !important;
  filter: saturate(1.15) contrast(1.08) brightness(.8);
  transform: scale(1.02);
  transition: transform 6s ease-out;
}
@media (prefers-reduced-motion: no-preference) {
  .profile-banner__bg { animation: profile-banner-drift 22s ease-in-out infinite alternate; }
}
@keyframes profile-banner-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(0, -1.5%, 0); }
}
.profile-banner::after {
  content: ""; position: absolute; inset: 0; height: 608px; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.6) 4%, transparent 4%, transparent 96%, rgba(0,0,0,.6) 96%, rgba(0,0,0,.6) 100%),
    radial-gradient(120% 130% at 50% 15%, transparent 32%, rgba(3, 6, 11, .58) 100%),
    linear-gradient(180deg, rgba(6, 12, 20, .1) 0%, transparent 30%, transparent 55%, var(--bg) 96%);
}
.profile-banner__inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding: 0 4px 28px;
}
.profile-avatar-wrap { position: relative; flex: 0 0 auto; }
.profile-avatar {
  width: 112px; height: 112px; border-radius: 22%; overflow: hidden;
  border: 3px solid rgba(141,225,255,0.62); background: var(--surface-2);
  display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 0 7px rgba(85,199,255,0.08);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 34px;
}
.profile-level-badge {
  position: absolute; bottom: 2px; right: -4px;
  background: var(--orange); color: #1a1204; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px; border: 3px solid var(--bg);
}
.profile-banner__info { flex: 1; min-width: 200px; }
.profile-like-btn {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: rgba(20,40,71,.65); color: var(--text-muted); font-size: 14px; font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.profile-like-btn:hover { border-color: #ec4899; color: #ec4899; }
.profile-like-btn:active { transform: scale(0.94); }
.profile-like-btn--liked { background: rgba(236,72,153,.15); border-color: #ec4899; color: #ec4899; }
.profile-like-btn--liked svg { fill: #ec4899; }
.profile-like-btn:disabled { cursor: default; opacity: 0.7; }
.profile-like-btn:disabled:hover { border-color: var(--border); color: var(--text-muted); }
.profile-like-btn--liked:disabled:hover { border-color: #ec4899; color: #ec4899; }
.profile-name { font-size: clamp(1.5rem, 3vw, 2.15rem); font-weight: 850; letter-spacing: 0; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.profile-handle { font-size: 14px; color: var(--text-muted); }
.profile-content { display: flex; flex-direction: column; gap: 22px; margin-top: 4px; }

.profile-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.profile-stat {
  min-width: 0; background: linear-gradient(145deg, rgba(20,40,71,.82), rgba(16,29,49,.96)); border: 1px solid rgba(141,225,255,0.12);
  border-radius: 10px; padding: 15px 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.profile-stat__value { font-size: 22px; font-weight: 800; color: var(--orange); }
.profile-stat__label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.profile-xp { background: linear-gradient(90deg, rgba(20,40,71,.9), rgba(17,28,43,.92)); border: 1px solid rgba(141,225,255,0.14); border-radius: var(--radius); padding: 16px 18px; }
.profile-xp__head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.profile-xp__head span:first-child { font-weight: 700; }
.profile-xp__head span:last-child { color: var(--text-muted); }
.profile-xp__bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.profile-xp__fill { height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-hover)); border-radius: 999px; transition: width 0.4s ease; }

.profile-bio { font-size: 14px; color: var(--text-muted); line-height: 1.6; max-width: 640px; }
.profile-watchtime { font-size: 12px; color: var(--text-dim); }
.profile-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 2px; }
.profile-fact { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; background: rgba(20,40,71,.55); border-left: 2px solid var(--orange); border-radius: 4px; }
.profile-fact strong { color: var(--text-dim); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.profile-fact span { color: var(--text); font-size: 12px; font-weight: 700; }
.profile-banner__actions { display: flex; gap: 10px; flex: 0 0 auto; }

.profile-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; background: rgba(20,40,71,.42); padding: 4px 4px 0; border-radius: 8px 8px 0 0; }
.profile-tab {
  padding: 12px 18px; font-size: 14px; font-weight: 700; color: var(--text-dim);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color 0.15s ease;
}
.profile-tab:hover { color: var(--text); }
.profile-tab--active { color: var(--orange); border-bottom-color: var(--orange); }

.profile-favorites__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.profile-favorites__header h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px;
  background: var(--surface-2); border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--text-muted);
}
.profile-favorites__header select {
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}

.rating-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 22px; }
.rating-list__item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px;
  text-decoration: none; color: inherit; transition: background 0.15s ease;
}
.rating-list__item:hover { background: var(--surface-2); }
.rating-list__poster { width: 42px; height: 58px; border-radius: 6px; overflow: hidden; flex: 0 0 auto; background: var(--surface-2); }
.rating-list__poster img { width: 100%; height: 100%; object-fit: cover; }
.rating-list__info { flex: 1; min-width: 0; }
.rating-list__title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rating-list__date { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.rating-list__score { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; font-weight: 800; color: var(--orange); }

.profile-common-friends { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

.activity-feed { display: flex; flex-direction: column; gap: 2px; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
}
.activity-item:last-child { border-bottom: none; }
.activity-item__icon {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--border); color: var(--orange); display: grid; place-items: center;
}
.activity-item__body { flex: 1; min-width: 0; }
.activity-item__msg { font-size: 14px; color: var(--text); line-height: 1.4; }
.activity-item__time { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.activity-item__user { color: var(--orange); font-weight: 700; text-decoration: none; }
.activity-item__user:hover { text-decoration: underline; }
.activity-item__link { color: inherit; text-decoration: none; }
.activity-item__link:hover { text-decoration: underline; }

.btn--sm { padding: 9px 16px; font-size: 13px; }

.friends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 6px 2px 22px; }
.friend-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
}
.friend-card__avatar { position: relative; width: 46px; height: 46px; border-radius: 24%; overflow: hidden; flex: 0 0 auto; }
.friend-card__status {
  position: absolute; bottom: 0; right: 0; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--surface); background: var(--text-dim);
}
.friend-card__status--online { background: #22c55e; }
.friend-card__info { flex: 1; min-width: 0; }
.friend-card__name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-card__meta { font-size: 12px; color: var(--text-dim); }
.friend-card__remove {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-dim); flex: 0 0 auto;
}
.friend-card__remove:hover { color: var(--text); background: rgba(255,255,255,0.08); }

/* ===================== MODAIS (editar perfil / adicionar amigos) ===================== */
.modal {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(6, 6, 8, 0.88); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal__panel {
  width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px;
}
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal__head h2 { font-size: 18px; font-weight: 800; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.field input[type="text"],
.field input[type="password"],
.field textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; }

.avatar-editor { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar-editor__preview { width: 72px; height: 72px; border-radius: 24%; overflow: hidden; background: var(--surface-2); flex: 0 0 auto; }
.avatar-editor__preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-editor__actions { display: flex; flex-direction: column; gap: 8px; }
.avatar-editor__actions .btn { padding: 8px 14px; font-size: 13px; }

.banner-swatches { display: flex; gap: 10px; }
.banner-swatch {
  width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer;
}
.banner-swatch--active { border-color: var(--text); }

.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.modal-confirm__text { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }
.btn--danger { background: #f87171; color: #2a0a0a; }
.btn--danger:hover { background: #f99b9b; }

.auth-error { font-size: 12px; color: #f87171; margin: -6px 0 16px; }
.modal__result {
  font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; margin-bottom: 16px; word-break: break-word;
}
.modal__result a { color: var(--orange); text-decoration: underline; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 16px; }
.auth-switch__link { color: var(--orange); font-weight: 700; text-decoration: underline; }

.friend-search { width: 100%; font-family: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.friend-suggestions { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; }
.friend-suggestion {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px;
}
.friend-suggestion:hover { background: var(--surface-2); }
.friend-suggestion__avatar { width: 40px; height: 40px; border-radius: 24%; overflow: hidden; flex: 0 0 auto; }
.friend-suggestion__info { flex: 1; min-width: 0; }
.friend-suggestion__name { font-size: 13px; font-weight: 700; }
.friend-suggestion__meta { font-size: 11px; color: var(--text-dim); }

.friend-requests { display: flex; flex-direction: column; gap: 18px; margin-bottom: 22px; }
.friend-requests__group-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim); margin-bottom: 10px;
}
.friend-requests__list { display: flex; flex-direction: column; gap: 8px; }
.friend-request-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.friend-request-row__avatar { width: 40px; height: 40px; border-radius: 24%; overflow: hidden; flex: 0 0 auto; }
.friend-request-row__info { flex: 1; min-width: 0; }
.friend-request-row__name { font-size: 13px; font-weight: 700; }
.friend-request-row__meta { font-size: 11px; color: var(--text-dim); }
.friend-request-row__actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* ===================== CONQUISTAS ===================== */
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 6px 2px 22px; }
.achievement-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 12px;
}
.achievement-card--locked { opacity: 0.45; filter: grayscale(0.6); }
.achievement-card--unlocked { border-color: var(--orange); box-shadow: 0 0 0 1px rgba(85, 199, 255, 0.25); }
.achievement-card__icon { font-size: 32px; line-height: 1; margin-bottom: 6px; }
.achievement-card__name { font-size: 13px; font-weight: 700; }
.achievement-card__desc { font-size: 11px; color: var(--text-muted); }
.achievement-card__status { font-size: 11px; color: var(--orange); margin-top: 6px; }
.achievement-card__progress { font-size: 11px; color: var(--text-dim); margin-top: 6px; }

/* ===================== RANKING ===================== */
.ranking-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  margin: 0 0 18px;
}
.ranking-summary__card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 16px;
  background: linear-gradient(180deg, rgba(15, 26, 39, 0.92), rgba(17, 22, 27, 0.96));
  border: 1px solid rgba(255,255,255,0.07); border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.ranking-summary__label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim);
}
.ranking-summary__card strong {
  font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.1; letter-spacing: -0.04em; color: var(--text);
}
.ranking-summary__card small {
  font-size: 11px; color: var(--text-muted);
}

.ranking-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.ranking-list { display: flex; flex-direction: column; gap: 8px; }
.ranking-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; margin: 8px 0 24px; }
.ranking-podium__card { display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 180px; padding: 18px 12px 16px; background: linear-gradient(180deg, rgba(34,77,122,.85), rgba(20,40,71,.96)); border: 1px solid var(--border); border-radius: 10px; text-align: center; transition: transform .18s ease, border-color .18s ease; }
.ranking-podium__card:hover { transform: translateY(-4px); border-color: var(--orange); }
.ranking-podium__card--1 { min-height: 214px; background: linear-gradient(180deg, rgba(85,199,255,.28), rgba(20,40,71,.98)); border-color: rgba(185,243,255,.6); }
.ranking-podium__place { font-size: 12px; font-weight: 900; color: var(--yellow); }
.ranking-podium__avatar { width: 60px; height: 60px; border-radius: 24%; overflow: hidden; border: 3px solid rgba(255,255,255,.18); }
.ranking-podium__card--1 .ranking-podium__avatar { width: 76px; height: 76px; border-color: var(--yellow); box-shadow: 0 0 22px rgba(185,243,255,.3); }
.ranking-podium__avatar img { width: 100%; height: 100%; object-fit: cover; }
.ranking-podium__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ranking-podium__handle { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-dim); }
.ranking-podium__metric { margin-top: auto; color: var(--orange); font-size: 18px; font-weight: 900; }
.ranking-podium__metric small { color: var(--text-muted); font-size: 10px; font-weight: 700; }
.ranking-list__rest { display: flex; flex-direction: column; gap: 8px; }
.ranking-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: inherit; transition: background 0.15s ease, border-color 0.15s ease;
}
.ranking-row:hover { background: var(--surface-2); border-color: rgba(255,255,255,0.15); }
.ranking-row--viewer { border-color: var(--orange); box-shadow: 0 0 0 1px rgba(85, 199, 255, 0.25); }
.ranking-row__rank { font-size: 20px; font-weight: 900; color: var(--text-dim); width: 36px; text-align: center; flex: 0 0 auto; }
.ranking-row--top1 .ranking-row__rank { color: #ffd166; }
.ranking-row--top2 .ranking-row__rank { color: #c9ccd1; }
.ranking-row--top3 .ranking-row__rank { color: #cd8a4d; }
.ranking-row__avatar { width: 52px; height: 52px; border-radius: 24%; overflow: hidden; flex: 0 0 auto; }
.ranking-row__info { flex: 1; min-width: 0; }
.ranking-row__name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ranking-row__name { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-row__level-badge {
  font-size: 10px; font-weight: 800; color: #1a1204; background: var(--orange);
  padding: 2px 8px; border-radius: 999px; flex: 0 0 auto;
}
.ranking-row__meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.ranking-row__badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.ranking-row__badge-icon {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px;
  background: rgba(255,255,255,0.06); font-size: 13px; cursor: default;
}
.ranking-row__no-badges { font-size: 11px; color: var(--text-dim); margin-top: 8px; }
.ranking-row__stats { flex: 0 0 auto; text-align: right; }
.ranking-row__stats strong { display: block; font-size: 18px; font-weight: 900; color: var(--orange); }
.ranking-row__stats span { font-size: 11px; color: var(--text-muted); }

@media (max-width: 680px) {
  .profile-banner { padding: 72px 16px 0; min-height: 448px; }
  .profile-banner__bg, .profile-banner::after { height: 448px; }
  .profile-banner__inner { align-items: center; padding-bottom: 22px; }
  .profile-banner__info { min-width: calc(100% - 136px); }
  .profile-banner__actions { width: 100%; }
  .profile-banner__actions .btn { flex: 1; justify-content: center; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ranking-podium { gap: 6px; }
  .ranking-podium__card { min-height: 154px; padding: 12px 6px; }
  .ranking-podium__card--1 { min-height: 178px; }
  .ranking-podium__card--1 .ranking-podium__avatar { width: 62px; height: 62px; }
  .ranking-podium__avatar { width: 48px; height: 48px; }
  .ranking-podium__name { font-size: 12px; }
  .ranking-podium__metric { font-size: 15px; }
  .ranking-row { gap: 8px; padding: 10px; }
  .ranking-row__stats { display: none; }
}

/* ===================== MENSAGENS (chat entre amigos) ===================== */
.chat-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; height: 70vh; min-height: 460px; max-height: 720px; }

.chat-sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.chat-sidebar__head { padding: 16px 18px; font-weight: 800; font-size: 14px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.chat-list { flex: 1; overflow-y: auto; }
.chat-list-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px;
  border-bottom: 1px solid var(--border); text-align: left; position: relative; transition: background 0.15s ease;
}
.chat-list-item:hover { background: var(--surface-2); }
.chat-list-item--active { background: rgba(85, 199, 255, 0.1); }
.chat-list-item__avatar { width: 44px; height: 44px; border-radius: 24%; overflow: hidden; flex: 0 0 auto; }
.chat-list-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-list-item__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-right: 20px; }
.chat-list-item__name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-item__time { font-size: 11px; color: var(--text-dim); flex: 0 0 auto; }
.chat-list-item__preview { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-item__badge {
  position: absolute; top: 10px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--orange); color: #1a1204; font-size: 10px; font-weight: 800;
  display: grid; place-items: center; flex: 0 0 auto;
}

.chat-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-dim); text-align: center; padding: 24px; }
.chat-empty__hint { font-size: 12px; }
.chat-thread { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-thread__head { padding: 14px 18px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.chat-thread__user { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: inherit; }
.chat-thread__avatar { width: 36px; height: 36px; border-radius: 24%; overflow: hidden; flex: 0 0 auto; }
.chat-thread__messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.chat-bubble {
  max-width: 70%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2);
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; align-self: flex-start;
}
.chat-bubble--mine { align-self: flex-end; background: linear-gradient(135deg, var(--orange), var(--orange-hover)); color: #1a1204; }
.chat-composer { display: flex; align-items: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.chat-composer textarea {
  flex: 1; resize: none; max-height: 120px; font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.chat-composer textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.chat-composer .btn { flex: 0 0 auto; padding: 11px 14px; }

@media (max-width: 780px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; max-height: none; }
  .chat-sidebar { max-height: 240px; }
  .chat-panel { min-height: 460px; }
}

/* ===================== FÓRUM ===================== */
.forum-category { margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.forum-category__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; transition: background 0.15s ease; }
.forum-category__header:hover { background: rgba(255,255,255,0.05); }
.forum-category__title { font-size: 16px; font-weight: 800; }
.forum-category__count { font-size: 12px; color: var(--text-dim); }
.forum-category__desc { padding: 10px 18px 14px; font-size: 12px; color: var(--text-dim); }
.forum-category__subforums { display: flex; flex-direction: column; }
.forum-subforum { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); transition: background 0.15s ease; }
.forum-subforum:last-child { border-bottom: none; }
.forum-subforum:hover { background: rgba(255,255,255,0.03); }
.forum-subforum__info { flex: 1; min-width: 0; }
.forum-subforum__name { font-size: 15px; font-weight: 700; }
.forum-subforum__desc { margin-top: 4px; font-size: 12px; color: var(--text-dim); }
.forum-subforum__stats { font-size: 12px; color: var(--text-muted); text-align: right; }
.forum-subforum__stats span { display: block; }
.forum-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.forum-tab { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.forum-tab:hover { color: var(--text); border-color: rgba(85, 199, 255, 0.4); }
.forum-tab--active { background: var(--orange); color: #1a1204; border-color: var(--orange); }
.forum-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }

.forum-sort { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.forum-sort__btn { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--text-muted); transition: background 0.15s ease, color 0.15s ease; }
.forum-sort__btn:hover { color: var(--text); }
.forum-sort__btn--active { background: var(--orange); color: #1a1204; }

/* Trilho de votos estilo Reddit */
.vote-rail { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 0 0 auto; padding: 2px 4px; }
.vote-rail__btn { width: 28px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--text-dim); transition: background 0.15s ease, color 0.15s ease; }
.vote-rail__btn:hover { background: var(--surface-2); color: var(--text); }
.vote-rail__btn--active-up { color: var(--orange); }
.vote-rail__btn--active-down { color: #7c9fff; }
.vote-rail__score { font-size: 13px; font-weight: 800; color: var(--text-muted); }
.vote-rail__score--up { color: var(--orange); }
.vote-rail__score--down { color: #7c9fff; }

.topic-row {
  display: flex; align-items: stretch; gap: 14px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); transition: background 0.15s ease, border-color 0.15s ease;
}
.topic-row:hover { background: var(--surface-2); border-color: rgba(255,255,255,0.15); }
.topic-row--pinned { border-color: rgba(85,199,255,0.5); background: rgba(85,199,255,0.04); }
.topic-row__main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px 0; color: inherit; text-decoration: none; }
.topic-row__text { min-width: 0; width: 100%; }
.topic-row__title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-row__author { margin-top: 4px; font-size: 12px; color: var(--text-dim); }
.topic-row__pin { font-size: 15px; }
.topic-row__lock { font-size: 12px; }
.topic-row__stats { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.topic-row__last { color: var(--text-dim); }

.topic-editor { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.topic-editor .field { margin-bottom: 18px; }
.topic-editor textarea { min-height: 220px; }
.topic-topic-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.topic-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.forum-breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }
.forum-breadcrumbs a { color: var(--orange); }
.topic-thread { display: flex; flex-direction: column; gap: 18px; }
.topic-post {
  display: grid; grid-template-columns: auto 72px 1fr; gap: 14px; padding: 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.topic-post .vote-rail { padding-top: 4px; }
.topic-post--solution { border-color: rgba(34,197,94,0.8); box-shadow: 0 0 0 1px rgba(34,197,94,0.25); }
.topic-post--nested { position: relative; background: rgba(255,255,255,0.015); }
.topic-post--nested::before {
  content: ""; position: absolute; left: -14px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, rgba(85,199,255,.5), rgba(85,199,255,.08));
}
.topic-post__user { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.topic-post__avatar { width: 52px; height: 52px; border-radius: 24%; overflow: hidden; }
.topic-post__name { font-size: 13px; font-weight: 700; text-align: center; }
.topic-post__level { font-size: 11px; color: var(--text-dim); }
.topic-post__body { min-width: 0; }
.topic-post__header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.topic-post__meta { font-size: 12px; color: var(--text-dim); }
.topic-post__actions { display: flex; gap: 8px; }
.topic-post__content { font-size: 14px; color: var(--text); line-height: 1.7; word-break: break-word; white-space: pre-wrap; }
.topic-post__footer { margin-top: 10px; }
.vote-btn { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.vote-btn:hover { background: rgba(255,255,255,0.06); }
.solution-tag { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; background: rgba(34,197,94,0.12); color: #86efac; font-size: 11px; font-weight: 700; }

.reply-to-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  color: var(--text-dim); padding: 5px 10px; border-radius: 999px; transition: background 0.15s ease, color 0.15s ease;
}
.reply-to-btn:hover { background: rgba(85,199,255,0.1); color: var(--orange); }
.topic-post__inline-reply { margin-top: 10px; }
.inline-reply-form { display: flex; flex-direction: column; gap: 8px; }
.inline-reply-form textarea {
  width: 100%; font-family: inherit; font-size: 13px; color: var(--text); resize: vertical;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
}
.inline-reply-form textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.inline-reply-form__actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 720px) {
  .topic-row__title { white-space: normal; }
  .vote-rail { padding: 2px; }
  .vote-rail__btn { width: 24px; height: 22px; }
  .topic-post { grid-template-columns: 1fr; }
  .topic-post__user { align-items: flex-start; flex-direction: row; }
  .forum-subforum { flex-direction: column; align-items: flex-start; }
  .forum-subforum__stats { text-align: left; }
}

/* ===================== TOASTS ===================== */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 300;
  display: flex; flex-direction: column-reverse; gap: 8px;
  max-width: min(340px, calc(100vw - 40px));
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--text-dim); color: var(--text);
  font-size: 13px; font-weight: 600; padding: 12px 16px; border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.4);
  opacity: 0; transform: translateY(10px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast--show { opacity: 1; transform: translateY(0); }
.toast__icon { flex: 0 0 auto; display: grid; place-items: center; }
.toast__msg { line-height: 1.4; }
.toast--success { border-left-color: #22c55e; }
.toast--success .toast__icon { color: #22c55e; }
.toast--error { border-left-color: #f87171; }
.toast--error .toast__icon { color: #f87171; }
.toast--warning { border-left-color: var(--orange); }
.toast--warning .toast__icon { color: var(--orange); }
.toast--info .toast__icon { color: var(--text-muted); }

/* ===================== FOOTER ===================== */
.footer {
  max-width: var(--max); margin: 40px auto 0; padding: 28px 24px 48px;
  border-top: 1px solid var(--border); color: var(--text-dim); font-size: 13px;
}

/* ===================== RESPONSIVO ===================== */
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .slide, .hero__track { height: min(91vh, 676px); }
  .player-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .header__inner { padding: 0 16px; }
  .header__left { gap: 16px; }
  .header__auth { display: none; }
  .row { padding: 30px 16px 8px; }
  .slide__content { padding: 0 16px 40px; }
  .card { width: 150px; }
  .row__controls { display: none; }
  .slide__actions .btn { flex: 1; justify-content: center; }
  .search-overlay { padding: 6vh 14px 30px; }
  .cards--grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
  .page-banner__inner { padding: 36px 16px 26px; }
  .filter-bar { padding: 18px 16px 0; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}
