/* «Rewind по четверти» в «Я → Достижения» (app/js/rewind.js). Оверлей и карточка — тот же паттерн, что
   у .proto-lightbox/.proto-card (protocol.css); портальное CSS-only оформление — язык
   teacher/battle-run.css .br-portal-*, перекрашенный через --q под акцент четверти (PROTOCOL_Q).
   Анимации выключает уже существующий глобальный body[data-motion='off'] * (design.css) — отдельных
   правил на reduced-motion здесь не нужно. */
.rw-entry { display: grid; gap: 10px; border-top: 3px solid var(--q, var(--accent)); }

body.rw-on { overflow: hidden; }

.rw-lightbox { position: fixed; inset: 0; z-index: 900; display: grid; place-content: center; padding: 16px; background: rgba(4, 2, 10, 0.9); }
.rw-card {
  --q: #2de2e6; position: relative; display: grid; gap: 18px; width: min(92vw, 640px); min-height: min(70vh, 520px);
  padding: 30px 22px 22px; border: 2px solid var(--q); border-radius: 18px; background: var(--panel-solid, #131a2a);
  box-shadow: 0 0 40px color-mix(in srgb, var(--q) 35%, transparent); text-align: center;
}
.rw-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 18px; cursor: pointer;
}
.rw-dots { display: flex; justify-content: center; gap: 6px; }
.rw-pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.rw-pdot.on { background: var(--q); }
.rw-slide { display: grid; place-content: center; gap: 10px; min-height: 260px; animation: rw-slide-in 0.35s ease-out; }
@keyframes rw-slide-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
.rw-nav { display: flex; justify-content: space-between; gap: 10px; }

.rw-title-wrap { display: grid; justify-items: center; gap: 10px; }
.rw-portal { position: relative; width: 140px; height: 140px; display: grid; place-items: center; }
.rw-portal-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--q); opacity: 0.6; }
.rw-portal-ring.r1 { animation: rw-portal-spin 7s linear infinite; }
.rw-portal-ring.r2 { inset: 16px; animation: rw-portal-spin 5s linear infinite reverse; }
@keyframes rw-portal-spin { to { transform: rotate(360deg); } }
.rw-portal-glyph { font-size: 2.4rem; font-weight: 700; color: var(--q); text-shadow: 0 0 20px var(--q); }
.rw-h { margin: 0; font-size: clamp(1.4rem, 5vw, 2.2rem); color: #fff; }
.rw-sub { margin: 0; color: var(--q); }

.rw-stat { display: grid; justify-items: center; gap: 6px; }
.rw-num { font-size: clamp(2.4rem, 11vw, 4.4rem); font-weight: 700; color: var(--q); font-family: var(--mono, monospace); line-height: 1; }
.rw-num-sm { font-size: clamp(1.3rem, 6vw, 1.9rem); }
.rw-label { color: var(--text-dim, #b9b0dc); }
.rw-note { font-size: 0.9rem; color: var(--text-dim, #b9b0dc); }
.rw-hz { font-size: clamp(2.6rem, 12vw, 4.4rem); color: var(--q); line-height: 1.1; }
.rw-py { color: var(--text-dim, #b9b0dc); }
.rw-ru { color: #fff; }
.rw-level-up { font-size: 1.2rem; color: var(--q); font-weight: 700; }

.rw-week-dots { display: flex; gap: 8px; }
.rw-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); }
.rw-dot.on { background: var(--q); box-shadow: 0 0 8px var(--q); }

.rw-badge-list { display: grid; gap: 8px; max-height: 220px; overflow-y: auto; }
.rw-badge-chip { padding: 6px 14px; border: 1px solid var(--q); border-radius: 999px; color: #fff; animation: rw-slide-in 0.3s ease-out backwards; }

.rw-comparison { width: 100%; }
.rw-cmp-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.rw-cmp-delta { margin-left: 8px; color: var(--success, #39ff88); }

@media (max-width: 480px) { .rw-card { padding: 22px 14px 16px; } }
