/* ===========================================
   DEMON SLAYER — Shinobu Kocho Theme
   Wisteria poison, butterfly grace
   =========================================== */

.demon-slayer-theme
{
    --panel-accent: #f700ff;
}

.demon-slayer-theme .manga-show-content {
    background: radial-gradient(ellipse at top, rgba(197,23,255,0.06) 0%, transparent 60%);
}

.demon-slayer-theme .dedication-card {
    border-color: #C517FF;
    box-shadow: 0 0 40px rgba(197,23,255,0.3), 0 0 80px rgba(197,23,255,0.1), inset 0 0 30px rgba(197,23,255,0.04), inset 0 1px 0 rgba(255,255,255,0.07);
}

.demon-slayer-theme .dedication-card::before {
    background: linear-gradient(90deg, transparent, #7B00CC, #C517FF, #7B00CC, transparent);
}

.demon-slayer-theme .dedication-tagline {
    color: #e8c0ff;
    text-shadow: 0 0 15px rgba(197,23,255,0.7), 0 0 40px rgba(197,23,255,0.2);
    font-style: normal;
    letter-spacing: 0.04em;
}

.demon-slayer-theme .dedication-icon i {
    color: #C517FF;
    text-shadow: 0 0 15px #C517FF, 0 0 40px rgba(197,23,255,0.5);
    animation: shinobuFlutter 3s ease-in-out infinite;
}

@keyframes shinobuFlutter {
    0%, 100% { text-shadow: 0 0 15px #C517FF, 0 0 40px rgba(197,23,255,0.5); transform: rotate(0deg) scale(1); }
    30% { transform: rotate(-8deg) scale(1.05); text-shadow: 0 0 25px #C517FF, 0 0 60px rgba(197,23,255,0.8); }
    60% { transform: rotate(8deg) scale(1.08); }
}

.demon-slayer-theme .manga-hero-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(75,0,110,0.5) 60%, rgba(197,23,255,0.7) 100%);
}

.demon-slayer-theme .panel-glow-bar {
    background: linear-gradient(90deg, transparent, #7B00CC, #C517FF, #7B00CC, transparent);
}

.demon-slayer-theme .manga-panel-frame {
    border-color: rgba(197,23,255,0.3);
}

.demon-slayer-theme .manga-panel-frame:hover {
    border-color: #C517FF;
    box-shadow: 0 0 30px rgba(197,23,255,0.6);
}

.demon-slayer-theme .section-title {
    background: linear-gradient(45deg, #7B00CC, #C517FF, #e8c0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.demon-slayer-theme .section-line {
    background: linear-gradient(90deg, #7B00CC, #C517FF, #7B00CC);
    box-shadow: 0 0 20px rgba(197,23,255,0.5);
}

.demon-slayer-theme .cyber-button.secondary {
    border-color: #C517FF;
    color: #e8c0ff;
}

.demon-slayer-theme .cyber-button.secondary:hover {
    background: rgba(197,23,255,0.15);
    box-shadow: 0 0 30px rgba(197,23,255,0.5);
    color: #ffffff;
}

.recording-mode .demon-slayer-theme .dedication-icon i {
    animation: none !important;
    transform: none !important;
}



/* =================================================================
   DEMON SLAYER — Shinobu Kocho
   demon-slayer.css  ·  Requires manga.css for base rules
   ================================================================= */

/* ── Page ambient background ─────────────────────────────────────── */

.demon-slayer-theme .manga-show-content {
    background:
            radial-gradient(ellipse at 20% 0%,   rgba(120, 0, 180, 0.12) 0%, transparent 55%),
            radial-gradient(ellipse at 80% 30%,  rgba(197, 23, 255, 0.07) 0%, transparent 50%),
            radial-gradient(ellipse at 50% 100%, rgba(90,  0, 140, 0.10) 0%, transparent 60%),
            linear-gradient(180deg, #0a0010 0%, #06000d 40%, #080012 100%);
    position: relative;
}

/* Ambient butterfly canvas — fixed, behind all content */
.ds-ambient-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}

/* ── Portrait Field ──────────────────────────────────────────────── */

.ds-portrait-field {
    position: relative;
    width: 100%;
    min-height: 580px;
    margin-bottom: 3rem;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem 5rem;
    background:
            radial-gradient(ellipse at 50% 40%, rgba(140, 0, 200, 0.18) 0%, transparent 60%),
            radial-gradient(ellipse at 50% 100%, rgba(197, 23, 255, 0.08) 0%, transparent 50%),
            linear-gradient(180deg, rgba(10, 0, 18, 0.97) 0%, rgba(6, 0, 12, 0.99) 100%);
    border: 1px solid rgba(197, 23, 255, 0.2);
    box-shadow:
            inset 0 0 80px rgba(197, 23, 255, 0.05),
            0 0 60px rgba(140, 0, 200, 0.1);
}

/* Watermark */
.ds-portrait-field::before {
    content: 'SHINOBU';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-ghost);
    font-size: clamp(4rem, 14vw, 10rem);
    font-weight: 900;
    color: rgba(197, 23, 255, 0.025);
    letter-spacing: 0.35em;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    text-transform: uppercase;
    animation: dsWatermarkBreath 8s ease-in-out infinite;
}

@keyframes dsWatermarkBreath {
    0%, 100% { opacity: 0.7; letter-spacing: 0.35em; }
    50%       { opacity: 1;   letter-spacing: 0.42em; }
}

/* Petal canvas — inside the field, above bg */
.ds-petal-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ── Portrait Arena — three-column ──────────────────────────────── */

.ds-portrait-arena {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    width: 100%;
    max-width: 960px;
    position: relative;
    z-index: 3;
}

/* ── Stat columns ────────────────────────────────────────────────── */

.ds-stats-col {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    flex: 1;
    max-width: 210px;
}

.ds-stats-left  { align-items: flex-end;   text-align: right; }
.ds-stats-right { align-items: flex-start; text-align: left;  }

.ds-gate-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
    background: rgba(10, 0, 18, 0.82);
    border: 1px solid rgba(197, 23, 255, 0.25);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    backdrop-filter: blur(6px);
    width: 100%;
    position: relative;
}

.ds-gate-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(90deg, transparent, rgba(197, 23, 255, 0.7), transparent);
}

/* Left column — accent line on right edge */
.ds-stats-left .ds-gate-stat {
    border-right: 2px solid rgba(197, 23, 255, 0.45);
    transform: translateX(-10px);
}

/* Right column — accent line on left edge */
.ds-stats-right .ds-gate-stat {
    border-left: 2px solid rgba(197, 23, 255, 0.45);
    transform: translateX(10px);
}

.ds-gate-stat.active {
    opacity: 1;
    transform: none;
}

.ds-stat-key {
    font-family: var(--font-ghost);
    font-size: 0.64rem;
    letter-spacing: 0.38em;
    color: rgba(197, 23, 255, 0.75);
    text-transform: uppercase;
}

.ds-stat-val {
    font-family: var(--font-ghost);
    font-size: 0.82rem;
    color: rgba(232, 192, 255, 0.92);
    letter-spacing: 0.04em;
    line-height: 1.4;
}

/* ── Torii Gate (centre column) ──────────────────────────────────── */

.ds-torii-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 320px;
    height: 420px;
}

