/* ============================================================
   book-select.css  (v4.3 — 2026-03-22)
   screen-book-select 전용 스타일
   [New] 슬라이딩 캐러셀 (viewport / track / translateX)
   [New] 거리 기반 원근감 깊이 효과 (JS inline style)
   [New] 빌런 이미지: ink_shadow_boss / finalredvillain
   ============================================================ */

/* ── Screen container ─────────────────────────────────────── */
#screen-book-select {
    background: radial-gradient(ellipse at 50% 0%, #280050 0%, #0a000f 60%);
    justify-content: flex-start;
    padding: 0;
    overflow: hidden;
    flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────── */
.bs-header {
    width: 100%;
    padding: 10px 20px 6px;
    box-sizing: border-box;
    text-align: center;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(80,0,160,0.30) 0%, transparent 100%);
}
.bs-rift-badge {
    display: inline-block;
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    letter-spacing: 4px;
    color: #ff4d88;
    text-transform: uppercase;
    background: rgba(255,60,120,0.1);
    border: 1px solid rgba(255,60,120,0.35);
    border-radius: 20px;
    padding: 3px 12px;
    margin-bottom: 6px;
    text-shadow: 0 0 10px rgba(255,60,120,0.6);
}
.bs-title-text {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e8d0ff;
    letter-spacing: 3px;
    margin: 0;
    text-shadow: 0 0 20px rgba(180,0,255,0.5);
}

/* ─────────────────────────────────────────────────────────────
   CAROUSEL — sliding rail system
   ───────────────────────────────────────────────────────────── */

/* Outer row: [prev-btn] [viewport] [next-btn] */
.bs-carousel-wrap {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 14px 6px 10px;
    box-sizing: border-box;
    gap: 4px;
}

/* Nav buttons sit as flex siblings — no absolute positioning */
.bs-nav-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(180,100,255,0.4);
    background: rgba(80,20,140,0.25);
    color: #c090ff;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.12s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 5;
}
.bs-nav-btn:hover  { background: rgba(110,50,200,0.4); }
.bs-nav-btn:active { transform: scale(0.88); }

/* Clipping viewport — books slide inside this */
.bs-carousel-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 168px;   /* enough for tallest book + label */
}

/* Sliding rail — JS sets transform: translateX(offset) */
.bs-carousel-track {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    position: absolute;
    left: 0;
    top: 50%;
    /* JS overrides transform completely: translateY(-50%) translateX(...) */
    transform: translateY(-50%);
    will-change: transform;
    /* transition injected by JS after first paint */
}

/* ── CAROUSEL ITEM — fixed width for predictable slot math ── */
.bs-carousel-item {
    flex-shrink: 0;
    width: 90px;           /* ITEM_WIDTH constant in JS */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    /* transform / opacity: 100% JS-controlled (distance-based depth) */
    will-change: transform, opacity;
    transition: transform 0.38s cubic-bezier(0.22,1,0.36,1),
                opacity   0.30s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}

