/* DevOps Campus custom UI styles (keep Bootstrap as base) */

:root {
  --rs-bg: #fbfcff;
  --rs-card-radius: 18px;
  --rs-shadow: 0 16px 44px rgba(16, 24, 40, 0.10);
  --rs-shadow-hover: 0 24px 80px rgba(16, 24, 40, 0.18);
  --rs-text: #0b1220;
  --rs-muted: rgba(11, 18, 32, 0.68);
  --rs-ease: cubic-bezier(0.2, 0.9, 0.2, 1);
  --rs-focus: 0 0 0 0.25rem rgba(13, 110, 253, 0.22);
  --rs-surface: rgba(255, 255, 255, 0.90);
  --rs-surface-2: rgba(255, 255, 255, 0.74);
  --rs-border: rgba(15, 23, 42, 0.10);
  --rs-border-soft: rgba(15, 23, 42, 0.08);
  --rs-accent: #2f6df6;
  --rs-accent-2: #20c997;
  --rs-accent-3: #6f42c1;
}

/* Base typography */
.rs-body {
  color: var(--rs-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

html,
body {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "Noto Sans",
    "Liberation Sans",
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

/* Slightly larger readable headings */
.card-title,
.rs-hero-title {
  letter-spacing: -0.02em;
}

.rs-hero-subtitle,
.text-muted,
.text-secondary {
  line-height: 1.6;
}

body.bg-light {
  background:
    radial-gradient(1200px 650px at 12% 12%, rgba(47, 109, 246, 0.14), transparent 60%),
    radial-gradient(1200px 650px at 88% 8%, rgba(32, 201, 151, 0.10), transparent 60%),
    radial-gradient(900px 520px at 50% -10%, rgba(111, 66, 193, 0.08), transparent 65%),
    var(--rs-bg) !important;
}

/* Light ambient motion */
body.bg-light {
  position: relative;
}

body.bg-light::before {
  content: "";
  position: fixed;
  inset: -40px;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 10% 10%, rgba(47, 109, 246, 0.10), transparent 60%),
    radial-gradient(900px 420px at 90% 20%, rgba(32, 201, 151, 0.08), transparent 60%),
    radial-gradient(700px 360px at 60% 0%, rgba(111, 66, 193, 0.07), transparent 65%);
  filter: blur(14px);
  opacity: 0.75;
  animation: rs-ambient 18s var(--rs-ease) infinite alternate;
}

@keyframes rs-ambient {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(10px, -8px, 0) scale(1.02); }
}

/* Keep layout above background without creating stacking issues */
.rs-main {
  position: relative;
}

.text-muted,
.text-secondary {
  color: var(--rs-muted) !important;
}

/* Subtle entrance animation */
.rs-animate-in {
  animation: rs-fade-up 420ms var(--rs-ease) both;
}

@keyframes rs-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Make cards feel more "app-like" */
.card {
  border-radius: var(--rs-card-radius);
  box-shadow: var(--rs-shadow);
  border: 1px solid var(--rs-border-soft);
  overflow: hidden;
}

.card.rs-card-hover {
  transition: transform 220ms var(--rs-ease), box-shadow 220ms var(--rs-ease);
  will-change: transform;
}

.card.rs-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--rs-shadow-hover);
}

.card.rs-card-hover:active {
  transform: translateY(-1px);
}

/* "glass" surfaces */
.rs-surface {
  background: var(--rs-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--rs-border-soft);
}

.rs-surface-soft {
  background: var(--rs-surface-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--rs-border-soft);
}

/* Hero */
.rs-hero {
  border-radius: 22px;
  padding: 22px 22px;
  background:
    radial-gradient(900px 260px at 20% 0%, rgba(47, 109, 246, 0.22), transparent 60%),
    radial-gradient(900px 260px at 80% 0%, rgba(32, 201, 151, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.64));
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 18px 60px rgba(16, 24, 40, 0.10);
}

.rs-hero {
  position: relative;
  overflow: hidden;
}

.rs-hero::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(47, 109, 246, 0.18), rgba(32, 201, 151, 0.12), rgba(111, 66, 193, 0.12));
  opacity: 0.10;
  mix-blend-mode: multiply;
}

