/* ===========================================
   CHAINSAW MAN — Makima Theme
   Deep crimson control, oppressive beauty
   =========================================== */

.manga-show-page.chainsaw-man-theme
{
    --panel-accent: #7cff01;
}

.chainsaw-man-theme .manga-show-content
{
    background: radial-gradient(ellipse at top, rgba(185,0,0,0.08) 0%, transparent 60%);
}

.chainsaw-man-theme .dedication-card {
    border-color: #B90000;
    box-shadow: 0 0 40px rgba(185,0,0,0.4), 0 0 80px rgba(185,0,0,0.15), inset 0 0 30px rgba(185,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.05);
}

.chainsaw-man-theme .dedication-card::before
{
    background: linear-gradient(90deg, transparent, #B90000, #cc0000, #B90000, transparent);
}

.chainsaw-man-theme .dedication-tagline
{
    color: #f5f0f0;
    text-shadow: 0 0 15px rgba(185,0,0,0.8), 0 0 40px rgba(185,0,0,0.3);
    font-style: normal;
    letter-spacing: 0.05em;
}

.chainsaw-man-theme .dedication-icon i
{
    color: #B90000;
    text-shadow: 0 0 10px #B90000, 0 0 30px rgba(185,0,0,0.6), 0 0 60px rgba(185,0,0,0.2);
    animation: makimaGlow 4s ease-in-out infinite;
}

@keyframes makimaGlow
{
    0%, 100% {
        text-shadow: 0 0 10px #B90000, 0 0 30px rgba(185,0,0,0.6), 0 0 60px rgba(185,0,0,0.2);
        opacity: 1;
    }
    50% {
        text-shadow: 0 0 20px #cc0000, 0 0 50px rgba(185,0,0,0.9), 0 0 90px rgba(185,0,0,0.4);
        opacity: 0.85;
    }
}

.chainsaw-man-theme .manga-hero-banner
{
    filter: saturate(0.4) contrast(1.1);
}

.chainsaw-man-theme .manga-hero-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(60,0,0,0.6) 60%, rgba(185,0,0,0.85) 100%);
}

