/* ========================
   RIFT — inner.css
   Shared Inner Page Styles
   ======================== */

/* Active nav link */
.nav-links a.active {
    color: var(--text) !important;
}

/* Inner page layout */
.inner-main {
    padding-top: var(--nav-h);
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 5rem;
    position: relative;
    z-index: 1;
}

/* Page Header */
.page-header {
    padding: 3.5rem 0 2.5rem;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 2.5rem;
}

.page-header-inner {
    max-width: 680px;
}

.page-breadcrumb {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.page-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.page-breadcrumb a:hover {
    color: var(--primary-light);
}

.novel-crumb {
    color: var(--primary-light);
    font-weight: 600;
}

.page-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.page-sub {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

/* ========================
   CHARACTERS PAGE
   ======================== */
.controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.8rem 0.65rem 2.2rem;
    color: var(--text);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    transition: border-color var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
}

.search-input::placeholder {
    color: var(--text-dim);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    padding: 0.3rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.filter-btn.active,
.filter-btn:hover {
    background: rgba(196, 30, 58, 0.1);
    border-color: rgba(196, 30, 58, 0.3);
    color: var(--primary-light);
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
}

.view-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
    transition: all var(--transition);
}

.view-btn.active {
    background: rgba(196, 30, 58, 0.1);
    border-color: rgba(196, 30, 58, 0.3);
    color: var(--primary-light);
}

.results-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    letter-spacing: 0.03em;
}

/* Character Grid Full */
.char-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    transition: all var(--transition);
}

.char-grid-full.list-mode {
    grid-template-columns: 1fr;
}

/* Dynamically created cards — animate in immediately */
.char-card {
    animation: fadeUp 0.5s ease both;
}

.lore-card {
    animation: fadeUp 0.5s ease both;
}

.char-grid-full.list-mode .char-card {
    flex-direction: row;
    max-height: 130px;
}

.char-grid-full.list-mode .char-portrait {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    border-radius: var(--radius) 0 0 var(--radius);
}

.char-grid-full.list-mode .portrait-symbol {
    font-size: 2.5rem;
}

.char-grid-full.list-mode .char-powers {
    display: none;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-family: 'Cinzel', serif;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.no-results p {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform var(--transition);
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    z-index: 10;
    transition: all var(--transition);
}

.modal-close:hover {
    background: rgba(196, 30, 58, 0.1);
    color: var(--primary-light);
}

.modal-body {
    padding: 2rem;
}

.modal-portrait {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -2rem -2rem 2rem;
    border-radius: var(--radius) var(--radius) 0 0;
    position: relative;
    overflow: hidden;
}

.modal-portrait .portrait-symbol {
    font-size: 5rem;
    z-index: 1;
}

.modal-char-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.modal-char-name {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.modal-char-epithet {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.modal-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

.modal-bg {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.modal-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.modal-abilities {
    margin-bottom: 1.5rem;
}

.modal-key-moments {
    margin-bottom: 1.5rem;
}

.km-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.km-list li {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--primary);
    border-radius: 0 4px 4px 0;
}

.modal-relationships {
    margin-top: 1.5rem;
}

.rel-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rel-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.82rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
}

.rel-name {
    font-weight: 600;
    min-width: 80px;
}

.rel-type {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.rel-type.ally {
    background: rgba(45, 212, 191, 0.1);
    color: var(--teal);
}

.rel-type.enemy {
    background: rgba(196, 30, 58, 0.1);
    color: var(--primary-light);
}

.rel-type.complex {
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold);
}

.rel-note {
    color: var(--text-muted);
    flex: 1;
}

/* ========================
   RECAP PAGE
   ======================== */
.recap-page-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: flex-start;
}

@media(max-width:900px) {
    .recap-page-layout {
        grid-template-columns: 1fr;
    }
}

.recap.inv-char-display {
    background: radial-gradient(circle at top center, rgba(15, 10, 25, 0.8), rgba(5, 0, 10, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.char-portrait-area {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Add subtle animated breathing to the portrait area */
    animation: portraitBreathe 8s ease-in-out infinite alternate;
}

@keyframes portraitBreathe {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.02);
    }
}

.char-portrait-img {
    position: absolute;
    bottom: 0;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    z-index: 2;
    mask-image: linear-gradient(to top, transparent 0%, black 15%);
    -webkit-mask-image: linear-gradient(to top, transparent 0%, black 15%);
    filter: drop-shadow(0 0 30px var(--char-color));
    transition: opacity 0.4s ease, filter 0.4s ease;
}

/* Holographic Equipment Slots Array */
.eq-halo {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    padding: 2rem 3rem;
    box-sizing: border-box;
}

.eq-halo-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
    width: 65px;
}

.holo-eq-slot {
    width: 65px;
    height: 65px;
    border-radius: 14px;
    background: rgba(10, 5, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(12px);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6), 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    cursor: pointer;
}

.holo-eq-slot::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 50%, rgba(255, 255, 255, 0.15));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
}