.rs-hero-title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.rs-hero-subtitle {
  color: var(--rs-muted);
  max-width: 62ch;
}

.rs-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.70);
  font-size: 0.85rem;
  color: rgba(11, 18, 32, 0.82);
}

/* Tabs: more clickable */
.nav-tabs {
  border-bottom: 0;
  gap: 0.25rem;
}

.nav-tabs .nav-link {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color 180ms var(--rs-ease), color 180ms var(--rs-ease), transform 180ms var(--rs-ease), border-color 180ms var(--rs-ease);
}

.nav-tabs .nav-link:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 23, 42, 0.18);
}

.nav-tabs .nav-link.active {
  background: #ffffff;
  color: var(--rs-text);
  border-color: rgba(15, 23, 42, 0.14);
}

/* Smooth content switching */
.tab-pane {
  animation: rs-pane 250ms var(--rs-ease) both;
}

@keyframes rs-pane {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons: gentle hover */
.btn {
  border-radius: 12px;
  transition: transform 180ms var(--rs-ease), box-shadow 180ms var(--rs-ease), filter 180ms var(--rs-ease), background-color 180ms var(--rs-ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(180deg, rgba(47, 109, 246, 1), rgba(34, 92, 224, 1));
  border-color: rgba(34, 92, 224, 1);
  box-shadow: 0 14px 34px rgba(47, 109, 246, 0.26);
}

.btn-primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 18px 48px rgba(47, 109, 246, 0.32);
}

.btn-outline-primary:hover {
  box-shadow: 0 12px 30px rgba(13, 110, 253, 0.16);
}

.btn:focus-visible,
.form-control:focus,
.btn-close:focus {
  box-shadow: var(--rs-focus) !important;
}

/* Loading state for buttons */
.rs-btn-loading {
  pointer-events: none;
  filter: saturate(0.9);
}

.rs-btn-loading .rs-btn-text {
  opacity: 0.9;
}

/* Badges */
.badge.rs-badge-pulse {
  animation: rs-pulse 1.8s var(--rs-ease) infinite;
}

@keyframes rs-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.35);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(25, 135, 84, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
  }
}

/* Toasts */
.toast-container {
  z-index: 1080;
}

.toast.rs-toast {
  border-radius: 14px;
  border: 1px solid rgba(16, 24, 40, 0.12);
  box-shadow: var(--rs-shadow);
}

.toast.rs-toast.rs-toast--info {
  border-color: rgba(13, 110, 253, 0.22);
  box-shadow: 0 18px 60px rgba(13, 110, 253, 0.10);
}

.toast.rs-toast.rs-toast--success {
  border-color: rgba(25, 135, 84, 0.28);
  box-shadow: 0 18px 60px rgba(25, 135, 84, 0.10);
}

.toast.rs-toast.rs-toast--warning {
  border-color: rgba(255, 193, 7, 0.34);
  box-shadow: 0 18px 60px rgba(255, 193, 7, 0.12);
}

.toast.rs-toast.rs-toast--danger {
  border-color: rgba(220, 53, 69, 0.30);
  box-shadow: 0 18px 60px rgba(220, 53, 69, 0.12);
}

.toast.rs-toast .toast-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Inputs / list items */
.form-control {
  border-radius: 12px;
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.input-group > .form-control:focus {
  border-color: rgba(47, 109, 246, 0.38);
}

.list-group-item {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.80);
}

.list-group-item.rs-list-item {
  transition: transform 160ms var(--rs-ease), box-shadow 160ms var(--rs-ease), border-color 160ms var(--rs-ease), background-color 160ms var(--rs-ease);
  border-radius: 14px;
  margin-bottom: 10px;
}

.list-group-item.rs-list-item.rs-list-item-active {
  border-color: rgba(32, 201, 151, 0.30);
  background:
    linear-gradient(90deg, rgba(32, 201, 151, 0.16), rgba(255, 255, 255, 0.88) 40%),
    rgba(255, 255, 255, 0.86);
  position: relative;
}

.list-group-item.rs-list-item.rs-list-item-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(32, 201, 151, 0.95), rgba(47, 109, 246, 0.75));
}