.chainsaw-man-theme .panel-glow-bar {
    background: linear-gradient(90deg, transparent, #B90000, #cc0000, #B90000, transparent);
}

.chainsaw-man-theme .manga-panel-frame {
    border-color: rgba(185, 0, 0, 0.78);
    filter: saturate(0.6);
}

.chainsaw-man-theme .manga-panel-frame:hover {
    border-color: #B90000;
    box-shadow: 0 0 30px rgba(185,0,0,0.6);
    filter: saturate(1);
}

.chainsaw-man-theme .section-title {
    background: linear-gradient(45deg, #B90000, #cc4444, #f5dede);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chainsaw-man-theme .section-line {
    background: linear-gradient(90deg, #B90000, #cc4444, #B90000);
    box-shadow: 0 0 20px rgba(185,0,0,0.5);
}

.chainsaw-man-theme .cyber-button.secondary {
    border-color: #B90000;
    color: #f5dede;
    box-shadow: 0 0 15px rgba(185,0,0,0.3);
}

.chainsaw-man-theme .cyber-button.secondary:hover {
    background: rgba(185,0,0,0.15);
    box-shadow: 0 0 30px rgba(185,0,0,0.6);
    color: #ffffff;
}

.recording-mode .chainsaw-man-theme .dedication-icon i {
    animation: none !important;
    text-shadow: 0 0 10px #B90000 !important;
}

/* ===========================================
   MAKIMA — Control Field Radial
   =========================================== */

.makima-control-field {
    position: relative;
    width: 100%;
    min-height: 560px;
    margin-bottom: 3rem;
    overflow: hidden;
    border-radius: 20px;
    background: radial-gradient(ellipse at 50% 50%, rgba(80, 0, 0, 0.35) 0%, rgba(30, 0, 0, 0.6) 40%, rgba(5, 0, 0, 0.92) 100%);
    border: 1px solid rgba(185, 0, 0, 0.73);
    box-shadow: inset 0 0 80px rgba(185, 0, 0, 0.15), 0 0 60px rgba(185, 0, 0, 0.2);
}

.makima-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-ghost);
    font-size: clamp(5rem, 15vw, 11rem);
    font-weight: 900;
    color: rgba(185, 0, 0, 0.07);
    letter-spacing: 0.3em;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    text-transform: uppercase;
    animation: watermarkBreath 8s ease-in-out infinite;
}

@keyframes watermarkBreath {
    0%, 100% { opacity: 0.6; letter-spacing: 0.3em; }
    50%       { opacity: 1;   letter-spacing: 0.4em; }
}

.control-arena {
    position: relative;
    width: 100%;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    padding: 3rem 2rem;
}

.control-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.ctrl-line {
    stroke: rgba(185, 0, 0, 0.35);
    stroke-width: 1;
    stroke-dasharray: 6 4;
    animation: linePulseIdle 4s ease-in-out infinite;
}

.ctrl-line-1 { animation-delay: 0s; }
.ctrl-line-2 { animation-delay: 0.8s; }
.ctrl-line-3 { animation-delay: 1.6s; }
.ctrl-line-4 { animation-delay: 2.4s; }

@keyframes linePulseIdle {
    0%, 100% { stroke: rgba(185, 0, 0, 0.35); stroke-width: 1; }
    50%       { stroke: rgba(210, 0, 0, 0.55); stroke-width: 1.5; }
}

.ctrl-node {
    fill: rgba(185, 0, 0, 0.5);
    r: 4px;  /* Base value */
    animation: nodePulseFill 4s ease-in-out infinite, nodePulseRadius 4s ease-in-out infinite;
}

.ctrl-node-1 { animation-delay: 0s; }
.ctrl-node-2 { animation-delay: 0.8s; }
.ctrl-node-3 { animation-delay: 1.6s; }
.ctrl-node-4 { animation-delay: 2.4s; }

@keyframes nodePulse {
    0%, 100% { fill: rgba(185, 0, 0, 0.5); r: 4; }
    50%       { fill: rgba(220, 0, 0, 0.9); r: 6; }
}

@keyframes nodePulseFill {
    0%, 100% { fill: rgba(185, 0, 0, 0.5); }
    50% { fill: rgba(220, 0, 0, 0.9); }
}

@keyframes nodePulseRadius {
    0%, 100% { r: 4px; }  /* Add px or % for length-percentage */
    50% { r: 6px; }
}

.control-portrait
{
    position: relative;
    width: 220px;
    height: 280px;
    flex-shrink: 0;
    border-radius: 50%;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    border: 2px solid rgba(185, 0, 0, 0.6);
    box-shadow: 0 0 40px rgba(185, 0, 0, 0.5), 0 0 80px rgba(185, 0, 0, 0.2), inset 0 0 30px rgba(0, 0, 0, 0.4);
    z-index: 3;
    animation: portraitPulse 6s ease-in-out infinite;
    overflow: visible;
}

@keyframes portraitPulse
{
    0%, 100% { box-shadow: 0 0 40px rgba(185,0,0,0.5), 0 0 80px rgba(185,0,0,0.2); }
    50%       { box-shadow: 0 0 60px rgba(200,0,0,0.7), 0 0 120px rgba(185,0,0,0.35); }
}

.portrait-inner-glow
{
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(185, 0, 0, 0.25) 100%);
    pointer-events: none;
}

.makima-rings
{
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(185, 0, 0, 0.61);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: ringOrbit 6s ease-in-out infinite;
}

.ring-1
{
    width: 270px; height: 270px;
    animation-duration: 6s;
    animation-delay: 0s;
    border-color: rgba(185, 0, 0, 0.49);
}

.ring-2
{
    width: 340px; height: 340px;
    animation-duration: 9s;
    animation-delay: 1s;
    border-color: rgba(185, 0, 0, 0.32);
}

.ring-3
{
    width: 420px; height: 420px;
    animation-duration: 12s;
    animation-delay: 2s;
    border-color: rgba(185, 0, 0, 0.25);
}

@keyframes ringOrbit
{
    0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    50%       { opacity: 0.8; transform: translate(-50%, -50%) scale(1.03); }
}

.ctrl-stats-arc {
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    z-index: 4;
}

.ctrl-stat {
    cursor: default;
    transition: transform 0.3s ease;
}

.ctrl-stat:hover {
    transform: translateX(-6px);
}

