﻿:root {
    --bg-main: rgba(30, 30, 30, 0.93);
    --bg-soft: rgba(44, 44, 44, 0.74);
    --bg-darker: rgba(25, 25, 25, 0.95);
    --bg-plugins: rgba(28, 28, 35, 0.93);
    --line: rgba(138, 138, 138, 0.24);
    --line-strong: rgba(182, 182, 182, 0.45);
    --text-main: #dddddd;
    --text-soft: #bebebe;
    --text-muted: #989898;

    --color-rules: #8b6bb8;
    --color-rules-light: #a78bca;
    --color-rules-dark: #6d4c9e;
    --color-objects: #7b5ba8;
    --color-plugins: #6d4c9e;

    --color-sci: #edc759;
    --color-classd: #f6b26b;
    --color-teches: #ce776e;
    --color-adm: #ea9999;
    --color-med: #ffb3b3;
    --color-security: #858585;
    --color-mog: #6d9eeb;
    --color-chaos: #6aa84f;
    --color-serpents: #487348;

    --color-safe: #59a85a;
    --color-euclid: #d3ab57;
    --color-keter: #c55e5e;

    --highlight-bg: rgba(139, 107, 184, 0.25);
    --highlight-border: rgba(139, 107, 184, 0.5);
    --highlight-text: #c9a8e8;

    --navbar-h: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.top-tabs {
    background: rgba(20, 20, 20, 0.95);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
    margin: 0 16px 20px;
    border-radius: 12px;
}

.top-tabs-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 4px;
    padding: 10px 20px;
    justify-content: center;
}

.tab-btn {
    display: flex;
    align-items: center;
    padding: 12px 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.tab-btn:hover {
    background: rgba(139, 107, 184, 0.2);
    color: var(--color-rules-light);
}

.tab-btn.active {
    background: rgba(139, 107, 184, 0.3);
    color: var(--color-rules-light);
}

.rules-page {
    padding-top: 0;
    min-height: 100vh;
}

.shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

@keyframes sectionSlideRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes sectionSlideLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-enter-right {
    animation: sectionSlideRight 0.35s ease forwards;
}

.section-enter-left {
    animation: sectionSlideLeft 0.35s ease forwards;
}

.section-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    background: var(--bg-main);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-layout--full {
    grid-template-columns: 1fr;
    background: var(--bg-darker);
}

.side-nav {
    position: sticky;
    top: calc(var(--navbar-h) + 20px);
    align-self: start;
    max-height: calc(100vh - var(--navbar-h) - 40px);
    overflow-y: auto;
}

.side-nav-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}

.side-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-group {
    margin-bottom: 12px;
}

.nav-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(139, 107, 184, 0.15);
    color: var(--color-rules-light);
}

.nav-link--section {
    font-weight: 600;
    color: var(--color-rules-light);
    margin-bottom: 4px;
}

.nav-sublist {
    list-style: none;
    padding-left: 12px;
}

.nav-link--rule {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.nav-sublist--deep {
    padding-left: 14px;
}

.nav-link--subrule {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.85;
    padding: 4px 12px;
}

.edge-bar {
    position: fixed;
    top: 50%;
    z-index: 500;
    padding: 24px 10px;
    cursor: pointer;
    border: 1px solid var(--line);
    background: rgba(20, 20, 20, 0.92);
    backdrop-filter: blur(6px);
    color: var(--color-rules-light);
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.25s ease;
    pointer-events: none;
    opacity: 0;
}

.edge-bar.visible {
    opacity: 1;
    pointer-events: auto;
}

.edge-bar:hover {
    background: rgba(139, 107, 184, 0.25);
    border-color: var(--color-rules);
}

.edge-bar--left {
    left: 0;
    border-left: none;
    border-radius: 0 10px 10px 0;
    transform: translateY(-50%);
}

.edge-bar--left:hover {
    padding-left: 6px;
}

.edge-bar--right {
    right: 0;
    border-right: none;
    border-radius: 10px 0 0 10px;
    transform: translateY(-50%);
}

.edge-bar--right:hover {
    padding-right: 6px;
}

.edge-bar-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 0.72rem;
}

