/* ============================================================================
   Rules — V0-faithful port of app/rules/page.tsx.

   Structure: glass panel (gold border, top shimmer, 4 corner ornaments) +
   centered header (gavel icon → "GAME RULES" gold-gradient title with
   horizontal-line backdrop → "Nexian — Official Server Rules" subtitle) +
   Shield divider + intro-warning panel + scroll-activated rules list.

   The rules-list items themselves are rendered by render_scroll_section()
   so their dim → highlight behavior is in scroll-section.css. This file
   only owns the OUTER chrome.
   ============================================================================ */

/* ─── Page shell ─────────────────────────────────────────────────────────── */
/*
 * Top padding 0 to match halloffame's baseline gap (shell's <main> already
 * provides the standard space below the navbar). Page only contributes
 * horizontal + bottom padding.
 */
.rules-page {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 0 1rem 5rem;
}
@media (min-width: 768px) {
    .rules-page { padding: 0 1.5rem 5rem; }
}

.rules-inner {
    max-width: 64rem;       /* V0 max-w-4xl */
    margin: 0 auto;
    width: 100%;
}

/* ─── Glass panel — same chrome as the Manual page ───────────────────────── */
.rules-panel {
    position: relative;
    border-radius: 1rem;
    background: linear-gradient(160deg, rgba(22,16,10,0.82) 0%, rgba(12,9,6,0.88) 100%);
    border: 1px solid rgba(212, 175, 55, 0.20);
    box-shadow:
        0 0 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(212, 175, 55, 0.10);
    /*
     * `overflow: visible` (not hidden) for the same reason the Manual modal
     * keeps overflow visible — any future tooltips / popovers can extend
     * past the panel without being clipped. The bg gradient + border still
     * follow the rounded corners automatically; the shimmer bars have their
     * own border-radius matching the panel.
     */
    overflow: visible;
}

.rules-panel-shimmer {
    position: absolute;
    inset-inline: 0;
    pointer-events: none;
}
.rules-panel-shimmer.top {
    top: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        #D4AF37 20%,
        #FFF8DC 50%,
        #D4AF37 80%,
        transparent 100%);
    box-shadow: 0 0 24px rgba(212, 175, 55, 0.7);
    border-top-right-radius: 1rem;
    border-top-left-radius: 1rem;
}

/* 4 corner ornaments — short L-shaped gold strokes 1rem inset. */
.rules-panel-corner {
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    pointer-events: none;
}
.rules-panel-corner.tl {
    top: 1rem; right: 1rem;
    border-top: 1px solid rgba(212, 175, 55, 0.35);
    border-right: 1px solid rgba(212, 175, 55, 0.35);
    border-top-right-radius: 4px;
}
.rules-panel-corner.tr {
    top: 1rem; left: 1rem;
    border-top: 1px solid rgba(212, 175, 55, 0.35);
    border-left: 1px solid rgba(212, 175, 55, 0.35);
    border-top-left-radius: 4px;
}
.rules-panel-corner.bl {
    bottom: 1rem; right: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    border-right: 1px solid rgba(212, 175, 55, 0.35);
    border-bottom-right-radius: 4px;
}
.rules-panel-corner.br {
    bottom: 1rem; left: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    border-left: 1px solid rgba(212, 175, 55, 0.35);
    border-bottom-left-radius: 4px;
}

.rules-panel-body {
    padding: 1.75rem 1.5rem 2rem;
}
@media (min-width: 768px) {
    .rules-panel-body { padding: 1.75rem 2.5rem 2rem; }
}

/* ─── Header (icon + GAME RULES title + subtitle) ────────────────────────── */
.rules-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.rules-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: #D4AF37;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

/*
 * Title block — has a darkened horizontal-fade backdrop with thin gold
 * lines top/bottom. Same pattern as the Manual page's "GAME MANUAL" title.
 */
.rules-title-block {
    display: inline-block;
    position: relative;
    padding: 0.75rem 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(8, 5, 2, 0.82) 28%,
        rgba(8, 5, 2, 0.88) 50%,
        rgba(8, 5, 2, 0.82) 72%,
        transparent 100%);
}
.rules-title-block::before,
.rules-title-block::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 175, 55, 0.28) 35%,
        rgba(212, 175, 55, 0.28) 65%,
        transparent 100%);
}
.rules-title-block::before { top: 0; }
.rules-title-block::after  { bottom: 0; }

.rules-title {
    position: relative;
    z-index: 1;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;           /* V0 text-2xl md:text-3xl */
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0;
    background: linear-gradient(180deg, #FFF8E7 0%, #F4E287 30%, #D4AF37 65%, #9A7515 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 14px rgba(212, 175, 55, 0.35));
}
@media (min-width: 768px) {
    .rules-title { font-size: 1.875rem; }
}

.rules-sub {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;             /* ≈ 14.4px actual */
    color: rgba(190, 170, 130, 0.75);
    margin: 0;
    line-height: 1.55;
}

/* ─── Shield divider ─────────────────────────────────────────────────────── */
.rules-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.rules-divider .line {
    flex: 1 1 0;
    max-width: 6rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3));
}
.rules-divider .line + .line {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.3), transparent);
}
.rules-divider .glyph {
    color: rgba(212, 175, 55, 0.4);
    display: inline-flex;
    align-items: center;
}

/* ─── Intro warning — gold left-border accented panel ────────────────────── */
.rules-intro {
    margin: 0 0 2rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: linear-gradient(160deg, rgba(32, 24, 12, 0.6) 0%, rgba(22, 16, 8, 0.7) 100%);
    border-right: 4px solid rgba(212, 175, 55, 0.6);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    border-left: 1px solid rgba(212, 175, 55, 0.1);
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    box-shadow:
        inset 0 1px 0 rgba(212, 175, 55, 0.06),
        0 4px 16px rgba(0, 0, 0, 0.2);
}
.rules-intro p {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;         /* ≈ 16.2px actual */
    line-height: 1.7;
    color: rgba(220, 200, 160, 0.92);
}

/* ─── Rules list spacing ─────────────────────────────────────────────────── */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
