/* =====================
   v2.0.12 - Guía de reglas sincronizada
   ===================== */
.rules-view {
    scroll-behavior: smooth;
}

.rules-head {
    border-color: rgba(56, 189, 248, 0.28);
}

.rules-head h2 {
    margin-bottom: 6px;
}

.rules-head-actions {
    justify-content: flex-end;
}

.rules-intro-panel {
    margin-bottom: 18px;
    border-color: rgba(245, 158, 11, 0.28);
}

.rules-intro-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.rules-intro-grid article {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.72));
}

.rules-intro-grid h3,
.rules-intro-grid p {
    margin: 6px 0 0;
}

.rules-kicker {
    display: inline-flex;
    align-items: center;
    width: max-content;
    border: 1px solid rgba(245, 158, 11, 0.42);
    border-radius: 999px;
    padding: 4px 9px;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.10);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rules-tools {
    display: grid;
    grid-template-columns: minmax(260px, 420px) 1fr;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
}

.rules-search-label {
    display: grid;
    gap: 8px;
    color: #cbd5e1;
    font-weight: 800;
}

.rules-search-label input {
    width: 100%;
}

.rules-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rules-chip {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(30, 41, 59, 0.92);
    color: #dbeafe;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 0.86rem;
}

.rules-chip.active {
    border-color: rgba(56, 189, 248, 0.72);
    background: rgba(56, 189, 248, 0.16);
    color: #e0f2fe;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08);
}

.rules-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.rules-index {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rules-index h3 {
    margin: 0 0 8px;
}

.rules-index a {
    color: #bfdbfe;
    text-decoration: none;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.55);
    font-weight: 700;
}

.rules-index a:hover {
    border-color: rgba(245, 158, 11, 0.48);
    color: #fef3c7;
}

.rules-content {
    display: grid;
    gap: 18px;
}

.rules-card {
    overflow: hidden;
}

.rules-card.is-filtered-out {
    display: none;
}

.rules-card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.rules-card-head h3,
.rules-card-head p {
    margin: 0;
}

.rules-card-head p,
.rules-point p,
.rules-combat-grid p,
.rules-don-grid p,
.rules-resolution-list span,
.rules-zone-grid span,
.rules-anatomy-list span,
.rules-empty-state p,
.rules-timeline span,
.rules-callout span {
    color: var(--muted);
    line-height: 1.5;
}

.rules-number {
    min-width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(239, 68, 68, 0.86));
    color: #fff7ed;
    font-weight: 1000;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

.rules-columns,
.rules-combat-grid,
.rules-zone-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.rules-point,
.rules-combat-grid article,
.rules-zone-grid div,
.rules-don-grid article,
.rules-resolution-list div,
.rules-anatomy-list div,
.rules-empty-state {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    padding: 13px;
    background: rgba(15, 23, 42, 0.48);
}

.rules-point strong,
.rules-zone-grid strong,
.rules-don-grid strong,
.rules-resolution-list strong,
.rules-anatomy-list strong,
.rules-empty-state strong {
    display: block;
    color: #fef3c7;
    margin-bottom: 5px;
}

.rules-zone-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rules-zone-grid div span,
.rules-resolution-list div span,
.rules-anatomy-list div span {
    display: block;
}