/* Per-user task status badges */
.badge.rs-status-badge {
  border-radius: 999px;
  font-weight: 650;
  letter-spacing: 0.2px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.badge.rs-status-solved {
  background: rgba(32, 201, 151, 0.16);
  color: rgba(10, 80, 55, 0.95);
  border-color: rgba(32, 201, 151, 0.22);
}

.badge.rs-status-tried {
  background: rgba(255, 193, 7, 0.18);
  color: rgba(90, 60, 0, 0.95);
  border-color: rgba(255, 193, 7, 0.28);
}

/* Сценарии: сложность task */
.rs-task-meta {
  column-gap: 0.5rem;
}

.rs-difficulty-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.25;
  border: 1px solid transparent;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 6px 14px rgba(15, 23, 42, 0.06);
  white-space: nowrap;
}

.rs-difficulty-pill--easy {
  color: rgba(6, 78, 59, 0.96);
  background: linear-gradient(165deg, rgba(209, 250, 229, 0.98), rgba(110, 231, 183, 0.55));
  border-color: rgba(16, 185, 129, 0.38);
}

.rs-difficulty-pill--medium {
  color: rgba(100, 55, 5, 0.96);
  background: linear-gradient(165deg, rgba(254, 243, 199, 0.98), rgba(251, 191, 36, 0.48));
  border-color: rgba(245, 158, 11, 0.42);
}

.rs-difficulty-pill--hard {
  color: rgba(90, 12, 28, 0.96);
  background: linear-gradient(165deg, rgba(254, 226, 226, 0.98), rgba(248, 113, 113, 0.45));
  border-color: rgba(239, 68, 68, 0.4);
}

.rs-difficulty-pill--unknown {
  color: rgba(15, 23, 42, 0.78);
  background: linear-gradient(165deg, rgba(248, 250, 252, 0.98), rgba(226, 232, 240, 0.65));
  border-color: rgba(15, 23, 42, 0.12);
}

.list-group-item.rs-list-item:hover .rs-difficulty-pill {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 8px 18px rgba(15, 23, 42, 0.08);
}

.list-group-item.rs-list-item:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 109, 246, 0.22);
  box-shadow: 0 14px 44px rgba(16, 24, 40, 0.10);
  background: rgba(255, 255, 255, 0.92);
}

/* Страница «Сценарии» */
.rs-scenarios-page .rs-scenarios-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 42rem;
}

.rs-scenarios-page .rs-scenarios-actions .btn {
  border-radius: 12px;
}

.rs-scenarios-card {
  border-radius: var(--rs-card-radius);
}

.rs-scenarios-hint-panel {
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--rs-border-soft);
  background: linear-gradient(135deg, rgba(47, 109, 246, 0.05), rgba(32, 201, 151, 0.04));
}

.rs-scenarios-hint-list {
  margin: 0;
  padding-left: 1.15rem;
}

.rs-scenarios-hint-list li {
  margin-bottom: 0.4rem;
  padding-left: 0.15rem;
}

.rs-scenarios-hint-list li:last-child {
  margin-bottom: 0;
}

/* Сценарии: вкладки категорий и блоки сложности */
.rs-tasks-list-mount {
  min-height: 2rem;
}

.rs-tasks-browser .rs-scenario-cat-tabs {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  gap: 0.2rem;
  border-bottom: 1px solid var(--rs-border-soft);
  padding-bottom: 0;
  scrollbar-width: thin;
}

@media (min-width: 768px) {
  .rs-tasks-browser .rs-scenario-cat-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.rs-tasks-browser .rs-scenario-cat-tabs .nav-item {
  flex-shrink: 0;
}

.rs-tasks-browser .rs-scenario-cat-tab {
  border-radius: 12px 12px 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  color: var(--rs-muted);
  border: 1px solid transparent;
  border-bottom: none;
  transition:
    color 0.15s var(--rs-ease),
    background 0.15s var(--rs-ease),
    border-color 0.15s var(--rs-ease);
}

.rs-tasks-browser .rs-scenario-cat-tab:hover {
  color: var(--rs-text);
  background: rgba(47, 109, 246, 0.06);
}

.rs-tasks-browser .rs-scenario-cat-tab.active {
  color: var(--rs-accent);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--rs-border-soft);
  border-bottom-color: transparent;
  margin-bottom: -1px;
}

.rs-scenario-tab-panes {
  min-height: 4rem;
}

