/**
 * Последний Очаг - Стили Mini App
 */

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideDown {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from { 
        opacity: 0;
        transform: translateX(-30px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--accent-green); }
    50% { box-shadow: 0 0 20px var(--accent-green); }
}

@keyframes damageFlash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(244, 67, 54, 0.3); }
}

@keyframes healFlash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(76, 175, 80, 0.3); }
}

@keyframes energyPulse {
    0%, 100% { 
        background: linear-gradient(135deg, #FFC107, #FF9800);
    }
    50% { 
        background: linear-gradient(135deg, #FFEB3B, #FFC107);
    }
}

@keyframes loadingDots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Классы анимаций */
.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-slideUp {
    animation: slideUp 0.3s ease-out;
}

.animate-slideDown {
    animation: slideDown 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-shake {
    animation: shake 0.5s;
}

.animate-bounce {
    animation: bounce 0.5s;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-glow {
    animation: glow 1.5s ease-in-out infinite;
}

/* Новые анимации для UI */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

@keyframes slideInUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Классы для новых анимаций */
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-ripple { position: relative; overflow: hidden; }
.animate-shimmer { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); background-size: 200% 100%; animation: shimmer 2s infinite; }
.animate-heart { animation: heartBeat 1.5s ease-in-out; }
.animate-slide-up { animation: slideInUp 0.3s ease-out; }
.animate-zoom-in { animation: zoomIn 0.3s ease-out; }

/* Улучшенные кнопки с эффектами (постапокалиптические) */
.btn {
    background: linear-gradient(180deg, #3a3025 0%, #2a2218 100%);
    border: 1px solid #4a3f30;
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn:hover {
    background: linear-gradient(180deg, #4a4035 0%, #3a3025 100%);
    border-color: var(--accent-rust);
}

.btn:active {
    transform: scale(0.95);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(180deg, #5a7c4a 0%, #3a5c2a 100%);
    border-color: #4a7c3f;
    box-shadow: 
        0 3px 10px rgba(74, 124, 63, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #6a8c5a 0%, #4a6c3a 100%);
    border-color: #5a8c4f;
}

.btn-primary:active {
    box-shadow: 
        0 1px 4px rgba(74, 124, 63, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Карточки с эффектом глубины (постапокалиптические) */
.card {
    background: 
        linear-gradient(145deg, var(--bg-card) 0%, #1f1a16 100%);
    border-radius: 4px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid #3a3025;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

/* Эффект ржавчины на карточках */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-rust), transparent);
    opacity: 0.5;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-color: var(--accent-rust);
}

/* Карточка опасности (для радиации) */
.card.danger {
    border-left: 3px solid var(--radiation-color);
}

.card.danger::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at center, var(--radiation-color) 0%, transparent 70%);
    opacity: 0.3;
}

/* Задержки для последовательных анимаций */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Постапокалиптическая цветовая палитра (Fallout/Wasteland) */
    --bg-dark: #1a1814;           /* Тёмный бетон */
    --bg-card: #2a2520;           /* Загрязнённый металл */
    --bg-header: #1f1b17;         /* Ржавый фон */
    --bg-rust: #3d2914;           /* Ржавчина */
    
    --text-primary: #c4b998;       /* Состаренный пергамент */
    --text-secondary: #8a8070;     /* Выцветший текст */
    --text-rust: #d4a574;         /* Ржавый текст */
    
    /* Акцентные цвета */
    --accent-green: #4a7c3f;      /* Оксид меди (неон Fallout) */
    --accent-rust: #8b4513;        /* Ржавчина */
    --accent-orange: #cc5500;       /* Предупреждение ржавчина */
    --accent-red: #8b0000;         /* Кровь/опасность */
    --accent-yellow: #b8860b;      /* Радиация */
    --accent-blue: #4a6b8a;        /* Сталь */
    --accent-radiation: #39ff14;   /* Неон радиация */
    
    /* Цвета состояний */
    --health-color: #cc3333;       /* Красный */
    --energy-color: #ffcc00;       /* Жёлтый */
    --hunger-color: #cc6600;       /* Оранжевый */
    --thirst-color: #3399cc;      /* Голубой */
    --radiation-color: #39ff14;    /* Радиоактивный неон */
    
    /* Текстуры */
    --texture-noise: url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.1"/></svg>');
}

/* Telegram темная тема */
[data-theme="dark"] {
    --bg-dark: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-header: #121212;
    --bg-rust: #2a1a10;
    
    --text-primary: #e0e0e0;
    --text-secondary: #9e9e9e;
    --text-rust: #d4a574;
}

/* Telegram светлая тема */
html[data-theme="light"] {
    --bg-dark: #f5f0e6;
    --bg-card: #ebe5d8;
    --bg-header: #e8e0d0;
    --bg-rust: #4a3520;
    
    --text-primary: #3a3025;
    --text-secondary: #6a6050;
    --text-rust: #8b5a2b;
}

html, body {
    height: 100%;
    font-family: 'Courier New', Courier, monospace; /* Рубленый военный шрифт */
    background: 
        linear-gradient(135deg, rgba(26, 24, 20, 0.95) 0%, rgba(45, 37, 20, 0.9) 100%),
        var(--texture-noise),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        );
    color: var(--text-primary);
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Экраны */
.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 80px;
    animation: fadeIn 0.2s ease-out;
}

.screen.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

/* Экран загрузки */
#loading-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.loader {
    text-align: center;
}

.loader-icon {
    font-size: 64px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.loader h1 {
    margin-top: 16px;
    font-size: 24px;
    color: var(--accent-green);
}

.loader p {
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Хедер */
.game-header {
    background: var(--bg-header);
    padding: 12px 16px;
    border-bottom: 1px solid #333;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.player-level {
    background: var(--accent-green);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
}

.player-rank {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
}

.player-name {
    font-size: 16px;
    font-weight: 500;
}

/* Полоски статов */
.player-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-bar {
    position: relative;
    height: 24px;
    background: #333;
    border-radius: 12px;
    overflow: hidden;
}

.stat-bar .bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 12px;
}

.health-bar {
    background: linear-gradient(90deg, var(--health-color), #ff6b6b);
}

.energy-bar {
    background: linear-gradient(90deg, var(--energy-color), #ffd93d);
}

.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Секция локации */
.location-section {
    padding: 16px;
}

.location-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 2px solid var(--accent-green);
}

.location-icon {
    font-size: 48px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 12px;
}

.location-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.location-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.location-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
}

.radiation {
    color: var(--radiation-color);
}

.danger {
    color: var(--accent-orange);
}

/* Кнопки действий */
.actions-section {
    padding: 0 16px;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.action-btn {
    flex: 1;
    padding: 20px 16px;
    border: none;
    border-radius: 16px;
    background: var(--bg-card);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.action-btn:active {
    transform: scale(0.95) translateY(0);
    background: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.action-btn.loading::after {
    content: '...';
    animation: loadingDots 1s infinite;
}

.search-btn {
    background: linear-gradient(135deg, var(--accent-green), #2E7D32);
    flex: 2;
}

.btn-icon {
    font-size: 28px;
}

.btn-text {
    font-size: 14px;
    font-weight: 600;
}

.btn-cost {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

/* Статусы персонажа */
.status-section {
    padding: 0 16px;
    margin-bottom: 16px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.status-item {
    background: var(--bg-card);
    padding: 12px 8px;
    border-radius: 12px;
    text-align: center;
}

.status-item.danger {
    background: rgba(156, 39, 176, 0.2);
    border: 1px solid var(--accent-purple);
}

.status-icon {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.status-value {
    font-size: 16px;
    font-weight: bold;
    display: block;
}

.status-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Состояния: переломы и инфекции */
.conditions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.condition-item {
    background: var(--bg-card);
    padding: 10px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.condition-item.broken-bones {
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid #ff9800;
}

.condition-item.infections {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid #f44336;
}

.condition-icon {
    font-size: 18px;
}

.condition-text {
    flex: 1;
    font-size: 13px;
    font-weight: bold;
}

.condition-effect {
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Кнопки лечения */
.heal-actions {
    padding: 0 16px;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.heal-btn {
    flex: 1;
    padding: 14px 10px;
    border: 1px solid #4caf50;
    border-radius: 12px;
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.heal-btn:hover {
    background: rgba(76, 175, 80, 0.3);
    transform: scale(1.02);
}

.heal-btn:active {
    transform: scale(0.98);
}

/* Дополнительные кнопки */
.extra-actions {
    padding: 0 16px;
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.extra-btn {
    flex: 1;
    padding: 12px 8px;
    border: 1px solid #444;
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.extra-btn:active {
    background: #333;
}

/* Нижняя навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-header);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid #333;
    z-index: 100;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 12px;
}

.nav-btn span {
    font-size: 24px;
}

.nav-btn.active {
    color: var(--accent-green);
}

/* Экраны (общие стили) */
.screen-header {
    background: var(--bg-header);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    background: none;
    border: none;
    color: var(--accent-green);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
}

.screen-header h2 {
    font-size: 18px;
}

/* Список локаций */
.locations-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Контейнер карты */
.map-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    height: calc(100% - 60px);
}

#city-map {
    width: 100%;
    max-width: 360px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6),
                0 0 60px rgba(74, 144, 217, 0.1),
                inset 0 0 80px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

.map-info {
    margin-top: 12px;
    padding: 12px 24px;
    background: var(--bg-card);
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.map-location-name {
    font-size: 16px;
    color: var(--accent-yellow);
    font-weight: bold;
}

.map-location-info {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.location-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.location-item:active {
    background: #333;
}

.location-item.locked {
    opacity: 0.5;
}

.location-item .loc-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.location-item .loc-info {
    flex: 1;
}

.location-item .loc-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.location-item .loc-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

.location-item .loc-lock {
    font-size: 20px;
    color: var(--accent-red);
}

/* Панель управления инвентарём */
.inventory-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.inv-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.filter-btn {
    padding: 6px 12px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-blue), #2a5f9e);
    border-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 12px rgba(74, 144, 217, 0.4);
}

.inv-sort {
    display: flex;
    justify-content: center;
}

#sort-select {
    padding: 8px 16px;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

#sort-select:focus {
    border-color: var(--accent-blue);
}

#sort-select option {
    background: #1a1a2e;
    color: #fff;
}

/* Инвентарь */
.inventory-content {
    padding: 16px;
}

.inventory-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 12px;
}

.inv-stat {
    font-size: 14px;
}

.inv-stat span:last-child {
    font-weight: bold;
    color: var(--accent-yellow);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.inventory-slot {
    aspect-ratio: 1;
    background: var(--bg-card);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.inventory-slot .item-icon {
    font-size: 24px;
}

.inventory-slot .item-count {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 10px;
    font-weight: bold;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 4px;
}

.inventory-slot .item-rarity {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 8px 8px 0 0;
}

.rarity-common { background: #808080; }
.rarity-uncommon { background: var(--accent-green); }
.rarity-rare { background: var(--accent-blue); }
.rarity-epic { background: var(--accent-purple); }
.rarity-legendary { background: var(--accent-yellow); }

/* Боссы */
.bosses-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.boss-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.boss-item:active {
    background: #333;
}

.boss-item.locked {
    opacity: 0.5;
}

.boss-item .boss-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(244, 67, 54, 0.2);
    border-radius: 12px;
}

.boss-item .boss-info {
    flex: 1;
}

.boss-item .boss-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.boss-item .boss-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.boss-item .boss-reward {
    font-size: 12px;
    color: var(--accent-yellow);
}

.boss-item .boss-keys {
    font-size: 12px;
    color: var(--accent-orange);
}

/* Бой с боссом */
.boss-fight-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.boss-display {
    text-align: center;
    width: 100%;
}

.boss-icon {
    font-size: 80px;
    margin-bottom: 16px;
    animation: boss-pulse 2s ease-in-out infinite;
}

@keyframes boss-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.boss-health-bar {
    width: 100%;
    max-width: 300px;
    height: 32px;
    background: #333;
    border-radius: 16px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.boss-health-bar .bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-red), #ff6b6b);
    transition: width 0.3s ease;
}

.boss-health-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.fight-log {
    width: 100%;
    max-width: 300px;
    height: 150px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px;
    overflow-y: auto;
    font-size: 14px;
}

.fight-log p {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.fight-log .damage {
    color: var(--accent-red);
}

.fight-log .heal {
    color: var(--accent-green);
}

.attack-btn {
    background: linear-gradient(135deg, var(--accent-red), #c62828);
    max-width: 300px;
    width: 100%;
}

/* Магазин */
.shop-content {
    padding: 16px;
}

.shop-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.shop-tab {
    flex: 1;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
}

.shop-tab.active {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.shop-item .item-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.shop-item .item-info {
    flex: 1;
}

.shop-item .item-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.shop-item .item-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.shop-item .item-price {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-yellow);
}

.shop-item button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: var(--accent-green);
    color: white;
    cursor: pointer;
}

/* Элемент магазина */
.shop-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px;
    gap: 12px;
}

.shop-item-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}

.shop-item-info {
    flex: 1;
}

.shop-item-name {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
}

.shop-item-desc {
    font-size: 11px;
    color: #888;
}

.shop-item-price {
    font-weight: bold;
    color: var(--accent-yellow);
    font-size: 13px;
    white-space: nowrap;
}

.shop-buy-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-green), #3a8);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
}

.shop-buy-btn:active {
    transform: scale(0.95);
}

.shop-buy-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Мини-игры */
.minigame-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 20px;
}

.slots-machine {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f23 100%);
    border-radius: 16px;
    padding: 20px;
    border: 3px solid #444;
}

.slot-row {
    display: flex;
    gap: 10px;
}

.slot {
    width: 80px;
    height: 100px;
    background: linear-gradient(180deg, #fff 0%, #ddd 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border: 2px solid #333;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

.minigame-info {
    text-align: center;
    color: #888;
    font-size: 14px;
}

.minigame-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#bet-amount {
    padding: 10px 20px;
    font-size: 18px;
    border-radius: 8px;
    border: 2px solid #444;
    background: #1a1a2e;
    color: white;
    text-align: center;
    width: 120px;
}

.game-btn {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0ad4e, #d68c2a);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(240, 173, 78, 0.3);
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 173, 78, 0.4);
}

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

/* Колесо удачи */
.wheel-container {
    position: relative;
    width: 280px;
    height: 280px;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #e74c3c 0deg 60deg,
        #f39c12 60deg 120deg,
        #2ecc71 120deg 180deg,
        #3498db 180deg 240deg,
        #9b59b6 240deg 300deg,
        #e91e63 300deg 360deg
    );
    border: 4px solid #fff;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-segment {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(calc(var(--i) * 60deg));
}

.wheel-segment span {
    background: rgba(0,0,0,0.7);
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    transform: translateY(-100px);
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 10;
}

/* Рейтинг */
.rating-content {
    padding: 16px;
}

.rating-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.rating-tab {
    flex: 1;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
}

.rating-tab.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.rating-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-item .rank {
    font-size: 18px;
    font-weight: bold;
    width: 32px;
    color: var(--accent-yellow);
}

.rating-item .rank-1 { color: gold; }
.rating-item .rank-2 { color: silver; }
.rating-item .rank-3 { color: #cd7f32; }

.rating-item .info {
    flex: 1;
}

.rating-item .name {
    font-size: 14px;
    font-weight: 600;
}

.rating-item .stats {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-content button {
    padding: 12px 32px;
    border: none;
    border-radius: 12px;
    background: var(--accent-green);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.modal-content button:active {
    transform: translateY(0);
}

/* Анимация получения лута */
.loot-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(76, 175, 80, 0.95);
    padding: 20px 30px;
    border-radius: 16px;
    text-align: center;
    z-index: 1000;
    pointer-events: none;
}

.loot-animation .loot-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.loot-animation .loot-name {
    color: white;
    font-size: 16px;
    font-weight: bold;
}

/* Анимации */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.3s ease-in-out;
}

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

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

/* Скроллбар */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Адаптивность */
@media (max-width: 360px) {
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .inventory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Улучшенная мобильная адаптивность */
@media (max-width: 400px) {
    /* Уменьшаем отступы */
    .screen {
        padding: 12px;
    }
    
    /* Кнопки удобнее для тапа */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    /* Карточки компактнее */
    .card {
        padding: 12px;
    }
    
    /* Меньше текст */
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }
}

/* Поддержка темной темы для модальных окон */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: var(--bg-card);
    }
}

/* Улучшенная навигация для iOS */
@supports (-webkit-touch-callout: none) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .screen {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

/* Оптимизация для устройств с высокой плотностью пикселей */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn, .card {
        -webkit-font-smoothing: antialiased;
    }
}

/* Крафт */
.craft-content {
    padding: 16px;
}

.craft-info {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.recipes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recipe-item {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 16px;
    border: 2px solid #444;
}

.recipe-item.locked {
    opacity: 0.6;
}

.recipe-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

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

.recipe-info {
    flex: 1;
}

.recipe-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

.recipe-level {
    font-size: 12px;
    color: #888;
}

.recipe-result {
    color: #4CAF50;
    font-weight: bold;
}

.recipe-ingredients {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 12px;
}

.ingredients-label {
    color: #666;
    margin-right: 8px;
}

.ingredient {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 6px;
    background: #333;
    border-radius: 4px;
}

.ingredient.missing {
    color: #f44336;
}

.craft-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.craft-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.craft-btn.disabled {
    background: #555;
    cursor: not-allowed;
}

.empty-message {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* ======================== */
/* Стили для Базы           */
/* ======================== */

.base-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 80px;
}

/* Бонусы базы */
.base-bonuses {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
}

.base-bonuses h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--accent-yellow);
}

.bonuses-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.bonus-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    font-size: 12px;
}

.bonus-icon {
    font-size: 18px;
}

.bonus-name {
    flex: 1;
    color: var(--text-secondary);
}

.bonus-value {
    color: var(--accent-green);
    font-weight: bold;
}

.no-bonuses {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 16px;
}

/* Постройки игрока */
.player-buildings h3,
.available-buildings h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.buildings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-building-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
}

.player-building-item:active {
    transform: scale(0.98);
}

.building-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

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

.building-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
}

.building-level {
    background: var(--accent-blue);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
}

.building-bonuses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.building-bonuses .bonus {
    background: rgba(76, 175, 80, 0.2);
    color: var(--accent-green);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.upgrade-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-green), #388E3C);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.upgrade-btn:active {
    transform: scale(0.98);
}

.max-level {
    display: block;
    text-align: center;
    color: var(--accent-yellow);
    font-size: 14px;
    padding: 12px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
}

.no-buildings {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: 12px;
}

/* Табы строительства */
.build-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.build-tab {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.build-tab.active {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

.available-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.available-building-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
}

.available-building-item.locked {
    opacity: 0.6;
}

.available-building-item.maxed {
    border: 2px solid var(--accent-yellow);
}

.available-building-item .building-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0;
}

.building-cost {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.cost-coins {
    color: var(--accent-yellow);
    font-weight: bold;
    font-size: 14px;
}

.cost-resource {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.building-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.available-building-item.locked .building-status {
    color: var(--accent-red);
}

.available-building-item.maxed .building-status {
    color: var(--accent-yellow);
}

.build-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-blue), #1976D2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.build-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.build-btn:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.6;
}

.build-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* ========== СИСТЕМА КЛАНОВ ========== */

/* Экран клана */
.clan-content {
    padding: 16px;
    padding-bottom: 80px;
}

.clan-card {
    background: linear-gradient(135deg, #2a2a4a 0%, #1a1a3a 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 2px solid var(--accent-purple);
}

.clan-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.clan-icon {
    font-size: 48px;
}

.clan-title h3 {
    font-size: 24px;
    color: #fff;
    margin: 0;
}

.clan-level {
    font-size: 14px;
    color: var(--accent-purple);
}

.clan-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
}

.clan-stats {
    display: flex;
    justify-content: space-around;
    gap: 12px;
}

.clan-stat {
    text-align: center;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    flex: 1;
}

.clan-stat .stat-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 4px;
}

.clan-stat .stat-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-yellow);
}

