body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Arial', sans-serif;
    margin: 0;
}



/* Верхняя панель */
.top-bar { background: #1a1a1a; padding: 15px 30px; display: flex; justify-content: space-between; border-bottom: 1px solid #333; }
.logo { font-size: 20px; font-weight: bold; color: #fff; }
.user-name { margin-right: 15px; color: #ffc107; font-weight: bold;}
.btn-logout { color: #888; text-decoration: none; font-size: 14px; }

/* Сетка */
.container { display: flex; padding: 20px; }
.market-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    gap: 15px; 
    width: 100%; 
    align-items: start; /* Добавь это, чтобы карточки не растягивались по высоте соседа */
}

/* --- КАРТОЧКА ТОВАРА --- */
.card {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    /* height: 100%;       <-- УДАЛИЛ ЭТО (чтобы не тянулась) */
    /* min-height: 280px;  <-- УДАЛИЛ ЭТО (чтобы не было пустоты) */
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    height: auto; /* Карточка подстраивается под содержимое */
}

.card:hover {
    transform: translateY(-5px);
    border-color: #ff9800;
}
/* ... остальные стили (top, image-box) оставляем как были ... */

.btn-buy-green {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 10px 0;
    width: 100%;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    
    /* margin-top: auto;  <-- УДАЛИЛ ЭТО (виновник пустоты) */
    margin-top: 15px;     /* Сделал аккуратный отступ */
}

.btn-buy-green:hover { background-color: #218838; }

/* Верх: Иконка слева, Инфо справа */
.card-top {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.item-image-box {
    position: relative;
    width: 42px; /* Чуть больше стандартного */
    height: 42px;
    margin-right: 15px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #000;
}
.item-image-box img { width: 100%; height: 100%; display: block; }
.enchant-val {
    position: absolute;
    top: 2px; left: 4px;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.item-details { flex: 1; }
.item-name {
    color: #ffc107; /* Желтый цвет названия */
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 4px;
    line-height: 1.2;
}
.item-count {
    color: #777; /* Серый цвет кол-ва */
    font-size: 13px;
}

/* Цена */
.card-price-block {
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
}
.price-label { color: #fff; font-weight: bold; margin-right: 5px; font-size: 18px;}
.price-val { color: #fff; font-weight: bold; font-size: 18px; margin-right: 5px; }
.currency-name { color: #888; font-size: 14px; margin-right: 8px;}
.currency-mini-icon { width: 20px; height: 20px; vertical-align: middle; }

/* Разделитель */
.separator { height: 1px; background: #333; margin: 5px 0 10px 0; }

/* Аугментация */
.card-augment {
    display: flex;
    align-items: center;
    background: #252525;
    padding: 5px;
    border-radius: 4px;
    margin-bottom: 15px;
}
.card-augment img { width: 24px; height: 24px; margin-right: 8px; border: 1px solid #444;}
.card-augment span { color: #4488ff; font-size: 12px; } /* Голубой цвет скилла */
.augment-placeholder { height: 36px; margin-bottom: 15px;} /* Чтобы карточки были ровными */

/* Зеленая кнопка */
.btn-buy-green {
    background-color: #28a745; /* Зеленый цвет */
    color: #fff;
    border: none;
    padding: 10px 0;
    width: 100%;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: auto; /* Прижимает кнопку к низу */
}
.btn-buy-green:hover { background-color: #218838; }

/* Сайдбар */
.sidebar { width: 220px; margin-right: 20px; border-right: 1px solid #333; padding-right: 10px;}
.sidebar ul { list-style: none; padding: 0; }
.sidebar a {
    display: block; padding: 10px; color: #aaa; text-decoration: none;
    border-bottom: 1px solid #2a2a2a;
}
.sidebar a:hover, .sidebar a.active { color: #fff; background: #252525; border-left: 3px solid #28a745; }

/* Модалка */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); }
.modal-content { background: #222; margin: 15% auto; padding: 25px; width: 300px; border-radius: 8px; text-align: center; border: 1px solid #444;}
.modal input { width: 90%; padding: 10px; margin: 10px 0; background: #333; border: 1px solid #555; color: #fff; border-radius: 4px;}
.close { float: right; cursor: pointer; color: #fff; font-size: 24px; }


/* --- СТИЛИ ДЛЯ ИСТОРИИ --- */
.history-title { color: #ffc107; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 20px; }
.empty-msg { background: #1e1e1e; padding: 20px; text-align: center; color: #777; border-radius: 6px; }

.table-wrapper {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    overflow: hidden; /* Скругление углов таблицы */
}

.history-table { width: 100%; border-collapse: collapse; }
.history-table th { background: #252525; color: #aaa; padding: 12px; text-align: left; font-size: 14px; border-bottom: 2px solid #333; }
.history-table td { padding: 12px; border-bottom: 1px solid #2a2a2a; color: #ddd; vertical-align: middle; }
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover { background: #2a2a2a; }

.h-date { color: #666; font-size: 13px; width: 120px; }
.h-item { display: flex; align-items: center; gap: 10px; }
.h-item img { width: 32px; height: 32px; border: 1px solid #444; border-radius: 4px; background: #000; }
.h-item span { font-weight: bold; }