/* Extracted legacy CSS from modules/rules.php. Theme overrides load after this file. */

:root {
    --gold-bright: var(--bw-gold);
    --gold-mid: var(--bw-gold-dim);
    --gold-dark: var(--bw-gold-dim);
    --gold-dim: rgba(77, 147, 201,.25);
    --crimson: #C84747;
    --crimson-bg: rgba(200,71,71,.12);
    --amber: var(--bw-gold-dim);
    --amber-bg: rgba(61, 146, 211,.1);
    --parchment: var(--bw-gold-bright);
    --parchment-dim: rgba(181, 212, 235,.7);
    --ink: #2C1A0A;
    --bg-deep: rgba(4,10,20,.97);
    --bg-card: rgba(8,20,38,.92);
    --bg-section: rgba(4,14,28,.9);
    --border-gold: rgba(77, 147, 201,.5);
    --border-gold-bright: rgba(77, 147, 201,.85);
}

#muonline-rules-root {
    background: transparent;
    padding: 24px 0;
    font-family: 'Crimson Pro', Georgia, serif;
}

/* === MAIN CARD === */
.rc-wrap {
    max-width: 860px;
    margin: 0 auto;
    position: relative;
}
.rc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--bw-radius);
    box-shadow:
        0 0 0 1px rgba(0,0,0,.8),
        0 8px 40px rgba(0,0,0,.7),
        inset 0 1px 0 rgba(77, 147, 201,.15);
    overflow: hidden;
}

/* === CORNER ORNAMENTS === */
.rc-corner {
    position: absolute;
    width: 22px;
    height: 22px;
    z-index: 2;
    pointer-events: none;
}
.rc-corner--tl { top: -1px; left: -1px; }
.rc-corner--tr { top: -1px; right: -1px; transform: scaleX(-1); }
.rc-corner--bl { bottom: -1px; left: -1px; transform: scaleY(-1); }
.rc-corner--br { bottom: -1px; right: -1px; transform: scale(-1,-1); }

/* === HEADER === */
.rc-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(180deg, rgba(2,5,10,.95) 0%, rgba(5,15,30,.9) 100%);
    border-bottom: 1px solid var(--border-gold-bright);
}
.rc-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-mid), var(--gold-bright), var(--gold-mid), transparent);
    opacity: .5;
}
.rc-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}
.rc-title-icon {
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(77, 147, 201,.6));
}
.rc-title-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.rc-title-label {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-dark);
    line-height: 1;
}
.rc-title-main {
    font-family: 'Cinzel', serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-bright);
    text-shadow: 0 0 20px rgba(107, 176, 229,.35);
    line-height: 1;
}

/* === HEADER DIVIDER === */
.rc-hdiv {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    max-width: 60px;
}
.rc-hdiv-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-gold));
}

/* === BUTTONS === */
.rc-btn-row { display: flex !important; gap: 7px !important; flex-wrap: wrap !important; }
.rc-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px 14px !important;
    border-radius: var(--bw-radius) !important;
    border-style: solid !important;
    border-width: 1px !important;
    font-family: 'Cinzel', serif !important;
    font-weight: 600 !important;
    font-size: 10px !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: filter .2s ease, box-shadow .2s ease !important;
    position: relative !important;
    overflow: hidden !important;
    outline: none !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}
.rc-btn:focus { outline: none !important; box-shadow: none !important; }
.rc-btn:hover { filter: brightness(1.15) !important; text-decoration: none !important; }
.rc-btn:active { filter: brightness(.9) !important; }
.rc-btn:disabled { opacity: .5 !important; cursor: not-allowed !important; pointer-events: none !important; }

.rc-btn-gold {
    background: linear-gradient(160deg, var(--bw-gold) 0%, var(--bw-muted) 60%, var(--bw-muted) 100%) !important;
    border-color: var(--bw-gold-dim) !important;
    color: #1A0C00 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.5), inset 0 1px 0 rgba(122, 185, 233,.2) !important;
    text-shadow: 0 1px 0 rgba(104, 176, 231,.2) !important;
}
.rc-btn-gold:hover { color: #1A0C00 !important; }

.rc-btn-ghost {
    background: linear-gradient(160deg, rgba(8,28,50,.9) 0%, rgba(4,14,30,.95) 100%) !important;
    border-color: rgba(60, 122, 170,.6) !important;
    color: var(--gold-mid) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.4) !important;
}
.rc-btn-ghost:hover { border-color: var(--gold-bright) !important; color: var(--gold-bright) !important; }