.ds-torii-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 1s ease;
}

.ds-portrait-field.portrait-active .ds-torii-svg {
    opacity: 1;
}

.ds-torii-beam {
    fill: rgba(90, 0, 140, 0.85);
    stroke: rgba(197, 23, 255, 0.7);
    stroke-width: 1;
    filter: drop-shadow(0 0 6px rgba(197, 23, 255, 0.5));
}

.ds-torii-kasagi {
    fill: rgba(110, 0, 160, 0.9);
    filter: drop-shadow(0 0 10px rgba(197, 23, 255, 0.6));
    animation: toriiBeamPulse 5s ease-in-out infinite;
}

.ds-torii-pillar {
    fill: rgba(70, 0, 110, 0.8);
    stroke: rgba(197, 23, 255, 0.5);
    stroke-width: 1;
}

.ds-torii-cap {
    fill: rgba(120, 0, 180, 0.9);
    stroke: rgba(197, 23, 255, 0.6);
    stroke-width: 1;
}

.ds-torii-drape {
    stroke: rgba(197, 23, 255, 0.35);
    stroke-width: 1;
    stroke-dasharray: 3 4;
    animation: toriiDrapeDrift 3s ease-in-out infinite;
}

.ds-torii-drape:nth-child(odd)  { animation-delay: 0.4s; }
.ds-torii-drape:nth-child(even) { animation-delay: 0.9s; }

