/* ==========================================================================
   Страница «О Roblox»: ключевые цифры, график по годам, возраст, безопасность, сравнение
   Подключается после style.css
   ========================================================================== */

.rb-hero .hero__inner { grid-template-columns: 1fr; }
.rb-hero .hero__title { font-size: clamp(30px, 4.2vw, 58px); max-width: 980px; }
.rb-hero .hero__lead { max-width: 720px; }

/* ---------- Ключевые цифры ---------- */
.rb-kpis {
  position: relative; margin-top: clamp(40px, 6vw, 64px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
}
.rb-kpi {
  display: flex; flex-direction: column; gap: 8px; padding: 26px 24px;
  border-radius: var(--radius-lg); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-light);
}
.rb-kpi strong { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 3.2vw, 44px); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.rb-kpi strong small { font-size: .5em; letter-spacing: 0; margin-left: 4px; color: var(--accent-light); }
.rb-kpi span { font-size: 15px; line-height: 1.4; color: rgba(255, 255, 255, .66); }
.rb-kpi em { font-style: normal; font-size: 13px; color: rgba(255, 255, 255, .42); margin-top: auto; padding-top: 6px; }

/* ---------- Общие карточки ---------- */
.rb-card { padding: clamp(22px, 3.4vw, 40px); border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--line); }
.rb-note { margin-top: 18px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.rb-grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }

/* ---------- График по годам ---------- */
.rb-chart__top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.rb-chart__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(19px, 2vw, 24px); line-height: 1.2; letter-spacing: -0.01em; }
.rb-chart__sub { margin-top: 6px; font-size: 15px; color: var(--muted); }
.rb-tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); }
.rb-tabs button {
  border: 0; background: none; cursor: pointer; font: 600 14px/1 var(--font-body); color: var(--muted);
  padding: 10px 16px; border-radius: 999px; transition: background-color .25s, color .25s;
}
.rb-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--white); }

