/* =============================================
   CASE OPENING GAME
   ============================================= */

#case-opening-view,
#case-opening-view button,
#case-opening-view input,
#case-opening-view .case-price {
    font-family: 'Poppins', sans-serif;
}

/* ---- Case Selection (Grid) ---- */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.case-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 340px;
    box-shadow: none;
}

.case-card:hover {
    transform: translateY(-8px);
}

.case-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 15px;
}

.case-image {
    width: 100%;
    max-width: 220px;
    object-fit: contain;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.6));
    transition: transform 0.4s ease;
}

.case-card:hover .case-image {
    transform: scale(1.1) rotate(2deg);
}

.case-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 5px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    line-height: 1.1;
}

.case-price {
    /* REMOVED Courier */
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    color: #ffd700;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.2);
}

.btn-preview {
    background: transparent;
    border: 2px solid #ffd700;
    color: #ffd700;
    padding: 10px 28px;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1.5px;
}

.case-card:hover .btn-preview {
    background: #ffd700;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    transform: scale(1.05);
}

/* ---- Spinner View ---- */
.spinner-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.spinner-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

#co-btn-back {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Poppins', sans-serif;
    background: rgba(255, 255, 255, 0.05);
    color: #a0aec0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#co-btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.spinner-title {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 10px;
}

.spinner-subtitle {
    color: rgba(255, 255, 255, 0.5);
}

/* The Spinner Box - NOW OBSOLETE / REUSED AS ROW CLASS */
.spinner-box {
    display: none;
    /* Hide original static class usage */
}

/* The tick marker */
.spinner-tick {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: #ffd700;
    z-index: 10;
    transform: translateX(-50%);
    box-shadow: 0 0 10px #ffd700;
}

.spinner-tick::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -8px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid #ffd700;
}

.spinner-tick::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: -8px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 15px solid #ffd700;
}

/* Gradient Overlays for depth */
.spinner-overlay-left,
.spinner-overlay-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 150px;
    z-index: 5;
    pointer-events: none;
}

.spinner-overlay-left {
    left: 0;
    background: linear-gradient(to right, #0f0f16, transparent);
}

.spinner-overlay-right {
    right: 0;
    background: linear-gradient(to left, #0f0f16, transparent);
}

/* The strip of items that moves */
.spinner-strip {
    display: flex;
    height: 100%;
    align-items: center;
    will-change: transform;
    /* Transformation is controlled by JS */
}

/* Individual Item Card in Spinner */
.spinner-item {
    flex: 0 0 180px;
    /* Fixed width */
    height: 160px;
    margin: 0 5px;
    background: #181822;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 4px solid #444;
    /* Default rarity color */
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.spinner-item.rarity-common {
    border-bottom-color: #b0c3d9;
}

.spinner-item.rarity-uncommon {
    border-bottom-color: #5e98d9;
}

.spinner-item.rarity-rare {
    border-bottom-color: #4b69ff;
}

.spinner-item.rarity-mythical {
    border-bottom-color: #8847ff;
}

.spinner-item.rarity-legendary {
    border-bottom-color: #d32ce6;
}

.spinner-item.rarity-ancient {
    border-bottom-color: #eb4b4b;
}

.spinner-item.rarity-exceedingly {
    border-bottom-color: #ffd700;
}

.spinner-item img {
    max-width: 80%;
    max-height: 90px;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.spinner-item-name {
    font-size: 0.8rem;
    color: #ccc;
    text-align: center;
    padding: 2px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Jackpot Special Style */
.spinner-item.rarity-jackpot {
    border: 2px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    padding: 0 !important;
    overflow: hidden;
    background: #000;
}

.spinner-item.rarity-jackpot img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    margin: 0;
    filter: brightness(1.1);
}

.spinner-item.rarity-jackpot .spinner-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700 !important;
    font-weight: 800;
    text-shadow: 0 0 5px #ffd700;
    z-index: 2;
    padding: 4px 0;
}

/* ---- Controls ---- */
.spinner-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.multi-roll-selector {
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.roll-count-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #aaa;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.roll-count-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.roll-count-btn.active {
    background: #ffd700;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.active-spins-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 800px;
    overflow-y: auto;
}

.spinner-row {
    position: relative;
    width: 100%;
    height: 160px;
    /* Reduced specific height for staking */
    background: #0f0f16;
    border-radius: 8px;
    border: 2px solid #2a2a35;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}


.btn-spin {
    background: linear-gradient(135deg, #ffd700, #f0a500);
    color: #000;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(1);
}

.btn-spin:active:not(:disabled) {
    transform: translateY(2px);
}

.fast-game-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
    color: #ffd700;
    margin-left: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.fast-game-option input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #ffd700;
}

.fast-game-option label {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Items Won Section ---- */
.items-won-container {
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.items-won-title {
    font-size: 1.1rem;
    color: #ffd700;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.items-won-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.won-card {
    flex: 0 0 120px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.won-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.won-card-name {
    font-size: 0.75rem;
    margin-top: 5px;
    color: #ccc;
}

.won-card-price {
    font-size: 0.7rem;
    color: #ffd700;
    font-weight: 700;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .cases-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .spinner-box {
        height: 160px;
    }

    .spinner-item {
        flex: 0 0 140px;
        height: 130px;
    }
}