/* ── Carousel cover image — 80×110 (base size) ─────────────── */
.bs-carousel-cover-wrap {
    width: 80px;
    height: 110px;
    border-radius: 7px;
    overflow: hidden;
    background: #13001e;
    position: relative;
    box-shadow: 0 4px 14px rgba(0,0,0,0.65);
    transition: box-shadow 0.35s;
}
.bs-carousel-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: scale(1.08);
}
.bs-carousel-cover-fallback {
    font-size: 1.8rem;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Active item cover glow — pulse animation */
.bs-carousel-item.bs-carousel-active .bs-carousel-cover-wrap {
    box-shadow:
        0 0 0 2px var(--bs-item-accent, #8b2fc9),
        0 0 22px var(--bs-item-glow, rgba(139,47,201,0.6)),
        0 6px 20px rgba(0,0,0,0.7);
    animation: bsGlowPulse 2.5s ease-in-out infinite;
}

/* SELECTED / LOCKED badge */
.bs-carousel-item-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel', serif;
    font-size: 0.50rem;
    letter-spacing: 2px;
    color: #fff;
    background: var(--bs-item-accent, #8b2fc9);
    padding: 2px 9px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 0 10px var(--bs-item-glow, rgba(139,47,201,0.6));
    z-index: 10;
    display: none;
}
.bs-carousel-item.bs-carousel-active .bs-carousel-item-badge {
    display: block;
}

/* Carousel label */
.bs-carousel-label {
    font-family: 'Cinzel', serif;
    font-size: 0.56rem;
    color: #9a88b8;
    text-align: center;
    letter-spacing: 0.4px;
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s;
    line-height: 1.2;
}
.bs-carousel-item.bs-carousel-active .bs-carousel-label {
    color: #fff;
}

/* Glow pulse animation */
@keyframes bsGlowPulse {
    0%,100% { box-shadow: 0 0 0 2px var(--bs-item-accent,#8b2fc9), 0 0 16px var(--bs-item-glow,rgba(139,47,201,0.5)), 0 6px 20px rgba(0,0,0,0.7); }
    50%     { box-shadow: 0 0 0 2px var(--bs-item-accent,#8b2fc9), 0 0 30px var(--bs-item-glow,rgba(139,47,201,0.85)), 0 6px 20px rgba(0,0,0,0.7); }
}

/* ── Detail panel ───────────────────────────────────────────── */
.bs-detail-panel {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px 18px 10px;
    box-sizing: border-box;
    gap: 16px;
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(to bottom, rgba(40,0,80,0.12) 0%, rgba(20,0,40,0.40) 100%);
}
.bs-detail-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bs-detail-cover {
    width: 120px;
    height: 164px;
    object-fit: cover;
    border-radius: 9px;
    box-shadow:
        0 0 0 2px rgba(180,100,255,0.35),
        0 10px 30px rgba(0,0,0,0.65),
        0 0 30px rgba(120,50,220,0.3);
    transform: perspective(600px) rotateY(-8deg);
    transition: opacity 0.25s ease, transform 0.35s ease;
}
.bs-detail-cover:hover {
    transform: perspective(600px) rotateY(0deg);
}
.bs-detail-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: opacity 0.25s ease;
}

/* Detail info elements */
.bs-detail-title {
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.5px;
    word-break: break-word;
}
.bs-detail-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    color: #706080;
    letter-spacing: 0.3px;
    margin-top: -4px;
}
.bs-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bs-meta-item {
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    color: #9090a8;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.bs-meta-item b {
    color: #d8d8e8;
    font-weight: 700;
}
.bs-detail-difficulty {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
}
.bs-star { font-size: 1rem; line-height: 1; }
.bs-diff-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-left: 5px;
}
.bs-detail-tagline {
    font-family: 'Crimson Text', serif;
    font-size: 0.82rem;
    color: #8a7aa0;
    font-style: italic;
    line-height: 1.45;
    margin: 0;
    border-left: 2px solid rgba(180,100,255,0.3);
    padding-left: 8px;
}

/* ── Locked book overlay ─────────────────────────────────────── */
.bs-carousel-cover-locked {
    filter: grayscale(55%) brightness(0.7);
}
.bs-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.38);
    border-radius: 7px;
    z-index: 3;
}
.bs-lock-icon { font-size: 1.4rem; filter: drop-shadow(0 0 6px rgba(255,255,255,0.5)); }
.bs-locked-badge {
    display: inline-block;
    background: rgba(80,80,80,0.55);
    border: 1px solid rgba(200,200,200,0.25);
    border-radius: 14px;
    padding: 4px 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #bbb;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 4px 0;
    width: fit-content;
}
.bs-locked-hint {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    color: #5a5a6e;
    font-style: italic;
    margin-top: 4px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.bs-footer {
    flex-shrink: 0;
    width: 100%;
    padding: 8px 20px 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 60%, transparent);
}
.bs-browse-hint {
    font-family: 'Outfit', sans-serif;
    font-size: 0.68rem;
    color: #5a4870;
    letter-spacing: 1px;
    margin: 0;
    text-align: center;
}
.bs-start-btn {
    width: 220px;
    padding: 13px 0;
    border: none;
    border-radius: 30px;
    background: linear-gradient(90deg, #6200ea, #b000df);
    color: #fff;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139,47,201,0.6), 0 0 0 1px rgba(180,100,255,0.2);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    text-transform: uppercase;
}
.bs-start-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 28px rgba(139,47,201,0.85), 0 0 0 1px rgba(200,130,255,0.4);
}
.bs-start-btn:active  { transform: scale(0.97); filter: brightness(0.92); }
.bs-start-btn:disabled { opacity: 0.7; cursor: default; transform: none; }

/* legacy compat */
.bs-select-btn { display: none; }

/* ── Villain showcase row ───────────────────────────────────── */
.bs-villain-row {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 12px 0;
    box-sizing: border-box;
    height: 100px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(to top, rgba(40,0,10,0.85) 0%, transparent 100%);
    pointer-events: none;
}
.bs-villain-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.bs-villain-img {
    width: 86px;
    height: auto;
    max-height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255,60,60,0.5));
    display: block;
}
.bs-villain--left .bs-villain-img {
    animation: bsVillainLeft 3.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(30,120,255,0.55));
}
.bs-villain--right .bs-villain-img {
    animation: bsVillainRight 4s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255,40,40,0.65));
}
@keyframes bsVillainLeft {
    0%,100% { transform: translateY(0px) scaleX(-1); }
    50%      { transform: translateY(-7px) scaleX(-1); }
}
@keyframes bsVillainRight {
    0%,100% { transform: translateY(0px); }
    50%      { transform: translateY(-8px); }
}
.bs-villain-label {
    font-family: 'Cinzel', serif;
    font-size: 0.46rem;
    letter-spacing: 2px;
    color: #664444;
    text-transform: uppercase;
    text-align: center;
}
.bs-villain-center-text {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 12px;
}
.bs-villain-tagline {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    color: #aa4422;
    text-align: center;
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 0 12px rgba(255,80,0,0.5);
    letter-spacing: 0.5px;
    animation: bsVillainGlow 2s ease-in-out infinite;
}
@keyframes bsVillainGlow {
    0%,100% { text-shadow: 0 0 10px rgba(255,80,0,0.4); }
    50%      { text-shadow: 0 0 22px rgba(255,130,0,0.8); }
}

