/* Meme Party — страница /rating.
   Живёт поверх дизайн-системы account.css (.acc-*, .mp-hero, .mp-lg-pill).
   Все отступы — логическими свойствами: страница целиком работает в RTL (he).
   Правило: ни один элемент не шире контейнера — горизонтального скролла нет. */

/* Языковые кнопки в мини-навбаре страницы */
.pg-langs { display: flex; gap: 3px; align-items: center; }
.pg-langs .lang-btn {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; cursor: pointer; font-size: 0.9rem; line-height: 1;
  padding: 5px 7px; transition: 0.15s; color: inherit;
}
.pg-langs .lang-btn:hover { border-color: rgba(103, 232, 249, 0.5); }
.pg-langs .lang-btn.active-locale { border-color: #a78bfa; background: rgba(167, 139, 250, 0.2); }

/* ── Хиро ─────────────────────────────────────────────────────────────── */
.rt-hero-in { text-align: center; padding: 26px 16px 22px; }
.rt-hero-badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: #ffe9a8; background: rgba(255, 215, 94, 0.13);
  border: 1px solid rgba(255, 215, 94, 0.32);
}
.rt-hero-title {
  margin: 12px 0 0; font-family: 'Unbounded', 'Manrope', sans-serif;
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.08;
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  background: linear-gradient(100deg, #ffd75e, #ff5edb 52%, #67e8f9);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rt-hero-sub {
  margin: 10px auto 0; max-width: 46ch; font-size: 0.9rem; line-height: 1.5;
  color: rgba(232, 235, 255, 0.78);
}
.rt-hero-chips {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; margin-top: 18px;
}
.rt-hero-actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px;
}
.rt-hero-actions .acc-btn { text-decoration: none; text-align: center; }

