/**
 * Rewind
 * Location: /assets/css/rewind.css
 * Description: Story toàn màn hình, khung 9:16 trên desktop, tràn màn hình trên điện thoại.
 * Version: 2.0.0
 */

html.im-rw-open,
html.im-rw-open body { overflow: hidden; }

.im-rw {
    --rw-a: #4c1d95;
    --rw-b: #be185d;
    --rw-c: #f59e0b;
    --rw-ink: #fff;
    --rw-soft: rgba(255, 255, 255, .78);
    --rw-glass: rgba(255, 255, 255, .12);
    --rw-line: rgba(255, 255, 255, .2);
    --rw-hot: #ffd166;
    --rw-ease: cubic-bezier(.2, .8, .2, 1);

    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0718;
    color: var(--rw-ink);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Bảng màu theo từng slide (đặt trên #im-rewind và từng slide) */
[data-theme="intro"]       { --rw-a: #4c1d95; --rw-b: #be185d; --rw-c: #f59e0b; }
[data-theme="chapters"]    { --rw-a: #1e3a8a; --rw-b: #4f46e5; --rw-c: #22d3ee; }
[data-theme="months"]      { --rw-a: #064e3b; --rw-b: #0f766e; --rw-c: #a3e635; }
[data-theme="rhythm"]      { --rw-a: #0f0a2e; --rw-b: #3730a3; --rw-c: #f472b6; }
[data-theme="genres"]      { --rw-a: #7c2d12; --rw-b: #e11d48; --rw-c: #fdba74; }
[data-theme="top"]         { --rw-a: #111827; --rw-b: #78350f; --rw-c: #fbbf24; }
[data-theme="journey"]     { --rw-a: #134e4a; --rw-b: #4d7c0f; --rw-c: #fde047; }
[data-theme="support"]     { --rw-a: #7f1d1d; --rw-b: #c2410c; --rw-c: #fcd34d; }
[data-theme="community"]   { --rw-a: #1e3a8a; --rw-b: #0369a1; --rw-c: #67e8f9; }
[data-theme="collection"]  { --rw-a: #3b0764; --rw-b: #a21caf; --rw-c: #f0abfc; }
[data-theme="games"]       { --rw-a: #14532d; --rw-b: #15803d; --rw-c: #bef264; }
[data-theme="personality"] { --rw-a: #500724; --rw-b: #7e22ce; --rw-c: #fda4af; }
[data-theme="summary"]     { --rw-a: #1e1b4b; --rw-b: #6d28d9; --rw-c: #f472b6; }

.im-rw-backdrop {
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(40% 50% at 20% 30%, var(--rw-b), transparent 70%),
        radial-gradient(40% 50% at 80% 70%, var(--rw-c), transparent 70%),
        var(--rw-a);
    filter: blur(60px) saturate(1.2);
    opacity: .55;
    transition: background .8s var(--rw-ease);
}

/* Khung story */
.im-rw-frame {
    position: relative;
    width: min(100vw, calc((100dvh - 32px) * 9 / 16));
    height: min(100dvh, calc(100dvh - 32px));
    max-width: 520px;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
    container-type: inline-size;
    background: var(--rw-a);
    user-select: none;
    -webkit-user-select: none;
}
@media (max-width: 640px), (max-height: 560px) {
    .im-rw-frame { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; box-shadow: none; }
}
@supports not (height: 100dvh) {
    .im-rw-frame { height: calc(100vh - 32px); width: min(100vw, calc((100vh - 32px) * 9 / 16)); }
    @media (max-width: 640px) { .im-rw-frame { height: 100vh; } }
}

/* Thanh trên */
.im-rw-top {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 5;
    padding: 12px 14px 0;
    padding-top: max(12px, env(safe-area-inset-top));
    background: linear-gradient(rgba(0, 0, 0, .35), transparent);
    pointer-events: none;
}
.im-rw-bars { display: flex; gap: 4px; height: 3px; }
.im-rw-bar { flex: 1; background: rgba(255, 255, 255, .3); border-radius: 3px; overflow: hidden; }
.im-rw-bar i { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; will-change: transform; }
.im-rw-bar.is-done i { transform: scaleX(1); }

.im-rw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.im-rw-brand { display: flex; flex-direction: column; line-height: 1.15; color: #fff !important; text-decoration: none !important; pointer-events: auto; min-width: 0; }
.im-rw-brand-name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-rw-brand-year { font-size: 12px; opacity: .75; }
.im-rw-tools { display: flex; gap: 4px; pointer-events: auto; }
.im-rw-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(0, 0, 0, .25); color: #fff !important; cursor: pointer;
    transition: background .2s;
}
.im-rw-icon:hover { background: rgba(0, 0, 0, .45); }
.im-rw-icon svg { fill: currentColor; }
.im-rw-pause .i-play { display: none; }
.im-rw.is-paused .im-rw-pause .i-play { display: block; }
.im-rw.is-paused .im-rw-pause .i-pause { display: none; }

/* Nút chuyển trên desktop */
.im-rw-nav {
    position: absolute; top: 50%; z-index: 6;
    width: 40px; height: 40px; margin-top: -20px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    transition: background .2s, opacity .2s;
}
.im-rw-nav svg { fill: currentColor; }
.im-rw-nav:hover { background: rgba(255, 255, 255, .3); }
.im-rw-nav:disabled { opacity: 0; pointer-events: none; }
.im-rw-nav.is-prev { left: 8px; }
.im-rw-nav.is-next { right: 8px; }
@media (hover: hover) and (min-width: 641px) {
    .im-rw-nav:not([hidden]) { display: inline-flex; opacity: 0; }
    .im-rw-frame:hover .im-rw-nav:not(:disabled) { opacity: 1; }
}

/* Sân khấu & slide */
.im-rw-stage { position: absolute; inset: 0; touch-action: pan-y; cursor: pointer; }
.im-rw-slide {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    background:
        radial-gradient(120% 70% at 100% 0%, color-mix(in srgb, var(--rw-b) 85%, transparent), transparent 60%),
        radial-gradient(90% 60% at 0% 100%, color-mix(in srgb, var(--rw-c) 45%, transparent), transparent 65%),
        var(--rw-a);
    opacity: 0;
    transition: opacity .45s var(--rw-ease);
    overflow: hidden;
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
    .im-rw-slide { background: radial-gradient(120% 70% at 100% 0%, var(--rw-b), transparent 60%), var(--rw-a); }
}
.im-rw-slide.is-active { opacity: 1; z-index: 1; }
.im-rw-slide.is-leaving { opacity: 0; z-index: 0; }

.im-rw-body {
    position: relative; z-index: 1;
    flex: 1;
    display: flex; flex-direction: column; justify-content: center;
    gap: 3.2cqw;
    padding: 96px 7cqw 40px;
    padding-bottom: max(40px, env(safe-area-inset-bottom));
    overflow-y: auto;
    scrollbar-width: none;
}
.im-rw-body::-webkit-scrollbar { display: none; }

/* Hình trang trí chuyển động */
.im-rw-deco { position: absolute; inset: 0; pointer-events: none; }
.im-rw-deco i {
    position: absolute; border-radius: 50%;
    background: var(--rw-c); opacity: .22; filter: blur(2px);
    animation: rw-float 14s ease-in-out infinite alternate;
}
.im-rw-deco i:nth-child(1) { width: 62cqw; height: 62cqw; right: -22cqw; top: -12cqw; }
.im-rw-deco i:nth-child(2) { width: 34cqw; height: 34cqw; left: -12cqw; bottom: 18%; background: var(--rw-b); opacity: .35; animation-duration: 18s; }
.im-rw-deco i:nth-child(3) {
    width: 22cqw; height: 22cqw; right: 12cqw; bottom: -6cqw;
    background: transparent; border: 2px solid var(--rw-c); opacity: .5; animation-duration: 11s;
}
@keyframes rw-float {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-6cqw, 5cqw, 0) scale(1.12); }
}

/* Xuất hiện lần lượt */
.rw-in { opacity: 0; transform: translateY(18px); }
.is-active .rw-in { animation: rw-in .7s var(--rw-ease) forwards; animation-delay: var(--d, 0ms); }
@keyframes rw-in { to { opacity: 1; transform: none; } }

/* Chữ */
.im-rw-kicker { margin: 0; font-size: max(13px, 3.6cqw); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--rw-soft); }
.im-rw-mega {
    margin: 0; color: #fff;
    font-size: 30cqw; font-weight: 900; line-height: .9; letter-spacing: -.04em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 6px 30px rgba(0, 0, 0, .25);
    word-break: break-word;
}
.im-rw-mega.is-word { font-size: 14cqw; line-height: 1; letter-spacing: -.02em; }
.im-rw-title { margin: 0; color: #fff; font-size: 8.4cqw; font-weight: 900; line-height: 1.1; letter-spacing: -.01em; }
.im-rw-title.is-sm { font-size: 6.4cqw; font-weight: 800; }
.im-rw-lead { margin: 0; color: var(--rw-soft); font-size: max(14px, 4.2cqw); line-height: 1.45; }
.im-rw-note { color: var(--rw-soft); font-size: max(13px, 3.6cqw); }
.im-rw-note p { margin: 0; }
.im-rw-fine { margin: 0; color: rgba(255, 255, 255, .6); font-size: max(11px, 3cqw); line-height: 1.4; }

.im-rw-avatar { width: 22cqw; height: 22cqw; max-width: 110px; max-height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.im-rw-logo { max-width: 40cqw; max-height: 16cqw; object-fit: contain; }

.im-rw-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.im-rw-chips small { width: 100%; color: var(--rw-soft); font-size: max(12px, 3.2cqw); }
.im-rw-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px; border-radius: 999px;
    background: var(--rw-glass); border: 1px solid var(--rw-line);
    font-size: max(12px, 3.3cqw); font-weight: 700; color: #fff; white-space: nowrap;
    backdrop-filter: blur(6px);
}
.im-rw-chip.is-hot { background: var(--rw-hot); border-color: transparent; color: #3b0a45; }

/* Ô số liệu */
.im-rw-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.im-rw-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.im-rw-grid.is-1 { grid-template-columns: 1fr; }
.im-rw-stat {
    display: flex; flex-direction: column; gap: 2px;
    padding: 3.6cqw 4cqw; border-radius: 16px;
    background: var(--rw-glass); border: 1px solid var(--rw-line);
    backdrop-filter: blur(8px);
    min-width: 0;
}
.im-rw-stat strong { font-size: 8cqw; font-weight: 900; line-height: 1.05; color: #fff; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.im-rw-grid.is-3 .im-rw-stat strong { font-size: 6.4cqw; }
.im-rw-stat strong small { font-size: .5em; font-weight: 700; opacity: .8; }
.im-rw-stat > span { color: var(--rw-soft); font-size: max(11px, 3.1cqw); font-weight: 600; line-height: 1.3; }

.im-rw-emblem { line-height: 0; color: var(--rw-c); filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .25)); }
.im-rw-emblem svg { width: 14cqw; height: 14cqw; fill: currentColor; }

.im-rw-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3cqw 4cqw; border-radius: 14px; background: rgba(0, 0, 0, .2); font-size: max(12px, 3.4cqw); }
.im-rw-line span { color: var(--rw-soft); }
.im-rw-line b { text-align: right; }

/* Biểu đồ cột tháng */
.im-rw-columns { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.6cqw; align-items: end; height: 56cqw; margin-top: 4cqw; }
.im-rw-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.im-rw-col-bar {
    width: 100%; height: var(--h); min-height: 3px; border-radius: 6px 6px 3px 3px;
    background: rgba(255, 255, 255, .35);
    transform: scaleY(0); transform-origin: bottom;
}
.is-active .im-rw-col-bar { animation: rw-grow-y .9s var(--rw-ease) forwards; animation-delay: calc(400ms + var(--i) * 60ms); }
.im-rw-col.is-peak .im-rw-col-bar { background: var(--rw-c); box-shadow: 0 0 24px var(--rw-c); }
.im-rw-col-l { font-size: max(10px, 2.8cqw); font-weight: 700; color: var(--rw-soft); text-transform: uppercase; }
.im-rw-col-v { font-size: max(11px, 3cqw); font-weight: 800; min-height: 1.2em; white-space: nowrap; }
@keyframes rw-grow-y { to { transform: scaleY(1); } }
@keyframes rw-grow-x { to { transform: scaleX(1); } }

/* Đồng hồ 24h */
.im-rw-clock-wrap { display: flex; justify-content: center; padding: 6cqw 0; }
.im-rw-clock {
    position: relative; width: 50cqw; height: 50cqw;
    border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .1) 0 28%, transparent 29%);
}
.im-rw-ray {
    position: absolute; left: 50%; top: 0;
    width: 2.6cqw; height: 50%; margin-left: -1.3cqw;
    transform-origin: 50% 100%;
    transform: rotate(var(--a));
    opacity: 0;
}
.im-rw-ray::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 30%;
    height: calc(var(--r) * .7); border-radius: 3cqw;
    background: rgba(255, 255, 255, .45);
}
.is-active .im-rw-ray { animation: rw-ray .6s var(--rw-ease) forwards; animation-delay: calc(300ms + var(--a) * 1.2ms); }
@keyframes rw-ray { to { opacity: 1; } }
.im-rw-ray.is-peak::before { background: var(--rw-c); box-shadow: 0 0 18px var(--rw-c); }
.im-rw-clock b {
    position: absolute; left: 50%; top: 50%;
    font-size: max(10px, 2.8cqw); font-weight: 700; color: var(--rw-soft);
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(-28.5cqw) rotate(calc(var(--a) * -1));
}
.im-rw-clock em {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-style: normal; font-size: 6cqw; font-weight: 900;
}

/* Thanh ngang (thứ trong tuần) */
.im-rw-hbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1.6cqw; align-items: end; height: 16cqw; }
.im-rw-hbar { display: flex; flex-direction: column-reverse; align-items: center; height: 100%; gap: 4px; }
.im-rw-hbar span { font-size: max(10px, 2.6cqw); color: var(--rw-soft); font-weight: 700; }
.im-rw-hbar i { width: 100%; height: var(--w); border-radius: 4px; background: rgba(255, 255, 255, .35); transform: scaleY(0); transform-origin: bottom; }
.is-active .im-rw-hbar i { animation: rw-grow-y .8s var(--rw-ease) forwards; animation-delay: 900ms; }
.im-rw-hbar.is-peak i { background: var(--rw-c); }

/* Thể loại */
.im-rw-genres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2.6cqw; }
.im-rw-genres li { display: grid; grid-template-columns: 7cqw minmax(0, 1.2fr) 1fr auto; align-items: center; gap: 2.6cqw; font-size: max(13px, 3.8cqw); }
.im-rw-rank { font-weight: 900; color: var(--rw-c); font-variant-numeric: tabular-nums; }
.im-rw-gname { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-rw-gbar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.im-rw-gbar i { display: block; height: 100%; width: var(--w); background: var(--rw-c); border-radius: inherit; transform: scaleX(0); transform-origin: left; }
.is-active .im-rw-gbar i { animation: rw-grow-x .9s var(--rw-ease) forwards; animation-delay: 700ms; }
.im-rw-gval { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--rw-soft); }

/* Bìa truyện */
.im-rw-cover-img { position: relative; display: block; flex: none; overflow: hidden; border-radius: 12px; background: rgba(255, 255, 255, .12); aspect-ratio: 3 / 4; }
.im-rw-cover-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.im-rw-cover-img.is-xs { width: 13cqw; border-radius: 8px; }
.im-rw-cover-img.is-hero { width: 40cqw; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.im-rw-cover-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 6cqw; color: var(--rw-soft); }

.im-rw-hero { display: flex; gap: 5cqw; align-items: flex-end; }
.im-rw-hero-t { min-width: 0; display: flex; flex-direction: column; gap: 2cqw; align-items: flex-start; }
.im-rw-hero-t h2 { margin: 0; color: #fff; font-size: 6.8cqw; font-weight: 900; line-height: 1.12; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.im-rw-hero-t p { margin: 0; color: var(--rw-soft); font-weight: 700; font-size: max(13px, 3.6cqw); }

.im-rw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2.4cqw; }
.im-rw-list li, .im-rw-row { display: flex; align-items: center; gap: 3cqw; min-width: 0; }
.im-rw-list .im-rw-rank { width: 6cqw; font-size: 5cqw; text-align: center; }
.im-rw-tl { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.im-rw-tl b { font-size: max(13px, 3.8cqw); font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-rw-tl small { font-size: max(11px, 3cqw); color: var(--rw-soft); }

.im-rw-shelf-wrap small { display: block; margin-bottom: 2cqw; color: var(--rw-soft); font-size: max(11px, 3.1cqw); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.im-rw-shelf { display: flex; gap: 2cqw; }
.im-rw-shelf .im-rw-cover-img { transform: rotate(-3deg); }
.im-rw-shelf .im-rw-cover-img:nth-child(even) { transform: rotate(3deg); }

.im-rw-split { height: 12px; border-radius: 12px; background: var(--rw-b); overflow: hidden; }
.im-rw-split i { display: block; height: 100%; width: var(--w); background: var(--rw-c); transform: scaleX(0); transform-origin: left; }
.is-active .im-rw-split i { animation: rw-grow-x 1s var(--rw-ease) forwards; animation-delay: 900ms; }
.im-rw-split-l { display: flex; justify-content: space-between; margin-top: 6px; font-size: max(11px, 3.1cqw); font-weight: 700; color: var(--rw-soft); }

/* Thẻ sưu tập */
.im-rw-card-wrap { display: flex; align-items: center; gap: 4cqw; }
.im-rw-card { position: relative; display: block; width: 30cqw; flex: none; aspect-ratio: 5 / 7; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .14); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); animation: rw-tilt 5s ease-in-out infinite alternate; }
.im-rw-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.im-rw-card .im-rw-card-frame { object-fit: fill; }
@keyframes rw-tilt { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(3deg) translateY(-6px); } }
.im-rw-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.im-rw-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 5px; border-radius: 999px; background: var(--rw-glass); border: 1px solid var(--rw-line); font-size: max(11px, 3.1cqw); }
.im-rw-badge img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

/* Phong cách đọc */
.im-rw-seal {
    width: 34cqw; height: 34cqw; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: conic-gradient(from 0deg, var(--rw-c), var(--rw-b), var(--rw-c));
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .12), 0 20px 60px rgba(0, 0, 0, .35);
    animation: rw-spin 12s linear infinite;
}
.im-rw-seal-i { font-size: 16cqw; line-height: 1; animation: rw-spin 12s linear infinite reverse; }
@keyframes rw-spin { to { transform: rotate(360deg); } }
.im-rw-ai { display: flex; flex-direction: column; gap: 4px; }
.im-rw-ai.is-done { padding: 4cqw; border-radius: 16px; background: rgba(0, 0, 0, .25); border: 1px solid var(--rw-line); }
.im-rw-ai.is-done small { color: var(--rw-c); font-weight: 800; font-size: max(11px, 3cqw); text-transform: uppercase; letter-spacing: .08em; }
.im-rw-ai.is-done b { font-size: 5.4cqw; }
.im-rw-ai.is-done p { margin: 0; font-size: max(12px, 3.5cqw); color: var(--rw-soft); }

/* Nút */
.im-rw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.im-rw-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
    background: #fff; color: #1e1b4b !important; text-decoration: none !important;
    font: inherit; font-weight: 800; font-size: max(13px, 3.6cqw); cursor: pointer;
    transition: transform .15s, background .2s, opacity .2s;
}
.im-rw-btn:hover { transform: translateY(-1px); }
.im-rw-btn:active { transform: scale(.97); }
.im-rw-btn:disabled { opacity: .6; cursor: wait; }
.im-rw-btn.is-ghost { background: var(--rw-glass); color: #fff !important; border: 1px solid var(--rw-line); }
.im-rw-btn:focus-visible, .im-rw-icon:focus-visible, .im-rw-link:focus-visible, .im-rw-year:focus-visible { outline: 2px solid var(--rw-hot); outline-offset: 2px; }

.im-rw-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.im-rw-link { padding: 0; border: 0; background: none; color: #fff !important; font: inherit; font-weight: 700; font-size: max(12px, 3.3cqw); text-decoration: underline !important; text-underline-offset: 3px; cursor: pointer; }

.im-rw-years { display: flex; flex-wrap: wrap; gap: 6px; }
.im-rw-year { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--rw-line); background: transparent; color: #fff; font: inherit; font-size: max(12px, 3.2cqw); font-weight: 700; cursor: pointer; }
.im-rw-year.is-on { background: #fff; color: #1e1b4b; }

/* Tổng kết */
.im-rw-slide[data-slide="summary"] .im-rw-body { justify-content: flex-start; gap: 3cqw; }
.im-rw-share-wrap { display: flex; justify-content: center; }
.im-rw-sharecard {
    width: 52cqw; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .25); box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
    cursor: default;
}
.im-rw-sharecard img, .im-rw-sharecard canvas { width: 100%; height: 100%; display: block; object-fit: cover; }
.im-rw-slide[data-slide="summary"] .im-rw-actions { justify-content: center; }

.im-rw-privacy { display: flex; flex-direction: column; gap: 4px; padding: 3.4cqw 4cqw; border-radius: 14px; background: rgba(0, 0, 0, .22); }
.im-rw-public-state { margin: 0; font-size: max(12px, 3.2cqw); color: var(--rw-soft); }
.im-rw-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 800; font-size: max(13px, 3.5cqw); }
.im-rw-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.im-rw-switch i { position: relative; flex: none; width: 42px; height: 24px; border-radius: 24px; background: rgba(255, 255, 255, .3); transition: background .2s; }
.im-rw-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--rw-ease); }
.im-rw-switch input:checked + i { background: #22c55e; }
.im-rw-switch input:checked + i::after { transform: translateX(18px); }
.im-rw-switch input:focus-visible + i { outline: 2px solid var(--rw-hot); outline-offset: 2px; }

/* Đang tải */
.im-rw-loader { display: flex; align-items: center; gap: 10px; color: var(--rw-soft); font-weight: 700; font-size: max(13px, 3.6cqw); }
.im-rw-spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: rw-spin .8s linear infinite; }
.im-rw.is-ready .im-rw-loader { display: none; }

/* Giữ để tạm dừng: ẩn chrome */
.im-rw.is-holding .im-rw-top { opacity: 0; transition: opacity .2s; }

/* Toast */
.im-rw-toast {
    position: absolute; left: 50%; bottom: 28px; z-index: 20;
    padding: 10px 18px; border-radius: 999px;
    background: rgba(0, 0, 0, .8); color: #fff; font-weight: 700; font-size: 14px;
    transform: translate(-50%, 20px); opacity: 0; transition: all .3s var(--rw-ease);
    pointer-events: none; max-width: 90vw; text-align: center;
}
.im-rw-toast.is-in { transform: translate(-50%, 0); opacity: 1; }

/* Ẩn header/footer site chồng lên (một số theme con dùng z-index cao) */
html.im-rw-open #wpadminbar { z-index: 1000; }

@media (prefers-reduced-motion: reduce) {
    .rw-in, .im-rw-col-bar, .im-rw-hbar i, .im-rw-gbar i, .im-rw-split i { opacity: 1 !important; transform: none !important; animation: none !important; }
    .im-rw-ray { transform: rotate(var(--a)) !important; }
    .im-rw-ray { opacity: 1 !important; animation: none !important; }
    .im-rw-deco i, .im-rw-seal, .im-rw-seal-i, .im-rw-card { animation: none !important; }
    .im-rw-slide { transition: none; }
}

/* v3.6.7: Thưởng xem hết Rewind */
.im-rw-reward {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--rw-hot);
    color: #3b0a45;
    font-size: 14px;
    line-height: 1.35;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    animation: im-rw-reward-in .5s var(--rw-ease) both;
}
.im-rw-reward[hidden] { display: none; }
.im-rw-reward b { font-weight: 800; }
.im-rw-reward-i { font-size: 22px; line-height: 1; }
@keyframes im-rw-reward-in {
    from { opacity: 0; transform: translateY(8px) scale(.96); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .im-rw-reward { animation: none; }
}