/* Блоки сложности: спокойный цвет + лёгкий фон, без агрессивных границ */
.rs-scenario-diff-block {
  position: relative;
  border-radius: 14px;
  padding: 0.7rem 1rem 0.85rem;
  margin: 0;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-left-width: 3px;
  background: rgba(255, 255, 255, 0.42);
}

.rs-scenario-diff-block + .rs-scenario-diff-block {
  margin-top: 1rem;
}

.rs-scenario-diff-block--easy {
  border-left-color: rgba(16, 185, 129, 0.42);
  background: linear-gradient(100deg, rgba(16, 185, 129, 0.07) 0%, rgba(255, 255, 255, 0.35) 42%, rgba(255, 255, 255, 0.2) 100%);
}

.rs-scenario-diff-block--medium {
  border-left-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(100deg, rgba(245, 158, 11, 0.08) 0%, rgba(255, 255, 255, 0.35) 42%, rgba(255, 255, 255, 0.2) 100%);
}

.rs-scenario-diff-block--hard {
  border-left-color: rgba(248, 113, 113, 0.5);
  background: linear-gradient(100deg, rgba(248, 113, 113, 0.07) 0%, rgba(255, 255, 255, 0.35) 42%, rgba(255, 255, 255, 0.2) 100%);
}

.rs-scenario-diff-block--unknown {
  border-left-color: rgba(100, 116, 139, 0.4);
  background: linear-gradient(100deg, rgba(148, 163, 184, 0.1) 0%, rgba(255, 255, 255, 0.35) 45%, rgba(255, 255, 255, 0.2) 100%);
}

.rs-scenario-diff-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-bottom: 0.55rem;
  opacity: 0.92;
}

.rs-scenario-diff-title--easy {
  color: rgba(4, 120, 87, 0.82);
}

.rs-scenario-diff-title--medium {
  color: rgba(154, 89, 12, 0.82);
}

.rs-scenario-diff-title--hard {
  color: rgba(153, 45, 45, 0.8);
}

.rs-scenario-diff-title--unknown {
  color: rgba(71, 85, 105, 0.88);
}

/* Сценарии: компактные строки списка задач */
.rs-tasks-list-compact .list-group-item.rs-list-item {
  padding: 0.45rem 0.65rem;
  margin-bottom: 6px;
  border-radius: 11px;
}

.rs-tasks-list-compact .list-group-item.rs-list-item.rs-list-item-active::before {
  top: 7px;
  bottom: 7px;
  width: 3px;
}

.rs-tasks-list-compact .rs-scenario-row {
  row-gap: 0.2rem;
}

.rs-tasks-list-compact .rs-scenario-head {
  font-size: 0.92rem;
  line-height: 1.22;
}

.rs-tasks-list-compact .rs-scenario-meta {
  margin-top: 0.08rem;
  row-gap: 0.15rem;
  column-gap: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.rs-tasks-list-compact .rs-difficulty-pill,
.rs-profile-scroll-list .rs-difficulty-pill {
  padding: 0.08rem 0.42rem;
  font-size: 0.68rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 3px 8px rgba(15, 23, 42, 0.05);
}

.rs-tasks-list-compact .badge.rs-status-badge {
  font-size: 0.62rem;
  padding: 0.1rem 0.38rem;
  font-weight: 600;
}

.rs-tasks-list-compact .btn-sm {
  --bs-btn-padding-y: 0.18rem;
  --bs-btn-padding-x: 0.42rem;
  font-size: 0.76rem;
  border-radius: 9px;
}

.rs-tasks-list-compact .list-group-item.rs-list-item:hover .rs-difficulty-pill,
.rs-profile-scroll-list .list-group-item:hover .rs-difficulty-pill {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 4px 10px rgba(15, 23, 42, 0.07);
}

.list-group-item.rs-list-item:active {
  transform: translateY(0);
}

.list-group .list-group-item.rs-list-item:last-child {
  margin-bottom: 0;
}

.list-group-item a {
  text-decoration: none;
}

.list-group-item a:hover {
  text-decoration: underline;
}

/* Navbar: modern "glass" on dark */
.rs-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.80)) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rs-navbar .navbar-brand {
  letter-spacing: 0.2px;
  font-weight: 750;
}