.ds-torii-tick {
    stroke: rgba(197, 23, 255, 0.6);
    stroke-width: 1.5;
}

@keyframes toriiBeamPulse {
    0%, 100% {
        fill: rgba(110, 0, 160, 0.9);
        filter: drop-shadow(0 0 8px rgba(197, 23, 255, 0.5));
    }
    50% {
        fill: rgba(140, 0, 200, 0.95);
        filter: drop-shadow(0 0 18px rgba(197, 23, 255, 0.85));
    }
}

@keyframes toriiDrapeDrift {
    0%, 100% { stroke-dashoffset: 0;  opacity: 0.35; }
    50%       { stroke-dashoffset: 14; opacity: 0.65; }
}

/* ── Portrait Frame inside gate ──────────────────────────────────── */

.ds-portrait-frame {
    position: relative;
    width: 200px;
    height: 300px;
    overflow: hidden;
    border-radius: 4px;
    z-index: 2;
    box-shadow:
            0 0 40px rgba(197, 23, 255, 0.25),
            inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.ds-portrait-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    filter: saturate(0) brightness(0.7);
    opacity: 0;
    transition: filter 2s ease, opacity 0.5s ease;
    z-index: 1;
}

.ds-portrait-field.portrait-visible .ds-portrait-img {
    opacity: 1;
}

.ds-portrait-field.revealed .ds-portrait-img {
    filter: saturate(0.65) brightness(0.92) contrast(1.05);
}

.ds-portrait-scanline {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(197, 23, 255, 0.04) 3px,
            rgba(197, 23, 255, 0.04) 4px
    );
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 2;
}

/* Petal reveal canvas — over portrait */
.ds-reveal-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* ── Reveal progress bar ─────────────────────────────────────────── */

.ds-reveal-bar-wrap {
    position: absolute;
    bottom: 1.8rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 6;
    transition: opacity 0.6s ease;
    white-space: nowrap;
}

.ds-portrait-field.revealed .ds-reveal-bar-wrap {
    opacity: 0;
    pointer-events: none;
}

.ds-reveal-label {
    font-family: var(--font-ghost);
    font-size: 0.63rem;
    letter-spacing: 0.4em;
    color: rgba(197, 23, 255, 0.7);
    text-transform: uppercase;
}

