/* ===== Lists ===== */
.items-list{
  margin: 12px 0 0;
  padding-left: 22px;
}

.items-list > li{
  margin: 12px 0;
}

.block-items-list{
  list-style: none;
  padding-left: 0;
  margin: 12px 0 0;
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* ===== Universal “accent rail” ===== */
.accent-rail{
  position: relative;
}
.accent-rail::before{
  content:"";
  position:absolute;
  left:10px;
  top:12px;
  bottom:12px;
  width:6px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--c-red), var(--c-yellow), var(--c-purple));
  opacity:.95;
}

/* ===== Task / Video cards ===== */
.task-item,
.video-item{
  position: relative;
  padding: 14px 14px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow-sm);
}

.task-item{ padding-left: 26px; }
.video-item{ padding-left: 26px; }

.task-item.accent-rail::before,
.video-item.accent-rail::before{
  left: 12px;
}

.task-item.is-hidden,
.video-item.is-hidden{
  opacity: .45;
  filter: saturate(.85);
}

.task-item.is-solved{
  background: rgba(111,44,255,.08);
  border-color: rgba(111,44,255,.18);
}

.card-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.card-title{
  font-weight: 800;
}

.card-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.task-actions{
  display:flex;
  gap:6px;
  align-items:center;
}

.task-actions .btn--icon{
  width:34px; height:34px;
}

/* ===== FIX #1: image frame (NO rounding on image, small white border) ===== */
.media-box{
  margin-top: 10px;
  padding: 10px;                 /* рамка, чтобы текст не упирался в углы */
  border-radius: var(--r-lg);     /* скругляем РАМКУ */
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.96);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.60),
    0 10px 24px rgba(0,0,0,.06);
}

.media-box img{
  border-radius: 0 !important;    /* НЕ скругляем саму картинку */
  width: 100%;
  height: auto;
  display:block;
  background:#fff;
}

.statement-text{
  margin-top: 8px;
  color: var(--c-text);
  line-height: 1.45;
}

/* ===== Attempts badge + tooltip ===== */
.attempts-wrap { position: relative; display: inline-block; }
.attempts-badge{
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: rgba(255,255,255,.85);
  cursor: help;
  user-select: none;
  font-weight: 650;
}

.attempts-tooltip{
  display:none;
  position:absolute;
  right:0;
  top: calc(100% + 8px);
  z-index: 999;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 10px;
  min-width: 280px;
  box-shadow: var(--shadow-md);
}
.attempts-wrap:hover .attempts-tooltip{ display:block; }

.attempt-row{
  display:flex;
  gap:8px;
  justify-content:space-between;
  border-top: 1px solid rgba(0,0,0,.07);
  padding-top: 6px;
  margin-top: 6px;
  font-size: 12px;
}

.attempt-time{ color: var(--c-muted); white-space: nowrap; }
.attempt-answer{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.attempt-verdict{ white-space: nowrap; }

/* ===== Answer / check box ===== */
.task-check{
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.75);
}
.task-check .input{
  width: 180px;
  padding: 9px 10px;
  border-radius: 999px;
}
.task-check .btn{ padding: 9px 12px; }

/* ===== TopicBlock (GLASS, like left-bottom) ===== */
.topic-block{
  position: relative;
  padding: 16px;  /* чуть воздуха слева */
  border-radius: var(--r-xl);
  border: 1px solid rgba(255,255,255,.46);

  /* “стекло” + цветные рефракции */
  background:
    radial-gradient(260px 160px at 14% 12%, rgba(255,221,45,.22), rgba(255,221,45,0) 70%),
    radial-gradient(280px 200px at 86% 16%, rgba(111,44,255,.20), rgba(111,44,255,0) 72%),
    radial-gradient(260px 180px at 62% 82%, rgba(255,43,71,.14), rgba(255,43,71,0) 72%),
    linear-gradient(135deg, rgba(255,255,255,.72), rgba(255,255,255,.44));

  backdrop-filter: blur(14px) saturate(1.45);
  box-shadow: 0 16px 42px rgba(0,0,0,.10);
  overflow: hidden;
}