.rs-navbar .navbar-text {
  color: rgba(255, 255, 255, 0.82) !important;
}

.rs-navbar .text-secondary {
  color: rgba(255, 255, 255, 0.70) !important;
}

.rs-navbar #authStatus {
  color: rgba(255, 255, 255, 0.86) !important;
  font-weight: 500;
}

.rs-navbar .btn.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.22);
}

.rs-navbar .btn.btn-outline-light:hover {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.35);
}

.rs-navbar .btn.active {
  background: rgba(255, 255, 255, 0.92) !important;
  color: rgba(15, 23, 42, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.65) !important;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.40);
}

.rs-main {
  min-height: calc(100vh - 260px);
}

/* Task meta / markdown */
.rs-task-meta {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 14px 14px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Modal: softer borders */
.modal-content {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: var(--rs-shadow-hover);
}

.modal-backdrop.show {
  opacity: 0.22;
}

.modal-header {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

.modal-footer {
  border-top-color: rgba(15, 23, 42, 0.08);
}

.rs-md h1,
.rs-md h2,
.rs-md h3 {
  margin: 0.5rem 0 0.35rem;
}

.rs-md p {
  margin: 0.35rem 0;
}

.rs-md ul {
  margin: 0.35rem 0 0.35rem 1.1rem;
}

.rs-md code {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0.08rem 0.35rem;
  border-radius: 8px;
}

.rs-md pre {
  margin: 0.5rem 0;
  padding: 0.75rem 0.85rem;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  overflow: auto;
}

.rs-md pre code {
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  white-space: pre;
}

.rs-md a {
  text-decoration: none;
}

.rs-md a:hover {
  text-decoration: underline;
}

/* Profile */
.rs-avatar {
  width: 44px;
  height: 44px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 12px 30px rgba(13, 110, 253, 0.25);
}

.rs-profile-menu .list-group-item {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  margin-bottom: 8px;
}

.rs-profile-menu .list-group-item.active {
  border-color: rgba(13, 110, 253, 0.28);
  box-shadow: 0 12px 28px rgba(13, 110, 253, 0.14);
}

/* Списки сценариев в профиле: ограниченная высота и прокрутка */
.rs-profile-scroll-list {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 14px;
  border: 1px solid var(--rs-border-soft);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.22) transparent;
}

.rs-profile-scroll-list::-webkit-scrollbar {
  width: 8px;
}

.rs-profile-scroll-list::-webkit-scrollbar-track {
  margin: 6px 0;
  background: transparent;
}

.rs-profile-scroll-list::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 999px;
}

.rs-profile-scroll-list::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.28);
}

.rs-profile-scroll-list .list-group-item:first-child {
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
}

.rs-profile-scroll-list .list-group-item:last-child {
  border-bottom-left-radius: 13px;
  border-bottom-right-radius: 13px;
}

/* Профиль — компактные строки «Ваши сценарии» */
.rs-profile-scroll-list .list-group-item.rs-profile-scenario-item {
  padding: 0.38rem 0.55rem;
  margin-bottom: 5px;
  border-radius: 10px;
}

.rs-profile-scroll-list .list-group-item.rs-profile-scenario-item:last-child {
  margin-bottom: 0;
}

.rs-profile-scenario-compact {
  gap: 0.35rem;
}

.rs-profile-sc-title {
  font-size: 0.88rem;
  line-height: 1.2;
}

.rs-profile-sc-status {
  font-size: 0.62rem;
  padding: 0.12em 0.4em;
  font-weight: 600;
}

.rs-profile-sc-line2 {
  margin-top: 0.12rem;
  font-size: 0.72rem;
  line-height: 1.25;
  column-gap: 0.35rem;
  row-gap: 0.15rem;
}

.rs-profile-sc-slug {
  font-size: 0.68rem;
  padding: 0 0.2rem;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
}

.rs-profile-sc-actions {
  margin-top: 0.25rem;
}

.rs-profile-sc-id {
  font-size: 0.7rem;
  padding: 0.2em 0.45em;
}

.rs-profile-sc-stop {
  --bs-btn-padding-y: 0.12rem;
  --bs-btn-padding-x: 0.4rem;
  font-size: 0.72rem;
  line-height: 1.2;
  border-radius: 8px;
}