.ds-reveal-track {
    width: 180px;
    height: 3px;
    background: rgba(197, 23, 255, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.ds-reveal-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: linear-gradient(to right, rgba(123, 0, 204, 0.7), #C517FF);
    box-shadow: 0 0 8px rgba(197, 23, 255, 0.7);
    transition: width 0.4s ease;
}

.ds-reveal-pct {
    font-family: var(--font-ghost);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: rgba(220, 160, 255, 0.85);
    min-width: 2.5rem;
}

/* ── ID tag ──────────────────────────────────────────────────────── */

.ds-id-tag-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1.2rem;
    z-index: 6;
    position: relative;
}

.ds-id-tag-name {
    font-family: var(--font-ghost);
    font-size: 0.78rem;
    letter-spacing: 0.35em;
    color: rgba(197, 23, 255, 0.85);
    text-transform: uppercase;
    text-shadow: 0 0 14px rgba(197, 23, 255, 0.55);
    opacity: 0;
    transition: opacity 1s ease;
}

.ds-id-tag-sub {
    font-family: var(--font-ghost);
    font-size: 0.64rem;
    letter-spacing: 0.25em;
    color: rgba(180, 120, 220, 0.55);
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.ds-portrait-field.revealed .ds-id-tag-name,
.ds-portrait-field.revealed .ds-id-tag-sub {
    opacity: 1;
}

/* ── Bottom quote ────────────────────────────────────────────────── */

.ds-field-quote {
    position: absolute;
    bottom: 1.8rem;
    left: 50%;
    transform: translateX(-50%);
    width: 58%;
    text-align: center;
    z-index: 6;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
    pointer-events: none;
}

.ds-portrait-field.revealed .ds-field-quote {
    opacity: 1;
}

.ds-field-quote p {
    font-style: italic;
    font-size: 0.82rem;
    color: rgba(220, 160, 255, 0.55);
    line-height: 1.8;
    border-top: 1px solid rgba(197, 23, 255, 0.15);
    padding-top: 0.8rem;
}


/* ── ARE YOU SMILING? — Conversation Segment ─────────────────────── */

.shinobu-conversation {
    position: relative;
    width: 100%;
    min-height: 520px;
    margin-bottom: 3rem;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background:
            radial-gradient(ellipse at 30% 20%, rgba(140, 0, 200, 0.12) 0%, transparent 60%),
            radial-gradient(ellipse at 70% 80%, rgba(197, 23, 255, 0.06) 0%, transparent 50%),
            linear-gradient(180deg, rgba(8, 0, 14, 0.98) 0%, rgba(4, 0, 10, 0.99) 100%);
    border: 1px solid rgba(197, 23, 255, 0.15);
    box-shadow:
            inset 0 0 100px rgba(197, 23, 255, 0.03),
            0 0 80px rgba(140, 0, 200, 0.08);
}

/* Petal canvas */
.shinobu-petals {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Main arena — two-column */
.shinobu-arena {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    width: 100%;
    max-width: 1000px;
    position: relative;
    z-index: 3;
}

/* Portrait frame */
.shinobu-portrait-frame {
    position: relative;
    width: 280px;
    height: 380px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow:
            0 0 50px rgba(197, 23, 255, 0.2),
            inset 0 0 30px rgba(0, 0, 0, 0.4);
}

.shinobu-portrait {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: saturate(0.2) brightness(0.6);
    opacity: 0;
    transition: all 2s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 2;
}

.shinobu-conversation.active .shinobu-portrait {
    opacity: 1;
    filter: saturate(0.75) brightness(0.95) contrast(1.05);
}

.shinobu-conversation.complete .shinobu-portrait {
    filter: saturate(1) brightness(1) contrast(1.1);
}

.shinobu-scanline {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
            0deg,
            transparent,
            transparent 4px,
            rgba(197, 23, 255, 0.03) 4px,
            rgba(197, 23, 255, 0.03) 5px
    );
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 3;
}

/* Cover petals */
.shinobu-cover-petals {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

/* Dialogue column */
.shinobu-dialogue {
    flex: 1;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Typewriter text */
.shinobu-text {
    position: relative;
    min-height: 120px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.shinobu-text.active {
    opacity: 1;
    transform: none;
}

.shinobu-avatar {
    position: absolute;
    left: -60px;
    top: 0;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.shinobu-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(197, 23, 255, 0.9) 0%, rgba(140, 0, 200, 0.8) 60%, rgba(90, 0, 140, 0.6) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(197, 23, 255, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.1);
    opacity: 0;
    animation: shinobuAvatarFloat 3s ease-in-out infinite 1s;
}

@keyframes shinobuAvatarFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50%      { transform: translateY(-3px) rotate(2deg); }
}

.shinobu-message {
    background: rgba(10, 0, 18, 0.85);
    border: 1px solid rgba(197, 23, 255, 0.3);
    border-radius: 12px;
    padding: 1.8rem 2rem 1.8rem 3rem;
    backdrop-filter: blur(10px);
    font-family: var(--font-ghost);
    font-size: 1.05rem;
    line-height: 1.65;
    color: rgba(232, 192, 255, 0.95);
    letter-spacing: 0.02em;
    position: relative;
}

.shinobu-message::before
{
    content: '';
    position: absolute;
    left: 2.2rem;
    top: 2rem;
    width: 0;
    height: 0;
    transition: opacity 0.2s ease;
    border: 8px solid transparent;
    border-right-color: rgba(197, 23, 255, 0.3);
}


.shinobu-conversation .shinobu-message {
    color: #e8c0ff !important;
    opacity: 1 !important;
    z-index: 10 !important;
    background: rgba(10, 0, 18, 0.95) !important;
    border: 1px solid rgba(197, 23, 255, 0.5) !important;
}

.shinobu-text {
    opacity: 1 !important;
    z-index: 10 !important;
}

.shinobu-message * {
    color: inherit !important;
}


.shinobu-cursor {
    position: absolute;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 2px;
    height: 22px;
    background: rgba(197, 23, 255, 0.9);
    border-radius: 1px;
    opacity: 0;
    animation: shinobuCursorBlink 1s step-end infinite;
}

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

/* Response buttons */
.shinobu-responses {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.shinobu-responses.active {
    opacity: 1;
    transform: none;
}

.shinobu-response-btn {
    background: rgba(197, 23, 255, 0.08);
    border: 1px solid rgba(197, 23, 255, 0.4);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    color: rgba(232, 192, 255, 0.9);
    font-family: var(--font-ghost);
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.shinobu-response-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.shinobu-response-btn:hover {
    border-color: rgba(197, 23, 255, 0.7);
    box-shadow: 0 0 25px rgba(197, 23, 255, 0.3);
    transform: translateX(4px);
}

.shinobu-response-btn:hover::before {
    left: 100%;
}

.shinobu-response-btn:active {
    transform: translateX(2px);
}

/* Final inscription */
.shinobu-inscription {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-ghost);
    font-size: 0.82rem;
    color: rgba(220, 160, 255, 0.4);
    letter-spacing: 0.2em;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease 1s;
}

.shinobu-conversation.complete .shinobu-inscription {
    opacity: 1;
}

/* Responsive */
@media (max-width: 860px) {
    .shinobu-arena {
        flex-direction: column;
        gap: 2rem;
    }

    .shinobu-portrait-frame {
        width: 240px;
        height: 320px;
    }

    .shinobu-dialogue {
        max-width: none;
    }

    .shinobu-avatar {
        left: 0;
        position: relative;
    }

    .shinobu-message {
        padding: 1.4rem 1.6rem 1.4rem 2.2rem;
    }

    .shinobu-message::before {
        left: 1.8rem;
        top: 1.6rem;
    }
}

@media (max-width: 480px) {
    .shinobu-portrait-frame {
        width: 200px;
        height: 280px;
    }

    .shinobu-response-btn {
        padding: 0.9rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ── BUTTERFLY COUNTER — Fixed height, no growth ─────────────── */
.butterfly-counter {
    position: relative;
    width: 100%;
    height: 480px;               /* FIXED — no more growing */
    min-height: unset;           /* remove old min-height */
    margin-bottom: 3rem;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 2rem 1.5rem;
    background: radial-gradient(ellipse at 20% 30%, rgba(140, 0, 200, 0.1) 0%, transparent 60%), linear-gradient(180deg, rgba(8, 0, 14, 0.95) 0%, rgba(4, 0, 10, 0.98) 100%);
    border: 1px solid rgba(197, 23, 255, 0.18);
    box-shadow: inset 0 0 60px rgba(197, 23, 255, 0.02), 0 0 40px rgba(140, 0, 200, 0.06);
}

/* Catch canvas — absolute, full segment */
.butterfly-catch-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Stats row */
.butterfly-stats {
    display: flex;
    gap: 3rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    z-index: 3;
    position: relative;
    flex-shrink: 0;
}

.butterfly-count {
    text-align: center;
    min-width: 140px;
}

.butterfly-number {
    font-family: var(--font-ghost);
    font-size: clamp(2rem, 6vw, 3.2rem);
    font-weight: 900;
    background: linear-gradient(135deg, #C517FF, #e8c0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    letter-spacing: -0.02em;
}

.butterfly-label {
    font-family: var(--font-ghost);
    font-size: 0.73rem;
    letter-spacing: 0.3em;
    color: rgba(197, 23, 255, 0.6);
    text-transform: uppercase;
}

.wisteria-bar {
    flex: 1;
    max-width: 280px;
}

.wisteria-track {
    height: 6px;
    background: rgba(197, 23, 255, 0.12);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(197, 23, 255, 0.25);
}

.wisteria-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, rgba(123, 0, 204, 0.8), #C517FF);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(197, 23, 255, 0.6);
    transition: width 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.wisteria-label {
    font-family: var(--font-ghost);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    color: rgba(220, 160, 255, 0.7);
    text-transform: uppercase;
    margin-top: 0.6rem;
    display: block;
    text-align: center;
}

/* ── Specimen board — complete rework ────────────────────────── */
.specimen-board {
    position: relative;
    width: 100%;
    max-width: 720px;
    height: 240px;               /* FIXED height */
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    z-index: 3;
    border: 1px solid rgba(197, 23, 255, 0.2);
    background: rgba(6, 0, 12, 0.9);
}

/* Purple glass look — no cork */
.specimen-board::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 0%, rgba(197, 23, 255, 0.06) 0%, transparent 50%), radial-gradient(ellipse at 80% 100%, rgba(140, 0, 200, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Top label */
.specimen-board::after {
    content: 'SPECIMEN COLLECTION';
    position: absolute;
    top: 0.7rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-ghost);
    font-size: 0.61rem;
    letter-spacing: 0.45em;
    color: rgba(197, 23, 255, 0.3);
    text-transform: uppercase;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
}

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

.specimen-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: rgba(197, 23, 255, 0.25);
    font-family: var(--font-ghost);
    font-size: 0.73rem;
    letter-spacing: 0.2em;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 2;
}

.specimen-empty.hidden {
    opacity: 0;
}

.specimen-empty i {
    font-size: 2rem;
    opacity: 0.2;
}

/* Milestone popup */
.milestone-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: rgba(10, 0, 18, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(197, 23, 255, 0.6);
    border-radius: 12px;
    padding: 1.5rem 2.5rem;
    box-shadow: 0 0 50px rgba(197, 23, 255, 0.4);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    max-width: 360px;
    text-align: center;
}

.milestone-popup.showing {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.milestone-text {
    font-family: var(--font-ghost);
    font-size: 1rem;
    color: rgba(220, 160, 255, 0.95);
    letter-spacing: 0.1em;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 860px)
{
    .butterfly-counter { height: 520px; }
    .butterfly-stats
    {
        flex-direction: column;
        gap: 1.2rem;
        align-items: center;
    }
    .wisteria-bar { max-width: none; width: 260px; }
    .specimen-board { height: 200px; }
}

@media (max-width: 480px) {
    .butterfly-counter { height: 480px; }
    .specimen-board { height: 160px; }
}


/* ── Recording mode ──────────────────────────────────────────────── */

.recording-mode .ds-ambient-canvas,
.recording-mode .ds-petal-canvas        { display: none !important; }
.recording-mode .ds-torii-kasagi        { animation: none !important; }
.recording-mode .ds-torii-drape         { animation: none !important; }
.recording-mode .ds-portrait-field::before { animation: none !important; }
.recording-mode .ds-id-tag-name,
.recording-mode .ds-id-tag-sub          { opacity: 1 !important; transition: none !important; }
.recording-mode .ds-gate-stat           { opacity: 1 !important; transform: none !important; transition: none !important; }
.recording-mode .ds-portrait-img {
    opacity: 1 !important;
    filter: saturate(0.65) brightness(0.92) contrast(1.05) !important;
    transition: none !important;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 860px) {
    .ds-portrait-arena {
        flex-direction: column;
        gap: 1.5rem;
    }

    .ds-stats-col {
        flex-direction: row;
        max-width: 100%;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .ds-stats-left,
    .ds-stats-right            { align-items: stretch; text-align: left; }

    .ds-gate-stat              { min-width: 160px; flex: 1; }

    /* Reset directional borders on mobile */
    .ds-stats-left  .ds-gate-stat { border-right: none; border-left: 2px solid rgba(197, 23, 255, 0.45); transform: translateY(8px); }
    .ds-stats-right .ds-gate-stat { transform: translateY(8px); }

    .ds-torii-wrap { width: 280px; height: 370px; }
    .ds-portrait-field { min-height: 520px; padding: 2rem 1rem 5rem; }
    .ds-field-quote    { width: 82%; }
}

@media (max-width: 480px) {
    .ds-torii-wrap     { width: 240px; height: 320px; }
    .ds-portrait-frame { width: 130px; height: 190px; }
    .ds-gate-stat      { min-width: 130px; }
    .ds-field-quote    { width: 90%; }
}
