/* ==========================================================================
   REGLAMENTO OFICIAL DEL SERVIDOR - SKY RP
   Normativa de Convivencia, Seguridad Técnica (Anti-Cheat & SS) y Medidas Disciplinarias
   Estilos completos, modulares y 100% autocontenidos
   ========================================================================== */

/* Animación de pulso para estado de carga */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.7;
    }
}

/* ==========================================================================
   CABECERA DE PÁGINA Y BUSCADOR EN VIVO
   ========================================================================== */
.page-header {
    padding: 130px 0 40px;
    text-align: center;
    position: relative;
}

.section-label {
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--neon-cyan, #00e5ff);
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 6px;
}

.reglamento-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: var(--neon-cyan, #00e5ff);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 14px;
    box-shadow: 0 0 20px -5px rgba(0, 229, 255, 0.3);
}

.wiki-search-container {
    max-width: 780px;
    margin: 24px auto 0;
    position: relative;
}

.wiki-search-box {
    display: flex;
    align-items: center;
    background: rgba(13, 15, 24, 0.85);
    border: 1.5px solid rgba(0, 229, 255, 0.25);
    border-radius: 14px;
    padding: 10px 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px -5px rgba(0, 229, 255, 0.15);
    transition: all 0.25s ease;
    backdrop-filter: blur(12px);
}

.wiki-search-box:focus-within {
    border-color: var(--neon-cyan, #00e5ff);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 229, 255, 0.35);
    transform: translateY(-2px);
}

.wiki-search-icon {
    font-size: 18px;
    margin-right: 12px;
    color: var(--neon-cyan, #00e5ff);
    user-select: none;
}

.wiki-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 15.5px;
    font-family: inherit;
    text-align: center;
}

.wiki-search-input::placeholder {
    color: #64748b;
    text-align: center;
}

.wiki-search-clear {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #94a3b8;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.wiki-search-clear:hover {
    background: rgba(255, 42, 133, 0.3);
    color: #ffffff;
}

.wiki-search-kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    padding: 3px 7px;
    border-radius: 6px;
    user-select: none;
    margin-left: 8px;
}

/* ==========================================================================
   ANCHO DE PÁGINA PANORÁMICO (OPTIMIZACIÓN DE ESPACIO DE REGLAMENTO)
   ========================================================================== */
.container {
    --max-width: 1600px;
    width: min(var(--max-width), calc(100% - 48px));
}

/* ==========================================================================
   LAYOUT PRINCIPAL: SIDEBAR + ÁREA DE CONTENIDO
   ========================================================================== */
.wiki-layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 30px;
    margin-bottom: 90px;
    align-items: start;
}

@media (max-width: 960px) {
    .wiki-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Sidebar de Navegación Rápida / Índice */
.wiki-sidebar {
    background: var(--bg-surface-elevated, rgba(22, 25, 38, 0.78));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px 18px;
    backdrop-filter: blur(20px);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 42, 133, 0.35) transparent;
}

.wiki-sidebar::-webkit-scrollbar {
    width: 5px;
}

.wiki-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 42, 133, 0.35);
    border-radius: 4px;
}

.wiki-sidebar h3 {
    font-family: var(--font-display, Arial, sans-serif);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--neon-cyan, #00e5ff);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wiki-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wiki-nav li {
    margin: 0;
    padding: 0;
}