.ctrl-stat-content {
    background: rgba(10, 0, 0, 0.7);
    border: 1px solid rgba(185, 0, 0, 0.53);
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    backdrop-filter: blur(6px);
    min-width: 200px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ctrl-stat-content::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: 8px 0 0 8px;
    background: rgba(185, 0, 0, 0.5);
    transition: background 0.3s ease;
}

.ctrl-stat:hover .ctrl-stat-content {
    border-color: rgba(200, 0, 0, 0.7);
    background: rgba(30, 0, 0, 0.85);
    box-shadow: 0 0 20px rgba(185, 0, 0, 0.4),
    inset 0 0 10px rgba(185, 0, 0, 0.1);
}

.ctrl-stat:hover .ctrl-stat-content::before {
    background: #cc0000;
    box-shadow: 0 0 8px rgba(200, 0, 0, 0.8);
}

.ctrl-stat-label {
    font-family: var(--font-ghost);
    font-size: 0.73rem;
    color: rgba(185, 0, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.3s ease;
}

.ctrl-stat-value {
    font-family: var(--font-ghost);
    font-size: 0.91rem;
    color: #f5dede;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.ctrl-stat:hover .ctrl-stat-label {
    color: #ff4444;
}

.ctrl-stat:hover .ctrl-stat-value {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 100, 100, 0.6);
}

.ctrl-stat-1:hover ~ * .ctrl-line-1,
.ctrl-stat-2:hover ~ * .ctrl-line-2,
.ctrl-stat-3:hover ~ * .ctrl-line-3,
.ctrl-stat-4:hover ~ * .ctrl-line-4 {
    stroke: rgba(220, 0, 0, 0.9);
    stroke-width: 2;
    animation: none;
}

.control-quote {
    position: absolute;
    bottom: 1.8rem;
    left: 50%;
    transform: translateX(-50%);
    width: 55%;
    text-align: center;
    z-index: 4;
}

.control-quote p
{
    font-style: italic;
    font-size: 0.87rem;
    color: rgba(245, 220, 220, 0.6);
    line-height: 1.7;
    border-top: 1px solid rgba(185, 0, 0, 0.51);
    padding-top: 0.8rem;
    transition: color 0.4s ease;
}

.makima-control-field:hover .control-quote p {
    color: rgba(245, 220, 220, 0.85);
}

.control-portrait::after {
    content: 'MAKIMA';
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-ghost);
    font-size: 0.76rem;
    letter-spacing: 0.4em;
    color: rgba(185, 0, 0, 0.7);
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(185, 0, 0, 0.5);
}

.recording-mode .makima-watermark,
.recording-mode .ring,
.recording-mode .control-portrait {
    animation: none !important;
}

.recording-mode .ctrl-line,
.recording-mode .ctrl-node {
    animation: none !important;
    stroke: rgba(185, 0, 0, 0.4) !important;
}

@media (max-width: 900px) {
    .control-arena {
        flex-direction: column;
        min-height: 700px;
        padding-bottom: 6rem;
    }

    .ctrl-stats-arc {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-width: 360px;
        margin-top: 2rem;
        align-items: center;
    }

    .ctrl-stat-content {
        min-width: 260px;
    }

    .control-lines {
        display: none;
    }

    .control-quote {
        width: 85%;
        bottom: 1rem;
    }

    .ring-2, .ring-3 {
        display: none;
    }
}

@media (max-width: 480px)
{
    .makima-watermark { font-size: 3.5rem; }
    .control-portrait { width: 160px; height: 200px; }
    .ring-1 { width: 200px; height: 200px; }
}

/* ===========================================
   CHAINSAW MAN — Contract Terminal (Section 1)
   =========================================== */

.csm-contract-terminal {
    position: relative;
    margin-bottom: 3rem;
    border-radius: 12px;
    overflow: hidden;
    background: #030000;
    border: 1px solid rgba(185, 0, 0, 0.62);
    transition: border-color 0.4s ease;
}

.csm-contract-terminal.contract-active {
    border-color: rgba(210, 0, 0, 0.75);
    box-shadow: 0 0 40px rgba(185, 0, 0, 0.22);
}

.csm-contract-terminal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.06) 2px, rgba(0, 0, 0, 0.06) 4px);
    pointer-events: none;
    z-index: 10;
}