.rules-anatomy {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.rules-card-example {
    min-height: 460px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(245, 158, 11, 0.30);
    border-radius: 20px;
    padding: 16px;
    background:
        radial-gradient(circle at 50% 10%, rgba(245, 158, 11, 0.12), transparent 42%),
        linear-gradient(180deg, rgba(30, 41, 59, 0.76), rgba(2, 6, 23, 0.78));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.rules-card-example > .cg-template-runtime,
.rules-card-example > .detail-template-card,
.rules-card-example .rules-example-card {
    width: min(100%, 360px);
    max-width: 360px;
    margin: 0 auto;
}

.rules-card-example .cg-template-runtime-actions,
.rules-card-example .detail-template-actions {
    display: none;
}

.rules-card-example-placeholder {
    width: 100%;
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px dashed rgba(148, 163, 184, 0.30);
    border-radius: 16px;
    padding: 18px;
    color: var(--muted);
    text-align: center;
    background: rgba(15, 23, 42, 0.45);
}

.rules-card-example-placeholder strong {
    color: #fef3c7;
}

.rules-card-example-placeholder span {
    line-height: 1.5;
}

.rules-anatomy-list,
.rules-resolution-list {
    display: grid;
    gap: 10px;
}

.rules-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
    counter-reset: phase;
}

.rules-timeline li {
    counter-increment: phase;
    display: grid;
    grid-template-columns: 48px minmax(130px, 220px) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.48);
}

.rules-timeline li::before {
    content: counter(phase);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(56, 189, 248, 0.14);
    color: #bae6fd;
    border: 1px solid rgba(56, 189, 248, 0.38);
    font-weight: 1000;
}

.rules-timeline strong {
    color: #fef3c7;
}

.rules-callout {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    border: 1px solid rgba(56, 189, 248, 0.26);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(56, 189, 248, 0.08);
}

.rules-callout strong {
    color: #bae6fd;
    white-space: nowrap;
}

.rules-combat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rules-combat-grid h4 {
    margin: 0 0 8px;
    color: #fde68a;
}

.rules-don-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.rules-don-grid article {
    min-height: 128px;
}

.rules-don-entry-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}

.rules-don-entry-head strong {
    margin: 0;
}

.rules-don-entry-head .card-state-badge {
    flex: 0 0 auto;
}

.rules-don-entry p {
    margin: 0;
}

.rules-no-results {
    border-color: rgba(245, 158, 11, 0.32);
    color: #fde68a;
    text-align: center;
    font-weight: 800;
}

.rules-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.rules-video-card {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.48);
}

.rules-video-media {
    aspect-ratio: 16 / 9;
    background: rgba(2, 6, 23, 0.74);
}

.rules-video-media iframe,
.rules-video-media video {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.rules-video-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
}

.rules-video-body {
    padding: 13px;
}

.rules-video-body strong {
    display: block;
    color: #fef3c7;
    margin-bottom: 6px;
}

.rules-video-body strong span {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    border: 1px solid rgba(245, 158, 11, 0.42);
    border-radius: 999px;
    padding: 2px 7px;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.10);
    font-size: 0.72rem;
}

.rules-video-body p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

body.auth-locked #rules.view.active {
    display: block !important;
    width: min(1320px, 100%);
}

body.auth-locked #account.view.active {
    display: block !important;
    width: min(1080px, 100%);
}

body.auth-locked #account.view:not(.active),
body.auth-locked #rules.view:not(.active) {
    display: none !important;
}

body.auth-locked #rules .rules-head-actions .secondary[data-go="duel"] {
    display: none;
}

@media (max-width: 1180px) {
    .rules-layout,
    .rules-anatomy,
    .rules-tools {
        grid-template-columns: 1fr;
    }

    .rules-index {
        position: static;
    }

    .rules-index {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    }

    .rules-index h3 {
        grid-column: 1 / -1;
    }

    .rules-intro-grid,
    .rules-columns,
    .rules-zone-grid,
    .rules-combat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .rules-intro-grid,
    .rules-columns,
    .rules-zone-grid,
    .rules-combat-grid {
        grid-template-columns: 1fr;
    }

    .rules-card-head {
        flex-direction: column;
    }

    .rules-card-example {
        min-height: 380px;
        padding: 10px;
    }

    .rules-callout {
        display: grid;
    }

    .rules-callout strong {
        white-space: normal;
    }

    .rules-timeline li {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .rules-timeline span {
        grid-column: 2;
    }
}

.account-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

body.auth-locked .account-head-actions {
    justify-content: center;
}
