/* ==========================================================================
   v3-shell.css -- PlayRank prototype v3 shell (2026-08-23)
   Extracted from prototype/v3/*.html without duplication. Include AFTER
   rankedin_prototype.css as overlay. ~12KB, covers shell of all 18 pages;
   per-page deltas -- separate files/blocks.
   Source: prototype/v3/_patch.css + common 35 rules (>=12 files)
   ========================================================================== */

/* ── 0. Токены которых нет в rankedin_prototype.css ── */
:root {
  --rail-w: 64px;
  --teal-soft: #d9f2ef;
  --teal-dark: #0b7d73;
  --r-pill: 999px;
  --r-xs: 8px;
  --shadow-md: 0 8px 28px rgba(13,148,136,.14);
  --grad: linear-gradient(135deg,#0d9488,#6366f1);
  --grad-soft: linear-gradient(135deg,#0d9488 0%,#0b7d73 55%,#6366f1 100%);
  --ok: #047857; --ok-bg: #d1fae5; --ok-bd: #a7f3d0;
  --warn: #b45309; --warn-bd: #fde68a;
  --muted: var(--text-muted);
  --subtle: var(--text-subtle);
}

/* WCAG-контраст: в прототипах --text-muted #475569 (было #64748b).
   Переопределяем только внутри прототипного shell, чтобы не трогать
   остальной сайт глобально. */
.pt-app { --text-muted: #475569; }

/* ── 1. Shell layout: rail + main + topbar ── */
.pt-app { display:flex; min-height:100vh; }
.main { flex:1; min-width:0; }
.page { padding:18px; max-width:1120px; margin:0 auto; }
.viewport { outline:none; }
.viewport:focus-visible { outline:2px solid #0d9488; }

/* rail — фиксированная иконочная панель (десктоп), в rankedin_new
   маппится на .app-shell.collapsed; здесь — standalone для прототипов */
.rail {
  width:var(--rail-w); flex:0 0 var(--rail-w);
  background:var(--surface); border-right:1px solid var(--surface-border);
  display:flex; flex-direction:column; align-items:center;
  padding:14px 0; gap:6px;
  position:sticky; top:0; height:100vh; z-index:20;
}
.rail .logo {
  width:38px; height:38px; border-radius:11px; background:var(--grad);
  display:grid; place-items:center; color:#fff;
  font-family:'Unbounded',system-ui,sans-serif; font-weight:800; font-size:15px;
  margin-bottom:8px; text-decoration:none;
}
.rail a {
  position:relative;
  width:44px; height:44px; border-radius:12px;
  display:grid; place-items:center; color:var(--text-muted);
  text-decoration:none; font-size:20px;
  transition:background .15s, color .15s;
}
.rail a:hover { background:var(--surface-hover); color:var(--text); }
.rail a.active, .rail a.on { background:var(--teal-soft); color:var(--teal-dark); }
.rail .spacer { flex:1; }
/* hover-подпись (замена emoji, a11y) */
.rail a .rail-label {
  position:absolute; left:56px; top:50%; transform:translateY(-50%);
  background:#0f172a; color:#fff; font-size:12px; font-weight:700;
  padding:6px 8px; border-radius:8px; white-space:nowrap;
  opacity:0; pointer-events:none; transition:opacity .15s; z-index:10;
}
.rail a:hover .rail-label, .rail a:focus-visible .rail-label { opacity:1; }

/* topbar — единый: Назад | крошки | — | Live-часы | действия */
.topbar {
  position:sticky; top:0; z-index:20;
  background:rgba(238,242,244,.88); backdrop-filter:blur(10px);
  display:flex; align-items:center; gap:12px;
  padding:11px 18px; border-bottom:1px solid var(--surface-border);
}
.back {
  width:38px; height:38px; border-radius:11px;
  border:1px solid var(--surface-border); background:var(--surface);
  display:grid; place-items:center; font-size:18px; text-decoration:none;
  color:var(--text); flex:0 0 auto;
}
.crumbs {
  font-size:13px; color:var(--text-muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.crumbs b { color:var(--text); }
.crumbs a { color:var(--text); text-decoration:none; font-weight:700; }
.crumbs a:hover { color:var(--teal-dark); }
.top-actions { margin-left:auto; display:flex; gap:8px; align-items:center; }
.icon-btn {
  width:38px; height:38px; border-radius:11px;
  border:1px solid var(--surface-border); background:var(--surface);
  display:grid; place-items:center; font-size:16px; text-decoration:none; color:var(--text);
}
.bell-wrap { position:relative; }
.badge-dot { position:absolute; top:6px; right:6px; width:8px; height:8px; background:#ef4444; border:2px solid #fff; border-radius:50%; }

/* mobile bottom nav (скрыт на десктопе) */
.bnav { display:none; }

/* ── 2. Tabs: pill + overflow fade + a11y ── */
.tabs-wrap { position:relative; }
.tabs-wrap::after {
  content:''; position:absolute; right:0; top:0; bottom:0; width:40px;
  pointer-events:none; background:linear-gradient(to left, var(--surface, #fff), transparent);
  opacity:0; transition:opacity .15s;
}
.tabs-wrap.has-overflow::after { opacity:1; }

.tabs {
  display:flex; width:100%; overflow-x:auto; gap:6px;
  padding:10px 18px; border-bottom:1px solid var(--surface-border);
  background:var(--surface); scrollbar-width:none;
  scroll-behavior:smooth; scroll-padding:16px;
}
.tabs::-webkit-scrollbar { display:none; }
.tab {
  flex:0 0 auto; display:inline-flex; align-items:center; gap:6px;
  padding:9px 15px; border-radius:999px; font-size:13.5px; font-weight:700;
  text-decoration:none; color:var(--text-muted); background:var(--surface-hover);
  white-space:nowrap; transition:background .15s, color .15s, box-shadow .15s;
}
.tab:hover { color:var(--text); }
.tab.active, .tab.on, .tab[aria-selected=true] { background:var(--teal); color:#fff; box-shadow:0 4px 16px rgba(13,148,136,.28); }
.tab:focus-visible { outline:2px solid var(--teal); outline-offset:2px; }
.tab .ti { font-size:14px; line-height:1; }

/* ── 3. Hero compact (v3 fix: 40% ниже, chips читаемые) ── */
.hero { padding:16px 22px !important; }
.hero h1 { font-size:22px !important; }
.hero .chip {
  background:rgba(255,255,255,.96) !important; color:var(--text) !important;
  border:1px solid rgba(255,255,255,.9) !important; backdrop-filter:none !important;
}
.hero .chip-live { background:#fff !important; color:#0b7d73 !important; }
/* внутри hero chip контраст 12:1 вместо 1.8:1 */
.chip, .cat, small, .hint, .lsub, .fact .k { color:#475569 !important; }
[data-theme="dark"] .chip,
[data-theme="dark"] .cat,
[data-theme="dark"] small,
[data-theme="dark"] .hint,
[data-theme="dark"] .lsub,
[data-theme="dark"] .fact .k { color: var(--text-muted) !important; }

/* ── 4. Live-meta + статусные бейджи ── */
.live-meta {
  margin-left:auto; font-size:11px; font-weight:700; color:var(--text-muted);
  display:inline-flex; gap:8px; align-items:center;
}
.live-meta .offline {
  color:#e11d48; background:#fee2e2; border:1px solid #fecdd3;
  padding:2px 8px; border-radius:999px;
}
.live-meta .offline.hidden { display:none; }
.badge-live-tbl::before { content:'\25CF '; font-size:10px; } /* ● */
.badge-wait::before      { content:'\25CB '; font-size:10px; } /* ○ */
.badge-done::before      { content:'\2713 '; font-size:10px; } /* ✓ */

/* ── 5. A11y / системные ── */
.skip-link {
  position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden;
}
.skip-link:focus {
  left:16px; top:16px; width:auto; height:auto;
  background:#0d9488; color:#fff; padding:8px 12px; border-radius:8px; z-index:100;
}
*:focus-visible { outline:2px solid #0d9488; outline-offset:2px; }
@media (prefers-reduced-motion:reduce) { *{animation:none!important;transition:none!important} }

/* ── 6. Совместимость с rankedin_new .app-shell ──
   Когда прототипный контент встраивается внутрь существующего
   .app-shell, rail скрывается — используется нативный sidebar.
   Класс .pt-app--embedded вешается на wrapper. */
.pt-app--embedded .rail { display:none; }
.pt-app--embedded .topbar { background:var(--surface); backdrop-filter:none; }

/* ── 7. Bnav mobile breakpoint (как в прототипах <960) ── */
@media (max-width:959px) {
  .rail { display:none; }
  .bnav {
    display:flex; position:fixed; left:0; right:0; bottom:0; z-index:30;
    background:var(--surface); border-top:1px solid var(--surface-border);
    padding:6px 0 calc(6px + env(safe-area-inset-bottom));
  }
  .bnav a {
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
    font-size:11px; color:var(--text-muted); text-decoration:none; padding:6px 0;
  }
  .bnav a.on { color:var(--teal); font-weight:700; }
  .bnav .ico { font-size:19px; }
  .main { margin-left:0; padding-bottom:64px; }
}