.edge-bar--left .edge-bar-text {
    transform: rotate(180deg);
}

.edge-bar-arrow {
    font-size: 1.2rem;
    line-height: 1;
}

.search-bar-wrapper {
    position: sticky;
    top: var(--navbar-h);
    z-index: 100;
    margin-bottom: 24px;
}

.search-bar {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(40, 40, 40, 0.95);
    border: 1px solid var(--line);
    border-radius: 6px;
    backdrop-filter: blur(8px);
}

.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.search-input {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-family: 'Manrope', sans-serif;
    font-size: 0.92rem;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-count {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--color-rules-light);
    min-width: 70px;
    text-align: center;
}

.search-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    background: rgba(139, 107, 184, 0.2);
    color: var(--color-rules-light);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: rgba(139, 107, 184, 0.35);
    border-color: var(--color-rules);
}

.search-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.search-bar--plugins {
    border-color: rgba(109, 76, 158, 0.4);
}

.search-bar--plugins .search-count {
    color: var(--color-plugins);
}

.search-bar--plugins .search-btn {
    background: rgba(109, 76, 158, 0.25);
    color: var(--color-plugins);
    border-color: rgba(109, 76, 158, 0.3);
}

.search-bar--plugins .search-btn:hover {
    background: rgba(109, 76, 158, 0.4);
    border-color: var(--color-plugins);
}

.rules-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.rule-section {
    scroll-margin-top: calc(var(--navbar-h) + 30px);
}

.rule-section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--color-rules-light);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-rules-dark);
    margin-bottom: 20px;
}

.rule-block {
    scroll-margin-top: calc(var(--navbar-h) + 30px);
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(35, 35, 35, 0.5);
    border: 1px solid var(--line);
    border-left: 3px solid var(--color-rules);
    border-radius: 6px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.rule-block.highlight {
    background: var(--highlight-bg);
    border-color: var(--highlight-border);
}

.rule-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-rules-light);
    margin-bottom: 12px;
}

.rule-body {
    color: var(--text-soft);
    line-height: 1.75;
    font-size: 0.95rem;
}

.rule-body p {
    margin-bottom: 12px;
}

.rule-body ul, .rule-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.rule-body li {
    margin-bottom: 6px;
}

.rule-body i, .rule-body em {
    color: var(--text-muted);
}

.highlight-match {
    background: var(--highlight-bg);
    color: var(--highlight-text);
    padding: 1px 4px;
    border-radius: 2px;
    box-shadow: 0 0 4px rgba(139, 107, 184, 0.3);
}

.sub-rules {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}

.sub-rule {
    scroll-margin-top: calc(var(--navbar-h) + 30px);
    margin-top: 12px;
    padding: 12px;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 4px;
    border-left: 2px solid var(--color-rules-dark);
}

.sub-rule-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-rules-light);
    margin-bottom: 8px;
}

.sub-rule-body {
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.65;
}

.briefing-section {
    scroll-margin-top: calc(var(--navbar-h) + 30px);
    margin-top: 8px;
}

.briefing-section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--color-rules-light);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-rules-dark);
    margin-bottom: 20px;
}

.briefing-card {
    display: block;
    text-decoration: none;
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(35, 35, 35, 0.5);
    border: 1px solid var(--line);
    border-left: 3px solid var(--color-rules);
    border-radius: 6px;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

.briefing-card:hover {
    background: rgba(139, 107, 184, 0.15);
    border-color: var(--color-rules);
    transform: translateX(4px);
}

.briefing-card .rule-title {
    color: var(--color-rules-light);
    margin-bottom: 0;
}

.cards-section {
    margin-bottom: 32px;
}

.cards-section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--color-objects);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 156px);
    gap: 14px;
    justify-content: center;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card {
    width: 156px;
    min-height: 218px;
    background: rgba(50, 50, 50, 0.88);
    border: 1px solid #4a4a4a;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 9px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.24);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card-link:hover .card {
    transform: translateY(-4px);
    box-shadow: 0 0 22px -4px var(--glow), 0 8px 20px rgba(0, 0, 0, 0.35);
    border-color: var(--card-color);
}