.rb-bars {
  --h: 260px; position: relative; height: var(--h);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(6px, 1.4vw, 18px); align-items: end;
  padding-top: 28px; border-bottom: 1px solid var(--line);
  background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 25%; background-position: 0 28px;
}
.rb-bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; }
.rb-bar__fill {
  position: relative; height: calc(var(--v) * 1%); min-height: 4px; border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--accent), #2a4fd0);
  transform-origin: bottom; transition: height .8s var(--ease-out);
}
.rb-bar--peak .rb-bar__fill { background: linear-gradient(180deg, #6f93ff, var(--accent)); }
.rb-bar--fc .rb-bar__fill {
  background: repeating-linear-gradient(135deg, rgba(59, 107, 255, .22) 0 6px, rgba(59, 107, 255, .1) 6px 12px);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.rb-bar__val {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.rb-bar--fc .rb-bar__val { color: var(--accent); }
.rb-trend {
  position: absolute; left: 0; top: 28px; width: 100%; height: calc(100% - 28px);
  overflow: visible; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .6s ease .7s;
}
.rb-trend.is-in { opacity: 1; }
.rb-trend__band { fill: rgba(59, 107, 255, .1); stroke: rgba(59, 107, 255, .35); stroke-width: 1; stroke-dasharray: 3 4; }
.rb-trend__line { fill: none; stroke: #0a0e1a; stroke-width: 2; stroke-dasharray: 6 5; stroke-linecap: round; }
.rb-years { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(6px, 1.4vw, 18px); margin-top: 10px; }
.rb-years span { text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rb-years b { font-weight: inherit; }
.rb-y-short { display: none; }
.rb-years span.is-fc { color: var(--accent); font-weight: 600; }
.rb-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; font-size: 14px; color: var(--muted); }
.rb-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 8px; background: var(--accent); }
.rb-legend i.is-line { height: 0; width: 22px; border-radius: 0; background: none; border-top: 2px dashed #0a0e1a; vertical-align: 4px; }
.rb-legend i.is-band { background: rgba(59, 107, 255, .14); box-shadow: inset 0 0 0 1px rgba(59, 107, 255, .4); }
.rb-legend i.is-fc { background: repeating-linear-gradient(135deg, rgba(59, 107, 255, .3) 0 4px, rgba(59, 107, 255, .1) 4px 8px); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* Боковые факты рядом с графиком */
.rb-side { display: grid; gap: 20px; }
.rb-fact { display: flex; flex-direction: column; gap: 8px; padding: 26px 24px; border-radius: var(--radius-lg); background: var(--ink); color: var(--white); }
.rb-fact strong { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px, 3vw, 40px); line-height: 1; letter-spacing: -0.03em; }
.rb-fact span { font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, .7); }
.rb-fact em { font-style: normal; font-size: 13px; color: rgba(255, 255, 255, .45); }
.rb-fact > div { display: flex; flex-direction: column; gap: 8px; }
.rb-fact > div > span, .rb-fact > div > em { display: block; }
/* В колонке рядом с графиком карточки растягиваются по высоте: число сверху, подпись снизу */
.rb-side .rb-fact { justify-content: space-between; gap: 18px; }
.rb-fact__big { font-size: clamp(48px, 5vw, 72px) !important; }
.rb-fact--accent { background: linear-gradient(150deg, #3b6bff, #2445c2 70%); }
.rb-fact--accent span { color: rgba(255, 255, 255, .88); font-size: 16px; }
.rb-fact--accent em { color: rgba(255, 255, 255, .7); line-height: 1.45; }
.rb-growth { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 2px 0 2px; }
.rb-growth b { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 15px; font-weight: 700; white-space: nowrap; }
.rb-growth b:last-child { background: var(--white); color: var(--accent); }
.rb-growth i { font-style: normal; color: rgba(255, 255, 255, .8); }
.rb-hl { color: var(--accent); }
.rb-fact--light { background: var(--white); color: var(--text); border: 1px solid var(--line); }
.rb-fact--light span { color: var(--muted); }
.rb-fact--light em { color: var(--muted-light); }

/* Россия */
.rb-ru { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; }
.rb-ru .rb-fact { background: linear-gradient(140deg, rgba(59, 107, 255, .28), rgba(59, 107, 255, .06) 60%), var(--ink-2); }

/* ---------- Возраст: кольцевая диаграмма ---------- */
.rb-age { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.rb-donut { position: relative; width: 100%; max-width: 340px; aspect-ratio: 1; margin: 0 auto; }
.rb-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rb-donut circle { fill: none; stroke-width: 22; }
.rb-donut .rb-donut__seg { stroke-dasharray: 0 999; transition: stroke-dasharray 1.1s var(--ease-out); }
.rb-donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22%; }
.rb-donut__center strong { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 3vw, 38px); line-height: 1; }
.rb-donut__center span { margin-top: 6px; font-size: 14px; line-height: 1.35; color: var(--muted); }
.rb-age__list { display: grid; gap: 14px; }
.rb-age__item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 18px 20px; border-radius: var(--radius); background: var(--paper); }
.rb-age__item i { width: 16px; height: 16px; border-radius: 5px; background: var(--c); }
.rb-age__item b { display: block; font-size: 17px; }
.rb-age__item span { font-size: 14px; color: var(--muted); }
.rb-age__item strong { font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- Бренды глазами игроков ---------- */
.rb-brands { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rb-brand {
  display: flex; flex-direction: column; gap: 10px; padding: 26px 24px; border-radius: var(--radius-lg);
  background: var(--white); border: 1px solid var(--line);
}
.rb-brand strong { font-family: var(--font-display); font-weight: 600; font-size: clamp(38px, 4vw, 52px); line-height: 1; letter-spacing: -0.03em; color: var(--accent); }
.rb-brand span { font-size: 16px; line-height: 1.5; color: var(--text); text-wrap: pretty; }
.rb-brand em { margin-top: auto; padding-top: 6px; font-style: normal; font-size: 13px; color: var(--muted-light); }
.rb-brand--main { background: linear-gradient(150deg, #3b6bff, #2445c2 70%); border-color: transparent; }
.rb-brand--main strong { color: var(--white); }
.rb-brand--main span { color: rgba(255, 255, 255, .9); }
.rb-brand--main em { color: rgba(255, 255, 255, .65); }
.rb-insight {
  margin-top: 20px; padding: 20px 24px; border-radius: var(--radius); background: var(--ink); color: rgba(255, 255, 255, .8);
  font-size: 16px; line-height: 1.55;
}
.rb-insight b { color: var(--white); }

/* ---------- Безопасность ---------- */
.rb-safety { background: var(--ink); color: var(--white); position: relative; overflow: hidden; }
.rb-safety::after {
  content: ""; position: absolute; width: 700px; height: 700px; left: -300px; top: -360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 107, 255, .26), transparent 65%); pointer-events: none;
}
.rb-safety .section__lead { color: rgba(255, 255, 255, .64); }
.rb-safety__grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.rb-safe { display: flex; flex-direction: column; gap: 10px; padding: 28px 26px; border-radius: var(--radius-lg); background: var(--ink-2); border: 1px solid var(--line-light); }
.rb-safe__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(59, 107, 255, .16); color: var(--accent-light); margin-bottom: 6px; }
.rb-safe__icon svg { width: 24px; height: 24px; }
.rb-safe h3 { font-size: 19px; line-height: 1.3; font-weight: 600; }
.rb-safe p { font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, .66); }

/* ---------- Россия: доступность ---------- */
.rb-access .section__title { font-size: clamp(26px, 3vw, 40px); }
.rb-access { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: stretch; }
/* Панель с таймлайном тянется на всю высоту левой колонки: свободное место забирают шаги, поэтому линии всегда доходят до следующей точки */
.rb-access .rb-steps { display: flex; flex-direction: column; }
.rb-access .rb-steps li:not(:last-child) { flex: 1 1 auto; }
.rb-access .section__lead { max-width: none; }
.rb-status { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: #e7f6ee; color: #12693f; font-weight: 600; font-size: 15px; }
.rb-status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #1f9d5c; box-shadow: 0 0 0 0 rgba(31, 157, 92, .5); animation: rbPulse 2.2s infinite; }
@keyframes rbPulse { 0% { box-shadow: 0 0 0 0 rgba(31, 157, 92, .5); } 70% { box-shadow: 0 0 0 10px rgba(31, 157, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 157, 92, 0); } }
.rb-status[data-state="partial"] { background: #fff4e0; color: #8a5300; }
.rb-status[data-state="partial"]::before { background: #e59a1a; animation: none; }
.rb-status[data-state="down"] { background: #fde8e8; color: #a12424; }
.rb-status[data-state="down"]::before { background: #d93a3a; animation: none; }
.rb-live { margin-top: 28px; display: grid; gap: 14px; }
.rb-live__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.rb-live__time { font-size: 14px; color: var(--muted); }
.rb-live__days { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; height: 34px; }
.rb-live__days i { border-radius: 3px; background: #e3e7f0; transition: background-color .4s; }
.rb-live__days i[data-s="up"] { background: #2fbf71; }
.rb-live__days i[data-s="mostly"] { background: #9bdcb6; }
.rb-live__days i[data-s="partial"] { background: #f0b44c; }
.rb-live__days i[data-s="down"] { background: #e05252; }
.rb-live__legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--muted-light); }
.rb-live__uptime { color: var(--muted); font-weight: 600; }
.rb-steps {
  position: relative; display: grid; gap: 0; padding: clamp(22px, 3vw, 32px) clamp(20px, 3vw, 32px) clamp(22px, 3vw, 32px) calc(clamp(20px, 3vw, 32px) + 30px);
  border-radius: var(--radius); background: var(--paper);
}
.rb-steps li { position: relative; padding: 0 0 26px; }
.rb-steps li:last-child { padding-bottom: 0; }
/* Линия соединяет точку с точкой следующего шага и не уходит ниже последней */
.rb-steps li:not(:last-child)::after { content: ""; position: absolute; left: -23px; top: 20px; bottom: -4px; width: 2px; border-radius: 2px; background: #d5dbe8; }
.rb-steps li::before { content: ""; position: absolute; left: -30px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); box-shadow: inset 0 0 0 3px var(--muted-light); }
.rb-steps li.is-ok::before { box-shadow: inset 0 0 0 3px var(--accent); background: var(--accent); }
.rb-steps li.is-now::before { background: #1f9d5c; box-shadow: 0 0 0 5px rgba(31, 157, 92, .18); }
.rb-steps time { display: block; font-weight: 700; font-size: 16px; line-height: 1.5; }
.rb-steps span { display: block; margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }

/* ---------- Сравнение ---------- */
.rb-compare { border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--line); overflow: hidden; }
.rb-row { display: grid; grid-template-columns: minmax(0, 1.05fr) repeat(3, minmax(0, 1fr)); }
.rb-row + .rb-row { border-top: 1px solid var(--line); }
.rb-row > * { padding: 20px 22px; font-size: 15px; line-height: 1.5; }
.rb-row > :nth-child(2) { background: var(--accent-soft); }
.rb-row--head > * { font-weight: 700; font-size: 16px; }
.rb-row--head > :nth-child(2) { background: var(--accent); color: var(--white); }
.rb-row__label { font-weight: 600; color: var(--text); }
.rb-row b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; line-height: 1.15; }
.rb-row small { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.rb-yes, .rb-no, .rb-mid { display: inline-block; margin-right: 6px; font-weight: 700; }
.rb-yes { color: #1f9d5c; }
.rb-no { color: #c2410c; }
.rb-mid { color: #b7791f; }

/* ---------- Источники ---------- */
.rb-sources { margin-top: 28px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.rb-sources summary { cursor: pointer; font-weight: 600; color: var(--text); font-size: 14px; }
.rb-sources ol { margin-top: 10px; padding-left: 20px; list-style: decimal; }
.rb-sources a { color: var(--accent); word-break: break-word; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .rb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-grid-2 { grid-template-columns: 1fr; }
  .rb-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rb-safety__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-brands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-ru { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-ru > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .rb-age, .rb-access { grid-template-columns: 1fr; }
  .rb-donut { max-width: 280px; }
  .rb-safety__grid { grid-template-columns: 1fr; }
  .rb-bars { --h: 220px; }
  .rb-bar__val { font-size: 11px; }
  .rb-years span { font-size: 11px; }
  /* Таблица превращается в карточки по платформам */
  .rb-row--head { display: none; }
  .rb-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rb-row__label { grid-column: 1 / -1; padding-bottom: 4px; background: var(--paper); font-size: 14px; }
  .rb-row > * { padding: 12px 12px 16px; font-size: 13px; }
  .rb-row > :nth-child(n+2)::before { content: attr(data-p); display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
  .rb-row > :nth-child(2) { background: var(--accent-soft); }
  .rb-row b { font-family: var(--font-body); font-size: 16px; font-weight: 700; letter-spacing: 0; overflow-wrap: anywhere; hyphens: auto; }
  .rb-row > * { overflow-wrap: break-word; }
}
@media (max-width: 600px) {
  .rb-kpis { gap: 10px; }
  .rb-kpi { padding: 20px 18px; }
  .rb-side, .rb-ru { grid-template-columns: 1fr; }
  .rb-brands { grid-template-columns: 1fr; gap: 12px; }
  .rb-brand { padding: 22px 20px; }
  .rb-tabs { width: 100%; }
  .rb-tabs button { flex: 1; }
  .rb-bar__val { font-size: 10px; }
  .rb-y-full { display: none; }
  .rb-y-short { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .rb-bar__fill, .rb-donut .rb-donut__seg { transition: none; }
  .rb-status::before { animation: none; }
}