.clan-stat .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Карточка "нет клана" */
.no-clan-card {
    background: linear-gradient(135deg, #2a2a4a 0%, #1a1a3a 100%);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 16px;
    border: 2px solid var(--accent-purple);
}

.no-clan-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.no-clan-card h3 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 8px;
}

.no-clan-card p {
    color: var(--text-secondary);
}

/* Кнопки действий клана */
.clan-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.clan-actions .action-btn {
    width: 100%;
    justify-content: flex-start;
}

.clan-admin {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.clan-admin h4 {
    color: var(--accent-yellow);
    margin-bottom: 12px;
    font-size: 14px;
}

/* Информация о клане */
.clan-info {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 16px;
}

.clan-info h4 {
    color: var(--accent-purple);
    margin-bottom: 12px;
}

.clan-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.clan-info li {
    padding: 8px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid #333;
}

.clan-info li:last-child {
    border-bottom: none;
}

/* Участники онлайн */
.clan-members-preview {
    margin-top: 16px;
}

.clan-members-preview h4 {
    color: var(--accent-green);
    margin-bottom: 12px;
    font-size: 14px;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}

.member-item.online {
    border-left: 3px solid var(--accent-green);
}

.member-role {
    font-size: 18px;
}

.member-name {
    flex: 1;
    color: #fff;
}

.member-level {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Экран создания клана */
.clan-create-content {
    padding: 16px;
    padding-bottom: 80px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

/* Экран списка кланов */
.clans-list-search {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: #1a1a1a;
}

.clans-list-search input {
    flex: 1;
    padding: 12px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

.clans-list-search button {
    padding: 12px 20px;
    background: var(--accent-purple);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.clans-list {
    padding: 16px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clan-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #2a2a2a;
    border-radius: 12px;
    border: 2px solid #444;
}

.clan-list-icon {
    font-size: 32px;
}

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

.clan-list-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

.clan-list-stats {
    font-size: 12px;
    color: var(--text-secondary);
}

.join-btn {
    padding: 8px 16px;
    background: var(--accent-green);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.join-btn:hover {
    background: #45a049;
}

/* Экран чата клана */
.clan-chat-messages {
    height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 12px;
    border-left: 3px solid var(--accent-purple);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.chat-author {
    font-weight: bold;
    color: var(--accent-purple);
}

.chat-level {
    font-size: 12px;
    color: var(--text-secondary);
}

.chat-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}

.chat-text {
    color: #fff;
    word-wrap: break-word;
}

.clan-chat-input {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.clan-chat-input input {
    flex: 1;
    padding: 12px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

.clan-chat-input button {
    padding: 12px 20px;
    background: var(--accent-purple);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* Модальное окно участников */
.clan-members-modal {
    max-height: 300px;
    overflow-y: auto;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #333;
}

.member-row:last-child {
    border-bottom: none;
}

.member-info {
    flex: 1;
}

.member-info .member-name {
    font-size: 14px;
}

.member-info .member-level {
    font-size: 12px;
}

.member-status {
    font-size: 12px;
}

.member-status.online {
    color: var(--accent-green);
}

.member-status.offline {
    color: var(--text-secondary);
}

/* Настройки клана */
.clan-settings {
    text-align: center;
}

.clan-settings p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.clan-settings strong {
    color: var(--accent-yellow);
    font-size: 18px;
}

/* ==================== PVP STYLES ==================== */

/* Индикатор зоны PvP */
.pvp-zone-indicator {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.pvp-zone-danger {
    background: linear-gradient(135deg, #8B0000, #DC143C);
    color: #fff;
    padding: 16px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    animation: pulse-red 1.5s ease-in-out infinite;
    border: 2px solid #FF0000;
}

.pvp-zone-safe {
    background: linear-gradient(135deg, #1a5c1a, #228B22);
    color: #fff;
    padding: 16px;
    border-radius: 8px;
    font-size: 16px;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
    50% { box-shadow: 0 0 25px rgba(255, 0, 0, 0.8); }
}

/* Список игроков PvP */
.pvp-players-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.pvp-player-item {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--accent-red);
    transition: all 0.2s;
}

.pvp-player-info {
    flex: 1;
}

.pvp-player-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.pvp-player-stats {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
}

.pvp-player-pvp {
    font-size: 12px;
    color: var(--accent-yellow);
    display: flex;
    gap: 12px;
}

.pvp-attack-player-btn {
    background: linear-gradient(135deg, #8B0000, #DC143C);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.pvp-attack-player-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.4);
}

.pvp-attack-player-btn:active {
    transform: scale(0.98);
}

/* Кнопки действий PvP */
.pvp-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 16px 0;
}

/* Экран PvP боя */
.pvp-fight-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pvp-combatants {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 16px;
}

.pvp-combatant {
    flex: 1;
    text-align: center;
}

.combatant-avatar {
    font-size: 48px;
    margin-bottom: 8px;
}

.combatant-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.combatant-level {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.pvp-vs {
    font-size: 28px;
    font-weight: bold;
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Лог боя PvP */
.pvp-battle-log {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    height: 150px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

.pvp-battle-log p {
    margin: 4px 0;
    color: var(--text-secondary);
}

.pvp-battle-log .battle-result {
    color: var(--accent-yellow);
    font-weight: 600;
    font-size: 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #333;
}

/* Кнопка атаки PvP */
.pvp-fight-actions {
    display: flex;
    justify-content: center;
}

.pvp-attack-btn {
    background: linear-gradient(135deg, #8B0000, #DC143C);
    color: #fff;
    border: none;
    padding: 20px 60px;
    border-radius: 16px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.4);
}

.pvp-attack-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.6);
}

.pvp-attack-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4);
}

.pvp-attack-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Награды PvP */
.pvp-rewards {
    background: linear-gradient(135deg, #1a3a1a, #2d5a2d);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid var(--accent-green);
}

.pvp-rewards h3 {
    margin-bottom: 16px;
    color: var(--accent-green);
}

.reward-item {
    padding: 8px;
    margin: 4px 0;
    font-size: 16px;
    color: var(--accent-yellow);
}

.reward-item.loss {
    color: var(--accent-red);
}

/* Статистика PvP */
.pvp-stats-container {
    padding: 16px;
}

.pvp-rating-card {
    background: linear-gradient(135deg, #1a1a3a, #2d2d5a);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
    border: 2px solid var(--accent-purple);
}

.rating-value {
    font-size: 48px;
    font-weight: bold;
    color: var(--accent-purple);
}

.rating-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

/* Достижения */
.achievements-stats {
    padding: 16px;
    background: linear-gradient(135deg, #1a1a3a, #2d2d5a);
    border-radius: 12px;
    margin: 16px;
    text-align: center;
}

.achievements-stats .total {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-gold);
}

.achievements-stats .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.achievements-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 16px;
}

.achievement-category-btn {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.achievement-category-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.achievements-list {
    padding: 0 16px 80px;
}

.achievement-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
}

.achievement-card.completed {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, #2d2d1a, #3d3d2a);
}

.achievement-card .icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border-radius: 12px;
}

.achievement-card.completed .icon {
    background: var(--accent-gold);
}

.achievement-card .info {
    flex: 1;
}

.achievement-card .name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
}

.achievement-card .description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.achievement-card .progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-card .progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.achievement-card .progress-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 4px;
    transition: width 0.3s;
}

.achievement-card.completed .progress-fill {
    background: var(--accent-gold);
}

.achievement-card .progress-text {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: right;
}

.achievement-card .reward {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.achievement-card .reward-item {
    font-size: 12px;
    padding: 4px 8px;
    background: var(--bg-dark);
    border-radius: 4px;
}

.achievement-card .claim-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--accent-gold);
    border: none;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
}

.achievement-card .claim-btn:disabled {
    background: var(--bg-dark);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.achievement-card .claimed-badge {
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--accent-green);
    color: white;
    font-size: 12px;
}

.achievement-card .rarity-common { border-color: #9e9e9e; }
.achievement-card .rarity-uncommon { border-color: #4caf50; }
.achievement-card .rarity-rare { border-color: #2196f3; }
.achievement-card .rarity-epic { border-color: #9c27b0; }
.achievement-card .rarity-legendary { border-color: #ff9800; }

.pvp-damage-stats,
.pvp-losses-stats {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.pvp-damage-stats h3,
.pvp-losses-stats h3,
.pvp-recent-matches h3 {
    color: var(--accent-yellow);
    margin-bottom: 12px;
    font-size: 16px;
}

.damage-dealt,
.coins-lost {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.damage-taken,
.items-lost {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.damage-dealt span:last-child {
    color: var(--accent-green);
}

.damage-taken span:last-child {
    color: var(--accent-red);
}

.coins-lost span:last-child {
    color: var(--accent-red);
}

.items-lost span:last-child {
    color: var(--accent-orange);
}

/* Кулдаун PvP */
.pvp-cooldown {
    background: linear-gradient(135deg, #3a3a1a, #5a5a2d);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 2px solid var(--accent-yellow);
}

.cooldown-icon {
    font-size: 24px;
}

.cooldown-text {
    color: var(--accent-yellow);
}

.cooldown-timer {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent-yellow);
}

/* Последние бои PvP */
.pvp-recent-matches {
    margin-top: 20px;
}

.pvp-match-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #444;
}

.pvp-match-item.win {
    border-left-color: var(--accent-green);
}

.pvp-match-item.loss {
    border-left-color: var(--accent-red);
}

.pvp-match-item.draw {
    border-left-color: var(--accent-yellow);
}

.match-result {
    font-size: 24px;
}

.match-info {
    flex: 1;
}

.match-opponent {
    font-weight: 600;
    color: #fff;
}

.match-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.match-damage {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

.match-damage span:first-child {
    color: var(--accent-green);
}

.match-damage span:last-child {
    color: var(--accent-red);
}

/* ========================================
   БАРАХОЛКА
   ======================================== */

/* Экран барахолки */
.market-filters {
    padding: 12px;
    background: var(--bg-dark);
    border-bottom: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.market-filters .search-input,
.market-filters .filter-select {
    width: 100%;
    padding: 10px 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.market-filters .filter-select {
    display: flex;
    gap: 8px;
}

.market-info-bar {
    padding: 12px;
    background: #222;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid #333;
}

.market-info-bar #market-commission {
    font-size: 12px;
    color: var(--text-secondary);
    margin-right: auto;
}

.market-info-bar .tab-btn {
    padding: 8px 16px;
    background: #333;
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.market-info-bar .tab-btn.active {
    background: var(--accent-purple);
}

.market-tab {
    display: none;
    padding: 12px;
}

.market-tab.active {
    display: block;
}

/* Карточка объявления */
.market-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.market-listing-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.market-listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.market-listing-card.rarity-common { border-color: #808080; }
.market-listing-card.rarity-uncommon { border-color: var(--accent-green); }
.market-listing-card.rarity-rare { border-color: var(--accent-blue); }
.market-listing-card.rarity-epic { border-color: var(--accent-purple); }
.market-listing-card.rarity-legendary { border-color: var(--accent-yellow); }

.listing-item-icon {
    font-size: 36px;
    width: 50px;
    text-align: center;
}

.listing-item-info {
    flex: 1;
}

.listing-item-name {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.listing-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.listing-item-meta .quantity {
    color: var(--accent-yellow);
    font-weight: 600;
}

.listing-expiry {
    font-size: 11px;
    color: var(--accent-orange);
    margin-top: 4px;
}

.listing-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.listing-price .price-coins {
    font-size: 16px;
    font-weight: bold;
    color: var(--accent-yellow);
}

.listing-price .price-stars {
    font-size: 14px;
    color: var(--accent-purple);
}

.listing-price .buy-btn {
    padding: 8px 16px;
    background: var(--accent-green);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.listing-price .buy-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

/* Мои объявления */
.market-my-info {
    padding: 12px;
    background: #2a2a2a;
    border-radius: 8px;
    margin-bottom: 12px;
}

.market-limits {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.market-listing-card.my-listing {
    position: relative;
}

.listing-status {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    color: #fff;
    font-weight: 600;
}

.listing-stats {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.listing-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.listing-actions .renew-btn,
.listing-actions .cancel-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.listing-actions .renew-btn {
    background: var(--accent-blue);
    color: #fff;
}

.listing-actions .cancel-btn {
    background: var(--accent-red);
    color: #fff;
}

/* История */
.market-history-stats {
    margin-bottom: 16px;
}

.history-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.history-stats-grid .stat-box {
    background: #2a2a2a;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.history-stats-grid .stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.history-stats-grid .stat-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--accent-yellow);
}

.market-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    border-left: 3px solid #444;
    margin-bottom: 8px;
}

.market-history-item.sale {
    border-left-color: var(--accent-green);
}

.market-history-item.purchase {
    border-left-color: var(--accent-blue);
}

.history-icon {
    font-size: 24px;
}

.history-info {
    flex: 1;
}

.history-item-name {
    font-weight: 600;
    color: #fff;
}

.history-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.history-price {
    font-weight: bold;
}

.history-price.positive {
    color: var(--accent-green);
}

.history-price.negative {
    color: var(--accent-red);
}

.history-price .commission {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Экран создания объявления */
.market-create-form {
    padding: 16px;
}

.market-create-form .form-group {
    margin-bottom: 16px;
}

.market-create-form label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.market-inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.market-inventory-slot {
    background: var(--bg-card);
    border: 2px solid #444;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.market-inventory-slot.selected {
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
}

.market-inventory-slot .item-icon {
    font-size: 24px;
    display: block;
}

.market-inventory-slot .item-quantity {
    font-size: 11px;
    color: var(--accent-yellow);
    display: block;
}

.market-inventory-slot .item-name {
    font-size: 10px;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-item-display {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.selected-item-display .placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

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

.selected-name {
    font-weight: 600;
    color: #fff;
}

.selected-qty {
    font-size: 12px;
    color: var(--text-secondary);
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
}

.market-create-summary {
    background: var(--bg-card);
    padding: 12px;
    border-radius: 8px;
    margin: 16px 0;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-yellow);
}

/* Модальное окно покупки */
.market-buy-modal {
    max-width: 400px;
}

.buy-item-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 8px;
    margin: 16px 0;
}

.buy-item-display .item-icon {
    font-size: 36px;
}

.buy-item-display .item-name {
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.buy-item-display .item-quantity {
    font-size: 18px;
    color: var(--accent-yellow);
    font-weight: bold;
}

.seller-info {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 16px;
}

.buy-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.buy-summary-row .price {
    font-weight: bold;
    color: var(--accent-yellow);
}

.buy-summary-row.commission {
    color: var(--text-secondary);
    font-size: 12px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.modal-buttons .action-btn,
.modal-buttons .cancel-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-buttons .action-btn {
    background: var(--accent-green);
    color: #fff;
}

.modal-buttons .cancel-btn {
    background: #444;
    color: #fff;
}

/* Пустое состояние */
.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   РЕФЕРАЛЬНАЯ СИСТЕМА
   ============================================ */

/* Секция приглашения */
.referral-invite-section {
    padding: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-bottom: 1px solid var(--border-color);
}

.referral-invite-section h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.referral-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 16px 0;
}

/* Блок с кодом */
.referral-code-box {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 2px solid var(--accent-purple);
}

.referral-code-label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
}

.referral-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

#referral-code {
    font-family: monospace;
    font-size: 20px;
    font-weight: bold;
    color: var(--accent-yellow);
    letter-spacing: 2px;
}

.copy-btn {
    background: var(--accent-purple);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #7c6cd6;
    transform: scale(1.05);
}

/* Секция изменения кода */
.referral-change-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.referral-change-section .input-field {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.referral-change-section .hint {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 8px;
}

/* Секция бонусов */
.referral-bonuses-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.referral-bonuses-section h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.bonuses-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.bonus-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.bonus-card .bonus-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.bonus-card .bonus-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.bonus-card .bonus-reward {
    color: var(--accent-yellow);
    font-size: 12px;
}

/* Секция статистики */
.referral-stats-section {
    padding: 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.referral-stats-section h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 8px;
}

.stat-item .stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-purple);
}

.stat-item .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Секция ввода кода */
.referral-use-section {
    padding: 16px;
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1), rgba(56, 178, 172, 0.1));
    border-bottom: 1px solid var(--border-color);
}

.referral-use-section h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.use-code-form {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.use-code-form .input-field {
    flex: 1;
}

/* Секция списка рефералов */
.referral-list-section {
    padding: 16px;
}

.referral-list-section h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.referrals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.referral-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.referral-info {
    flex: 1;
}

.referral-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.referral-level {
    font-size: 14px;
    color: var(--accent-purple);
    margin-bottom: 2px;
}

.referral-joined {
    font-size: 12px;
    color: var(--text-secondary);
}

.referral-bonuses {
    font-size: 20px;
}

/* ======================== */
/* Стили для Сезонов       */
/* ======================== */

.season-current {
    padding: 16px;
}

.season-inactive {
    text-align: center;
    padding: 32px 16px;
}

.season-inactive .season-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.season-info {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    border: 2px solid var(--accent-gold);
}

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

.season-header h3 {
    margin: 0;
    color: var(--accent-gold);
}

.season-days {
    background: var(--accent-gold);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.season-description {
    color: var(--text-secondary);
    margin: 8px 0;
}

.season-rank-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #333;
}

.season-rank-info .rank-label {
    color: var(--text-secondary);
}

.season-rank-info .rank-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-gold);
}

.season-rank-info .rank-points {
    color: var(--accent-green);
    margin-left: auto;
}

.season-events {
    padding: 16px;
}

.season-events h3 {
    margin: 0 0 12px 0;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-card {
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px;
    border-left: 3px solid var(--accent-gold);
}

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

.event-info h4 {
    margin: 0 0 4px 0;
}

.event-info p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.event-modifiers {
    font-size: 12px;
    color: var(--accent-green);
}

.season-modifiers {
    padding: 16px;
}

.season-modifiers h3 {
    margin: 0 0 12px 0;
}

.modifiers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modifier-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 8px;
}

.modifier-name {
    color: var(--text-secondary);
    text-transform: capitalize;
}

.modifier-value {
    color: var(--accent-green);
    font-weight: 600;
}

.season-rating-section {
    padding: 16px;
}

.season-rating-section h3 {
    margin: 0 0 12px 0;
}

.season-rating-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.season-rating-tab {
    flex: 1;
    padding: 12px;
    background: var(--bg-card);
    border: 2px solid #333;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.season-rating-tab.active {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.season-rating-content {
    min-height: 200px;
}

.season-top-rating,
.season-my-rating {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
}

.rating-rank {
    font-size: 18px;
    width: 32px;
    text-align: center;
}

.rating-name {
    flex: 1;
    font-weight: 600;
}

.rating-level {
    color: var(--text-secondary);
    font-size: 14px;
}

.rating-points {
    color: var(--accent-gold);
}

.my-rank-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #2d2d1a, #3d3d2a);
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
}

.my-rank-position {
    font-size: 36px;
    font-weight: bold;
    color: var(--accent-gold);
}

.my-rank-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.my-rank-details span {
    color: var(--text-secondary);
}

.my-points {
    color: var(--accent-green);
    font-weight: 600;
}

.season-daily-tasks {
    padding: 16px;
}

.season-daily-tasks h3 {
    margin: 0 0 12px 0;
}

.daily-tasks-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.daily-tasks-progress .progress-bar {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

.daily-tasks-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), #4caf50);
    transition: width 0.3s;
}

.daily-tasks-progress .progress-text {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
}

.daily-tasks-progress .event-badge {
    background: var(--accent-gold);
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.daily-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.daily-task-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 12px;
}

.daily-task-card.completed {
    border-left: 3px solid var(--accent-green);
}

.daily-task-card .task-icon {
    font-size: 28px;
}

.daily-task-card .task-info {
    flex: 1;
}

.daily-task-card .task-info h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.daily-task-card .task-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-task-card .task-progress-bar {
    flex: 1;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
}

.daily-task-card .task-progress-fill {
    height: 100%;
    background: var(--accent-green);
    transition: width 0.3s;
}

.daily-task-card .task-progress span {
    color: var(--text-secondary);
    font-size: 12px;
}

.daily-task-card .task-reward {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
}

.daily-task-card .task-reward span {
    color: var(--accent-gold);
}

.daily-task-card .claim-btn {
    padding: 8px 16px;
    background: var(--accent-green);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.daily-task-card .claim-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.season-join-section {
    padding: 16px;
    text-align: center;
}

.season-join-section .action-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    background: linear-gradient(135deg, var(--accent-gold), #f0c000);
    color: #000;
}
