/* --- БАЗОВЫЕ НАСТРОЙКИ --- */
body { 
    margin: 0;
    padding: 0;
    background-color: #0a0a0a;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: bold;
}

/* --- ЗОНА КЛИКЕРА --- */
.clicker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.main-coin {
    font-size: 8rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s;
    filter: drop-shadow(0 0 25px rgba(0, 237, 154, 0.4));
    margin: 30px 0;
}

.main-coin:active {
    transform: scale(0.85);
}

/* --- ИНВЕНТАРЬ --- */
.inventory-section {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #222;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.item-card {
    background: #151515;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    transition: 0.3s;
    border: 1px solid #333;
    font-weight: bold;
}

.btn-sell {
    margin-top: 10px;
    background: #ff4757;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
}

/* --- КАЗИНО --- */
.casino-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.casino-content {
    background: #111;
    border: 2px solid #ffcc00;
    border-radius: 25px;
    padding: 20px 30px;
    max-width: 700px;
    width: 92%;
    text-align: center;
    position: relative;
    box-shadow: 0 0 50px rgba(255, 204, 0, 0.15);
}

.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    background: none;
    border: none;
    color: #666;
    font-size: 2rem;
    cursor: pointer;
}

/* --- СЕТКА КЕЙСОВ --- */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    max-height: 360px; /* Окно ниже на 40пкс от оригинала */
    overflow-y: auto;
    padding: 10px 15px 10px 5px;
    margin-top: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.case-grid::-webkit-scrollbar { width: 6px; }
.case-grid::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }

.case-card {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 15px;
    cursor: pointer;
    border: 1px solid #333;
    transition: 0.2s;
}

.case-card:hover {
    transform: translateY(-5px);
    border-color: #ffcc00;
}

.case-icon { font-size: 2.5rem; display: block; }
.case-name { display: block; margin: 8px 0; }
.case-price { color: #ffcc00; font-size: 0.9rem; }

/* --- РУЛЕТКА --- */
.roulette-wrapper {
    position: relative;
    width: 100%;
    height: 130px;
    overflow: hidden;
    margin: 20px 0;
    background: #050505;
    border-radius: 15px;
    border: 1px solid #222;
}

.selector {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #ffcc00;
    z-index: 10;
    box-shadow: 0 0 15px #ffcc00;
}

.reel-horizontal {
    display: flex;
    align-items: center;
    height: 100%;
    will-change: transform;
}

.reel-item-horizontal {
    min-width: 120px;
    width: 120px;
    flex-shrink: 0;
    height: 100px;
    margin: 0 3px;
    background: #1a1a1a;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    border-bottom: 4px solid #333;
}

/* --- РЕДКОСТИ С МЯГКОЙ ПУЛЬСАЦИЕЙ --- */

/* Анимация "дыхания" для всех предметов */
@keyframes breath-glow {
    0% { 
        box-shadow: inset 0 0 10px var(--glow-c), 0 0 5px var(--glow-c);
        filter: brightness(1);
    }
    50% { 
        box-shadow: inset 0 0 20px var(--glow-c), 0 0 15px var(--glow-c);
        filter: brightness(1.2);
    }
    100% { 
        box-shadow: inset 0 0 10px var(--glow-c), 0 0 5px var(--glow-c);
        filter: brightness(1);
    }
}

.rarity-common { 
    --glow-c: rgba(43, 203, 186, 0.2);
    border-color: #2bcbba !important; 
    animation: breath-glow 4s infinite ease-in-out;
}

.rarity-rare { 
    --glow-c: rgba(75, 123, 236, 0.3);
    border-color: #4b7bec !important; 
    animation: breath-glow 3.5s infinite ease-in-out;
}

.rarity-epic { 
    --glow-c: rgba(165, 94, 234, 0.4);
    border-color: #a55eea !important; 
    animation: breath-glow 3s infinite ease-in-out;
}

.rarity-mythic { 
    --glow-c: rgba(235, 77, 75, 0.5);
    border-color: #eb4d4b !important; 
    animation: breath-glow 2.5s infinite ease-in-out;
}

.rarity-legendary { 
    --glow-c: rgba(241, 196, 15, 0.6);
    border-color: #f1c40f !important; 
    animation: breath-glow 2s infinite ease-in-out;
}

/* --- ВСЕЛЕННАЯ (ПЛАВНЫЙ ПЕРЕЛИВ + ПУЛЬСАЦИЯ) --- */
.rarity-universe { 
    position: relative;
    border-color: #ffffff !important;
    animation: 
        glow-rainbow-soft 8s infinite linear,
        breath-universe 2s infinite ease-in-out;
}

@keyframes breath-universe {
    0%, 100% { transform: scale(1); filter: brightness(1) saturate(1.2); }
    50% { transform: scale(1.03); filter: brightness(1.4) saturate(1.5); }
}

@keyframes glow-rainbow-soft {
    0%, 100% { 
        box-shadow: inset 0 0 25px rgba(255, 118, 117, 0.4), 0 0 20px rgba(255, 118, 117, 0.3); 
        border-color: #ff7675 !important;
    }
    33% { 
        box-shadow: inset 0 0 25px rgba(116, 185, 255, 0.4), 0 0 20px rgba(116, 185, 255, 0.3); 
        border-color: #74b9ff !important;
    }
    66% { 
        box-shadow: inset 0 0 25px rgba(162, 155, 254, 0.4), 0 0 20px rgba(162, 155, 254, 0.3); 
        border-color: #a29bfe !important;
    }
}
/* --- ПРЕДПРОСМОТР --- */
.case-content-preview {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #222;
}

.items-preview-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* --- ПРЕДПРОСМОТР --- */
.preview-item-wrapper {
    text-align: center;
    width: 39px; /* Чуть шире самой иконки */
}

.preview-icon-box {
    background: #1a1a1a;
    width: 37px;  /* Размер 37px по вашему запросу */
    height: 37px; /* Размер 37px по вашему запросу */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 1.1rem; /* Уменьшили эмодзи, чтобы не вылезал за границы */
    margin: 0 auto;
    transition: 0.2s;
}

.chance-label {
    display: block;
    font-size: 0.5rem; /* Совсем мелкий шрифт для шансов */
    color: #888;
    margin-top: 2px;
}

/* --- ДОСТИЖЕНИЯ --- */
#achievement-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement-card {
    background: rgba(20, 20, 20, 0.95);
    border-left: 5px solid #ffcc00;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 250px;
}

.achievement-card.show {
    transform: translateX(0);
}

.achievement-icon {
    font-size: 2rem;
}

.achievement-info b {
    display: block;
    color: #ffcc00;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.achievement-info span {
    font-size: 1.1rem;
}
