@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #4ecb95 0%, #2d8659 100%);
    --danger-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    --warning-gradient: linear-gradient(135deg, #ffd93d 0%, #f4a430 100%);
    --dark-bg: #0f0f23;
    --card-bg: rgba(30, 30, 60, 0.95);
    --card-border: rgba(102, 126, 234, 0.3);
    --primary-color: #667eea;
    --success-color: #4ecb95;
    --danger-color: #ff6b6b;
    --warning-color: #ffd93d;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #16213e 100%);
    color: #e0f2e9;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    width: 100%;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* ==================== NAVIGATION TABS ==================== */
/* ==================== NAVIGATION TABS ==================== */
.nav-tabs {
    display: flex;
    justify-content: space-around;
    background: var(--card-bg);
    padding: 8px;
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    border-radius: 18px 18px 0 0;
    gap: 6px;
}

.nav-tab {
    flex: 1;
    padding: 14px 12px;
    text-align: center;
    background: transparent;
    border: 2px solid transparent;
    color: rgba(224, 242, 233, 0.6);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    z-index: 1;
}

.nav-tab span {
    position: relative;
    z-index: 2;
}

/* Активная вкладка — красивая обводка + лёгкий полупрозрачный фон */
.nav-tab.active {
    color: #ffffff !important;
    background: rgba(102, 126, 234, 0.15);
    border: 2px solid #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    font-weight: 700;
}

/* Ховер для неактивных */
.nav-tab:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: rgba(224, 242, 233, 0.9);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

/* ==================== SECTIONS ==================== */
.section {
    display: none;
    padding: 20px;
}

.section.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(15px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.section.active::-webkit-scrollbar {
    width: 6px;
}

.section.active::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
}

.section.active::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 3px;
}

/* ==================== GAME HEADER ==================== */

.game-header {
    text-align: center;
    margin-bottom: 15px;
}

.game-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: -1px;
    text-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.score-display {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 12px;
    display: flex;
    justify-content: space-around;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
}

.score-item {
    text-align: center;
    position: relative;
}

.score-label {
    font-size: 10px;
    color: rgba(224, 242, 233, 0.6);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.score-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
    transition: transform 0.2s;
}

.combo-value.combo-active {
    animation: comboPulse 0.4s ease;
    color: var(--warning-color);
}

@keyframes comboPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ==================== GAME BOARD ==================== */

.game-board {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    position: relative;
}

.grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0px;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(15, 15, 35, 0.5);
    aspect-ratio: 1;
}

.cell {
    aspect-ratio: 1;
    background: rgba(102, 126, 234, 0.08);
    border: 2px solid rgba(102, 126, 234, 0.15);
    transition: transform 0.15s ease, background 0.15s ease;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.cell.filled {
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: scale(1.03);
}

.cell.hover-preview {
    background: rgba(78, 203, 149, 0.4);
    border-color: #4ecb95;
}

.cell.hover-invalid {
    background: rgba(255, 107, 107, 0.4);
    border-color: #ff6b6b;
}

.cell.clearing {
    animation: clearAnimation 0.2s ease-out;
}

@keyframes clearAnimation {
    0% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.15); 
        opacity: 0.6;
    }
    100% { 
        transform: scale(0); 
        opacity: 0; 
    }
}

/* ==================== COLOR BLOCKS ==================== */