.terminal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.5rem;
    background: rgba(20, 0, 0, 0.88);
    border-bottom: 1px solid rgba(185, 0, 0, 0.62);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.terminal-topbar-title {
    font-family: var(--font-ghost);
    font-size: 0.63rem;
    letter-spacing: 0.45em;
    color: rgba(200, 0, 0, 0.85);
    text-transform: uppercase;
}

.terminal-topbar-status {
    font-family: var(--font-ghost);
    font-size: 0.64rem;
    letter-spacing: 0.3em;
    color: rgba(185, 0, 0, 0.65);
    text-transform: uppercase;
    transition: color 0.4s ease;
}

.csm-contract-terminal.contract-active .terminal-topbar-status {
    color: var(--panel-accent);
    text-shadow: 0 0 10px rgba(200, 0, 0, 0.9);
    animation: csmStatusPulse 2s ease-in-out infinite;
}

@keyframes csmStatusPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.terminal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 420px;
}

.terminal-selector {
    padding: 2rem 1.5rem;
    border-right: 1px solid rgba(185, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    background: radial-gradient(ellipse at 0% 0%, rgba(185, 0, 0, 0.09) 0%, transparent 60%);
}

.terminal-selector-label {
    font-family: var(--font-ghost);
    font-size: 0.65rem;
    letter-spacing: 0.4em;
    color: rgba(200, 0, 0, 0.75);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(185, 0, 0, 0.51);
    padding-bottom: 0.7rem;
}

.devil-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.devil-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(185, 0, 0, 0.55);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    width: 100%;
}

.devil-option:hover {
    border-color: rgba(200, 0, 0, 0.65);
    background: rgba(185, 0, 0, 0.1);
}

.devil-option.selected {
    border-color: rgba(255, 0, 0, 0.94);
    background: rgba(185, 0, 0, 0.6);
    box-shadow: 0 0 15px rgba(185, 0, 0, 0.28),
    inset 0 0 20px rgba(185, 0, 0, 0.43);
}

.devil-option-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    filter: grayscale(0.7);
    transition: filter 0.3s ease;
    line-height: 1;
}

.devil-option.selected .devil-option-icon {
    filter: none;
}

.devil-option-name {
    font-family: var(--font-ghost);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: rgba(200, 0, 0, 0.8);
    transition: color 0.25s ease;
    display: block;
}

.devil-option:hover .devil-option-name,
.devil-option.selected .devil-option-name {
    color: var(--panel-accent);
    text-shadow: 0 0 8px rgba(200, 0, 0, 0.65);
}

.devil-option-fear {
    font-family: var(--font-ghost);
    font-size: 0.66rem;
    color: rgba(185, 0, 0, 0.58);
    display: block;
    letter-spacing: 0.1em;
    transition: color 0.25s ease;
}

.devil-option:hover .devil-option-fear,
.devil-option.selected .devil-option-fear {
    color: rgba(200, 0, 0, 0.85);
}

.terminal-contract {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: relative;
    background: radial-gradient(
            ellipse at 100% 100%,
            rgba(185, 0, 0, 0.09) 0%,
            transparent 60%
    );
}