.rc-btn-success {
    background: linear-gradient(160deg, #3a7025 0%, #265018 60%, #1a3a10 100%) !important;
    border-color: #3a8020 !important;
    color: #B8E898 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.5), inset 0 1px 0 rgba(120,220,80,.1) !important;
}
.rc-btn-success:hover { color: #C8F8A8 !important; }

.rc-btn-danger {
    background: linear-gradient(160deg, #7a2020 0%, #581414 60%, #3e0e0e 100%) !important;
    border-color: #8a2828 !important;
    color: #F0B0B0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.5), inset 0 1px 0 rgba(220,80,80,.1) !important;
}
.rc-btn-danger:hover { color: #FFCCCC !important; }

.rc-btn-icon { font-size: 12px !important; line-height: 1 !important; }

/* === BODY === */
.rc-body {
    padding: 24px 26px 28px;
    background: linear-gradient(180deg, rgba(4,12,24,.95) 0%, rgba(2,8,18,.98) 100%);
    min-height: 280px;
}

/* === RENDERED VIEW === */
.rc-rules-rendered { display: flex; flex-direction: column; gap: 0; }

/* Chapter (■ lines) */
.rc-chapter {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 0 10px;
    position: relative;
}
.rc-chapter:first-child { padding-top: 4px; }
.rc-chapter-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(50, 118, 170,.25), rgba(15,70,100,.2));
    border: 1px solid var(--border-gold);
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-bright);
    flex-shrink: 0;
    position: relative;
}
.rc-chapter-num::before, .rc-chapter-num::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background: var(--gold-mid);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.rc-chapter-num::before { top: -3px; left: 50%; transform: translateX(-50%); }
.rc-chapter-num::after { bottom: -3px; left: 50%; transform: translateX(-50%); }

.rc-chapter-title {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 16px rgba(107, 176, 229,.2);
    flex: 1;
}
.rc-chapter-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-gold), transparent);
    max-width: 180px;
}

/* Rule block */
.rc-rule-block {
    margin-left: 46px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Sub-rule header (numbered) */
.rc-sub-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 0 3px;
}
.rc-sub-num {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--gold-mid);
    min-width: 22px;
    flex-shrink: 0;
}
.rc-sub-title {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--parchment);
    letter-spacing: .4px;
}

/* Plain rule text */
.rc-rule-text {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 15.5px;
    color: rgba(175, 203, 226,.82);
    line-height: 1.65;
    padding: 1px 0 1px 0;
    font-weight: 300;
}

/* Violation (✖) */
.rc-violation {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--crimson-bg);
    border-left: 2px solid var(--crimson);
    padding: 7px 12px 7px 10px;
    margin: 3px 0;
    border-radius: var(--bw-radius);
}
.rc-violation-icon {
    color: var(--crimson);
    font-size: 13px;
    line-height: 1.5;
    flex-shrink: 0;
    font-weight: 700;
}
.rc-violation-text {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 14.5px;
    color: rgba(255,160,160,.88);
    line-height: 1.55;
    font-style: italic;
}

/* Warning (△) */
.rc-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--amber-bg);
    border-left: 2px solid var(--amber);
    padding: 7px 12px 7px 10px;
    margin: 3px 0;
    border-radius: var(--bw-radius);
}
.rc-warning-icon {
    color: var(--amber);
    font-size: 13px;
    line-height: 1.5;
    flex-shrink: 0;
}
.rc-warning-text {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 14.5px;
    color: rgba(255,200,120,.88);
    line-height: 1.55;
    font-style: italic;
}

/* Separator between chapters */
.rc-sep {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
    margin: 14px 0 2px;
    opacity: .5;
}

/* Ornament center */
.rc-sep-orn {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 4px;
    justify-content: center;
}
.rc-sep-orn-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-gold));
}
.rc-sep-orn-line:last-child { background: linear-gradient(90deg, var(--border-gold), transparent); }
.rc-sep-orn-diamond {
    width: 6px;
    height: 6px;
    background: var(--gold-mid);
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* === TEXTAREA (edit mode) === */
.rc-textarea-wrap {
    position: relative;
}
.rc-textarea-label {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin-bottom: 8px;
    display: block;
}
.rc-textarea {
    width: 100%;
    height: 420px;
    padding: 16px;
    background: rgba(2,6,12,.9);
    color: var(--parchment);
    border: 1px solid var(--border-gold);
    border-radius: var(--bw-radius);
    outline: none;
    resize: vertical;
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 15px;
    line-height: 1.7;
    box-sizing: border-box;
    transition: border-color .2s;
}
.rc-textarea:focus { border-color: var(--gold-bright); }
.rc-textarea::placeholder { color: rgba(86, 136, 174,.4); }
.rc-textarea-hint {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 13px;
    color: rgba(86, 136, 174,.5);
    margin-top: 10px;
    font-style: italic;
}
.rc-textarea-hint span { color: var(--gold-dark); font-style: normal; }

/* === ERROR / TOAST === */
.rc-error {
    background: rgba(200,71,71,.12);
    border: 1px solid rgba(200,71,71,.5);
    border-radius: var(--bw-radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #FF8080;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}
@keyframes rcToastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Spin */
@keyframes rc-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.rc-spin { display: inline-block; animation: rc-spin .9s linear infinite; }

/* Loading pulse */
.rc-loading-line {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-mid), transparent);
    background-size: 200% 100%;
    animation: rc-shimmer 1.4s infinite;
    border-radius: var(--bw-radius);
    margin-bottom: 20px;
}
@keyframes rc-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
