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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #eee;
    padding: 20px;
}

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

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #f5c842;
}

/* Фильтры */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filters input,
.filters select,
.filters button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background: #2a2a4a;
    color: #eee;
    font-size: 14px;
}

.filters input {
    flex: 1;
    min-width: 200px;
}

.filters button {
    background: #4a7c59;
    cursor: pointer;
    transition: background 0.3s;
}

.filters button:hover {
    background: #5a9c69;
}

/* Статистика */
.stats {
    display: flex;
    gap: 30px;
    padding: 15px 20px;
    background: #2a2a4a;
    border-radius: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stats strong {
    color: #f5c842;
}

/* Сетка карт */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Карточка в сетке */
.card-item {
    background: #2a2a4a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
    border: 2px solid transparent;
}

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

.card-item .image-container {
    width: 100%;
    height: 200px;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-item .image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-item .image-container .no-image {
    color: #666;
    font-size: 48px;
}

.card-item .card-info {
    padding: 15px;
}

.card-item .card-info .name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.card-item .card-info .rarity {
    color: #f5c842;
    font-size: 14px;
}

.card-item .card-info .type {
    color: #aaa;
    font-size: 12px;
    margin-top: 4px;
}

.card-item .card-info .status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    margin-top: 8px;
}

.status-owned {
    background: #4a7c59;
    color: #fff;
}

.status-missing {
    background: #7c4a4a;
    color: #fff;
}

.status-duplicate {
    background: #7c7c4a;
    color: #fff;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #2a2a4a;
    padding: 30px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}

.modal-content .close:hover {
    color: #fff;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #1a1a2e;
    color: #eee;
}

.form-group button {
    padding: 8px 15px;
    background: #4a6a7c;
    border: none;
    border-radius: 8px;
    color: #eee;
    cursor: pointer;
    margin-top: 5px;
}

.form-group button:hover {
    background: #5a8a9c;
}

.card-preview {
    background: #1a1a2e;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.card-preview .preview-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #2a2a4a;
}

form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #4a7c59;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

form button[type="submit"]:hover {
    background: #5a9c69;
}

/* Адаптив */
@media (max-width: 600px) {
    .filters {
        flex-direction: column;
    }
    .filters input {
        width: 100%;
    }
    .stats {
        flex-direction: column;
        gap: 10px;
    }
}