.terminal-idle {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.terminal-idle.hidden {
    opacity: 0;
}

.terminal-idle-icon {
    font-size: 2rem;
    opacity: 0.12;
    filter: grayscale(1);
}

.terminal-idle-text {
    font-family: var(--font-ghost);
    font-size: 0.71rem;
    letter-spacing: 0.4em;
    color: rgba(253, 12, 12, 0.87);
    text-transform: uppercase;
}

.terminal-contract-content {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    height: 100%;
}

.terminal-contract-content.visible {
    opacity: 1;
    transform: none;
    pointer-events: all;
}

.contract-header {
    border-bottom: 1px solid rgb(255, 0, 30);
    padding-bottom: 0.8rem;
}

.contract-devil-name {
    font-family: var(--font-ghost);
    font-size: 1.16rem;
    letter-spacing: 0.15em;
    color: var(--panel-accent);
    text-shadow: 0 0 20px rgba(200, 0, 0, 0.75),
    0 0 40px rgba(185, 0, 0, 0.38);
    display: block;
    margin-bottom: 0.2rem;
}

.contract-devil-title {
    font-family: var(--font-ghost);
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: rgba(218, 0, 0, 0.72);
    text-transform: uppercase;
    display: block;
}

.contract-terms {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.contract-term {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.contract-term-label {
    font-family: var(--font-ghost);
    font-size: 0.64rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.contract-term-label.gain {
    color: rgba(100, 255, 180, 0.78);
}

.contract-term-label.cost {
    color: rgba(255, 80, 110, 0.88);
}

.contract-term-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.contract-term-label.gain::before {
    background: rgba(100, 255, 180, 0.88);
    box-shadow: 0 0 6px rgba(100, 255, 180, 0.65);
}

.contract-term-label.cost::before {
    background: rgba(255, 80, 110, 0.92);
    box-shadow: 0 0 6px rgba(255, 80, 110, 0.72);
}

.contract-term-value
{
    font-family: var(--font-ghost);
    font-size: 0.82rem;
    line-height: 1.7;
    color: rgba(245, 220, 220, 0.88);
    display: block;
    min-height: 1.2rem;
}

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 0.85em;
    background: var(--panel-accent);
    margin-left: 2px;
    vertical-align: middle;
    animation: csmCursorBlink 0.7s step-end infinite;
}

@keyframes csmCursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.contract-note
{
    font-family: var(--font-ghost);
    font-size: 0.73rem;
    font-style: italic;
    color: rgba(210, 0, 0, 0.58);
    line-height: 1.7;
    border-top: 1px solid rgba(185, 0, 0, 0.52);
    padding-top: 0.8rem;
}

.contract-sign-wrap {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.contract-sign-btn {
    font-family: var(--font-ghost);
    font-size: 0.70rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--panel-accent);
    background: transparent;
    border: 1px solid rgba(200, 0, 0, 0.65);
    border-radius: 4px;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contract-sign-btn:hover {
    border-color: #cc0000;
    box-shadow: 0 0 25px rgba(200, 0, 0, 0.55),
    inset 0 0 15px rgba(185, 0, 0, 0.12);
    text-shadow: 0 0 12px rgba(124, 255, 1, 0.9);
}

.contract-sign-btn.signed {
    color: rgba(200, 0, 0, 0.28);
    border-color: rgba(185, 0, 0, 0.73);
    pointer-events: none;
    cursor: default;
    box-shadow: none;
    text-shadow: none;
}

.contract-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-18deg) scale(0);
    font-family: var(--font-ghost);
    font-size: 1.1rem;
    letter-spacing: 0.25em;
    color: rgba(220, 0, 0, 0.97);
    border: 2px solid rgba(200, 0, 0, 0.78);
    border-radius: 4px;
    padding: 0.3rem 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(220, 0, 0, 1),
    0 0 40px rgba(185, 0, 0, 0.65);
    box-shadow: 0 0 25px rgba(185, 0, 0, 0.55),
    inset 0 0 12px rgba(185, 0, 0, 0.22);
    transition: transform 0.15s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.3s ease;
    opacity: 0;
    background: rgba(10, 0, 0, 0.92);
}

.contract-stamp.stamped {
    transform: translate(-50%, -50%) rotate(-18deg) scale(1);
    opacity: 1;
}

/* ===========================================
   CHAINSAW MAN — Public Safety Files (Section 4)
   REVISED — Atmospheric Edition
   =========================================== */

.csm-psafety-files {
    position: relative;
    margin-bottom: 3rem;
    border-radius: 12px;
    overflow: hidden;
    background: #0a0000;
    border: 1px solid rgba(185, 0, 0, 0.49);
    min-height: 500px;
    box-shadow: 0 0 0 1px rgba(185, 0, 0, 0.06), 0 4px 40px rgba(0, 0, 0, 0.85), inset 0 0 80px rgba(185, 0, 0, 0.025);
}

/* Scanline overlay */
.csm-psafety-files::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.07) 2px, rgba(0, 0, 0, 0.07) 4px);
    pointer-events: none;
    z-index: 10;
    border-radius: 12px;
}

/* Soft vignette — darkens edges, draws focus inward */
.csm-psafety-files::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
    z-index: 1;
    border-radius: 12px;
}

.psafety-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.5rem;
    background: rgba(10, 0, 0, 0.96);
    border-bottom: none; /* replaced by ::after glow line */
    flex-wrap: wrap;
    gap: 0.5rem;
    position: relative;
    z-index: 5;
}

/* Glowing gradient rule under topbar — replaces the flat border */
.psafety-topbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, rgba(185, 0, 0, 0.45) 20%, rgba(210, 0, 0, 0.75) 50%, rgba(185, 0, 0, 0.45) 80%, transparent 100%);
}