/* ── compact for small screens ──────────────────────────────── */
@media (max-height: 680px) {
    .bs-carousel-viewport { height: 140px; }
    .bs-carousel-cover-wrap { width: 70px; height: 96px; }
    .bs-detail-cover  { width: 100px; height: 136px; }
    .bs-detail-panel  { padding: 8px 14px 6px; gap: 12px; }
    .bs-detail-title  { font-size: 0.85rem; }
    .bs-footer        { padding: 6px 20px 10px; }
    .bs-start-btn     { padding: 12px 0; font-size: 0.85rem; width: 190px; }
    .bs-villain-row   { height: 80px; }
    .bs-villain-img   { width: 70px; max-height: 75px; }
}

/* ================================================================
   MAGIC BORDER — 회전 레인보우 테두리 + 맥동 글로우 (v4.4)
   구조: .bs-magic-outer (relative) > ::before(ring) > .bs-carousel-cover-wrap (absolute)
   ================================================================ */

/* Outer wrapper: same size as cover, overflow visible for ring */
.bs-magic-outer {
    position: relative;
    width: 80px;
    height: 110px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Spinning conic-gradient rainbow ring */
.bs-magic-outer::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 12px;
    background: conic-gradient(
        from 0deg,
        #ff00cc 0%,
        #ffdd00 20%,
        #00ffcc 40%,
        #00aaff 60%,
        #cc00ff 80%,
        #ff00cc 100%
    );
    opacity: 0;
    animation: bsRingSpin 1.8s linear infinite;
    transition: opacity 0.35s ease;
    z-index: 0;
}