.wiki-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-muted, #8b95b2);
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.wiki-nav a:hover,
.wiki-nav a.active {
    background: rgba(255, 42, 133, 0.12);
    color: #ffffff;
    border-left-color: var(--neon-pink, #ff6faa);
    transform: translateX(4px);
}

/* Área de Contenido Principal */
.wiki-content-area {
    display: flex;
    flex-direction: column;
    gap: 36px;
    min-width: 0;
}

/* ==========================================================================
   TARJETA DE SECCIÓN / CAPÍTULO DE REGLAMENTO
   ========================================================================== */
.wiki-section-card {
    background: var(--bg-surface-elevated, rgba(22, 25, 38, 0.78));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 28px 30px;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
    position: relative;
    scroll-margin-top: 110px;
}

@media (max-width: 640px) {
    .wiki-section-card {
        padding: 22px 16px;
    }
}

.wiki-section-card h2 {
    font-family: var(--font-display, Arial, sans-serif);
    font-size: 24px;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.5px;
}

.wiki-section-card h2 .icon {
    color: var(--neon-pink, #ff6faa);
    text-shadow: 0 0 12px var(--neon-pink-glow, rgba(255, 111, 170, 0.4));
}

.wiki-section-lead {
    color: #94a3b8;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 24px;
}

/* ==========================================================================
   GRILLA Y TARJETAS DE REGLAS (RULE CARDS) - 3 COLUMNAS EN DESKTOP
   ========================================================================== */
.rule-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 20px 0 0;
}

@media (max-width: 1100px) {
    .rule-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .rule-cards-grid {
        grid-template-columns: 1fr;
    }
}

.rule-card {
    background: rgba(13, 15, 24, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 20px 22px;
    transition: all 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.rule-card:hover {
    border-color: rgba(0, 229, 255, 0.35);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px -5px rgba(0, 229, 255, 0.2);
    transform: translateY(-2px);
}

.rule-card.search-match {
    border-color: var(--neon-pink, #ff6faa) !important;
    box-shadow: 0 0 15px rgba(255, 111, 170, 0.35) !important;
}

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

.rule-title {
    font-family: var(--font-display, Arial, sans-serif);
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
}

/* Insignias de severidad / categoría */
.rule-badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.rule-badge.essential,
.badge-essential {
    background: rgba(0, 229, 255, 0.15);
    color: var(--neon-cyan, #00e5ff);
    border: 1px solid rgba(0, 229, 255, 0.35);
}

.rule-badge.prohibited,
.rule-badge.sancionable,
.badge-prohibited,
.badge-sancionable {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.rule-badge.warning,
.badge-warning {
    background: rgba(255, 170, 0, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(255, 170, 0, 0.4);
}

.rule-badge.system,
.badge-system {
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.rule-badge.legal,
.badge-legal {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.rule-badge.illegal,
.badge-illegal {
    background: rgba(244, 63, 94, 0.18);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.45);
}

.rule-badge.perma,
.badge-perma {
    background: rgba(220, 38, 38, 0.25);
    color: #fecaca;
    border: 1px solid #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.rule-badge.neutral,
.badge-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Contenido de la Regla */
.rule-desc {
    font-size: 13.5px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 12px;
}

.rule-example {
    background: rgba(0, 0, 0, 0.35);
    border-left: 3px solid rgba(255, 42, 133, 0.6);
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.5;
}

.rule-example strong {
    color: #ffffff;
}

/* Imágenes y Videos de la Regla */
.rule-image-wrapper {
    position: relative;
    width: 100%;
    max-height: 260px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid rgba(0, 229, 255, 0.25);
    background: #090b12;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: all 0.25s ease;
}

.rule-image-wrapper:hover {
    border-color: rgba(0, 229, 255, 0.55);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.6), 0 0 14px rgba(0, 229, 255, 0.2);
}

.rule-image-wrapper img {
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.rule-image-wrapper:hover img {
    transform: scale(1.02);
}

.rule-block-image-wrapper {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    margin: 12px 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #090b12;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.25s ease;
}

.rule-block-image-wrapper:hover {
    border-color: rgba(255, 42, 133, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), 0 0 12px rgba(255, 42, 133, 0.2);
}

.rule-block-image-wrapper img {
    width: 100%;
    max-height: 380px;
    object-fit: contain;
    display: block;
    background: rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.rule-block-image-wrapper:hover img {
    transform: scale(1.015);
}

.rule-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 14px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    background: #000000;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
    transition: all 0.25s ease;
}

.rule-video-wrapper:hover {
    border-color: rgba(255, 42, 133, 0.6);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.65), 0 0 16px rgba(255, 42, 133, 0.2);
}

.rule-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Botón de Copiar Enlace Directo */
.copy-rule-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    opacity: 0.6;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rule-card:hover .copy-rule-btn,
.wiki-section-card:hover .copy-rule-btn {
    opacity: 1;
}

.copy-rule-btn:hover {
    color: var(--neon-cyan, #00e5ff);
    background: rgba(0, 229, 255, 0.12);
}

.copy-rule-btn.copied {
    color: #10b981;
}

/* ==========================================================================
   ELEMENTOS ADICIONALES DE REGLAMENTO (BANNERS, SANCIONES, CALLOUTS)
   ========================================================================== */
.reglamento-banner-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, rgba(255, 42, 133, 0.12) 0%, rgba(121, 40, 202, 0.14) 100%);
    border: 1px solid rgba(255, 42, 133, 0.3);
    border-radius: 14px;
    padding: 16px 22px;
    margin: 22px 0 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    text-decoration: none;
    color: #ffffff;
    transition: all 0.25s ease;
}

.reglamento-banner-link:hover {
    border-color: var(--neon-pink, #ff6faa);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px -5px rgba(255, 42, 133, 0.3);
}

.reglamento-banner-link .banner-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reglamento-banner-link .banner-desc {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.4;
}

.reglamento-banner-link .banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ff2a85 0%, #7928ca 100%);
    color: #ffffff;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 0 15px -3px rgba(255, 42, 133, 0.4);
}

/* Tarjetas del Régimen de Sanciones */
.sanctions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.sanction-tier-card {
    background: rgba(13, 15, 24, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.sanction-tier-card:hover {
    transform: translateY(-3px);
}

.sanction-tier-card.tier-warn {
    border-top: 4px solid #fcd34d;
}

.sanction-tier-card.tier-temp {
    border-top: 4px solid #fb923c;
}

.sanction-tier-card.tier-heavy {
    border-top: 4px solid #f87171;
}

.sanction-tier-card.tier-perma {
    border-top: 4px solid #ef4444;
    background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.12) 0%, rgba(13, 15, 24, 0.9) 70%);
}

.sanction-tier-title {
    font-family: var(--font-display, Arial, sans-serif);
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.sanction-tier-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.55;
    margin-bottom: 12px;
}

.sanction-tier-examples {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.5;
}

.sanction-tier-examples strong {
    color: #ffffff;
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Callouts informativos */
.wiki-callout {
    border-radius: 12px;
    padding: 16px 20px;
    margin: 18px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.6;
    backdrop-filter: blur(10px);
}

.wiki-callout-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.wiki-callout.warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

.wiki-callout.warning strong {
    color: #fbbf24;
}

.wiki-callout.danger {
    background: rgba(239, 68, 68, 0.09);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fecaca;
}

.wiki-callout.danger strong {
    color: #f87171;
}

.wiki-callout.info {
    background: rgba(0, 229, 255, 0.07);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: #bae6fd;
}

.wiki-callout.info strong {
    color: var(--neon-cyan, #00e5ff);
}

/* Tablas */
.wiki-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 229, 255, 0.3) transparent;
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
    background: rgba(13, 15, 24, 0.85);
}

.wiki-table th {
    background: rgba(22, 27, 46, 0.95);
    color: var(--neon-cyan, #00e5ff);
    font-family: var(--font-display, Arial, sans-serif);
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 11.5px;
    padding: 14px 18px;
    border-bottom: 1.5px solid rgba(0, 229, 255, 0.25);
    white-space: nowrap;
}

.wiki-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    line-height: 1.5;
}

.wiki-table tr:last-child td {
    border-bottom: none;
}

.wiki-table tr:hover td {
    background: rgba(255, 42, 133, 0.04);
    color: #ffffff;
}

/* Bloque de código / comandos */
.code-box {
    background: #090b12;
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 12px;
    padding: 20px 24px;
    font-family: var(--font-mono, monospace);
    font-size: 13.5px;
    color: #ffffff;
    margin: 18px 0;
    line-height: 1.8;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.code-box .cmd {
    color: var(--neon-cyan, #00e5ff);
    font-weight: 700;
}

.code-box .comment {
    color: #64748b;
    display: block;
    margin-bottom: 6px;
}

.code-box .desc {
    color: #cbd5e1;
}

/* Toast flotante */
.wiki-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(13, 15, 24, 0.95);
    color: #ffffff;
    border: 1.5px solid var(--neon-cyan, #00e5ff);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.4);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(15px);
}

.wiki-toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

mark.wiki-highlight {
    background: rgba(255, 42, 133, 0.35);
    color: #ffffff;
    padding: 1px 4px;
    border-radius: 3px;
}
