.back-link {
    display: inline-block;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 16px;
}

.back-link:hover {
    color: var(--accent);
}

/* Компоновка страницы кейса */

.case-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
    justify-items: center;
}

.case-main-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Контейнер с кейсом, кольцом и оружием */
.case-detail-img-wrap {
    position: relative;
    margin: 18px 0 10px;
    background: radial-gradient(circle at center, #1b2340 0, transparent 55%);
    padding: 20px;
    border-radius: 18px;
    overflow: visible;
}

/* Вращающееся кольцо на фоне */
.case-detail-bg-rotator {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 380px;
    height: 380px;
    transform: translate(-50%, -50%);
    opacity: 0.9;
    animation: spin360 14s linear infinite, glowPulse 3.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
    filter:
        brightness(1)
        saturate(1.4)
        drop-shadow(0 0 40px rgba(0, 255, 255, 0.6))
        drop-shadow(0 0 80px rgba(0, 255, 255, 0.45));
}

/* Картинка кейса */
.case-detail-img {
    position: relative;
    z-index: 2;
    max-width: 360px;
    max-height: 360px;
    object-fit: contain;
}

/* Титульное оружие поверх кейса */
.case-title-weapon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    object-fit: contain;
    z-index: 3;
    pointer-events: none;
    animation: weaponFloat 3s ease-in-out infinite;
}

/* Панель открытия */

.open-panel {
    margin-top: 16px;
    padding: 18px 20px;
    border-radius: 16px;

    background: rgba(10, 12, 18, 0.55);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);

    border: 1px solid rgba(255, 255, 255, 0.05);

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.35),
        inset 0 0 12px rgba(255,255,255,0.02);
}

.open-panel-balance {
    font-size: 14px;
    margin-bottom: 12px;
    color: rgba(200,205,220,0.75);
    text-align: center;
}

.open-panel-muted {
    font-size: 13px;
    color: rgba(160,165,180,0.6);
    text-align: center;
}

/* Выбор количества */

.open-count-selector {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}

.ocs-label {
    font-size: 13px;
    color: rgba(170,175,185,0.6);
}

.open-count-btn {
    border-radius: 12px;
    padding: 6px 14px;

    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);

    color: rgba(230,230,240,0.9);
    font-size: 13px;

    cursor: pointer;
    transition: 0.18s ease;
}

.open-count-btn:hover {
    border-color: var(--accent);
    background: rgba(255,255,255,0.06);
}

.open-count-btn.active {
    background: rgba(63,140,255,0.18);
    border-color: var(--accent);
    color: #ffffff;
}

/* Кнопки действий */

.open-buttons-row {
    display: flex;
    gap: 12px;
}

.open-form {
    flex: 1;
}

.btn.btn-wide {
    width: 100%;
    padding: 12px 0;

    border-radius: 12px;
    border: none;

    background: linear-gradient(180deg, #3f8cff, #326dee);
    color: #fff;

    font-size: 14px;
    font-weight: 600;

    box-shadow: 0 4px 14px rgba(63,140,255,0.35);
    transition: 0.2s ease;
}

.btn.btn-wide:hover {
    filter: brightness(1.12);
}

.btn-outline.btn-wide {
    width: 100%;
    padding: 12px 0;

    border-radius: 12px;

    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(220,225,240,0.9);

    font-size: 14px;
    font-weight: 600;

    transition: 0.2s ease;
}

.btn-outline.btn-wide:hover {
    border-color: var(--accent);
    color: #ffffff;
}

/* Рулетка */

.case-roll-wrap {
    margin-top: 32px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.case-roll-line {
    display: flex;
    gap: 10px;
    will-change: transform;
}

.roll-item.win-glow {
    border-color: rgba(0,150,255,1);
    box-shadow:
        0 0 25px rgba(0,150,255,0.8),
        inset 0 0 18px rgba(0,150,255,0.45),
        0 6px 14px rgba(0,0,0,0.5);

    transform: scale(1.08);
    transition: 0.25s ease;
}

/* FULLSCREEN DROP POPUP */

.drop-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.drop-popup.hidden {
    display: none;
}

.drop-popup-inner {
    background: #0a0f18;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    width: 380px;
    border: 1px solid var(--border-soft);
    animation: popupAppear 0.35s ease;
}

.drop-popup-inner img {
    width: 85%;
    margin-bottom: 20px;
}

.drop-popup-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.drop-popup-buttons .btn,
.drop-popup-buttons .btn-outline {
    padding: 10px 20px;
    font-weight: 700;
    font-size: 14px;
}

/* Рулетка — исправление */

.case-roll-window {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 26px 0;
    border-radius: 20px;

    position: relative;
    overflow: visible;
}

/* Маска исчезновения карточек */
.case-roll-mask {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;

    mask-image: linear-gradient(
        to right,
        transparent 0%,
        rgba(0,0,0,1) 20%,
        rgba(0,0,0,1) 80%,
        transparent 100%
    );

    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        rgba(0,0,0,1) 20%,
        rgba(0,0,0,1) 80%,
        transparent 100%
    );
}

.case-roll-window .top-line,
.case-roll-window .bottom-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 19;
    pointer-events: none;

    background: linear-gradient(
        to right,
        transparent,
        rgba(255,140,0,0.9),
        transparent
    );
}