/* ── Табы игр ─────────────────────────────────────────────────────────── */
.rt-tabs {
  display: flex; gap: 7px; overflow-x: auto; overflow-y: hidden;
  padding: 4px 2px 10px; margin-bottom: 6px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.rt-tabs::-webkit-scrollbar { height: 4px; }
.rt-tabs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 4px; }
.rt-tab {
  flex: 0 0 auto; scroll-snap-align: center;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  font-size: 0.83rem; font-weight: 700; color: var(--text, #f2f2f8);
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
  transition: 0.15s; white-space: nowrap; font-family: inherit;
}
.rt-tab:hover { border-color: rgba(103, 232, 249, 0.45); }
.rt-tab.active {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border-color: transparent; color: #fff;
  box-shadow: 0 5px 18px rgba(150, 70, 255, 0.4);
}
.rt-tab-i { font-size: 1rem; line-height: 1; }

/* ── Панель ───────────────────────────────────────────────────────────── */
.rt-panel {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px; padding: clamp(14px, 3vw, 24px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); margin-bottom: 16px;
}
.rt-subtabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.rt-subtab {
  padding: 7px 16px; border-radius: 999px; cursor: pointer; font-family: inherit;
  font-size: 0.8rem; font-weight: 700; color: var(--muted, #9aa0b5);
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1);
  transition: 0.15s;
}
.rt-subtab.active { color: #fff; background: rgba(167, 139, 250, 0.22); border-color: rgba(167, 139, 250, 0.55); }

.rt-game-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.rt-game-i {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, rgba(167, 139, 250, 0.28), rgba(103, 232, 249, 0.16));
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.rt-game-head h2 {
  margin: 0; font-size: 1.15rem; font-weight: 800;
  font-family: 'Unbounded', 'Manrope', sans-serif; letter-spacing: -0.02em;
}
.rt-game-head p { margin: 2px 0 0; font-size: 0.76rem; color: var(--muted, #9aa0b5); }

/* ── Подиум топ-3 ─────────────────────────────────────────────────────── */
.rt-podium {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end; gap: 6px; margin: 6px 0 22px;
}
.rt-pod {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 4px; min-width: 0; text-align: center;
}
.rt-pod-medal { font-size: 1.5rem; line-height: 1; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5)); }
.rt-pod-ava {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 800; font-size: 1.15rem; color: #fff;
  background: linear-gradient(140deg, #7b3ff2, #00c8ff);
  box-shadow: 0 6px 18px rgba(120, 80, 255, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.16);
}
.rt-pod-name {
  font-size: 0.78rem; font-weight: 800; line-height: 1.2;
  max-width: 100%; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rt-pod-stat { font-size: 0.68rem; color: var(--muted, #9aa0b5); }
.rt-pod-stat b { color: #ffe07a; font-size: 0.78rem; }
.rt-pod-step {
  width: 100%; margin-top: 4px; border-radius: 12px 12px 0 0;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 6px; font-family: 'Unbounded', 'Manrope', sans-serif;
  font-weight: 900; font-size: 1.05rem; color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1); border-bottom: none;
}
.rt-pod-1 .rt-pod-step { height: 66px; background: linear-gradient(180deg, rgba(255, 215, 94, 0.42), rgba(255, 215, 94, 0.06)); }
.rt-pod-2 .rt-pod-step { height: 48px; background: linear-gradient(180deg, rgba(223, 232, 245, 0.32), rgba(223, 232, 245, 0.05)); }
.rt-pod-3 .rt-pod-step { height: 36px; background: linear-gradient(180deg, rgba(240, 168, 104, 0.32), rgba(240, 168, 104, 0.05)); }
.rt-pod-1 .rt-pod-ava { width: 58px; height: 58px; font-size: 1.4rem; box-shadow: 0 8px 26px rgba(255, 200, 80, 0.5); border-color: rgba(255, 215, 94, 0.7); }
.rt-pod-1 .rt-pod-medal { font-size: 1.9rem; }
.rt-pod.me .rt-pod-name { color: #67e8f9; }
.rt-pod.me .rt-pod-ava { outline: 2px solid #67e8f9; outline-offset: 2px; }

/* ── Список ───────────────────────────────────────────────────────────── */
.rt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.rt-row {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 9px 11px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.06);
}
.rt-row.top { background: rgba(255, 215, 94, 0.07); border-color: rgba(255, 215, 94, 0.22); }
.rt-row.me {
  background: linear-gradient(100deg, rgba(103, 232, 249, 0.16), rgba(167, 139, 250, 0.1));
  border-color: rgba(103, 232, 249, 0.55);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.18), 0 6px 20px rgba(0, 200, 255, 0.14);
}
.rt-rank {
  flex: 0 0 auto; min-width: 34px; text-align: center;
  font-size: 0.84rem; font-weight: 800; color: var(--muted, #9aa0b5);
  font-variant-numeric: tabular-nums;
}
.rt-row.top .rt-rank { font-size: 1.05rem; }
.rt-lg {
  flex: 0 0 auto; width: 26px; height: 26px; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(50% 0%, 100% 22%, 100% 70%, 50% 100%, 0% 70%, 0% 22%);
  background: linear-gradient(160deg, var(--lg-a, #5d6c85), var(--lg-b, #dfe8f5));
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.rt-name {
  flex: 1 1 auto; min-width: 0; font-size: 0.86rem; font-weight: 600;
  overflow-wrap: anywhere; overflow: hidden; text-overflow: ellipsis;
}
.rt-you {
  display: inline-block; padding: 1px 7px; border-radius: 999px; vertical-align: middle;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: #0a2b33; background: #67e8f9;
}
.rt-stat { flex: 0 0 auto; font-size: 0.72rem; color: var(--muted, #9aa0b5); text-align: end; font-variant-numeric: tabular-nums; }
.rt-stat b { color: #ffe07a; font-size: 0.86rem; }
.rt-stat-sub { display: block; font-size: 0.66rem; }

.rt-total { margin-top: 14px; text-align: center; font-size: 0.74rem; color: var(--muted, #9aa0b5); }

/* ── Своя строка ──────────────────────────────────────────────────────── */
.rt-me { margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(255, 255, 255, 0.12); }
.rt-me-cap {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: #67e8f9; margin-bottom: 7px;
}
.rt-me-note { margin-top: 6px; font-size: 0.7rem; color: var(--muted, #9aa0b5); }
.rt-me-none {
  display: flex; align-items: center; gap: 10px; margin-top: 18px;
  padding: 12px 14px; border-radius: 14px; font-size: 0.8rem; color: var(--muted, #9aa0b5);
  background: rgba(255, 255, 255, 0.03); border: 1px dashed rgba(255, 255, 255, 0.14);
}
.rt-me-none .rt-me-i { font-size: 1.2rem; flex-shrink: 0; }

/* ── Пусто ────────────────────────────────────────────────────────────── */
.rt-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rt-empty-i { font-size: 2.4rem; }
.rt-empty-t { max-width: 34ch; }
.rt-empty-cta { text-decoration: none; }

/* ── Как считается ────────────────────────────────────────────────────── */
.rt-how-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.rt-how-item {
  padding: 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.07);
}
.rt-how-i { font-size: 1.3rem; }
.rt-how-item b { display: block; margin: 6px 0 4px; font-size: 0.9rem; }
.rt-how-item p { margin: 0; font-size: 0.79rem; line-height: 1.5; color: var(--muted, #9aa0b5); }

/* ── Подвал ───────────────────────────────────────────────────────────── */
.rt-foot {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  padding: 8px 0 28px; font-size: 0.82rem;
}
.rt-foot a { color: #67e8f9; text-decoration: none; }
.rt-foot a:hover { text-decoration: underline; }

/* ── Тост ─────────────────────────────────────────────────────────────── */
.rt-toast {
  position: fixed; inset-inline: 0; bottom: 22px; margin-inline: auto; width: max-content;
  max-width: min(90vw, 420px); z-index: 200;
  padding: 11px 18px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  background: rgba(18, 14, 34, 0.95); border: 1px solid rgba(167, 139, 250, 0.5);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: 0.22s;
}
.rt-toast.show { opacity: 1; transform: translateY(0); }

/* ── RTL: числа/статистика остаются читаемыми, порядок — зеркальный ───── */
[dir="rtl"] .rt-stat { text-align: start; }
[dir="rtl"] .rt-rank,
[dir="rtl"] .rt-stat { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .rt-tabs { direction: rtl; }

/* ── Десктоп ──────────────────────────────────────────────────────────── */
@media (min-width: 720px) {
  .rt-hero-in { padding: 38px 30px 30px; }
  .rt-hero-chips { max-width: 460px; margin-inline: auto; }
  .rt-how-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rt-podium { gap: 14px; max-width: 560px; margin-inline: auto; }
  .rt-pod-ava { width: 60px; height: 60px; font-size: 1.5rem; }
  .rt-pod-1 .rt-pod-ava { width: 74px; height: 74px; font-size: 1.8rem; }
  .rt-pod-name { font-size: 0.92rem; }
  .rt-pod-1 .rt-pod-step { height: 92px; }
  .rt-pod-2 .rt-pod-step { height: 68px; }
  .rt-pod-3 .rt-pod-step { height: 50px; }
  .rt-row { padding: 11px 14px; }
  .rt-name { font-size: 0.92rem; }
}