.psafety-topbar-title
{
    font-family: var(--font-ghost);
    font-size: 0.65rem;
    letter-spacing: 0.45em;
    color: rgba(200, 0, 0, 0.82);
    text-transform: uppercase;
}

.psafety-topbar-access {
    font-family: var(--font-ghost);
    font-size: 0.63rem;
    letter-spacing: 0.3em;
    color: rgba(185, 0, 0, 0.42);
    text-transform: uppercase;
}

.psafety-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: 460px;
    position: relative;
    z-index: 2;
}

/* ── Sidebar — flat dark, no blob ── */
.psafety-agent-list {
    border-right: 1px solid rgba(185, 0, 0, 0.53);
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    background: rgba(6, 0, 0, 0.65);
    /* OLD BLOB REMOVED — radial-gradient was the culprit */
}

.psafety-list-label {
    font-family: var(--font-ghost);
    font-size: 0.62rem;
    letter-spacing: 0.4em;
    color: rgba(210, 0, 0, 0.74);
    text-transform: uppercase;
    padding: 0 1.2rem 0.8rem;
    border-bottom: 1px solid rgba(185, 0, 0, 0.41);
    margin-bottom: 0.5rem;
}

.psafety-agent-entry {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1.2rem;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.25s ease;
    position: relative;
}

/* Thin separator between rows */
.psafety-agent-entry::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.2rem;
    right: 0.8rem;
    height: 1px;
    background: rgba(185, 0, 0, 0.07);
}

.psafety-agent-entry:hover {
    background: rgba(185, 0, 0, 0.08);
    border-left-color: rgba(200, 0, 0, 0.42);
}

.psafety-agent-entry.active {
    background: rgba(185, 0, 0, 0.12);
    border-left-color: #cc0000;
    box-shadow: inset 0 0 20px rgba(185, 0, 0, 0.05);
}

.psafety-agent-icon {
    font-size: 1rem;
    flex-shrink: 0;
    filter: grayscale(0.7);
    transition: filter 0.3s ease;
    line-height: 1;
}

.psafety-agent-entry.active .psafety-agent-icon,
.psafety-agent-entry:hover .psafety-agent-icon {filter: none;}

