.rules-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 3rem;
    margin: 2rem auto;
    max-width: 900px;
    backdrop-filter: blur(12px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.rules-content h1 {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
}

.rules-content h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2.5rem;
    transition: all 0.3s ease;
}

.rules-content h2:hover {
    color: #818cf8;
    transform: translateX(5px);
}

.rules-content h2::after {
    content: '▼';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    font-size: 1rem;
    color: #818cf8;
}

.rules-content h2.collapsed::after {
    transform: translateY(-50%) rotate(-90deg);
}

.rules-content h2+ul,
.rules-content h2+ol,
.rules-content h2+p {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
    margin: 0;
}

.rules-content h2.expanded+ul,
.rules-content h2.expanded+ol,
.rules-content h2.expanded+p {
    max-height: 2000px;
    opacity: 1;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.rules-content h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    text-align: left;
}

.rules-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: left;
}

.rules-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.rules-content ul,
.rules-content ol {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    text-align: left;
}

.rules-content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.rules-content a {
    color: #818cf8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.rules-content a:hover {
    color: #a5b4fc;
}

.rules-content code {
    background: rgba(129, 140, 248, 0.1);
    color: #818cf8;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.rules-content pre {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.rules-content pre code {
    background: none;
    color: var(--text-primary);
    padding: 0;
}

.rules-content blockquote {
    border-left: 3px solid #818cf8;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.rules-content hr {
    border: none;
    height: 1px;
    background: var(--glass-border);
    margin: 2rem 0;
}

.admin-edit-button {
    text-align: center;
    margin: 2rem auto;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #818cf8;
}

.modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.modal-body textarea {
    width: 100%;
    min-height: 400px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #818cf8;
}

.markdown-help {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(129, 140, 248, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.markdown-help ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.markdown-help code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .rules-content {
        padding: 2rem 1.5rem;
    }

    .rules-content h1 {
        font-size: 2rem;
    }

    .rules-content h2 {
        font-size: 1.3rem;
    }

    .modal-content {
        width: 95%;
    }

    .modal-body textarea {
        min-height: 300px;
    }
}