.cell.color-1, .block-cell.filled.color-1 { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.cell.color-2, .block-cell.filled.color-2 { 
    background: linear-gradient(135deg, #5dd9ff 0%, #3d9bd8 100%);
}
.cell.color-3, .block-cell.filled.color-3 { 
    background: linear-gradient(135deg, #ffd93d 0%, #f4a430 100%);
}
.cell.color-4, .block-cell.filled.color-4 { 
    background: linear-gradient(135deg, #ff6b9d 0%, #ee5a8a 100%);
}
.cell.color-5, .block-cell.filled.color-5 { 
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}
.cell.color-6, .block-cell.filled.color-6 { 
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}
.cell.color-7, .block-cell.filled.color-7 { 
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
}
.cell.color-8, .block-cell.filled.color-8 { 
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}
/* ==================== BLOCKS CONTAINER ==================== */

.blocks-container {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    margin-top: 0;
    padding: 12px;
    background: rgba(15, 15, 35, 0.3);
    border-radius: 12px;
}

.block-preview {
    width: 14px;
    height: 14px;
    background: rgba(15, 15, 35, 0.85);
    cursor: grab;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    touch-action: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.block-preview:hover {
    transform: translateY(-6px) scale(1.06);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.block-preview:active {
    cursor: grabbing;
    transform: translateY(-4px) scale(1.03);
}

.block-preview.dragging {
    opacity: 0.6;
    transform: scale(0.95);
}

.block-grid {
    display: grid;
}

.block-cell {
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.15s;
    aspect-ratio: 1;
}

.block-cell.filled {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: none;
}

/* ==================== FLOATING BLOCK ==================== */

.floating-block {
    transform-origin: top left;
    transform: scale(1.3);
    will-change: transform;
}

/* ==================== SCORE POPUP ==================== */

.score-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--primary-gradient);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    animation: scorePopupAnim 1.2s ease-out;
    z-index: 100;
    pointer-events: none;
}

@keyframes scorePopupAnim {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    80% {
        transform: translate(-50%, -70%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -90%) scale(0.9);
        opacity: 0;
    }
}

/* ==================== BUTTONS ==================== */

.start-screen {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.start-button, .restart-button, .buy-button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin-top: 20px;
}

.start-button:hover, .restart-button:hover, .buy-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.5);
}

.start-button:active, .restart-button:active, .buy-button:active {
    transform: translateY(-1px);
}

.buy-button {
    background: linear-gradient(135deg, #ffd93d 0%, #f4a430 100%);
    color: #1a1a3e;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.buy-button:hover {
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.5);
}

/* ==================== LEADERBOARD ==================== */

.leaderboard {
    background: transparent;
    padding: 0;
}

.leaderboard-title {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.leaderboard-item {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
}

.leaderboard-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.2s;
}

.leaderboard-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.leaderboard-item:hover::before {
    opacity: 1;
}

.rank {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    min-width: 50px;
    text-align: center;
}

.rank.top-1 { 
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.rank.top-2 { 
    color: #c0c0c0;
}

.rank.top-3 { 
    color: #cd7f32;
}

.player-info {
    flex: 1;
    margin-left: 15px;
}

.player-name {
    font-size: 16px;
    font-weight: 600;
    color: #e0f2e9;
    margin-bottom: 3px;
}

.player-score {
    font-size: 22px;
    font-weight: 800;
    color: var(--success-color);
}

/* ==================== VIP SECTION ==================== */

.vip-section {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
}

.vip-header {
    text-align: center;
    margin-bottom: 30px;
}

.vip-title {
    font-size: 36px;
    font-weight: 800;
    color: #ffd700;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.vip-description {
    font-size: 15px;
    color: rgba(224, 242, 233, 0.7);
    line-height: 1.8;
}

.vip-price {
    background: var(--primary-gradient);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.price-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.price-value {
    font-size: 42px;
    font-weight: 800;
    color: white;
}

/* ==================== GAME ACTIONS BUTTONS ==================== */

.game-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 15px 20px;
    margin-top: 10px;
}

.action-button {
    flex: 1;
    max-width: 200px;
    padding: 14px 20px;
    border: none;
    border-radius: 15px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    font-family: 'Poppins', sans-serif;
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-button:not(:disabled):hover {
    transform: translateY(-2px);
}

.action-button:not(:disabled):active {
    transform: translateY(0);
}

.surrender-btn {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 2px solid rgba(255, 107, 107, 0.4);
}

.surrender-btn:not(:disabled):hover {
    background: rgba(255, 107, 107, 0.3);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.undo-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.undo-btn:not(:disabled):hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.undo-btn:disabled {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.2);
    box-shadow: none;
}

.vip-badge-small {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

/* ==================== CLANS SECTION ==================== */

.clans-section {
    padding: 0;
}

.clans-title {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.create-clan-btn {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 30px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
    margin-bottom: 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.create-clan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.create-clan-btn:active {
    transform: translateY(0);
}

.clans-leaderboard {
    margin-top: 25px;
}

.section-subtitle {
    font-size: 20px;
    font-weight: 700;
    color: #e0f2e9;
    margin-bottom: 15px;
    padding-left: 5px;
}

#clansList, #clansLeaderboard {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clan-item {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.clan-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.2s;
}

.clan-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.clan-item:hover::before {
    opacity: 1;
}

.clan-item-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.clan-rank {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.clan-rank.top-1 {
    color: #ffd700;
}

.clan-rank.top-2 {
    color: #c0c0c0;
}

.clan-rank.top-3 {
    color: #cd7f32;
}

.clan-info {
    flex: 1;
}

.clan-name {
    font-size: 18px;
    font-weight: 700;
    color: #e0f2e9;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clan-type-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clan-type-badge.open {
    background: rgba(78, 203, 149, 0.2);
    color: #4ecb95;
    border: 1px solid rgba(78, 203, 149, 0.3);
}

.clan-type-badge.closed {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.clan-details {
    font-size: 13px;
    color: rgba(224, 242, 233, 0.6);
    display: flex;
    gap: 15px;
}

.clan-score {
    font-size: 20px;
    font-weight: 800;
    color: var(--success-color);
}

.my-clan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 15px;
}

.clan-info-header {
    flex: 1;
}

.clan-name-display {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.leave-clan-btn {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.leave-clan-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: translateY(-2px);
}

.clan-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.stat-card {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    padding: 18px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.2s;
}

.stat-card:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 12px;
    color: rgba(224, 242, 233, 0.6);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
}

/* ==================== CLAN MEMBERS ==================== */

.clan-members-section {
    margin: 25px 0;
}

#clanMembersList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-item {
    background: rgba(102, 126, 234, 0.08);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(102, 126, 234, 0.15);
    transition: all 0.2s;
}

.member-item:hover {
    background: rgba(102, 126, 234, 0.15);
}

.member-item.leader {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.member-item.leader .member-avatar {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.member-details {
    flex: 1;
}

.member-name {
    font-size: 15px;
    font-weight: 600;
    color: #e0f2e9;
    margin-bottom: 3px;
}

.member-score {
    font-size: 13px;
    color: rgba(224, 242, 233, 0.6);
}

.kick-btn {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.kick-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.05);
}

/* ==================== CLAN REQUESTS ==================== */

#clanRequestsSection {
    margin: 25px 0;
    padding: 20px;
    background: rgba(78, 203, 149, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(78, 203, 149, 0.2);
}

#clanRequestsList {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.request-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.request-info {
    flex: 1;
}

.request-username {
    font-size: 15px;
    font-weight: 600;
    color: #e0f2e9;
    margin-bottom: 3px;
}

.request-time {
    font-size: 12px;
    color: rgba(224, 242, 233, 0.5);
}

.request-actions {
    display: flex;
    gap: 8px;
}

.accept-btn, .reject-btn {
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.accept-btn {
    background: rgba(78, 203, 149, 0.2);
    color: #4ecb95;
    border: 1px solid rgba(78, 203, 149, 0.3);
}

.accept-btn:hover {
    background: rgba(78, 203, 149, 0.3);
    transform: scale(1.05);
}

.reject-btn {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.reject-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.05);
}

.no-requests {
    text-align: center;
    color: rgba(224, 242, 233, 0.5);
    padding: 20px;
    font-size: 14px;
}

/* ==================== БАЗОВЫЕ МОДАЛКИ ==================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active,
.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--card-border);
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), 
                opacity 0.3s ease;
}

.modal.active .modal-content,
.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
}

.modal-close {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #e0f2e9;
    margin-bottom: 10px;
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    background: rgba(102, 126, 234, 0.08);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    color: #e0f2e9;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s;
    box-sizing: border-box;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.12);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-hint {
    font-size: 12px;
    color: rgba(224, 242, 233, 0.5);
    margin-top: 8px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.08);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.3);
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.radio-option:has(input:checked) {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.radio-label {
    flex: 1;
}

.radio-title {
    font-size: 15px;
    font-weight: 600;
    color: #e0f2e9;
    margin-bottom: 3px;
}

.radio-desc {
    font-size: 12px;
    color: rgba(224, 242, 233, 0.6);
}

.form-info {
    background: rgba(78, 203, 149, 0.1);
    border: 1px solid rgba(78, 203, 149, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
}

.info-item {
    font-size: 13px;
    color: rgba(224, 242, 233, 0.8);
    margin-bottom: 8px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    display: flex;
    gap: 12px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 14px 25px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #e0f2e9;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.15);
}

/* ==================== GAME OVER MODAL ==================== */

.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-over-overlay.active {
    display: flex;
    opacity: 1;
}

.game-over {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 40px 30px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    max-width: 90%;
    width: 400px;
    text-align: center;
    position: relative;
    transform: scale(0.8) translateY(100px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.game-over-overlay.active .game-over {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.game-over-title {
    font-size: 48px;
    font-weight: 800;
    color: var(--danger-color);
    margin-bottom: 20px;
    animation: shake 0.5s ease;
    text-shadow: 0 4px 20px rgba(255, 107, 107, 0.5);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.final-score {
    font-size: 20px;
    color: #e0f2e9;
    margin-bottom: 15px;
    font-weight: 600;
}

.final-score span {
    font-size: 56px;
    font-weight: 800;
    color: var(--success-color);
    display: block;
    margin-top: 15px;
    text-shadow: 0 4px 15px rgba(78, 203, 149, 0.5);
}

.max-combo-display {
    font-size: 16px;
    color: rgba(224, 242, 233, 0.7);
    margin-bottom: 30px;
    padding: 10px 20px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 12px;
    display: inline-block;
}

.max-combo-display span {
    color: #ffd700;
    font-weight: 800;
    font-size: 18px;
}

/* ==================== CASES MODAL ==================== */

.cases-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cases-modal.active {
    display: flex;
    opacity: 1;
}

.cases-modal-content {
    background: #1a1a1a;
    border-radius: 18px;
    width: 100%;
    max-width: 420px;
    max-height: 95vh;
    border: 1px solid #444;
    position: relative;
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.5);
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.3s ease;
}

.cases-modal.active .cases-modal-content {
    transform: scale(1);
    opacity: 1;
}

.cases-modal-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #333;
}

.cases-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #fff;
}

.cases-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.cases-close {
    position: absolute;
    top: 8px;
    right: 16px;
    font-size: 32px;
    color: #aaa;
    cursor: pointer;
    z-index: 10;
    background: transparent;
    border: none;
    width: auto;
    height: auto;
    transition: color 0.2s;
}

.cases-close:hover {
    color: #fff;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.item {
    background: #222;
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
    border: 1px solid #333;
}

.item img {
    width: 100%;
    height: 80px;
    object-fit: contain;
}

.item-name {
    font-size: 11px;
    color: #fff;
    margin: 6px 0 2px;
}

.item-rarity {
    font-size: 10px;
    color: #888;
}


/* ==================== CASES GRID ==================== */

.cases {
    background: transparent;
    padding: 0;
}

.cases-title {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding: 0 12px;
    margin-top: 30px;
}

.case-card {
    background: linear-gradient(145deg, #1a1a1a, #141414);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s ease;
    border: 1px solid #333;
    position: relative;
    aspect-ratio: 3 / 4;
}

.case-card:hover, .case-card:active {
    transform: scale(0.96);
    border-color: #a855f7;
    box-shadow: 0 15px 30px rgba(168, 85, 247, 0.3);
}

.case-rarity {
    height: 4px;
    background: var(--rarity-gradient);
}

.case-image {
    height: 65%;
    background-size: cover;
    background-position: center;
}

.case-info {
    padding: 12px 8px;
    text-align: center;
}

.case-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.2;
}

.case-price {
    font-size: 20px;
    font-weight: 800;
    color: #a855f7;
}

/* ==================== INVENTORY ==================== */

.inventory-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.inventory-title, .invent-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 20px 0;
    text-align: center;
}

.player-id-header {
    text-align: center;
    padding: 14px;
    background: rgba(0,0,0,0.25);
    border-radius: 16px;
    margin: 10px 12px;
    font-size: 15px;
    color: #ccc;
}

.player-id-header strong {
    color: #80cfa9;
    font-size: 22px;
    letter-spacing: 1px;
    font-family: monospace;
}

.inventory-item {
    position: relative;
    background: rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 12px;
    margin: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.inventory-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.item-rarity.common { border-left: 4px solid #888; }
.item-rarity.rare { border-left: 4px solid #4caf50; }
.item-rarity.epic { border-left: 4px solid #9c27b0; }
.item-rarity.legendary { border-left: 4px solid #ff9800; }

.item-actions {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.btn-equip {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
    transition: all 0.2s;
}

.btn-equip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.5);
}

.btn-unequip {
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    color: #333;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 154, 158, 0.3);
    transition: all 0.2s;
}

.btn-unequip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 154, 158, 0.5);
}

.btn-transfer {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 110, 234, 0.3);
    transition: all 0.2s;
}

.btn-transfer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 110, 234, 0.5);
}

.equipped-badge {
    background: #ffd700;
    color: #000;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 4px;
    display: inline-block;
}

.quantity {
    background: rgba(0,0,0,0.4);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
}

/* ==================== ITEM DETAIL MODAL ==================== */

.modal.item-modal {
    z-index: 10002;
}

.modal.item-modal .modal-content {
    max-width: 500px;
}

.item-detail-rarity {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.item-detail-rarity.rarity-common { background: rgba(158, 158, 158, 0.2); color: #9e9e9e; }
.item-detail-rarity.rarity-rare { background: rgba(33, 150, 243, 0.2); color: #2196f3; }
.item-detail-rarity.rarity-epic { background: rgba(156, 39, 176, 0.2); color: #9c27b0; }
.item-detail-rarity.rarity-legendary { background: rgba(255, 152, 0, 0.2); color: #ff9800; }

.item-detail-description {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.item-detail-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

/* ==================== VIP STYLES ==================== */

.vip-badge-active {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    display: inline-block;
    animation: vipGlow 2s ease infinite;
}

@keyframes vipGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }
}

.buy-vip-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    transition: all 0.2s ease;
    display: block;
    margin: 20px auto;
}

.buy-vip-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.7);
}

.buy-vip-button:active {
    transform: translateY(-1px);
}

.buy-vip-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== БЛОКИРОВКА СКРОЛЛА ==================== */

body.modal-open,
body.cases-modal-open {
    overflow: hidden !important;
}

/* ==================== UTILITIES ==================== */

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== LOADER ==================== */

.loader {
    position: fixed;
    inset: 0;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.2s, visibility 0.2s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== SCROLLBAR ==================== */

.modal-content::-webkit-scrollbar,
.cases-modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track,
.cases-modal-body::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
}

.modal-content::-webkit-scrollbar-thumb,
.cases-modal-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover,
.cases-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 480px) {
    .game-title {
        font-size: 32px;
    }
    
    .score-value {
        font-size: 20px;
    }
    
    .game-over-title {
        font-size: 36px;
    }
    
    .clan-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .my-clan-header {
        flex-direction: column;
    }
    
    .leave-clan-btn {
        width: 100%;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    .game-over {
        width: 95%;
        padding: 30px 20px;
    }
    
    .final-score span {
        font-size: 48px;
    }
    
    .game-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-button {
        max-width: 100%;
    }
    
    .request-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .request-actions {
        width: 100%;
    }
    
    .accept-btn, .reject-btn {
        flex: 1;
    }
    
    .cases-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ==================== PREVIEW EFFECTS ==================== */

.cell:not(.filled).preview {
    background: rgba(78, 203, 149, 0.4) !important;
    border: 2px solid #4ecb95 !important;
    box-shadow: 0 0 10px rgba(78, 203, 149, 0.4);
    z-index: 10;
    will-change: transform;
    animation: previewPulse 0.6s ease infinite;
}

.cell:not(.filled).preview.invalid {
    background: rgba(255, 107, 107, 0.4) !important;
    border: 2px solid #ff6b6b !important;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
    animation: shake 0.3s ease infinite;
}

.cell.filled.preview {
    background: inherit !important;
    border: inherit !important;
    box-shadow: inherit !important;
    animation: none !important;
}

.cell.combo-potential {
    background: rgba(255, 215, 0, 0.25) !important;
    border-color: #ffd700 !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
    animation: comboPotentialPulse 1.2s ease infinite;
}

.cell.combo-preview {
    position: relative;
    will-change: opacity;
    animation: comboGlow 0.8s ease infinite;
}

.cell.combo-preview::after {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid #ffd700;
    border-radius: 2px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    pointer-events: none;
    z-index: 5;
    animation: comboBorderPulse 0.8s ease infinite;
}

@keyframes previewPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

@keyframes comboGlow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

@keyframes comboBorderPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    }
}

@keyframes comboPotentialPulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 18px rgba(255, 215, 0, 0.6);
    }
}

/* ==================== COMBO COUNTER ==================== */

.combo-counter-preview {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a3e;
    padding: 15px 30px;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    z-index: 10000;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 12px;
    will-change: transform, opacity;
    animation: comboCounterBounce 0.4s ease;
}

.combo-icon {
    font-size: 32px;
}

.combo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.combo-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.combo-count {
    font-size: 20px;
    font-weight: 700;
}

@keyframes comboCounterBounce {
    0% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

/* ==================== TUTORIAL HINT ==================== */

.tutorial-hint {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    z-index: 10001;
    animation: tutorialBounce 0.4s ease;
    max-width: 90%;
}

.tutorial-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tutorial-icon {
    font-size: 32px;
}

.tutorial-text {
    font-size: 14px;
    line-height: 1.6;
}

.tutorial-text strong {
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
}

@keyframes tutorialBounce {
    0% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

.combo-hint-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: white;
    padding: 20px 35px;
    border-radius: 20px;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    z-index: 1001;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: comboHintBounce 0.5s ease;
}

.combo-hint-icon {
    font-size: 36px;
}

@keyframes comboHintBounce {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* ==================== NOTIFICATIONS ==================== */

.achievement-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10001;
    animation: slideInRight 0.5s ease-out;
    max-width: 350px;
}

.achievement-icon {
    font-size: 48px;
    animation: bounce 0.6s ease-out;
}

.achievement-text {
    flex: 1;
}

.achievement-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 5px;
}

.achievement-name {
    font-size: 16px;
    font-weight: 700;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ==================== GRID CELL HIGHLIGHTS ==================== */

.grid-cell.highlight {
    background-color: rgba(255, 255, 0, 0.4);
}

.grid-cell.highlight-invalid {
    background-color: rgba(255, 0, 0, 0.4);
}

/* ==================== PERFORMANCE MODE ==================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    padding: 10px 0;
}

.item-chance {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 6px 0 4px;
}

.item {
    background: rgba(30, 30, 60, 0.8);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.3);
    transition: transform 0.2s;
}

.item:hover {
    transform: translateY(-4px);
}

.item-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.item-name {
    font-size: 13px;
    margin: 8px 0 4px;
    word-break: break-word;
}

.item-rarity {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.rarity-covert {
    background: linear-gradient(90deg, #ff6b6b, #ffd93d);
    color: #000;
}

/* Анимация открытия кейса */
.case-opening-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
}

.spinning-case {
    font-size: 80px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.opening-text {
    margin-top: 20px;
    font-size: 20px;
    font-weight: bold;
    color: #80cfa9;
    animation: pulse 1.5s ease-in-out infinite;
}

.opening-subtext {
    margin-top: 10px;
    font-size: 14px;
    color: rgba(224, 242, 233, 0.7);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Результат открытия */
.case-result {
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.result-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #80cfa9;
    text-shadow: 0 0 20px rgba(128, 207, 169, 0.5);
}

.result-item {
    background: rgba(20, 20, 20, 0.5);
    border-radius: 16px;
    padding: 40px 20px;
    margin: 20px 0;
    border: 2px solid;
    backdrop-filter: blur(10px);
}

.result-item.rarity-legendary {
    border-color: #ffd700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
}

.result-item.rarity-epic {
    border-color: #f093fb;
    box-shadow: 0 0 40px rgba(240, 147, 251, 0.4);
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1), rgba(240, 147, 251, 0.05));
}

.result-item.rarity-rare {
    border-color: #667eea;
    box-shadow: 0 0 40px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(102, 126, 234, 0.05));
}

.result-item.rarity-common {
    border-color: #80cfa9;
    box-shadow: 0 0 40px rgba(128, 207, 169, 0.4);
    background: linear-gradient(135deg, rgba(128, 207, 169, 0.1), rgba(128, 207, 169, 0.05));
}

.result-icon {
    font-size: 100px;
    margin-bottom: 20px;
    animation: bounceIn 0.8s ease-out;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.result-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #e0f2e9;
}

.result-rarity {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    opacity: 0.8;
    font-weight: 600;
}

.result-description {
    font-size: 14px;
    opacity: 0.7;
    max-width: 400px;
    margin: 0 auto 10px;
    line-height: 1.5;
}

.result-chance {
    font-size: 12px;
    color: rgba(224, 242, 233, 0.5);
    margin-top: 10px;
}

/* Кнопки действий */
.case-actions {
    margin-top: 30px;
    text-align: center;
}

.btn-open-case {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-open-case:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-open-case:active {
    transform: translateY(0);
}

.btn-locked-case {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 2px solid #ff6b6b;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: not-allowed;
    opacity: 0.6;
}

.case-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
    z-index: 10;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Уведомление о новых кейсах */
.new-cases-notification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.new-cases-notification.show {
    opacity: 1;
}

.new-cases-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.new-cases-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: #80cfa9;
}

.new-cases-list {
    margin: 20px 0;
}

.new-case-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(128, 207, 169, 0.2);
}

.case-icon {
    font-size: 32px;
}

.case-name {
    flex: 1;
    font-weight: 600;
    color: #e0f2e9;
}

.case-score {
    font-size: 12px;
    color: rgba(224, 242, 233, 0.6);
}

.new-cases-content button {
    width: 100%;
    margin-top: 10px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ==================== CASES MODAL ==================== */

.cases-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cases-modal.active {
    display: flex;
    opacity: 1;
}

.cases-modal-content {
    background: #1a1a1a;
    border-radius: 18px;
    width: 100%;
    max-width: 420px;
    max-height: 95vh;
    border: 1px solid #444;
    position: relative;
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.5);
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cases-modal.active .cases-modal-content {
    transform: scale(1);
    opacity: 1;
}

.cases-modal-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.cases-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #fff;
}

.cases-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}