/* фирменная полоска слева */
/* .topic-block::before{
  content:"";
  position:absolute;
  left:12px;
  top:14px;
  bottom:14px;
  width:6px;
  border-radius:999px;
  background: linear-gradient(180deg, var(--c-red), var(--c-yellow), var(--c-purple));
  opacity:.95;
} */

/* “блик” */
.topic-block::after{
  content:"";
  position:absolute;
  top:-80px;
  right:-120px;
  width:320px;
  height:320px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.65), rgba(255,255,255,0) 68%);
  transform: rotate(18deg);
  pointer-events:none;
}

.topic-block.is-hidden{
  opacity: .45;
}

.topic-block__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.topic-block__left{
  width: 120px;
  display:flex;
  align-items:center;
  gap:8px;
}

.topic-block__center{
  flex:1;
  text-align:center;
}

.topic-block__title{
  margin:0;
  font-weight: 900;
  font-size: 20px;
}

.topic-block__desc{
  margin-top: 6px;
  color: rgba(18,18,18,.65);
  font-size: 13px;
  white-space: pre-wrap;
}

.topic-block__right{
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
}

/* процент — компактный “пузырь” */
.topic-block__percent{
  font-weight: 900;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
}

/* ===== QA ===== */
.qa-details{ margin-top: 12px; }
.qa-summary{ list-style:none; user-select:none; }
.qa-summary::-webkit-details-marker{ display:none; }

.qa-details[open] .qa-open{ display:none; }
.qa-details:not([open]) .qa-close{ display:none; }

.qa-panel{
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.78);
}

.qa-msg{ padding: 8px 0; border-bottom: 1px dashed rgba(0,0,0,.16); }
.qa-msg:last-child{ border-bottom:none; }

.qa-meta{ color: var(--c-muted); font-size: 12px; }
.qa-text{ margin-top: 4px; white-space: pre-wrap; }

.qa-dot{
  display:inline-block;
  width:8px; height:8px;
  border-radius:999px;
  background: var(--c-red);
  margin-left:8px;
  vertical-align:middle;
}

/* ===== Richdoc bits ===== */
.richdoc .rd-p{ margin: 6px 0; }
.richdoc .math-block{ margin: 10px 0; }

.rd-table{ border-collapse: collapse; width: 100%; background:#fff; }
.rd-table th, .rd-table td{ border: 1px solid rgba(0,0,0,.12); padding: 8px; vertical-align: top; }
.rd-caption{ caption-side: bottom; color: var(--c-muted); padding-top: 6px; font-size: 13px; }

@media (max-width: 720px){
  .card-top{ flex-direction:column; align-items:stretch; }
  .card-actions{ justify-content:flex-start; }
  .topic-block__left{ width:auto; }
}


/* ================================
   TOPIC: continuous numbering
   ================================ */
   #items-list .task-item,
   #items-list .video-item{
     position: relative;
   }
   
   /* номер рисуем псевдо-элементом, текст карточки не ломаем */
   /* #items-list .task-item[data-no]::after,
   #items-list .video-item[data-no]::after{
     content: attr(data-no);
     position: absolute;
     top: 10px;
     left: 18px;
   
     font-weight: 900;
     font-size: 22px;
     line-height: 1;
     letter-spacing: -0.02em;
   
     color: rgba(18,18,18,.58);
     text-shadow: 0 1px 0 rgba(255,255,255,.9);
     z-index: 2;
     pointer-events: none;
   } */
  /* ================================
   TOPIC: continuous numbering (OLD LOOK)
   IMPORTANT: uses ::after so it DOES NOT break accent-rail ::before
   ================================ */
#items-list .task-item,
#items-list .video-item{
  position: relative;
}

