﻿/* Official Rule Book (Tools) */

.rbk-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    background: rgba(5, 8, 13, .72);
    backdrop-filter: blur(4px);
}

    .rbk-overlay.active {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem;
    }

.rbk-shell {
    width: min(1060px, 100%);
    height: min(760px, 100%);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid var(--border-default, #2a3140);
    background: var(--bg-surface, #10141c);
    overflow: hidden;
}

.rbk-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--border-default, #2a3140);
}

    .rbk-head h2 {
        margin: 0;
        font-size: 1.02rem;
        white-space: nowrap;
    }

.rbk-tabs {
    display: flex;
    gap: .35rem;
    flex: 1;
    overflow-x: auto;
}

.rbk-tab {
    padding: .3rem .75rem;
    border-radius: 999px;
    border: 1px solid var(--border-default, #2a3140);
    background: transparent;
    color: var(--text-secondary, #9aa3b2);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

    .rbk-tab.active {
        background: var(--accent-blue, #4e8dff);
        border-color: var(--accent-blue, #4e8dff);
        color: #fff;
    }

.rbk-close {
    border: none;
    background: transparent;
    color: var(--text-secondary, #9aa3b2);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.rbk-searchbar {
    display: flex;
    gap: .6rem;
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border-default, #2a3140);
}

    .rbk-searchbar input[type="search"] {
        flex: 1;
        padding: .5rem .75rem;
        border-radius: 10px;
        border: 1px solid var(--border-default, #2a3140);
        background: var(--bg-elevated, #151a23);
        color: var(--text-primary, #e8ecf3);
        font-size: .88rem;
    }

.rbk-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.rbk-side {
    width: 280px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border-default, #2a3140);
    padding: .6rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rbk-side__section {
    margin: .6rem .4rem .2rem;
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-tertiary, #6b7382);
}

.rbk-side__item {
    text-align: left;
    padding: .45rem .6rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, #9aa3b2);
    font-size: .84rem;
    cursor: pointer;
}

    .rbk-side__item:hover {
        background: rgba(255, 255, 255, .04);
        color: var(--text-primary, #e8ecf3);
    }

    .rbk-side__item.active {
        background: rgba(78, 141, 255, .14);
        color: var(--accent-blue, #4e8dff);
        font-weight: 700;
    }

.rbk-side__hit {
    text-align: left;
    padding: .5rem .6rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

    .rbk-side__hit:hover {
        background: rgba(255, 255, 255, .04);
    }

.rbk-side__hit-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-primary, #e8ecf3);
}

.rbk-side__hit-snip {
    font-size: .72rem;
    line-height: 1.35;
    color: var(--text-tertiary, #6b7382);
}

.rbk-reader {
    flex: 1;
    overflow-y: auto;
    padding: 1.1rem 1.4rem;
}

.rbk-doc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .8rem;
}

    .rbk-doc-head h3 {
        margin: 0;
        font-size: 1.15rem;
    }

.rbk-doc-section {
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--accent-blue, #4e8dff);
}

.rbk-doc-admin {
    display: flex;
    gap: .4rem;
    flex-shrink: 0;
}

.rbk-doc-body p {
    margin: 0 0 .85rem;
    font-size: .92rem;
    line-height: 1.65;
    color: var(--text-primary, #e8ecf3);
}

.rbk-doc-body mark,
.rbk-side__hit-snip mark {
    background: rgba(232, 195, 60, .35);
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
}

.rbk-updated {
    margin-top: 1.2rem;
    font-size: .72rem;
    color: var(--text-tertiary, #6b7382);
}

.rbk-empty {
    padding: 1.4rem;
    font-size: .85rem;
    color: var(--text-tertiary, #6b7382);
}

/* Admin editor */
.rbk-editor {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    height: 100%;
}

    .rbk-editor h3 {
        margin: 0;
    }

.rbk-editor__row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

    .rbk-editor__row input {
        flex: 1 1 180px;
        padding: .5rem .65rem;
        border-radius: 8px;
        border: 1px solid var(--border-default, #2a3140);
        background: var(--bg-elevated, #151a23);
        color: var(--text-primary, #e8ecf3);
        font-size: .86rem;
    }

.rbk-editor textarea {
    flex: 1;
    min-height: 300px;
    resize: vertical;
    padding: .7rem .8rem;
    border-radius: 10px;
    border: 1px solid var(--border-default, #2a3140);
    background: var(--bg-elevated, #151a23);
    color: var(--text-primary, #e8ecf3);
    font-size: .86rem;
    line-height: 1.55;
    font-family: inherit;
}

.rbk-editor__actions {
    display: flex;
    gap: .5rem;
}

@media (max-width: 720px) {
    .rbk-overlay.active {
        padding: 0;
    }

    .rbk-shell {
        border-radius: 0;
        height: 100%;
    }

    .rbk-side {
        width: 200px;
    }
}