.card-link:hover .card-title {
    text-shadow: 0 0 12px var(--card-color);
}

.card-link:hover .card-image-box {
    border-color: var(--card-color);
    box-shadow: 0 0 14px -3px var(--glow);
}

.card--faction {
    --card-color: var(--faction-color);
    --glow: var(--faction-glow);
}

.card--sci {
    --faction-color: var(--color-sci);
    --faction-glow: rgba(237, 199, 89, 0.3);
}

.card--classd {
    --faction-color: var(--color-classd);
    --faction-glow: rgba(246, 178, 107, 0.3);
}

.card--teches {
    --faction-color: var(--color-teches);
    --faction-glow: rgba(206, 119, 110, 0.3);
}

.card--adm {
    --faction-color: var(--color-adm);
    --faction-glow: rgba(234, 153, 153, 0.3);
}

.card--med {
    --faction-color: var(--color-med);
    --faction-glow: rgba(255, 179, 179, 0.3);
}

.card--security {
    --faction-color: var(--color-security);
    --faction-glow: rgba(133, 133, 133, 0.3);
}

.card--mog {
    --faction-color: var(--color-mog);
    --faction-glow: rgba(109, 158, 235, 0.3);
}

.card--chaos {
    --faction-color: var(--color-chaos);
    --faction-glow: rgba(106, 168, 79, 0.3);
}

.card--serpents {
    --faction-color: var(--color-serpents);
    --faction-glow: rgba(72, 115, 72, 0.3);
}

.card--scp {
    --card-color: var(--scp-color);
    --glow: var(--scp-glow);
}

.card--safe {
    --scp-color: var(--color-safe);
    --scp-glow: rgba(89, 168, 90, 0.3);
}

.card--euclid {
    --scp-color: var(--color-euclid);
    --scp-glow: rgba(211, 171, 87, 0.3);
}

.card--keter {
    --scp-color: var(--color-keter);
    --scp-glow: rgba(197, 94, 94, 0.3);
}

.card-top-tag {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: #cfcfcf;
    border: 1px solid rgba(145, 145, 145, 0.35);
    border-radius: 3px;
    padding: 2px 6px;
    width: fit-content;
    margin: 0 auto;
    background: rgba(73, 73, 73, 0.32);
}