/* Outer diffuse glow — slightly larger, pulsing */
.bs-magic-outer::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 15px;
    background: transparent;
    box-shadow:
        0 0 18px 5px rgba(200, 60, 255, 0.55),
        0 0 36px 10px rgba(0, 200, 255, 0.30);
    opacity: 0;
    animation: bsMagicGlowPulse 2s ease-in-out infinite;
    transition: opacity 0.35s ease;
    z-index: -1;
}

/* Activate on selected item */
.bs-carousel-item.bs-carousel-active .bs-magic-outer::before,
.bs-carousel-item.bs-carousel-active .bs-magic-outer::after {
    opacity: 1;
}

/* Cover-wrap fills magic-outer, sits ABOVE ::before (z-index:1) */
.bs-carousel-cover-wrap {
    position: absolute !important;
    inset: 0 !important;
    border-radius: 8px;
    overflow: hidden;
    background: #13001e;
    z-index: 1;
    /* box-shadow handled by magic-outer */
    box-shadow: none !important;
}

/* Badge is inside magic-outer — correctly visible (not clipped) */
.bs-carousel-item-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel', serif;
    font-size: 0.48rem;
    letter-spacing: 2px;
    color: #fff;
    background: var(--bs-item-accent, #8b2fc9);
    padding: 2px 9px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 0 10px var(--bs-item-glow, rgba(139,47,201,0.6));
    z-index: 10;
    display: none;
    pointer-events: none;
}
.bs-carousel-item.bs-carousel-active .bs-carousel-item-badge {
    display: block;
}

@keyframes bsRingSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes bsMagicGlowPulse {
    0%, 100% {
        box-shadow:
            0 0 18px 5px rgba(200, 60, 255, 0.55),
            0 0 36px 10px rgba(0, 200, 255, 0.30);
    }
    50% {
        box-shadow:
            0 0 28px 10px rgba(0, 200, 255, 0.70),
            0 0 55px 18px rgba(200, 60, 255, 0.40);
    }
}

/* =================================================================
   MAGIC BORDER v2: Scroll Trace Ring (SVG stroke-dashoffset orbit)
   ===============================================================
   Perimeter of rect(x=2 y=2 w=80 h=110 rx=8):
     2*(80-16) + 2*(110-16) + 2*PI*8 = 128+188+50.3 = 366px
   ================================================================= */

/* Disable old conic-gradient ::before / ::after */
.bs-magic-outer::before,
.bs-magic-outer::after {
    opacity: 0 !important;
    animation: none !important;
    display: none !important;
}

/* SVG overlay — sits ABOVE cover-wrap (z-index:2) */
.bs-ring-svg {
    position: absolute;
    left: -2px;
    top:  -2px;
    width:  84px;
    height: 114px;
    overflow: visible;
    pointer-events: none;
    z-index: 2;
}

