.rules-page {
    margin-top: 80px;
}

.rules-hero {
    background: linear-gradient(rgba(10, 10, 11, 0.88), rgba(26, 26, 29, 0.95)),
        url('https://sunz.ir/Files/lada.jpg') no-repeat center center/cover;
    padding: 100px 0 60px;
    text-align: center;
}

.rules-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
}

.rules-hero p {
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.8;
}

.rules-section {
    padding: 40px 0 80px;
    background: var(--dark-surface);
}

.rules-update-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(229, 57, 53, 0.12));
    border: 1px solid rgba(255, 152, 0, 0.45);
    border-radius: 14px;
    padding: 1.1rem 1.35rem;
    margin-bottom: 1.75rem;
    color: var(--text-accent);
    line-height: 1.75;
}

.rules-update-banner i {
    font-size: 1.5rem;
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.rules-update-banner strong {
    color: #fff;
}

.rules-update-date {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.rules-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.rules-toolbar h2 {
    color: var(--text-primary);
    font-size: 1.15rem;
    margin: 0;
}

.rules-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-rules {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.15rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-rules:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-rules-primary {
    background: var(--gradient-primary);
    color: #fff;
}

.btn-rules-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-rules-ghost:hover {
    color: var(--text-primary);
}

.rules-preview-wrap {
    background: var(--dark-card);
    border: 1px solid rgba(229, 57, 53, 0.25);
    border-radius: 16px;
    overflow: hidden;
    min-height: 480px;
}

.rules-preview-frame {
    width: 100%;
    height: min(78vh, 900px);
    min-height: 480px;
    border: none;
    display: block;
    background: #1a1a1d;
}

.rules-missing {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.rules-missing i {
    font-size: 3rem;
    color: var(--warning);
    margin-bottom: 1rem;
}

.rules-missing code {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.35rem 0.65rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    color: var(--complement-teal-light);
    direction: ltr;
}

.rules-hint {
    margin-top: 1.25rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
}