.card-image-box {
    width: 102px;
    height: 102px;
    margin: 0 auto;
    border-radius: 8px;
    border: 2px solid rgba(110, 110, 110, 0.75);
    background: rgba(30, 30, 30, 0.76);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.card-image-box > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card--scp .card-image-box {
    border-width: 3px;
    perspective: 600px;
}

.card--scp .front, .card--scp .back {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    backface-visibility: hidden;
    transition: transform 0.5s ease;
    border-radius: 6px;
}

.card--scp .front {
    transform: rotateY(0deg);
    z-index: 1;
}

.card--scp .back {
    transform: rotateY(180deg);
    z-index: 2;
}

.card-link:hover .card--scp .front {
    transform: rotateY(-180deg);
}

.card-link:hover .card--scp .back {
    transform: rotateY(0deg);
}

.card-title {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.34;
    color: var(--card-color, #dddddd);
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: text-shadow 0.25s ease;
}

.filters-inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(40, 40, 40, 0.5);
    border-radius: 6px;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.chip {
    padding: 6px 12px;
    border: 1px solid var(--line);
    background: rgba(50, 50, 50, 0.5);
    color: var(--text-muted);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.chip:hover {
    background: rgba(139, 107, 184, 0.2);
    color: var(--color-rules-light);
}

.chip.active {
    background: rgba(139, 107, 184, 0.3);
    border-color: var(--color-rules);
    color: var(--color-rules-light);
}

.chip.safe.active {
    border-color: rgba(89, 168, 90, 0.64);
    color: var(--color-safe);
}

.chip.euclid.active {
    border-color: rgba(211, 171, 87, 0.64);
    color: var(--color-euclid);
}

.chip.keter.active {
    border-color: rgba(197, 94, 94, 0.64);
    color: var(--color-keter);
}

.scp-notes {
    display: flex;
    gap: 14px;
    margin: 0 auto 12px;
    align-items: flex-start;
    max-width: 900px;
    overflow: hidden;
}

.scp-note {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    background: rgba(35, 35, 35, 0.5);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    transition: flex 0.4s ease, opacity 0.35s ease, padding 0.35s ease, border-width 0.3s ease;
}

.scp-note.note-hidden {
    flex: 0 0 0;
    max-height: 0;
    min-width: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    border-width: 0;
    pointer-events: none;
    overflow: hidden;
}

.scp-note-header {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-objects);
    margin-bottom: 8px;
}

.scp-note-body {
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: break-word;
}

.scp-note-body ul {
    margin: 6px 0;
    padding-left: 20px;
}

.scp-note-body li {
    margin-bottom: 4px;
    color: var(--text-muted);
}

.plugins-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.plugin-section {
    scroll-margin-top: calc(var(--navbar-h) + 30px);
}

.plugin-section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--color-plugins);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-rules-dark);
    margin-bottom: 8px;
}

.plugin-section-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 16px;
}

.plugin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plugin-item {
    padding: 16px;
    background: rgba(35, 35, 35, 0.5);
    border: 1px solid var(--line);
    border-left: 3px solid var(--color-plugins);
    border-radius: 6px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.plugin-item.highlight {
    background: var(--highlight-bg);
    border-color: var(--highlight-border);
}

.plugin-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.plugin-desc {
    color: var(--text-soft);
    line-height: 1.65;
    font-size: 0.92rem;
}

.plugin-desc ul, .plugin-desc ol {
    margin: 8px 0;
    padding-left: 22px;
}

.plugin-desc li {
    margin-bottom: 4px;
    color: var(--text-soft);
}

.plugin-desc b, .plugin-desc strong {
    color: var(--text-main);
}

.plugin-desc i, .plugin-desc em {
    color: var(--text-muted);
}

.plugin-desc .cmd {
    font-family: 'Share Tech Mono', monospace;
    color: var(--color-rules-light);
    background: rgba(139, 107, 184, 0.12);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.88rem;
}

.plugin-desc .sub-ability {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(30, 30, 30, 0.4);
    border-radius: 4px;
    border-left: 2px solid var(--color-plugins-dark, #6d4c9e);
}

.plugin-desc .note-text {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 6px;
}

.empty-note {
    display: none;
    color: var(--text-muted);
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 20px 0;
    text-align: center;
}

.empty-note.show {
    display: block;
}

.hidden {
    display: none !important;
}

.side-nav::-webkit-scrollbar {
    width: 6px;
}

.side-nav::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.5);
    border-radius: 3px;
}

.side-nav::-webkit-scrollbar-thumb {
    background: rgba(139, 107, 184, 0.4);
    border-radius: 3px;
}

.side-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 107, 184, 0.6);
}

@media (max-width: 1024px) {
    .section-layout {
        grid-template-columns: 1fr;
    }

    .side-nav--left {
        display: none;
    }
}

@media (max-width: 768px) {
    .top-tabs-inner {
        padding: 6px 12px;
    }

    .tab-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .shell {
        padding: 0 12px 20px;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-nav {
        justify-content: center;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, 130px);
    }

    .rule-section-title, .plugin-section-title {
        font-size: 1.2rem;
    }

    .rule-block {
        padding: 12px;
    }

    .edge-bar {
        padding: 16px 6px;
    }

    .edge-bar-text {
        font-size: 0.65rem;
    }

    .scp-notes {
        flex-direction: column;
    }
}
