/* Interactive step player for "Симулятор алгоритма инвестора" (/scheme#investor-simulator) */
.cc-sim { container-type: inline-size; container-name: ccsim; }
.cc-sim__lead { margin: 0 0 2rem; color: #4a5875; font-size: 1.6rem; line-height: 1.55; }

.cc-sim__tabs { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 0 0 2rem; }
.cc-sim__tab {
  padding: 1rem 1.8rem; border: 1px solid #d9dde6; border-radius: 2.4rem; background: #fff;
  color: #243556; font-size: 1.5rem; font-weight: 600; line-height: 1; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.cc-sim__tab:hover { border-color: #243556; }
.cc-sim__tab.is-active { background: #243556; border-color: #243556; color: #fff; }

.cc-sim__player {
  display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(28rem, 1fr); gap: 2.4rem;
  align-items: start; margin-bottom: 4rem; outline: none;
}

.cc-sim__frame {
  border: 1px solid #dfe4ee; border-radius: 0.8rem; background: #fff; overflow: hidden;
  box-shadow: 0 1.6rem 5rem rgba(36, 53, 86, 0.12);
}
.cc-sim__bar { position: relative; display: flex; align-items: center; gap: 0.6rem; height: 3.8rem; padding: 0 1.2rem; background: #eef1f6; border-bottom: 1px solid #dfe4ee; }
.cc-sim__dot { width: 0.9rem; height: 0.9rem; border-radius: 50%; background: #c7cedc; flex: 0 0 auto; }
.cc-sim__url {
  flex: 1 1 auto; min-width: 0; margin: 0 1rem; padding: 0.5rem 1.2rem; border-radius: 1.2rem; background: #fff;
  color: #4a5875; font-size: 1.3rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cc-sim__full { position: relative; flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border: 0; background: transparent; cursor: pointer; }
.cc-sim__full::before { content: ""; position: absolute; inset: 0.6rem; border: 2px solid #4a5875; border-radius: 2px; }
.cc-sim__full:hover::before { border-color: #243556; }

.cc-sim__stage { position: relative; background: #f4f6fa; cursor: pointer; }
.cc-sim__stage img { display: block; width: 100%; height: auto; }
.cc-sim__hint {
  position: absolute; left: 1.2rem; bottom: 1.2rem; padding: 0.7rem 1.2rem; border-radius: 2rem;
  background: rgba(31, 42, 68, 0.88); color: #fff; font-size: 1.3rem; line-height: 1; pointer-events: none;
  opacity: 0; transform: translateY(0.4rem); transition: opacity .2s ease, transform .2s ease;
}
.cc-sim__stage:hover .cc-sim__hint { opacity: 1; transform: none; }

.cc-sim__progress { display: flex; gap: 0.3rem; padding: 0.4rem 1.2rem 0.6rem; background: #fff; }
.cc-sim__seg { position: relative; flex: 1 1 0; min-width: 0; height: 1.4rem; padding: 0; border: 0; background: transparent; cursor: pointer; }
.cc-sim__seg::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 0.4rem; transform: translateY(-50%); border-radius: 0.4rem; background: #dfe4ee; transition: background-color .2s ease; }
.cc-sim__seg.is-done::after { background: #7ea3e6; }
.cc-sim__seg.is-active::after { background: #243556; }
.cc-sim__seg:hover::after { background: #4d7dc6; }

.cc-sim__card {
  position: sticky; top: 12rem; max-height: calc(100vh - 14rem); overflow-y: auto;
  padding: 2.4rem; border-radius: 0.8rem; background: #1f2a44; color: #fff;
  box-shadow: 0 1.6rem 5rem rgba(31, 42, 68, 0.28);
}
.cc-sim__counter { margin-bottom: 0.8rem; color: #9fb4e6; font-size: 1.3rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.cc-sim .cc-sim__title { margin: 0 0 1.4rem; color: #fff; font-size: 2.2rem; line-height: 1.25; font-weight: 600; }
.cc-sim__text { color: rgba(255, 255, 255, 0.92); font-size: 1.55rem; line-height: 1.6; }
.cc-sim__text p { margin: 0 0 1.2rem; }
.cc-sim__text strong, .cc-sim__text b { color: #fff; }
.cc-sim__text a { color: #fff; text-decoration: underline; }
.cc-sim__text ul, .cc-sim__text ol { margin: 0 0 1.2rem 2rem; padding: 0; }
.cc-sim__text img { max-width: 100%; height: auto; }
.cc-sim__nav { display: flex; gap: 1rem; margin-top: 2rem; }
.cc-sim__btn {
  flex: 1 1 0; min-height: 4.6rem; padding: 0 1.6rem; border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 0.4rem;
  background: transparent; color: #fff; font-size: 1.5rem; font-weight: 600; cursor: pointer; transition: background-color .2s ease, opacity .2s ease;
}
.cc-sim__btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.cc-sim__btn:disabled { opacity: 0.35; cursor: default; }
.cc-sim__btn--primary { background: #fff; border-color: #fff; color: #1f2a44; }
.cc-sim__btn--primary:hover:not(:disabled) { background: #e6ecf8; }

/* fullscreen mode */
.cc-sim__player.is-full {
  position: fixed; inset: 0; z-index: 100000; margin: 0; padding: 2rem; overflow: auto;
  background: #0f182a; grid-template-columns: minmax(0, 2.2fr) minmax(30rem, 1fr);
}
.cc-sim__player.is-full .cc-sim__stage img { max-height: calc(100vh - 12rem); object-fit: contain; margin: 0 auto; }
.cc-sim__player.is-full .cc-sim__card { top: 2rem; max-height: calc(100vh - 4rem); }

@media (max-width: 991px) {
  .cc-sim__player, .cc-sim__player.is-full { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .cc-sim__card { position: static; max-height: none; }
  .cc-sim__hint { opacity: 1; transform: none; }
  .cc-sim__player.is-full .cc-sim__stage img { max-height: 55vh; }
}

@media (max-width: 767px) {
  .cc-sim__tab { padding: 0.9rem 1.4rem; font-size: 1.4rem; }
  .cc-sim__card { padding: 1.8rem; }
  .cc-sim .cc-sim__title { font-size: 2rem; }
  .cc-sim__text { font-size: 1.5rem; }
  .cc-sim__url { display: none; }
  .cc-sim__bar { justify-content: flex-end; }
  .cc-sim__bar .cc-sim__dot { margin-right: 0; }
}

/* narrow content column (the page has a sidebar): stack, so the screenshot gets the full column width */
@container ccsim (max-width: 1000px) {
  .cc-sim__player:not(.is-full) { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .cc-sim__player:not(.is-full) .cc-sim__card { position: static; max-height: none; }
}
