/* AivanCrate — Рулетка выбора (стиль V2) */
.rc { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; margin-top: 18px; }
.rc-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px 18px; position: sticky; top: 80px; }
.rc-wheel-wrap { position: relative; width: min(100%, 620px); aspect-ratio: 1; }
.rc-wheel-wrap canvas { width: 100%; height: 100%; display: block; filter: drop-shadow(0 18px 40px rgba(29, 39, 201, .45)); }
.rc-wheel-wrap.is-spinning canvas { filter: drop-shadow(0 18px 60px rgba(59, 73, 255, .75)); }
.rc-pointer {
    position: absolute; left: 50%; top: -6px; z-index: 3; width: 44px; height: 54px; transform: translateX(-50%);
    background: var(--av2-gold, #ffd84a); clip-path: polygon(0 0, 100% 0, 50% 100%);
    filter: drop-shadow(0 0 0 #000) drop-shadow(0 3px 0 #000);
}
.rc-pointer::after { content: ""; position: absolute; inset: 6px 9px 14px; background: #fff7c2; clip-path: polygon(0 0, 100% 0, 50% 100%); opacity: .55; }
.rc-wheel-wrap.is-spinning .rc-pointer { animation: rc-wiggle .09s linear infinite alternate; }
@keyframes rc-wiggle { from { transform: translateX(-50%) rotate(-7deg); } to { transform: translateX(-50%) rotate(5deg); } }
.rc-hub {
    position: absolute; left: 50%; top: 50%; width: 21%; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 2;
    border-radius: 50%; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0;
    background: radial-gradient(circle at 35% 30%, #4f5cff, #1d27c9 60%, #0b1170);
    box-shadow: 0 0 0 4px #000, 0 0 0 9px #8fa0ff, 0 0 0 12px #000, 0 10px 30px rgba(0, 0, 0, .6);
    transition: transform .18s ease, box-shadow .18s ease;
}
.rc-hub img { width: 46%; image-rendering: auto; filter: drop-shadow(0 2px 0 #000); }
.rc-hub span { font-size: clamp(9px, 1.4vw, 14px); color: #fff; text-shadow: 0 2px 0 #000; line-height: 1; }
.rc-hub:hover { transform: translate(-50%, -50%) scale(1.06); }
.rc-hub:active { transform: translate(-50%, -50%) scale(.96); }
.rc-wheel-wrap.is-spinning .rc-hub { pointer-events: none; animation: rc-pulse .6s ease-in-out infinite alternate; }
@keyframes rc-pulse { to { box-shadow: 0 0 0 4px #000, 0 0 0 9px #ffd84a, 0 0 0 12px #000, 0 0 40px rgba(255, 216, 74, .6); } }
.rc-now { font-weight: 800; font-size: 1.15rem; color: var(--av2-ink, #f4f6ff); text-align: center; min-height: 1.6em; }
.rc-now.is-shake { animation: rc-shake .4s ease; color: #ff8a8a; }
@keyframes rc-shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.rc-stage-actions { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: center; }
.rc-toggle { display: inline-flex; gap: 6px; align-items: center; color: var(--av2-muted, #9aa3cf); font-size: .9rem; cursor: pointer; user-select: none; }
.rc-toggle input { accent-color: #3b49ff; width: 16px; height: 16px; }

.rc-side { display: flex; flex-direction: column; gap: 14px; }
.rc-box { padding: 14px; }
.rc-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.rc-box-head .av2-label b { color: var(--av2-gold, #ffd84a); }
.rc-box-actions { display: flex; gap: 6px; }
.rc-search { display: block; }
.rc-search .av2-input { width: 100%; }
.rc-results { max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.rc-results:empty { display: none; }
.rc-res {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; text-align: left; cursor: pointer;
    background: rgba(255, 255, 255, .04); border: 1px solid rgba(143, 160, 255, .14); border-radius: 10px; color: var(--av2-ink, #f4f6ff);
    transition: background .15s, transform .15s;
}
.rc-res:hover { background: rgba(59, 73, 255, .25); transform: translateX(2px); }
.rc-res img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.rc-res span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rc-res b, .rc-res small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-res small { color: var(--av2-muted, #9aa3cf); font-size: .78rem; }
.rc-res i { font-style: normal; font-weight: 900; color: var(--av2-sky, #8fa0ff); width: 22px; text-align: center; }
.rc-res.is-in { opacity: .55; }
.rc-res.is-in i { color: #6ee7a8; }
.rc-empty { color: var(--av2-muted, #9aa3cf); margin: 6px 2px; }
.rc-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.rc-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow: auto; counter-reset: rc; }
.rc-items:empty::before { content: "—"; color: var(--av2-muted, #9aa3cf); padding: 8px; }
.rc-item {
    display: grid; grid-template-columns: 6px 52px minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
    padding: 6px 6px 6px 0; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(143, 160, 255, .12);
    animation: rc-in .25s ease;
}
@keyframes rc-in { from { opacity: 0; transform: translateY(-4px); } }
.rc-sw { align-self: stretch; background: var(--c); border-radius: 10px 0 0 10px; box-shadow: inset -1px 0 0 #000; }
.rc-thumb { width: 52px; height: 30px; object-fit: cover; border-radius: 6px; background: #070a33; box-shadow: 0 0 0 1px #000; display: block; }
.rc-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; position: relative; padding-left: 0; }
.rc-name b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--av2-ink, #f4f6ff); }
.rc-name small { color: var(--av2-muted, #9aa3cf); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-d { position: absolute; left: -26px; bottom: -6px; width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 1px 0 #000) drop-shadow(0 0 2px #000); }
.rc-w { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; margin: 0; }
.rc-w input {
    width: 62px; padding: 2px 6px; border-radius: 7px; border: 1px solid rgba(143, 160, 255, .3); background: #03041a; color: #fff;
    font-weight: 700; text-align: right; font-size: .85rem;
}
.rc-w input:focus { outline: 2px solid #3b49ff; outline-offset: 1px; }
.rc-w em { font-style: normal; font-size: .72rem; color: var(--av2-gold, #ffd84a); font-weight: 700; }
.rc-x { border: 0; background: transparent; color: var(--av2-muted, #9aa3cf); cursor: pointer; font-size: 1rem; width: 26px; height: 26px; border-radius: 8px; }
.rc-x:hover { background: rgba(255, 90, 90, .2); color: #ff8a8a; }
.rc-hint { color: var(--av2-muted, #9aa3cf); font-size: .78rem; margin: 10px 2px 0; }

.rc-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow: auto; counter-reset: h; }
.rc-history li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, .03); counter-increment: h; }
.rc-history li::before { content: counter(h); color: var(--av2-muted, #9aa3cf); font-size: .75rem; width: 18px; }
.rc-history a { color: var(--av2-ink, #f4f6ff); text-decoration: none; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-history a:hover { color: var(--av2-sky, #8fa0ff); }
.rc-history small { color: var(--av2-muted, #9aa3cf); }
.rc-history li.is-removed a { text-decoration: line-through; opacity: .65; }
.rc-history:empty::before { content: "—"; color: var(--av2-muted, #9aa3cf); padding: 4px 8px; }

.rc-modal { position: fixed; inset: 0; z-index: 1080; display: grid; place-items: center; padding: 16px; background: rgba(3, 4, 26, .78); backdrop-filter: blur(6px); }
.rc-modal[hidden] { display: none; }
.rc-modal-box {
    width: min(520px, 100%); text-align: center; padding: 22px; border-radius: 22px; color: var(--av2-ink, #f4f6ff);
    background: linear-gradient(180deg, #0b1170, #070a33 60%); box-shadow: 0 0 0 3px #000, 0 0 0 6px #3b49ff, 0 30px 80px rgba(0, 0, 0, .7);
    animation: rc-pop .35s cubic-bezier(.2, 1.4, .4, 1);
}
.rc-modal.is-final .rc-modal-box { box-shadow: 0 0 0 3px #000, 0 0 0 6px #ffd84a, 0 0 80px rgba(255, 216, 74, .35); }
@keyframes rc-pop { from { transform: scale(.7); opacity: 0; } }
.rc-res-kicker { font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--av2-gold, #ffd84a); font-size: .85rem; }
.rc-res-img { position: relative; margin: 12px 0; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #03041a; box-shadow: 0 0 0 2px #000; }
.rc-res-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#rc-res-bg { object-fit: cover; filter: blur(18px) brightness(.55); transform: scale(1.15); }
.rc-res-img .rc-res-diff { inset: auto auto 8px 8px; width: 54px; height: 54px; filter: drop-shadow(0 2px 0 #000); }
.rc-res-img.is-empty { aspect-ratio: auto; height: 150px; background: radial-gradient(circle, #1d27c9, #03041a 70%); }
.rc-res-img.is-empty .rc-res-diff { inset: 50% auto auto 50%; width: 110px; height: 110px; transform: translate(-50%, -50%); }
.rc-modal-box h2 { font-size: clamp(1.3rem, 4vw, 2rem); margin: 4px 0 2px; }
.rc-res-creator { color: var(--av2-muted, #9aa3cf); margin: 0 0 14px; }
.rc-res-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rc-res-actions[hidden] { display: none; }
.rc-res-link { display: inline-block; margin-top: 12px; color: var(--av2-sky, #8fa0ff); font-size: .9rem; }
.rc-confetti { position: fixed; inset: 0; z-index: 1090; pointer-events: none; }

@media (max-width: 1100px) {
    .rc { grid-template-columns: 1fr; }
    .rc-stage { position: static; }
}
@media (prefers-reduced-motion: reduce) {
    .rc-item, .rc-modal-box { animation: none; }
}

/* ---------- Хаб рулеток (V2) ---------- */
.rh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.rh-card {
    position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; min-height: 220px; border-radius: 18px; overflow: hidden;
    text-decoration: none; color: var(--av2-ink, #f4f6ff); background: linear-gradient(160deg, #0b1170, #070a33 70%);
    box-shadow: 0 0 0 2px #000, inset 0 0 0 1px rgba(143, 160, 255, .2); transition: transform .2s ease, box-shadow .2s ease;
}
.rh-card:hover { transform: translateY(-4px); color: var(--av2-ink, #f4f6ff); box-shadow: 0 0 0 2px #000, 0 0 0 5px #3b49ff, 0 20px 40px rgba(29, 39, 201, .4); }
.rh-card .rh-ico { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 3px 0 #000); transition: transform .5s ease; }
.rh-card:hover .rh-ico { transform: rotate(200deg); }
.rh-card h2 { font-size: 1.25rem; margin: 6px 0 0; }
.rh-card p { color: var(--av2-muted, #9aa3cf); margin: 0; flex: 1; font-size: .92rem; }
.rh-card .av2-btn { align-self: flex-start; }
.rh-card.is-new { background: linear-gradient(160deg, #2a35d8, #0b1170 55%, #070a33); }
.rh-card.is-new::after {
    content: "NEW"; position: absolute; top: 14px; right: -30px; transform: rotate(35deg); padding: 3px 38px;
    background: var(--av2-gold, #ffd84a); color: #1a1300; font-weight: 900; font-size: .75rem; box-shadow: 0 0 0 2px #000;
}

/* ---------- Своя рулетка выбора ---------- */
.rc-custom { display: flex; flex-direction: column; gap: .55rem; }
.rc-drop {
    position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: .9rem; overflow: hidden; cursor: pointer;
    border: 2px dashed rgba(143, 160, 255, .45); background: rgba(2, 3, 20, .55); color: var(--av2-muted); text-align: center; padding: .8rem;
    transition: border-color .15s, background .15s, transform .15s;
}
.rc-drop:hover, .rc-drop:focus-visible, .rc-drop.is-over { border-color: var(--av2-sky); background: rgba(59, 73, 255, .18); outline: none; }
.rc-drop.is-over { transform: scale(1.02); }
.rc-drop.has-img { border-style: solid; padding: 0; }
.rc-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rc-drop-hint { font-size: .85rem; font-weight: 700; line-height: 1.35; }
.rc-drop.is-bad, .rc-custom .av2-input.is-bad { animation: rc-shake .4s ease; border-color: #ff6b6b !important; }
.rc-diffpick { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; }
.rc-diffpick button {
    display: grid; place-items: center; aspect-ratio: 1; padding: 0; border-radius: .6rem; cursor: pointer; font-weight: 900; color: var(--av2-muted);
    background: rgba(2, 3, 20, .7); border: 1px solid var(--av2-line); transition: transform .15s, background .15s;
}
.rc-diffpick button img { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 1px 0 #000); }
.rc-diffpick button:hover { transform: translateY(-2px) scale(1.06); }
.rc-diffpick button.is-on { background: linear-gradient(180deg, var(--av2-blue-2), var(--av2-blue)); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--av2-gold); color: #fff; }
.rc-cadd { width: 100%; justify-content: center; }
.rc-res-link[hidden] { display: none; }
