/* ============================================================
   Внешний вид (js/cosmetics.js): рубашки, сукно, рамки + страница коллекции и сундуки.
   Предмет = CSS-переменные с сервера (--back-*, --felt*, --frame-*) + класс узора cos-<тип>-<узор>.
   Узор — маска (mask-image), закрашенная цветом из переменной: так любой цвет с сервера подходит к любому узору.
   Класс узора задаёт переменную маски, а не правило: ближайший предок побеждает (рубашки соперника внутри стола).
   ============================================================ */

:root {
    --r-common: #7d8890; --r-rare: #2f7fd8; --r-epic: #8b4fd6; --r-legendary: #d4921a;
    --mask-none: linear-gradient(transparent, transparent);
}

/* ---------- Рубашка карты ---------- */
.pcard.back { background: linear-gradient(135deg, var(--back-a, var(--felt-2)), var(--back-b, var(--felt))); }
.pcard.back::after { background-image: none; border-color: var(--back-line, rgba(255, 255, 255, .45)); z-index: 1; }
.pcard.back::before {
    content: ""; position: absolute; inset: 6px; border-radius: 7px; pointer-events: none;
    background: var(--back-line, rgba(255, 255, 255, .45)); opacity: .9;
    -webkit-mask-image: var(--back-mask, var(--mask-none)); mask-image: var(--back-mask, var(--mask-none));
    -webkit-mask-size: var(--back-mask-size, auto); mask-size: var(--back-mask-size, auto);
    -webkit-mask-position: center; mask-position: center;
}
.cos-back-none { --back-mask: var(--mask-none); }
.cos-back-ornament { --back-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 120 120'%3E%3Cpath d='M60 20c-14 0-24 10-24 22 0 9 7 15 15 15 6 0 10-4 10-9 0-4-3-7-7-7M60 20c14 0 24 10 24 22 0 9-7 15-15 15-6 0-10-4-10-9 0-4 3-7 7-7M60 100c-14 0-24-10-24-22 0-9 7-15 15-15 6 0 10 4 10 9 0 4-3 7-7 7M60 100c14 0 24-10 24-22 0-9-7-15-15-15-6 0-10 4-10 9 0 4 3 7 7 7' fill='none' stroke='black' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E"); --back-mask-size: 22px 22px; }
.cos-back-stripes { --back-mask: repeating-linear-gradient(45deg, #000 0 1.5px, transparent 1.5px 6px); --back-mask-size: auto; }
.cos-back-dots { --back-mask: radial-gradient(circle, #000 0 1.3px, transparent 1.7px); --back-mask-size: 7px 7px; }
.cos-back-mountains { --back-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='24' viewBox='0 0 40 24'%3E%3Cpath d='M0 22 9 9l5 6 8-11 9 12 4-4 5 6' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M19.4 7.6 22 4l2.7 3.7-2.7-1.2z' fill='black'/%3E%3C/svg%3E"); --back-mask-size: 26px 16px; }
.cos-back-waves { --back-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10' viewBox='0 0 20 10'%3E%3Cpath d='M0 5q5-5 10 0t10 0' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E"); --back-mask-size: 12px 6px; }
.cos-back-stars { --back-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M7 3l1.2 3.8L12 8l-3.8 1.2L7 13l-1.2-3.8L2 8l3.8-1.2zM22 15l.8 2.2L25 18l-2.2.8L22 21l-.8-2.2L19 18l2.2-.8zM14 23l.5 1.5 1.5.5-1.5.5-.5 1.5-.5-1.5-1.5-.5 1.5-.5z' fill='black'/%3E%3Ccircle cx='25' cy='5' r='1' fill='black'/%3E%3Ccircle cx='4' cy='24' r='.8' fill='black'/%3E%3C/svg%3E"); --back-mask-size: 20px 20px; }

/* ---------- Сукно: узор вместо стандартного орнамента ---------- */
.cos-felt > .ornament-layer {
    filter: none; opacity: 1; background-image: none; background-color: var(--felt-orn, rgba(255, 255, 255, .06));
    -webkit-mask-image: var(--felt-mask, var(--mask-none)); mask-image: var(--felt-mask, var(--mask-none));
    -webkit-mask-size: var(--felt-mask-size, auto); mask-size: var(--felt-mask-size, auto);
}
.cos-felt-none > .ornament-layer { display: none; }
.cos-felt-ornament { --felt-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M60 20c-14 0-24 10-24 22 0 9 7 15 15 15 6 0 10-4 10-9 0-4-3-7-7-7M60 20c14 0 24 10 24 22 0 9-7 15-15 15-6 0-10-4-10-9 0-4 3-7 7-7M60 100c-14 0-24-10-24-22 0-9 7-15 15-15 6 0 10 4 10 9 0 4-3 7-7 7M60 100c14 0 24-10 24-22 0-9-7-15-15-15-6 0-10 4-10 9 0 4 3 7 7 7' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E"); --felt-mask-size: 120px 120px; }
.cos-felt-stripes { --felt-mask: repeating-linear-gradient(135deg, #000 0 3px, transparent 3px 26px); }
.cos-felt-dots { --felt-mask: radial-gradient(circle, #000 0 2.4px, transparent 3px); --felt-mask-size: 26px 26px; }
.cos-felt-mountains { --felt-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='24' viewBox='0 0 40 24'%3E%3Cpath d='M0 22 9 9l5 6 8-11 9 12 4-4 5 6' fill='none' stroke='black' stroke-width='.7' stroke-linejoin='round'/%3E%3Cpath d='M19.4 7.6 22 4l2.7 3.7-2.7-1.2z' fill='black'/%3E%3C/svg%3E"); --felt-mask-size: 180px 108px; }
.cos-felt-waves { --felt-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10' viewBox='0 0 20 10'%3E%3Cpath d='M0 5q5-5 10 0t10 0' fill='none' stroke='black' stroke-width='.6'/%3E%3C/svg%3E"); --felt-mask-size: 72px 36px; }
.cos-felt-stars { --felt-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M7 3l1.2 3.8L12 8l-3.8 1.2L7 13l-1.2-3.8L2 8l3.8-1.2zM22 15l.8 2.2L25 18l-2.2.8L22 21l-.8-2.2L19 18l2.2-.8zM14 23l.5 1.5 1.5.5-1.5.5-.5 1.5-.5-1.5-1.5-.5 1.5-.5z' fill='black'/%3E%3Ccircle cx='25' cy='5' r='1' fill='black'/%3E%3Ccircle cx='4' cy='24' r='.8' fill='black'/%3E%3C/svg%3E"); --felt-mask-size: 140px 140px; }
.cos-felt-stars > .ornament-layer, .cos-felt-mountains > .ornament-layer { opacity: 1; }

/* ---------- Рамка аватара: кольцо-градиент снаружи белого бортика ---------- */
.avatar.cos-frame { position: relative; box-shadow: 0 0 10px 2px var(--frame-glow, transparent); }
.avatar.cos-frame::before {
    content: ""; position: absolute; inset: -5px; border-radius: 50%; padding: 3px; pointer-events: none;
    background: linear-gradient(135deg, var(--frame-a, transparent), var(--frame-b, transparent));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* Узор рамки — зубчики по внешнему краю */
.avatar.cos-frame::after { content: none; position: absolute; inset: -9px; border-radius: 50%; pointer-events: none; }
.avatar.cos-frame-ornament::after, .avatar.cos-frame-stars::after, .avatar.cos-frame-dots::after,
.avatar.cos-frame-stripes::after, .avatar.cos-frame-waves::after, .avatar.cos-frame-mountains::after {
    content: "";
    background: repeating-conic-gradient(var(--frame-a) 0 9deg, transparent 9deg 30deg);
    -webkit-mask: radial-gradient(closest-side, transparent 80%, #000 82%); mask: radial-gradient(closest-side, transparent 80%, #000 82%);
}
.avatar.cos-frame-dots::after, .avatar.cos-frame-stars::after { background: repeating-conic-gradient(var(--frame-a) 0 5deg, transparent 5deg 20deg); }
.avatar.cos-frame-stripes::after, .avatar.cos-frame-waves::after, .avatar.cos-frame-mountains::after { background: repeating-conic-gradient(var(--frame-b) 0 14deg, var(--frame-a) 14deg 28deg); }

/* ---------- Стол: рубашка соперника рядом с аватаром ---------- */
.opp .pcard.opp-back { width: 15px; height: 21px; flex: 0 0 auto; border-width: 1.5px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); margin-left: -2px; }
.opp .pcard.opp-back::after { inset: 2px; border-radius: 1.5px; }
.opp .pcard.opp-back::before { inset: 2px; border-radius: 1.5px; }
.seat-row .avatar.cos-frame, .rp-seat .avatar.cos-frame { margin: 4px; }

/* ---------- Итог партии: задания, сундуки, лига ---------- */
.progress-box .quests { list-style: none; display: grid; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--accent-line); }
.progress-box .quests li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.progress-box .quests .q-ico { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; font-weight: 800; line-height: 1; }
.progress-box .quests li.done .q-ico { background: var(--green); border-color: var(--green); color: #fff; }
.progress-box .quests .q-n { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.progress-box .quests li.just { background: var(--note-bg); border-radius: 8px; padding: 6px 8px; margin: 0 -8px; box-shadow: inset 0 0 0 1px var(--note-line); }
.progress-box .quests li.just .q-n { color: var(--note); }
.progress-box .q-just { grid-column: 2 / -1; font-size: 11px; font-weight: 800; color: var(--note); text-transform: uppercase; letter-spacing: .04em; }
.progress-box .gain { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--accent-line); font-size: 14px; }
.progress-box .gain b { font-weight: 800; }
.progress-box .gain a { color: var(--accent); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.progress-box .gain .chest-ico { width: 22px; height: 18px; flex: 0 0 auto; }
.progress-box .gain > span { display: inline-flex; align-items: center; gap: 8px; }
.progress-box .league-line { color: var(--muted); font-weight: 600; }
.progress-box .league-line b { color: var(--text); }
.modal-box { max-height: calc(100dvh - 32px); overflow-y: auto; }

/* ---------- Значок сундука (CSS) ---------- */
.chest-ico { --c1: #a8703a; --c2: #7a4a1e; --band: #e0b25a; position: relative; display: inline-block; width: 64px; height: 52px; }
.chest-ico.gold { --c1: #f2c04b; --c2: #c18a12; --band: #fff2c4; }
.chest-ico::before, .chest-ico::after { content: ""; position: absolute; left: 0; right: 0; }
.chest-ico::after { /* корпус */
    bottom: 0; height: 58%; border-radius: 0 0 18% 18% / 0 0 26% 26%;
    background: linear-gradient(90deg, transparent 44%, var(--band) 44% 56%, transparent 56%), linear-gradient(180deg, var(--c1), var(--c2));
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18);
}
.chest-ico::before { /* крышка */
    top: 0; height: 46%; border-radius: 48% 48% 6% 6% / 70% 70% 8% 8%; z-index: 1;
    background: linear-gradient(90deg, transparent 44%, var(--band) 44% 56%, transparent 56%), linear-gradient(180deg, var(--c1), var(--c2));
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .18); transform-origin: 10% 100%;
}

/* ============================================================
   Страница коллекции
   ============================================================ */
.col-page h1 { margin-bottom: 4px; }
.col-free { color: var(--muted); font-size: 14px; }

/* Примерка */
.col-preview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.mini-felt {
    position: relative; overflow: hidden; border-radius: 22px; min-height: 150px; padding: 16px;
    background: radial-gradient(ellipse at 50% 45%, var(--felt-2), var(--felt) 70%);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .16), inset 0 10px 40px rgba(0, 0, 0, .18), var(--shadow-sm);
    display: flex; align-items: center; justify-content: center; gap: 22px; color: #fff;
}
.mini-felt .ornament-layer { position: absolute; inset: 0; opacity: .07; pointer-events: none; filter: brightness(0) invert(1); }
.mini-felt .fan { position: relative; width: 104px; height: 100px; flex: 0 0 auto; }
.mini-felt .fan .pcard { position: absolute; top: 4px; width: 64px; height: 91px; box-shadow: 0 6px 16px rgba(0, 0, 0, .28); }
.mini-felt .fan .pcard:first-child { left: 0; transform: rotate(-10deg); }
.mini-felt .fan .pcard:last-child { left: 36px; transform: rotate(8deg); }
.mini-felt .who { display: grid; justify-items: center; gap: 8px; font-weight: 800; font-size: 14px; position: relative; }
.mini-felt .avatar { width: 56px; height: 56px; font-size: 22px; margin: 6px; }
.mini-felt .pv-label { position: absolute; left: 12px; bottom: 10px; font-size: 12px; font-weight: 700; background: rgba(0, 0, 0, .28); padding: 3px 10px; border-radius: 10px; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.col-pick .pick-name { font-weight: 800; }
.col-pick .pick-sub { color: var(--muted); font-size: 13px; }
.col-pick .btn { min-width: 140px; }
.col-pick[hidden] { display: none; }

/* Сундуки */
.chests { display: grid; gap: 10px; margin-top: 14px; }
@media (min-width: 560px) { .chests { grid-template-columns: 1fr 1fr; } }
.chest-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.chest-card.gold { background: linear-gradient(135deg, #fff8e3, #fff1c9); border-color: var(--note-line); }
.chest-card .chest-ico { grid-row: span 2; }
.chest-card h3 { font-size: 16px; font-weight: 800; display: flex; align-items: baseline; gap: 8px; }
.chest-card h3 .cnt { font-family: var(--font-head); font-weight: 600; font-size: 20px; color: var(--accent); font-variant-numeric: tabular-nums; }
.chest-card.empty h3 .cnt { color: var(--muted); }
.chest-card .odds { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.chest-card .odds b { font-weight: 800; }
.chest-card .btn { grid-column: 1 / -1; width: 100%; margin-top: 6px; }
.chests-empty { margin-top: 12px; padding: 14px; border-radius: var(--r); border: 1px dashed var(--line-strong); color: var(--muted); font-size: 14px; }
.chests-empty b { color: var(--text); }
.chests-empty[hidden] { display: none; }
.earn { list-style: none; display: grid; gap: 6px; margin-top: 12px; font-size: 14px; }
.earn li { display: flex; gap: 10px; align-items: baseline; }
.earn li::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: translateY(-1px) rotate(45deg); }
.earn .g { color: var(--note); font-weight: 800; }
.odds-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.r-common { --rc: var(--r-common); } .r-rare { --rc: var(--r-rare); } .r-epic { --rc: var(--r-epic); } .r-legendary { --rc: var(--r-legendary); }
.rar { color: var(--rc); font-weight: 800; }

/* Вкладки и сетка */
.col-tabs { display: flex; gap: 8px; margin-top: 4px; overflow-x: auto; scrollbar-width: none; }
.col-tabs .chip { flex: 0 0 auto; min-height: 40px; }
.col-tabs .chip small { font-weight: 700; opacity: .8; margin-left: 4px; font-variant-numeric: tabular-nums; }
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-top: 14px; list-style: none; }
.col-item {
    position: relative; width: 100%; display: grid; justify-items: center; gap: 6px; padding: 12px 8px 10px;
    border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--rc), var(--shadow-sm);
    text-align: center; min-height: 150px; transition: transform .12s ease, border-color .12s ease;
}
.col-item:hover { border-color: var(--rc); }
.col-item:active { transform: scale(.98); }
.col-item.sel { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--rc), 0 0 0 2px var(--accent); }
.col-item .sw { height: 76px; display: grid; place-items: center; }
.col-item .sw .pcard.back { width: 48px; height: 68px; border-width: 2px; border-radius: 8px; }
.col-item .sw .pcard.back::before, .col-item .sw .pcard.back::after { inset: 4px; border-radius: 5px; }
.col-item .sw .felt-sw { position: relative; overflow: hidden; width: 84px; height: 60px; border-radius: 14px; background: radial-gradient(ellipse at 50% 45%, var(--felt-2), var(--felt) 70%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.col-item .sw .felt-sw .ornament-layer { position: absolute; inset: 0; opacity: .07; filter: brightness(0) invert(1); }
.col-item .sw .avatar { width: 44px; height: 44px; font-size: 18px; border-color: var(--line-strong); }
.col-item .nm { font-weight: 800; font-size: 13.5px; line-height: 1.2; overflow-wrap: anywhere; }
.col-item .rar { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.col-item .on { position: absolute; top: 8px; right: 8px; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--accent); border-radius: 8px; padding: 2px 7px; }
/* Нет в коллекции: силуэт и редкость, без подробностей */
.col-item.locked { background: var(--surface-2); }
.col-item.locked .sw > * { filter: brightness(0); opacity: .14; }
.col-item.locked .sw::after { content: ""; position: absolute; width: 22px; height: 22px; background: var(--muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zm2 0h6V7a3 3 0 0 0-6 0z' fill='black'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zm2 0h6V7a3 3 0 0 0-6 0z' fill='black'/%3E%3C/svg%3E") center / contain no-repeat; }
.col-item.locked .sw { position: relative; }
.col-item.locked .nm { color: var(--muted); }
.col-count { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* ============================================================
   Открытие сундука: тряска → крышка → предмет. ≤ 2,5 с, тап — пропустить
   ============================================================ */
.reveal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(10, 22, 16, .78); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); color: #fff; }
.reveal[hidden] { display: none; }
.reveal-box { width: 100%; max-width: 360px; display: grid; justify-items: center; text-align: center; gap: 10px; }
.rv-stage { position: relative; width: 220px; height: 220px; display: grid; place-items: center; }
.rv-rays { position: absolute; inset: -20px; border-radius: 50%; opacity: 0; background: repeating-conic-gradient(from 0deg, var(--rc) 0 8deg, transparent 8deg 30deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%); }
.rv-glow { position: absolute; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, var(--rc), transparent 68%); opacity: 0; }
.rv-chest { position: relative; transform: scale(1.9); }
.rv-item { position: absolute; display: grid; place-items: center; opacity: 0; transform: translateY(30px) scale(.4); }
.rv-item .pcard.back { width: 92px; height: 130px; box-shadow: 0 0 0 3px var(--rc), 0 14px 34px rgba(0, 0, 0, .45); }
.rv-item .felt-sw { position: relative; overflow: hidden; width: 168px; height: 112px; border-radius: 22px; background: radial-gradient(ellipse at 50% 45%, var(--felt-2), var(--felt) 70%); box-shadow: 0 0 0 3px var(--rc), 0 14px 34px rgba(0, 0, 0, .45); }
.rv-item .felt-sw .ornament-layer { position: absolute; inset: 0; opacity: .07; filter: brightness(0) invert(1); }
.rv-item .avatar { width: 96px; height: 96px; font-size: 38px; }
.rv-info { min-height: 92px; display: grid; gap: 4px; opacity: 0; }
.rv-info .rar { color: var(--rc); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; filter: brightness(1.35); }
.rv-info h2 { font-family: var(--font-head); font-weight: 600; font-size: 24px; margin: 0; color: #fff; }
.rv-info .rv-type { font-size: 14px; opacity: .85; }
.rv-info .rv-dup { font-size: 14px; font-weight: 800; color: var(--warm); }
.rv-info .rv-new { font-size: 12px; font-weight: 800; color: #10301f; background: var(--warm); border-radius: 8px; padding: 2px 10px; justify-self: center; }
.rv-actions { display: grid; gap: 8px; width: 100%; opacity: 0; visibility: hidden; }
.rv-actions .btn { width: 100%; }
.rv-actions .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.rv-actions .btn-ghost:hover { color: #fff; border-color: #fff; }
.rv-actions .btn[hidden] { display: none; }
.rv-skip { font-size: 12px; opacity: .7; min-height: 18px; }

.reveal.shake .rv-chest { animation: rvShake .5s ease-in-out infinite; }
.reveal.open .rv-chest { animation: rvOpenChest .35s ease-out forwards; }
.reveal.open .rv-chest .chest-ico::before { transform: translateY(-14px) rotate(-38deg); transition: transform .22s cubic-bezier(.2, 1.4, .4, 1); }
.reveal.open .rv-glow { animation: rvFlash .6s ease-out forwards; }
.reveal.item .rv-chest { opacity: 0; transform: scale(1.6) translateY(30px); transition: opacity .25s, transform .25s; }
.reveal.item .rv-item { opacity: 1; transform: none; transition: opacity .2s, transform .45s cubic-bezier(.2, 1.5, .4, 1); }
.reveal.item .rv-glow { opacity: .55; }
.reveal.item.r-epic .rv-rays, .reveal.item.r-legendary .rv-rays { opacity: .55; animation: rvSpin 14s linear infinite; }
.reveal.item.r-rare .rv-rays { opacity: .3; animation: rvSpin 18s linear infinite; }
.reveal.done .rv-info { opacity: 1; transition: opacity .25s; }
.reveal.done .rv-actions { opacity: 1; visibility: visible; transition: opacity .25s .1s; }
.reveal.done .rv-chest { display: none; }
@keyframes rvShake { 0%, 100% { transform: scale(1.9) rotate(0); } 20% { transform: scale(1.9) rotate(-5deg); } 40% { transform: scale(1.92) rotate(5deg); } 60% { transform: scale(1.9) rotate(-3deg); } 80% { transform: scale(1.9) rotate(2deg); } }
@keyframes rvOpenChest { 0% { transform: scale(1.9); } 40% { transform: scale(2.05, 1.75); } 100% { transform: scale(1.9); } }
@keyframes rvFlash { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; } 100% { opacity: .55; transform: scale(1.3); } }
@keyframes rvSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .reveal *, .reveal *::before, .reveal *::after { animation: none !important; transition: none !important; }
    .reveal.item .rv-chest { display: none; }
    .col-item { transition: none; }
}

/* Кнопка «Надеть» под выбранной плиткой */
.col-grid > li { display: grid; gap: 6px; align-content: start; min-width: 0; }
.col-grid .tile-equip { width: 100%; min-height: 40px; }
/* Пропуск тапом — сразу итог, без доигрывания переходов */
.reveal.skip .rv-item, .reveal.skip .rv-info, .reveal.skip .rv-actions, .reveal.skip .rv-chest, .reveal.skip .rv-glow { transition: none !important; animation: none !important; }