/* номер рисуем псевдо-элементом, полоска accent-rail остаётся */
#items-list .task-item[data-no]::after,
#items-list .video-item[data-no]::after{
  content: attr(data-no);
  position: absolute;
  top: 4px;
  left: 25px;

  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;

  color: rgba(18,18,18,.58);
  text-shadow: 0 1px 0 rgba(255,255,255,.9);
  z-index: 2;
  pointer-events: none;
} 


   /* ================================
      TOPIC BLOCK: collapse
      ================================ */
   .topic-block__meta{
     display:flex;
     align-items:center;
     gap:10px;
     flex-wrap:wrap;
   }
   
   /* счетчик элементов */
   .topic-block__count{
     display:inline-flex;
     align-items:center;
     gap:8px;
     padding: 7px 12px;
     border-radius: 999px;
     border: 1px solid rgba(18,18,18,.12);
     background: rgba(255,255,255,.72);
     backdrop-filter: blur(10px);
     font-weight: 800;
     color: rgba(18,18,18,.70);
   }
   
   /* кнопка свернуть/развернуть */
   .topic-block__toggle{
    appearance:none;
    border: 1px solid rgba(18,18,18,.12);
    background: rgba(255,255,255,.72);
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 800;
    cursor: pointer;
    backdrop-filter: blur(10px);
  
    /* ДОБАВИЛ: чтобы не прыгало при "свернуть/развернуть" */
    min-width: 116px;        /* подгони, если хочешь */
    text-align: center;
  
    /* ДОБАВИЛ: чтобы высота была стабильной на всех браузерах */
    line-height: 1.1;
    min-height: 34px;
    box-sizing: border-box;
  }
  
  .topic-block__toggle:hover{
    box-shadow: 0 10px 26px rgba(0,0,0,.10);
  }
  
  .topic-block__toggle:focus{
    outline: none;
    box-shadow: 0 0 0 3px rgba(111,44,255,.22);
  }
  
  /* ДОБАВИЛ: чтобы мета-строка (счетчик + toggle) не скакала */
  .topic-block__meta{
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }
  
   
   
   /* тело блока */
   .topic-block__body{
     margin-top: 12px;
   }
   
   /* когда свернули — прячем содержимое */
   .topic-block.is-collapsed .topic-block__body{
     display:none;
   }
   

   /* solved emoji badge (always visible for solved tasks) */
.task-item{
  overflow: visible; /* чтобы эмодзи мог чуть вылезать за рамки */
}

.task-solved-emoji{
  position: absolute;

  /* было: right:-34px; bottom:-38px; */
  right: -8px;     /* левее (ближе внутрь) */
  bottom: 26px;    /* сильно выше */

  font-size: 110px;
  line-height: 1;
  transform: rotate(-10deg);
  filter: drop-shadow(0 22px 30px rgba(0,0,0,.22));
  pointer-events: none;
  user-select: none;
  z-index: 3;
  animation: solved-float 2.6s ease-in-out infinite;
}



@keyframes solved-float{
  0%,100% { transform: rotate(-10deg) translateY(0px); }
  50%     { transform: rotate(-10deg) translateY(-6px); }
}


/* ====== Красивый номер задачи/видео (плашка) ====== */
.task-item,
.video-item{
  position: relative; /* чтобы плашка позиционировалась внутри карточки */
}

.item-no-badge{
  position: absolute;
  left: 14px;
  top: 14px;

  padding: 8px 10px;
  border-radius: 999px;

  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.2px;

  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.40);
  box-shadow: 0 16px 30px rgba(0,0,0,.14);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  color: rgba(0,0,0,.70);
  pointer-events: none;
  z-index: 6;
}

/* На всякий случай: если где-то остались маркеры OL */
.task-item::marker,
.video-item::marker{
  content: "";
}





.items-list .task-item[data-no]::after,
.items-list .video-item[data-no]::after{
  content: attr(data-no);
  position: absolute;
  top: 12px;
  left: 18px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 34px;
  height: 34px;
  padding: 0 10px;

  border-radius: 999px;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;

  color: rgba(18,18,18,.72);
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(18,18,18,.12);
  box-shadow: 0 16px 30px rgba(0,0,0,.14);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  z-index: 6;
  pointer-events: none;
}