.case-roll-window .top-line {
    top: 0;
}

.case-roll-window .bottom-line {
    bottom: 0;
}

.roll-item {
    flex: 0 0 180px;
    height: 150px;
    margin: 0 6px;

    border-radius: 16px;
    background: rgba(20,22,30,0.7);
    border: 1px solid rgba(255,255,255,0.05);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    position: relative;
    overflow: hidden;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.roll-item::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--qcolor) 55%, transparent),
        transparent
    );
    opacity: 0.14;
    pointer-events: none;
}

.roll-item img {
    max-width: 95%;
    max-height: 80%;
    object-fit: contain;
}

.roll-name {
    margin-top: 6px;
    font-size: 12px;
    color: #d0d4df;
    text-align: center;
    opacity: 0.9;
}

.roll-center-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);

    background: linear-gradient(
        to bottom,
        transparent 0,
        rgba(0,150,255,0.9) 45%,
        rgba(0,150,255,0.9) 55%,
        transparent 100%
    );

    box-shadow: 0 0 12px rgba(0,150,255,0.6);
    z-index: 20;
}

/* Карточки скинов */

.case-items-card {
    width: 100%;
    max-width: none;
    margin: 26px 0 0;
    background: transparent;
    border-radius: 0;
    border: none;
    padding: 0;
}

.skins-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.skin-card {
    position: relative;
    flex: 0 1 190px;
    aspect-ratio: 1 / 1;
    border-radius: 0;

    background: radial-gradient(circle at top,
        color-mix(in srgb, var(--qcolor) 18%, #0b0e17) 0%,
        #050814 70%
    );

    border: 1px solid rgba(255, 255, 255, 0.05);

    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.skin-card::before {
    content: "";
    position: absolute;
    inset: 0;

    background: radial-gradient(circle at top,
        color-mix(in srgb, var(--qcolor) 35%, transparent) 0%,
        transparent 0%
    );

    opacity: 1;
    pointer-events: none;
}

.skin-img-wrap {
    position: relative;
    flex: 1 1 auto;
    border-radius: 12px;
    background: radial-gradient(circle at center,
        rgba(18, 24, 48, 0.9) 0,
        transparent 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    overflow: hidden;
}

.skin-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.skin-price {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 3px 10px 4px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.9);
    border-left: 3px solid var(--accent);
}

.skin-name {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 500;
    text-align: left;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.skin-quality-line {
    margin-top: 6px;
    height: 3px;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

/* Анимации */

@keyframes spin360 {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes glowPulse {
    0% {
        filter:
            brightness(1.4)
            saturate(1.2)
            drop-shadow(0 0 16px rgba(0, 255, 255, 0.25))
            drop-shadow(0 0 26px rgba(0, 255, 255, 0.15));
        opacity: 0.8;
    }
    50% {
        filter:
            brightness(1.8)
            saturate(1.5)
            drop-shadow(0 0 32px rgba(0, 255, 255, 0.55))
            drop-shadow(0 0 60px rgba(0, 255, 255, 0.4));
        opacity: 1;
    }
    100% {
        filter:
            brightness(1.4)
            saturate(1.2)
            drop-shadow(0 0 16px rgba(0, 255, 255, 0.25))
            drop-shadow(0 0 26px rgba(0, 255, 255, 0.15));
        opacity: 0.8;
    }
}

@keyframes weaponFloat {
    0%   { transform: translate(-50%, -50%) translateY(0); }
    50%  { transform: translate(-50%, -50%) translateY(-6px); }
    100% { transform: translate(-50%, -50%) translateY(0); }
}