.psafety-agent-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.psafety-agent-name {
    font-family: var(--font-ghost);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: rgba(200, 0, 0, 0.68);
    transition: color 0.25s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.psafety-agent-entry:hover .psafety-agent-name,
.psafety-agent-entry.active .psafety-agent-name {
    color: var(--panel-accent);
    text-shadow: 0 0 8px rgba(200, 0, 0, 0.5);
}

.psafety-agent-rank {
    font-family: var(--font-ghost);
    font-size: 0.60rem;
    letter-spacing: 0.08em;
    color: rgba(255, 36, 95, 0.76);
    transition: color 0.25s ease;
}

.psafety-agent-entry.active .psafety-agent-rank {
    color: rgba(210, 0, 0, 0.62);
}

.psafety-deceased-tag {
    position: absolute;
    right: 0.8rem;
    font-family: var(--font-ghost);
    font-size: 0.42rem;
    letter-spacing: 0.12em;
    color: rgba(255, 0, 96, 0.77);
    text-transform: uppercase;
    border: 1px solid rgba(255, 80, 100, 0.47);
    border-radius: 2px;
    padding: 0.1rem 0.3rem;
    background: rgba(255, 0, 50, 0.04);
}

/* ── Dossier panel — edge-lit, no blob ── */
.psafety-dossier {
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Subtle diagonal bleed from top-left corner only */
    background: linear-gradient(135deg, rgba(185, 0, 0, 0.04) 0%, transparent 30%);
}

/* Small corner accent in top-right — contained, not blobby */
.psafety-dossier::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(ellipse at top right, rgba(185, 0, 0, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.psafety-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: opacity 0.3s ease;
}

.psafety-empty.hidden {
    opacity: 0;
    pointer-events: none;
}

.psafety-empty-icon
{
    font-size: 2rem;
    opacity: 0.07;
    filter: grayscale(1);
}

.psafety-empty-text
{
    font-family: var(--font-ghost);
    font-size: 0.63rem;
    letter-spacing: 0.45em;
    color: rgba(248, 27, 27, 0.68);
    text-transform: uppercase;
}

.psafety-dossier-content {
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.psafety-dossier-content.visible {
    opacity: 1;
    transform: none;
    pointer-events: all;
}

.dossier-top {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(185, 0, 0, 0.16);
}

.dossier-portrait {
    width: 75px;
    height: 90px;
    border-radius: 4px;
    border: 1px solid rgba(185, 0, 0, 0.5);
    background: rgba(6, 0, 0, 0.98);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    filter: grayscale(0.4);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(185, 0, 0, 0.1), inset 0 0 16px rgba(0, 0, 0, 0.65);
}

.dossier-portrait::after
{
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(185, 0, 0, 0.04) 4px, rgba(185, 0, 0, 0.04) 8px);
}

.dossier-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dossier-agent-name {
    font-family: var(--font-ghost);
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: var(--panel-accent);
    text-shadow: 0 0 12px rgba(200, 0, 0, 0.5), 0 0 28px rgba(185, 0, 0, 0.22);
    display: block;
}

.dossier-agent-title
{
    font-family: var(--font-ghost);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    color: rgba(255, 18, 18, 0.85);
    text-transform: uppercase;
    display: block;
}

.dossier-status-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.dossier-status-badge {
    font-family: var(--font-ghost);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.status-active {
    color: rgba(100, 255, 180, 0.88);
    border: 1px solid rgba(100, 255, 180, 0.44);
    background: rgba(0, 255, 120, 0.05);
}

.status-deceased {
    color: rgba(255, 80, 110, 0.88);
    border: 1px solid rgba(255, 80, 110, 0.45);
    background: rgba(255, 0, 50, 0.05);
}

.status-mia {
    color: rgba(220, 180, 80, 0.88);
    border: 1px solid rgba(220, 180, 80, 0.49);
    background: rgba(220, 160, 0, 0.05);
}

.status-classified {
    color: rgba(220, 0, 0, 0.85);
    border: 1px solid rgba(210, 0, 0, 0.51);
    background: rgba(185, 0, 0, 0.08);
}

.dossier-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem 1.5rem;
}

.dossier-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dossier-field-key {
    font-family: var(--font-ghost);
    font-size: 0.56rem;
    letter-spacing: 0.35em;
    color: rgba(218, 0, 0, 0.55);
    text-transform: uppercase;
}

.dossier-field-val
{
    font-family: var(--font-ghost);
    font-size: 0.72rem;
    color: rgba(245, 220, 220, 0.85);
    line-height: 1.4;
}

.dossier-notes {
    border-top: 1px solid rgba(185, 0, 0, 0.45);
    padding-top: 1rem;
}

.dossier-notes-label
{
    font-family: var(--font-ghost);
    font-size: 0.64rem;
    letter-spacing: 0.4em;
    color: rgba(245, 27, 27, 0.72);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.dossier-notes-text {
    font-family: var(--font-ghost);
    font-size: 0.72rem;
    font-style: italic;
    color: rgba(255, 214, 225, 0.84);
    line-height: 1.85;
}

.dossier-threat-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dossier-threat-label {
    font-family: var(--font-ghost);
    font-size: 0.64rem;
    letter-spacing: 0.35em;
    color: rgba(229, 10, 10, 0.92);
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
}

.dossier-threat-bar {
    height: 4px;
    background: rgba(185, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.dossier-threat-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(to right, rgba(185, 0, 0, 0.5), rgba(220, 0, 0, 1));
    width: 0%;
    transition: width 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.2s;
    box-shadow: 0 0 8px rgba(200, 0, 0, 0.6), 0 0 16px rgba(185, 0, 0, 0.25);
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .psafety-layout {
        grid-template-columns: 1fr;
    }

    .psafety-agent-list {
        border-right: none;
        border-bottom: 1px solid rgba(185, 0, 0, 0.43);
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.5rem;
        gap: 0.3rem;
    }

    .psafety-list-label { display: none; }

    .psafety-agent-entry {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 0.5rem 0.8rem;
        border-radius: 4px;
    }

    .psafety-agent-entry::after { display: none; }

    .psafety-agent-entry.active {
        border-bottom-color: #cc0000;
        border-left-color: transparent;
    }

    .dossier-fields {
        grid-template-columns: 1fr;
    }
}

