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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #2c1810, #1a0f08);
    color: #f4f1e8;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #8b7355;
    padding-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    color: #d4af37;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

header p {
    font-size: 1.1rem;
    color: #e6d4b7;
}

.search-section {
    background: rgba(139, 115, 85, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid #8b7355;
}

.search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

#search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #8b7355;
    border-radius: 5px;
    background: rgba(42, 26, 15, 0.8);
    color: #f4f1e8;
    font-size: 14px;
    min-width: 200px;
    font-family: inherit;
}

#search-input::placeholder {
    color: #8b7355;
}

#search-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(145deg, #d4af37, #b8941f);
    color: #2c1810;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: inherit;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    color: #ccc;
}

.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

select {
    padding: 8px 12px;
    border: 1px solid #8b7355;
    border-radius: 5px;
    background: rgba(42, 26, 15, 0.8);
    color: #f4f1e8;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
    font-family: inherit;
}

select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

.stats-section {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #d4af37;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #e6d4b7;
    margin-top: 5px;
}

.results-section {
    min-height: 400px;
}

.loading, .error {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
}

.error {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.rule-card {
    background: linear-gradient(145deg, rgba(139, 115, 85, 0.1), rgba(61, 40, 23, 0.2));
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #8b7355;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.rule-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
    border-color: #d4af37;
}

.rule-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.rule-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #d4af37;
    margin: 0;
}

.rule-system {
    background: rgba(212, 175, 55, 0.8);
    color: #2c1810;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.rule-category {
    background: rgba(139, 115, 85, 0.5);
    color: #f4f1e8;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    display: inline-block;
}

.rule-description {
    color: #e6d4b7;
    line-height: 1.6;
    margin-bottom: 15px;
}

.rule-details {
    border-top: 1px solid #8b7355;
    padding-top: 15px;
}

.rule-detail {
    display: flex;
    margin-bottom: 8px;
    align-items: flex-start;
}

.rule-detail-label {
    font-weight: bold;
    color: #d4af37;
    min-width: 80px;
    margin-right: 10px;
}

.rule-detail-value {
    color: #e6d4b7;
    flex: 1;
}

.rule-source {
    font-style: italic;
    color: #8b7355;
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: right;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
}

#page-info {
    color: #e6d4b7;
    font-size: 14px;
}

.no-results {
    text-align: center;
    color: #8b7355;
    font-style: italic;
    padding: 40px;
    background: rgba(139, 115, 85, 0.1);
    border-radius: 8px;
    border: 1px solid #8b7355;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .search-controls {
        flex-direction: column;
    }
    
    #search-input {
        min-width: unset;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    select {
        min-width: unset;
    }
    
    .stats-section {
        gap: 20px;
    }
    
    .results-container {
        grid-template-columns: 1fr;
    }
    
    .rule-header {
        flex-direction: column;
        align-items: flex-start;
    }
}