.holo-eq-slot:hover::before {
    opacity: 1;
}

.holo-eq-slot.has-item {
    background: radial-gradient(circle at center, rgba(30, 20, 50, 0.85), rgba(10, 5, 20, 0.95));
    border-color: var(--item-color, rgba(255, 255, 255, 0.6));
    box-shadow: 0 0 25px var(--item-color, rgba(255, 255, 255, 0.3)), inset 0 0 20px rgba(0, 0, 0, 0.9);
    animation: holographicFloat 4s ease-in-out infinite alternate, holo-pulse 3s infinite;
}

@keyframes holographicFloat {
    0% {
        transform: translateY(0px) rotateX(0deg) rotateY(0deg);
    }

    100% {
        transform: translateY(-8px) rotateX(8deg) rotateY(8deg);
    }
}

@keyframes holo-pulse {

    0%,
    100% {
        box-shadow: 0 0 20px var(--item-color, rgba(255, 255, 255, 0.2)), inset 0 0 20px rgba(0, 0, 0, 0.9);
    }

    50% {
        box-shadow: 0 0 35px var(--item-color, rgba(255, 255, 255, 0.6)), inset 0 0 10px rgba(0, 0, 0, 0.7);
    }
}

.holo-slot-emoji {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px var(--item-color, #fff));
    z-index: 2;
    transition: transform 0.2s;
}

.holo-eq-slot.has-item:hover .holo-slot-emoji {
    transform: scale(1.15);
}

.holo-slot-label {
    position: absolute;
    bottom: -18px;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.6);
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.holo-eq-slot.has-item .holo-slot-label {
    color: var(--item-color, #fff);
    text-shadow: 0 0 5px var(--item-color, #fff);
}

.recap-card {
    background: var(--bg2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.75rem;
}

.recap-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.recap-status {
    font-size: 0.72rem;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

.rc-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    margin-top: 1.25rem;
}

.rc-section-label:first-of-type {
    margin-top: 0;
}

.rc-range-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rc-input-group {
    flex: 1;
}

.rc-input-group label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.rc-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color var(--transition);
}

.rc-input:focus {
    border-color: var(--primary);
}

.rc-arrow {
    color: var(--text-dim);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1rem;
}

.rc-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.28rem 0.7rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.preset-btn:hover,
.preset-btn.active-preset {
    background: rgba(196, 30, 58, 0.1);
    border-color: rgba(196, 30, 58, 0.3);
    color: var(--primary-light);
}

.rc-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.rc-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.rc-toggle input {
    display: none;
}

.toggle-track {
    width: 32px;
    height: 18px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    position: relative;
    transition: background var(--transition);
    flex-shrink: 0;
}

.toggle-track::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--text-dim);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all var(--transition);
}

.rc-toggle input:checked+.toggle-track {
    background: var(--primary);
}

.rc-toggle input:checked+.toggle-track::after {
    left: 17px;
    background: white;
}

.spoiler-slider-wrap {
    margin-bottom: 0.4rem;
}

.spoiler-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) 50%, rgba(255, 255, 255, 0.08) 50%);
    border-radius: 100px;
    outline: none;
    margin-bottom: 0.4rem;
}