.transfer-modal {
    z-index: 10003;
}

.transfer-item-display {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    font-size: 16px;
    color: #e0f2e9;
}

.transfer-item-display strong {
    color: var(--primary-color);
    font-size: 18px;
}

.input-field[type="number"] {
    -moz-appearance: textfield;
}

.input-field[type="number"]::-webkit-outer-spin-button,
.input-field[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Анимация для модалки передачи */
.transfer-modal.show {
    animation: fadeIn 0.3s ease;
}

.transfer-modal .modal-content {
    animation: slideUpBounce 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideUpBounce {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Улучшенный стиль для info блока */
.form-info {
    background: rgba(78, 203, 149, 0.08);
    border: 1px solid rgba(78, 203, 149, 0.25);
    border-left: 4px solid rgba(78, 203, 149, 0.6);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

.info-item {
    font-size: 13px;
    color: rgba(224, 242, 233, 0.85);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item:last-child {
    margin-bottom: 0;
}



/* ===== ДОБАВЬТЕ В styles9029.css ===== */

/* ==================== UPGRADE SYSTEM ==================== */

.upgrade-modal {
    z-index: 10004;
}

.btn-upgrade {
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
    color: white;
    border: none;
    padding: 14px 25px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.btn-upgrade:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.6);
}

.btn-upgrade:active {
    transform: translateY(0);
}

.upgrade-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.upgrade-level-display {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.upgrade-stars {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.upgrade-text {
    font-size: 14px;
    color: #ffd700;
    font-weight: 600;
}

/* Дисплей предмета в модалке улучшения */
.upgrade-item-display {
    background: rgba(102, 126, 234, 0.1);
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.upgrade-item-display:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.upgrade-item-name {
    font-size: 20px;
    font-weight: 700;
    color: #e0f2e9;
    margin-bottom: 8px;
}

.upgrade-rarity {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Прогресс улучшения */
.upgrade-progress {
    margin: 25px 0;
}

.upgrade-level-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.level-box {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 25px;
    min-width: 120px;
    text-align: center;
    transition: all 0.3s ease;
}

.level-box.current-level {
    border-color: rgba(102, 126, 234, 0.4);
}

.level-box.next-level {
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.05);
}

.level-label {
    font-size: 11px;
    color: rgba(224, 242, 233, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.level-value {
    font-size: 24px;
    font-weight: 800;
    color: #e0f2e9;
}

.level-box.next-level .level-value {
    color: #ffd700;
}

.upgrade-arrow {
    font-size: 32px;
    color: rgba(255, 215, 0, 0.6);
    animation: arrowPulse 2s ease infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Требования */
.upgrade-requirements {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.requirement-title {
    font-size: 16px;
    font-weight: 700;
    color: #e0f2e9;
    margin-bottom: 15px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.requirement-item:last-child {
    margin-bottom: 0;
}

.requirement-item.met {
    border-left: 4px solid #4caf50;
}

.requirement-item.not-met {
    border-left: 4px solid #ff6b6b;
}

.requirement-icon {
    font-size: 20px;
}

.requirement-text {
    font-size: 14px;
    color: rgba(224, 242, 233, 0.9);
    font-weight: 600;
}

.upgrade-info {
    background: rgba(255, 152, 0, 0.08);
    border-left: 4px solid rgba(255, 152, 0, 0.6);
}

.upgrade-info .info-item.warning {
    color: #ff9800;
    font-weight: 700;
}

/* Уведомление об успешном улучшении */
.upgrade-success-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10005;
    animation: upgradeSuccessBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes upgradeSuccessBounce {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.upgrade-success-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.success-icon {
    font-size: 64px;
    animation: rotateSuccess 1s ease;
}

@keyframes rotateSuccess {
    0% {
        transform: rotate(0deg) scale(0);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.success-text {
    text-align: left;
}

.success-title {
    font-size: 20px;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.success-item {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 6px;
}

.success-level {
    font-size: 18px;
    font-weight: 700;
    color: #ffd700;
}

/* Улучшенные предметы в инвентаре */
.inventory-item.upgraded {
    border: 2px solid #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.inventory-item .upgrade-level-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ffd700, #ff9800);
    color: #000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}


@media (max-width: 480px) {
    .upgrade-level-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .upgrade-arrow {
        transform: rotate(90deg);
        font-size: 24px;
    }
    
    .level-box {
        min-width: 100%;
    }
    
    .upgrade-success-content {
        flex-direction: column;
        text-align: center;
    }
    
    .success-text {
        text-align: center;
    }
}




.cell.hover-preview {
    background: rgba(78, 203, 149, 0.4);
    border-color: #4ecb95;
    transition: none !important;   /* Добавь эту строку */
}

.cell.hover-invalid {
    background: rgba(255, 107, 107, 0.4);
    border-color: #ff6b6b;
    transition: none !important;   /* Добавь эту строку */
}



#blocksContainer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
    padding: 20px;
    min-height: 105px;
    width: 100%; /* фиксированная ширина */
    max-width: 100%; /* не расширяется */
}

.block-preview {
    flex: 0 0 auto; /* не растягивается и не сжимается */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==================== ITEM VALUE DISPLAY ==================== */

.item-value-display {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 152, 0, 0.05));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
}

.value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.value-row.total-value {
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    margin-top: 8px;
    padding-top: 12px;
}

.value-label {
    font-size: 14px;
    color: rgba(224, 242, 233, 0.8);
    font-weight: 600;
}

.value-amount {
    font-size: 18px;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.value-row.total-value .value-amount {
    font-size: 20px;
    animation: valueGlow 2s ease infinite;
}

@keyframes valueGlow {
    0%, 100% {
        text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    }
    50% {
        text-shadow: 0 4px 15px rgba(255, 215, 0, 0.6);
    }
}

/* Адаптивность */
@media (max-width: 480px) {
    .value-label {
        font-size: 13px;
    }
    
    .value-amount {
        font-size: 16px;
    }
    
    .value-row.total-value .value-amount {
        font-size: 18px;
    }
}


/* ==================== INVENTORY STATS HEADER ==================== */

.inventory-stats-header {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 0 12px 20px 12px;
    animation: fadeInUp 0.5s ease;
}

.inventory-stat {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.05));
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.inventory-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s;
}

.inventory-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.inventory-stat:hover::before {
    opacity: 1;
}

.stat-icon {
    font-size: 36px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-4px);
    }
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 11px;
    color: rgba(224, 242, 233, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: #e0f2e9;
    line-height: 1.2;
}

/* Специальный стиль для стоимости */
.inventory-stat:nth-child(2) .stat-value {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: valueShine 3s ease infinite;
}

@keyframes valueShine {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

/* Мини-стоимость в карточке предмета */
.item-value-mini {
    font-size: 11px;
    color: #ffd700;
    font-weight: 700;
    margin-top: 6px;
    padding: 3px 8px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    display: inline-block;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

/* Адаптивность для статистики */
@media (max-width: 480px) {
    .inventory-stats-header {
        gap: 10px;
        margin: 0 10px 15px 10px;
    }
    
    .inventory-stat {
        padding: 12px;
    }
    
    .stat-icon {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-value {
        font-size: 18px;
    }
}

/* Анимация появления пустого инвентаря */
.empty-inventory {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
    animation: emptyBounce 2s ease-in-out infinite;
}

@keyframes emptyBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-inventory p {
    font-size: 18px;
    color: rgba(224, 242, 233, 0.6);
    margin: 10px 0;
}

.empty-hint {
    font-size: 14px !important;
    color: rgba(224, 242, 233, 0.4) !important;
}