/* Layer 1: Full perimeter dim glow — breathing */
.bs-ring-base {
    fill: none;
    stroke: var(--bs-item-accent, #8b2fc9);
    stroke-width: 1.2;
    opacity: 0;
    transition: opacity 0.5s ease;
    /* no dasharray = full stroke */
}

/* Layer 2: Orbiting 65px light segment */
.bs-ring-trace {
    fill: none;
    stroke: var(--bs-item-accent, #8b2fc9);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 65 301;   /* 65 + 301 = 366 (perimeter) */
    stroke-dashoffset: 366;
    opacity: 0;
    transition: opacity 0.4s ease;
    filter: drop-shadow(0 0 5px var(--bs-item-accent, #8b2fc9))
            drop-shadow(0 0 2px rgba(255,255,255,0.6));
}

/* Layer 3: Bright 5px head dot at the leading edge */
.bs-ring-head {
    fill: none;
    stroke: #ffffff;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 5 361;    /* tiny 5px dot */
    stroke-dashoffset: 366;
    opacity: 0;
    transition: opacity 0.4s ease;
    filter: drop-shadow(0 0 6px #ffffff) drop-shadow(0 0 3px var(--bs-item-accent, #8b2fc9));
}

/* ── Activate on selection ───────────────────────────────── */
.bs-carousel-item.bs-carousel-active .bs-ring-base {
    opacity: 0.30;
    animation: bsBaseBreath 2.8s ease-in-out infinite;
}
.bs-carousel-item.bs-carousel-active .bs-ring-trace {
    opacity: 1;
    animation: bsTraceOrbit 2.8s linear infinite;
}
.bs-carousel-item.bs-carousel-active .bs-ring-head {
    opacity: 1;
    animation: bsTraceOrbit 2.8s linear infinite;
}

/* Orbiting (stroke sweeps around perimeter) */
@keyframes bsTraceOrbit {
    from { stroke-dashoffset: 366; }
    to   { stroke-dashoffset:   0; }
}

/* Full perimeter dims/brightens slowly */
@keyframes bsBaseBreath {
    0%, 100% { opacity: 0.20; }
    50%      { opacity: 0.55; }
}

/* =================================================================
   MAGIC BORDER v3: Electric Arc (idea 2) — overrides scroll trace
   steps(1,end) = 즉각적 점프 → 번개 아크의 불규칙 스파크 재현
   ================================================================= */

/* 1. 기존 orbit 애니메이션 완전 비활성화 */
.bs-ring-trace,
.bs-ring-head {
    opacity: 0 !important;
    animation: none !important;
}

/* 2. Base ring: 일정한 전기 청색 테두리 + 부드러운 호흡 */
.bs-ring-base {
    stroke: #00c8ff !important;
    stroke-width: 1.8 !important;
}
.bs-carousel-item.bs-carousel-active .bs-ring-base {
    opacity: 0.75 !important;
    filter: drop-shadow(0 0 5px #00c8ff) drop-shadow(0 0 2px #aaeeff) !important;
    animation: bsArcBaseGlow 2s ease-in-out infinite !important;
}

/* 3. Electric flicker: bs-magic-outer box-shadow 를 steps(1) 로 돌린다 */
.bs-carousel-item.bs-carousel-active .bs-magic-outer {
    animation: bsElectricFlicker 2.2s steps(1, end) infinite;
    border-radius: 10px;
}

/* ── 베이스 호흡 ─────────────────────────────────────────── */
@keyframes bsArcBaseGlow {
    0%, 100% { opacity: 0.65; }
    50%      { opacity: 1.00; }
}

/* ── 전기 아크 플리커 (steps → 즉각 점프) ───────────────── */
@keyframes bsElectricFlicker {
    /* 0%: 안정 청색 글로우 */
    0%   { box-shadow:
        0 0 0 2px   #00c8ff,
        0 0 12px 4px  rgba(0,200,255,0.65),
        0 0 28px 8px  rgba(0,150,255,0.35); }

    /* 7%: 1차 서지 — 눈부신 백색 방전 */
    7%   { box-shadow:
        0 0 0 3px   #ffffff,
        0 0 26px 12px rgba(255,255,255,0.95),
        0 0 52px 22px rgba(0,200,255,0.75); }

    /* 9%: 아크 낙하 — 급격히 어두워짐 */
    9%   { box-shadow:
        0 0 0 1px   #0088bb,
        0 0  5px 1px  rgba(0,136,187,0.40),
        0 0 12px 3px  rgba(0,100,200,0.20); }

    /* 20%: 회복 청색 */
    20%  { box-shadow:
        0 0 0 2px   #00c8ff,
        0 0 14px 5px  rgba(0,200,255,0.80),
        0 0 32px 10px rgba(0,150,255,0.45); }

    /* 36%: 2차 서지 — 자색 변조 (리프트 에너지) */
    36%  { box-shadow:
        0 0 0 2px   #cc88ff,
        0 0 20px 8px  rgba(200,136,255,0.82),
        0 0 44px 16px rgba(150,80,255,0.55); }

    /* 38%: 순간 암흑 */
    38%  { box-shadow:
        0 0 0 1px   #6644aa,
        0 0  4px 1px  rgba(100,68,170,0.40),
        0 0 10px 2px  rgba(80,40,200,0.20); }

    /* 55%: 안정 청색 복귀 */
    55%  { box-shadow:
        0 0 0 2px   #00c8ff,
        0 0 10px 3px  rgba(0,200,255,0.70),
        0 0 24px 7px  rgba(0,150,255,0.40); }

    /* 70%: 3차 서지 — 최대 강도 */
    70%  { box-shadow:
        0 0 0 3px   #ffffff,
        0 0 32px 16px rgba(255,255,255,1.00),
        0 0 62px 28px rgba(0,200,255,0.82); }

    /* 72%: 하드 컷오프 */
    72%  { box-shadow:
        0 0 0 1px   #0088bb,
        0 0  4px 1px  rgba(0,136,187,0.35),
        0 0 10px 2px  rgba(0,100,200,0.18); }

    /* 85%: 소프트 회복 */
    85%  { box-shadow:
        0 0 0 2px   #44ccff,
        0 0 10px 3px  rgba(68,204,255,0.65),
        0 0 22px 6px  rgba(0,180,255,0.38); }

    /* 100%: 안정 循環 */
    100% { box-shadow:
        0 0 0 2px   #00c8ff,
        0 0 12px 4px  rgba(0,200,255,0.65),
        0 0 28px 8px  rgba(0,150,255,0.35); }
}

/* =================================================================
   MAGIC BORDER v3.1: Electric Arc (subtle) — 2026-03-22
   백색 flash 제거, max glow 반감, ease-in-out으로 부드럽게
   ================================================================= */

/* timing 교체: steps(1) → ease-in-out (부드러운 전이) */
.bs-carousel-item.bs-carousel-active .bs-magic-outer {
    animation: bsElectricSubtle 3s ease-in-out infinite !important;
    border-radius: 10px;
}

@keyframes bsElectricSubtle {
    /* 안정 청색 기준 */
    0%   { box-shadow:
        0 0 0 2px   #00c8ff,
        0 0 10px 3px  rgba(0,200,255,0.55),
        0 0 22px 6px  rgba(0,150,255,0.28); }

    /* 살짝 밝아짐 */
    15%  { box-shadow:
        0 0 0 2px   #22d4ff,
        0 0 14px 5px  rgba(0,210,255,0.68),
        0 0 28px 9px  rgba(0,170,255,0.38); }

    /* 짧은 부드러운 딤 */
    22%  { box-shadow:
        0 0 0 1.5px #0088bb,
        0 0  7px 2px  rgba(0,136,187,0.42),
        0 0 15px 4px  rgba(0,100,200,0.22); }

    /* 은은한 자색 (Rift 에너지 힌트) */
    45%  { box-shadow:
        0 0 0 2px   #aa88ff,
        0 0 12px 4px  rgba(170,136,255,0.58),
        0 0 24px 7px  rgba(120,80,255,0.32); }

    /* 자색에서 청색 복귀 중 살짝 어두운 순간 */
    52%  { box-shadow:
        0 0 0 1.5px #5566cc,
        0 0  6px 2px  rgba(85,102,204,0.40),
        0 0 14px 4px  rgba(60,80,200,0.20); }

    /* 안정 청색 */
    65%  { box-shadow:
        0 0 0 2px   #00c8ff,
        0 0 11px 3px  rgba(0,200,255,0.60),
        0 0 23px 6px  rgba(0,150,255,0.32); }

    /* 완만하게 조금 더 밝은 피크 — 눈에 띄지만 튀지 않음 */
    80%  { box-shadow:
        0 0 0 2px   #33d8ff,
        0 0 14px 5px  rgba(0,215,255,0.70),
        0 0 30px 9px  rgba(0,165,255,0.38); }

    /* 짧은 소프트 낙하 */
    84%  { box-shadow:
        0 0 0 1.5px #0088bb,
        0 0  6px 2px  rgba(0,136,187,0.38),
        0 0 14px 3px  rgba(0,100,200,0.20); }

    /* 원점 복귀 */
    100% { box-shadow:
        0 0 0 2px   #00c8ff,
        0 0 10px 3px  rgba(0,200,255,0.55),
        0 0 22px 6px  rgba(0,150,255,0.28); }
}