.spoiler-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
}

.spoiler-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-dim);
}

.spoiler-hint {
    font-size: 0.72rem;
    color: var(--primary-light);
    margin-bottom: 1.25rem;
    font-style: italic;
}

.rc-generate-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.875rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition);
    box-shadow: 0 0 25px var(--primary-glow);
    letter-spacing: 0.04em;
}

.rc-generate-btn:hover {
    background: var(--primary-light);
    box-shadow: 0 0 45px var(--primary-glow);
    transform: translateY(-1px);
}

.rc-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.progress-tracker-card {
    background: var(--bg2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-top: 1.25rem;
}

.ptc-header {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.ptc-novel {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 0.6rem;
}

.ptc-input-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.ptc-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ptc-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: var(--text);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    width: 90px;
    outline: none;
}

.ptc-save-btn {
    background: rgba(196, 30, 58, 0.1);
    border: 1px solid rgba(196, 30, 58, 0.25);
    border-radius: 6px;
    color: var(--primary-light);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition);
}

.ptc-save-btn:hover {
    background: rgba(196, 30, 58, 0.2);
}

.ptc-saved {
    font-size: 0.72rem;
    color: #4ade80;
    font-weight: 600;
}

/* Recap Result */
.recap-result-area {
    background: var(--bg2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recap-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    max-width: 360px;
}

.re-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    opacity: 0.5;
    filter: drop-shadow(0 0 10px var(--primary));
}

.recap-empty h3 {
    font-family: 'Cinzel', serif;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text);
}

.recap-empty p {
    font-size: 0.83rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.re-features {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
}

.re-feat {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.recap-output {
    width: 100%;
    padding: 2rem;
    align-self: flex-start;
    animation: fadeUp 0.4s ease;
}

.ro-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ro-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ro-icon {
    font-size: 1.2rem;
}

.ro-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.ro-actions {
    display: flex;
    gap: 0.5rem;
}

.ro-action-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.ro-action-btn:hover {
    background: rgba(196, 30, 58, 0.1);
    border-color: rgba(196, 30, 58, 0.25);
    color: var(--primary-light);
}

.ro-content {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.85;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--card-border);
}

.ro-tags-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.ro-events {
    margin-bottom: 1.5rem;
}

.ro-events-title,
.ro-chars-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.ro-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ro-event-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--primary);
    border-radius: 0 4px 4px 0;
}

.ro-event-dot {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.ro-event-ch {
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
    opacity: 0.7;
    margin-top: 1px;
    white-space: nowrap;
}

.ro-chars-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ro-char-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    padding: 0.25rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
}

.ro-char-chip:hover {
    border-color: rgba(196, 30, 58, 0.25);
    color: var(--primary-light);
}

/* Bookmarks */
.bookmarks-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

.bookmarks-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bookmark-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.bm-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.bm-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.bm-load-btn {
    background: rgba(196, 30, 58, 0.1);
    border: 1px solid rgba(196, 30, 58, 0.25);
    border-radius: 6px;
    color: var(--primary-light);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
}

/* ========================
   LORE PAGE
   ======================== */
.lore-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 2.5rem;
}

.lore-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
    margin-bottom: -1px;
}

.lore-tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

.lore-tab:hover:not(.active) {
    color: var(--text);
}

.lore-tab-content {
    display: none;
}

.lore-tab-content.active {
    display: block;
}

.lore-intro {
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.lore-section-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.lore-section-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

.rank-cards-full {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rank-full-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition);
}

.rank-full-card:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.rank-full-card:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.rank-full-card+.rank-full-card {
    border-top: none;
}

.rank-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.5rem;
    transition: background var(--transition);
}

.rank-full-card:hover .rank-header {
    background: rgba(255, 255, 255, 0.02);
}

.rank-full-card.expanded {
    border-color: rgba(196, 30, 58, 0.25);
}