.rs-profile-scroll-list .rs-difficulty-pill {
  padding: 0.05rem 0.32rem;
  font-size: 0.62rem;
}

.rs-kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 14px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rs-kv-key {
  color: var(--rs-muted);
  font-size: 0.9rem;
}

.rs-kv-val {
  min-width: 0;
}

@media (max-width: 576px) {
  .rs-kv {
    grid-template-columns: 1fr;
  }
}

/* Страница «Рейтинг» */
.rs-rating-page .rs-rating-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 40rem;
}

.rs-rating-actions .btn {
  border-radius: 12px;
}

.rs-rating-your-card {
  border-radius: var(--rs-card-radius);
  overflow: hidden;
}

.rs-rating-your-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1rem 1.5rem;
  padding: 1.15rem 1.35rem;
  background: linear-gradient(135deg, rgba(47, 109, 246, 0.08), rgba(32, 201, 151, 0.06));
  border: 1px solid rgba(47, 109, 246, 0.14);
}

.rs-rating-your-inner--guest {
  flex-direction: column;
  align-items: flex-start;
  background: var(--rs-surface);
  border-color: var(--rs-border-soft);
}

@media (min-width: 768px) {
  .rs-rating-your-inner--guest {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.rs-rating-your-inner--warn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 252, 255, 0.9));
  border-color: rgba(245, 158, 11, 0.28);
}

.rs-rating-your-stat {
  min-width: 4.5rem;
}

.rs-rating-your-stat--wide {
  flex: 1 1 10rem;
  min-width: 0;
}

.rs-rating-your-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* Рейтинг */
.rs-leaderboard-wrap {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
}

.rs-leaderboard thead th {
  font-size: 0.78rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.rs-leaderboard tbody td {
  font-size: 0.88rem;
}

.rs-leaderboard-points {
  font-variant-numeric: tabular-nums;
}

.rs-leaderboard tbody tr.rs-leaderboard-self {
  background: linear-gradient(90deg, rgba(13, 110, 253, 0.1), rgba(255, 255, 255, 0)) !important;
  box-shadow: inset 3px 0 0 rgba(13, 110, 253, 0.55);
}

.rs-leaderboard .rs-you-badge {
  font-size: 0.65rem;
  vertical-align: middle;
}

.rs-rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.12rem 0.35rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  color: rgba(15, 23, 42, 0.55);
  background: rgba(15, 23, 42, 0.06);
}

.rs-rank-num--1 {
  color: rgba(120, 53, 15, 0.95);
  background: linear-gradient(165deg, rgba(253, 230, 138, 0.95), rgba(245, 158, 11, 0.45));
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.rs-rank-num--2 {
  color: rgba(51, 65, 85, 0.95);
  background: linear-gradient(165deg, rgba(241, 245, 249, 0.98), rgba(148, 163, 184, 0.45));
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.rs-rank-num--3 {
  color: rgba(91, 33, 20, 0.95);
  background: linear-gradient(165deg, rgba(255, 237, 213, 0.98), rgba(251, 146, 60, 0.38));
  border: 1px solid rgba(251, 146, 60, 0.4);
}

/* Footer */
.rs-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.99) 0%, rgba(15, 23, 42, 0.97) 42%, rgba(2, 6, 23, 0.99) 100%);
  color: rgba(226, 232, 240, 0.88);
}

.rs-footer-meta {
  color: rgba(148, 163, 184, 0.88);
  line-height: 1.45;
}

/* Правая панель «О задаче» (нижняя шторка → условие задачи) */
.rs-task-info-panel-backdrop {
  position: fixed;
  left: 0;
  top: var(--rs-task-info-panel-top, 56px);
  right: 33.333vw;
  bottom: var(--rs-task-info-panel-bottom, 0px);
  z-index: 1038;
  background: rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.rs-task-info-panel-backdrop.rs-task-info-panel-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

.rs-task-info-panel {
  position: fixed;
  top: var(--rs-task-info-panel-top, 56px);
  right: 0;
  bottom: var(--rs-task-info-panel-bottom, 0px);
  width: 33.333vw;
  z-index: 1039;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.995), rgba(248, 250, 252, 0.99));
  border-left: 1px solid var(--rs-border-soft, rgba(15, 23, 42, 0.1));
  box-shadow: -16px 0 48px rgba(15, 23, 42, 0.14);
  transform: translateX(100%);
  pointer-events: none;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.rs-task-info-panel.rs-task-info-panel--open {
  transform: translateX(0);
  pointer-events: auto;
}