.rank-full-card.expanded .rank-header {
    background: rgba(196, 30, 58, 0.05);
}

.rank-dot-big {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rank-expand-icon {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-dim);
    transition: transform var(--transition);
}

.rank-full-card.expanded .rank-expand-icon {
    transform: rotate(180deg);
    color: var(--primary-light);
}

.rank-body {
    display: none;
    padding: 0 1.5rem 1.25rem calc(1.5rem + 14px + 1.25rem);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.75;
    animation: fadeUp 0.3s ease;
}

.rank-full-card.expanded .rank-body {
    display: block;
}

.rank-chars {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rank-char-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(196, 30, 58, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(196, 30, 58, 0.2);
}

.lore-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.lore-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
}

.lore-card:hover {
    transform: translateY(-3px);
    border-color: rgba(196, 30, 58, 0.2);
}

.lore-card-cat {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.lore-card-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.lore-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ========================
   COMMUNITY PAGE
   ======================== */
.community-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: flex-start;
}

@media(max-width:900px) {
    .community-layout {
        grid-template-columns: 1fr;
    }
}

.community-feed {
    min-width: 0;
}

.feed-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.feed-sort {
    display: flex;
    gap: 0.5rem;
}

.sort-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.sort-btn.active {
    background: rgba(196, 30, 58, 0.1);
    border-color: rgba(196, 30, 58, 0.3);
    color: var(--primary-light);
}

.feed-select {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
}

.post-form-card {
    background: var(--bg2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.post-form-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.post-avatar {
    width: 36px;
    height: 36px;
    background: rgba(196, 30, 58, 0.1);
    border: 1px solid rgba(196, 30, 58, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--primary);
    flex-shrink: 0;
}

.post-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
    color: var(--text);
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color var(--transition);
}

.post-input:focus {
    border-color: var(--primary);
}

.post-input::placeholder {
    color: var(--text-dim);
}

.post-form-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.post-type-btns {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.post-type-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.post-type-btn.active {
    background: rgba(196, 30, 58, 0.12);
    border-color: rgba(196, 30, 58, 0.3);
    color: var(--primary-light);
}

.post-chapter-tag {
    display: flex;
    gap: 0.5rem;
}

.post-chapter-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    color: var(--text);
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    width: 130px;
    outline: none;
}

.post-submit-btn {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 1rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition);
}

.post-submit-btn:hover {
    background: var(--primary-light);
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.thread-full-card {
    background: var(--bg2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    transition: all var(--transition);
    cursor: pointer;
}

.thread-full-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.thread-full-card.new-post {
    border-color: rgba(196, 30, 58, 0.3);
    animation: fadeUp 0.4s ease;
}

.tfc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tfc-chapter {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.tfc-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.tfc-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tfc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.tfc-tag {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
}

.tfc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tfc-user {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tfc-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
}

.thread-hot-badge {
    font-size: 0.62rem;
    font-weight: 700;
}

.badge-hot {
    color: var(--primary-light);
}

.badge-new {
    color: #4ade80;
}

.badge-trending {
    color: var(--gold);
}

/* Sidebar */
.community-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sidebar-card {
    background: var(--bg2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.sidebar-title {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.sidebar-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.ss-item {
    text-align: center;
}

.ss-num {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-light);
}

.ss-label {
    font-size: 0.62rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hot-topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ht-item {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
}

.ht-item:hover {
    color: var(--text);
}

.ht-num {
    font-weight: 700;
    color: var(--text-dim);
    width: 16px;
    flex-shrink: 0;
    font-size: 0.68rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-cloud-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.tag-cloud-tag:hover {
    background: rgba(196, 30, 58, 0.1);
    border-color: rgba(196, 30, 58, 0.25);
    color: var(--primary-light);
}

.tag-cloud-tag.active {
    background: rgba(196, 30, 58, 0.15);
    border-color: rgba(196, 30, 58, 0.4);
    color: var(--primary-light);
    box-shadow: 0 0 8px rgba(196, 30, 58, 0.2);
}