.rs-task-info-panel-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  height: 100%;
}

.rs-task-info-panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.65);
}

.rs-task-info-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}

/* Нижняя панель активного сценария (страница «Сценарии») */
.rs-active-scenario-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  background: linear-gradient(180deg, rgba(251, 252, 255, 0.97), rgba(255, 255, 255, 0.99));
  border-top: 1px solid var(--rs-border);
  border-left: 4px solid transparent;
  box-shadow: 0 -10px 40px rgba(16, 24, 40, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
}

.rs-active-scenario-bar--easy {
  border-left-color: rgba(16, 185, 129, 0.92);
}

.rs-active-scenario-bar--medium {
  border-left-color: rgba(245, 158, 11, 0.95);
}

.rs-active-scenario-bar--hard {
  border-left-color: rgba(239, 68, 68, 0.92);
}

.rs-active-scenario-bar--unknown {
  border-left-color: rgba(148, 163, 184, 0.55);
}

.rs-active-scenario-bar-diff.rs-difficulty-pill {
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.1rem 0.45rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 4px 10px rgba(15, 23, 42, 0.05);
}

.rs-active-scenario-bar-timer {
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--rs-text);
}

.rs-active-scenario-bar-slug {
  font-size: 0.8125rem;
}

body.rs-has-active-scenario-bar .rs-main {
  padding-bottom: 6.25rem;
}

@media (min-width: 768px) {
  body.rs-has-active-scenario-bar .rs-main {
    padding-bottom: 5.5rem;
  }
}

/* Страница «О портале» */
.rs-about-page .rs-about-hero {
  padding-bottom: 0.25rem;
}

.rs-about-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 42rem;
}

.rs-about-actions .btn {
  border-radius: 12px;
}

.rs-about-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.rs-about-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.25rem;
  height: 100%;
  background: var(--rs-surface);
  border: 1px solid var(--rs-border-soft);
  border-radius: var(--rs-card-radius);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.2s var(--rs-ease),
    box-shadow 0.2s var(--rs-ease);
}

.rs-about-step:hover {
  border-color: var(--rs-border);
  box-shadow: var(--rs-shadow);
}

.rs-about-step-num {
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--rs-accent) 0%, #2563eb 48%, var(--rs-accent-2) 100%);
  box-shadow: 0 4px 14px rgba(47, 109, 246, 0.35);
}

.rs-about-card {
  padding: 1.25rem 1.35rem;
  background: var(--rs-surface);
  border: 1px solid var(--rs-border-soft);
  border-radius: var(--rs-card-radius);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.rs-about-card-title {
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--rs-border-soft);
}

.rs-about-list {
  padding-left: 1.15rem;
  margin: 0;
}

.rs-about-list li {
  margin-bottom: 0.5rem;
}

.rs-about-list li:last-child {
  margin-bottom: 0;
}

.rs-about-highlight {
  border-left: 4px solid var(--rs-accent);
  padding: 1.15rem 1.35rem;
  background: linear-gradient(90deg, rgba(47, 109, 246, 0.09), rgba(47, 109, 246, 0.02));
  border-radius: 0 var(--rs-card-radius) var(--rs-card-radius) 0;
  border: 1px solid rgba(47, 109, 246, 0.12);
  border-left-width: 4px;
}

.rs-about-muted-list {
  padding-left: 1.2rem;
  margin: 0;
}

.rs-about-muted-list li {
  margin-bottom: 0.45rem;
}

.rs-about-muted-list li:last-child {
  margin-bottom: 0;
}

/* Reduce motion support */
@media (prefers-reduced-motion: reduce) {
  body.bg-light::before {
    animation: none !important;
  }
  .rs-animate-in,
  .tab-pane,
  .badge.rs-badge-pulse {
    animation: none !important;
  }
  .btn,
  .nav-tabs .nav-link,
  .card.rs-card-hover,
  .rs-about-step {
    transition: none !important;
  }
}

