/**
 * Dantian Tab Styles
 * Styles for the dedicated Dantian tab with orb visualization and elemental roots display
 */

/* === PARENT CONTAINER === */
.dantian-parent-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* === TOP ROW: Orb + Stats + Roots === */
.dantian-top-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

/* === TAB LAYOUT (legacy) === */
.dantian-tab-layout {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    flex-wrap: wrap;
}

/* === ORB CONTAINER === */
.dantian-orb-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

/* === LARGE ORB === */
.dantian-large-orb {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    animation: dantian-pulse 3s ease-in-out infinite;
    transition: width 0.5s, height 0.5s;
    --orb-glow-color: var(--ui-teal);
    flex-shrink: 0;
}

/* Pulse animation */
@keyframes dantian-pulse {
    0%, 100% {
        box-shadow: 0 0 20px var(--orb-glow-color, var(--ui-teal)),
                    inset 0 0 30px rgba(78, 205, 196, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px var(--orb-glow-color, var(--ui-teal)),
                    inset 0 0 50px rgba(78, 205, 196, 0.3);
        transform: scale(1.03);
    }
}

/* Orb state classes */
.dantian-large-orb.state-corrupted {
    --orb-glow-color: var(--p-dc143c);
}

.dantian-large-orb.state-pure {
    --orb-glow-color: var(--ui-teal);
}

.dantian-large-orb.state-infinity,
.dantian-orb.state-infinity {
    --orb-glow-color: var(--p-a855f7);
    animation: dantian-infinity-pulse 2s ease-in-out infinite;
    border-color: rgba(168, 85, 247, 0.6);
}

@keyframes dantian-infinity-pulse {
    0%, 100% {
        box-shadow: 0 0 25px var(--p-a855f7),
                    0 0 50px rgba(168, 85, 247, 0.4),
                    inset 0 0 30px rgba(168, 85, 247, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 45px var(--p-a855f7),
                    0 0 80px rgba(168, 85, 247, 0.5),
                    inset 0 0 50px rgba(168, 85, 247, 0.3);
        transform: scale(1.04);
    }
}

.dantian-purity.infinity {
    background: linear-gradient(180deg, var(--p-d8b4fe) 0%, var(--p-a855f7) 50%, var(--p-7c3aed) 100%);
}

/* === ORB SEGMENT LAYERS === */
.dantian-orb-layer {
    position: absolute;
    left: 0;
    right: 0;
    transition: height 0.3s ease, bottom 0.3s ease;
}

.dantian-purity-layer {
    background: linear-gradient(180deg, var(--p-5fd9d0) 0%, var(--ui-teal) 50%, var(--p-3ba89f) 100%);
}

/* Heaven Chosen golden purity layer */
.dantian-purity-layer.heaven-chosen {
    background: linear-gradient(180deg, var(--p-fff4b0) 0%, var(--ui-gold) 50%, var(--p-8b6914) 100%);
}

.dantian-impurity-layer {
    background: linear-gradient(180deg, var(--p-2a2a2a) 0%, var(--p-1a1a1a) 50%, var(--p-0a0a0a) 100%);
}

.dantian-corruption-layer {
    background: linear-gradient(180deg, var(--p-ff4444) 0%, var(--p-dc143c) 50%, var(--p-8b0000) 100%);
}

/* === ORB CENTER TEXT === */
.dantian-orb-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    z-index: 10;
    pointer-events: none;
}

/* === DEVELOP BUTTON === */
.dantian-develop-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--ui-teal) 0%, var(--p-3ba89f) 100%);
    border: none;
    border-radius: 8px;
    color: var(--ui-navy-1);
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.dantian-develop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.dantian-develop-btn:active {
    transform: translateY(0);
}

.dantian-develop-btn.active {
    background: linear-gradient(135deg, var(--ui-gold) 0%, var(--p-ffaa00) 100%);
    animation: btn-pulse 1.5s ease-in-out infinite;
}

@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 4px 25px rgba(255, 215, 0, 0.5); }
}

/* === STATS PANEL === */
.dantian-stats-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px 20px;
    min-width: 220px;
    flex-shrink: 0;
}

.dantian-stats-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--ui-gold);
    margin-bottom: 15px;
    text-align: center;
}

.dantian-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 20px;
}

.dantian-stat-row:last-child {
    border-bottom: none;
}

.dantian-stat-label {
    color: var(--p-aaaaaa);
    font-size: 0.95em;
}

.dantian-stat-value {
    color: var(--ui-teal);
    font-weight: bold;
    font-size: 1em;
}

.dantian-stat-value.purity {
    color: var(--ui-teal);
}

.dantian-stat-value.impurity {
    color: var(--p-888888);
}

.dantian-stat-value.demonic {
    color: var(--p-dc143c);
}

/* === CORRUPTED DANTIAN TIER SECTION === */
.dantian-tier-section {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(220, 20, 60, 0.3);
}

/* === SIZE DISPLAY === */
.dantian-size-bonus {
    color: var(--p-95e1d3);
    font-size: 0.85em;
    margin-left: 5px;
}

/* === STAT PERCENT === */
.dantian-stat-percent {
    color: var(--p-888888);
    font-size: 0.85em;
    margin-left: 5px;
    font-weight: normal;
}

/* === ATTUNEMENT === */
.dantian-attunement {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dantian-attunement-icon {
    font-size: 1.2em;
}

/* === ELEMENTAL ROOTS PANEL (separate panel) === */
.dantian-roots-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    flex: 1;
    min-width: 420px;
    max-width: 550px;
}

.dantian-roots-title {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--ui-gold);
    margin-bottom: 12px;
    text-align: center;
}

/* Grid layout for elemental roots - 3 per row */
.dantian-roots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* === ELEMENTAL ROOT CARD === */
.dantian-root-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 8px 10px;
    border-left: 3px solid var(--p-888888);
}

.dantian-root-item.inactive {
    opacity: 0.5;
}

.dantian-root-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 2px;
}

.dantian-root-name {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
}

.dantian-root-icon {
    font-size: 1em;
}

.dantian-root-label {
    color: var(--p-dddddd);
    font-weight: bold;
}

.dantian-root-value {
    color: var(--ui-teal);
    font-weight: bold;
    font-size: 0.85em;
}

.dantian-root-percent {
    color: var(--p-888888);
    font-size: 0.75em;
    margin-left: 2px;
}

/* Bar container */
.dantian-root-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
}

.dantian-root-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Element-specific bar colors */
.dantian-root-bar-fill.physical { background: linear-gradient(90deg, var(--p-888888), var(--p-aaaaaa)); }
.dantian-root-bar-fill.fire { background: linear-gradient(90deg, var(--ui-danger), var(--p-ff4444)); }
.dantian-root-bar-fill.water { background: linear-gradient(90deg, var(--ui-teal), var(--p-5fd9d0)); }
.dantian-root-bar-fill.wood { background: linear-gradient(90deg, var(--p-95e1d3), var(--p-7fcfbf)); }
.dantian-root-bar-fill.metal { background: linear-gradient(90deg, var(--p-c7c7c7), var(--p-e0e0e0)); }
.dantian-root-bar-fill.earth { background: linear-gradient(90deg, var(--p-d4a574), var(--p-c99a65)); }

/* === DAMAGE BONUS DISPLAY === */
.dantian-root-bonus {
    font-size: 0.75em;
    color: var(--p-95e1d3);
    margin-top: 4px;
}

.dantian-root-conversion {
    font-size: 0.7em;
    color: var(--p-888888);
    margin-top: 2px;
}

/* Wuxing cycle bonus/penalty display */
.dantian-root-wuxing-bonus {
    font-size: 0.75em;
    color: var(--ui-success);
    margin-top: 2px;
}

.dantian-root-wuxing-penalty {
    font-size: 0.75em;
    color: var(--p-ef4444);
    margin-top: 2px;
}

/* === MILESTONES SECTION (Bottom Row) === */
.dantian-milestones-section {
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dantian-milestones-title {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--ui-gold);
    margin-bottom: 15px;
    text-align: center;
}

/* Grid layout for milestones - horizontal */
.dantian-milestones-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.milestone-row {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    min-width: 180px;
    max-width: 220px;
    flex: 1 1 180px;
}

.milestone-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.milestone-icon {
    font-size: 1.3em;
}

.milestone-name {
    font-weight: bold;
    font-size: 1em;
}

.milestone-bonus {
    font-size: 0.95em;
    color: var(--ui-teal);
    margin-bottom: 8px;
}

.milestone-progress {
    height: 5px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.milestone-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.milestone-next {
    font-size: 0.8em;
    color: var(--p-888888);
}

/* === PROGRESS BAR FOR DEVELOP === */
.dantian-progress-container {
    width: 100%;
    margin-top: 10px;
}

.dantian-progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.dantian-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ui-teal), var(--p-5fd9d0));
    transition: width 0.3s ease;
    border-radius: 3px;
}

.dantian-progress-text {
    text-align: center;
    font-size: 0.85em;
    color: var(--p-888888);
    margin-top: 4px;
}

/* === LEFT COLUMN (Radial + Inventory) === */
.dantian-left-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* === RADIAL LAYOUT (D3.js rendered) === */
.dantian-radial-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
}

.dantian-radial-container svg {
    display: block;
}

/* === ELEMENTAL NODES INVENTORY PANEL === */
.dantian-inventory-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px 15px;
    width: 100%;
    max-width: 400px;
    border: 1px dashed rgba(255, 215, 0, 0.3);
}

.dantian-inventory-panel .text-game-gold {
    color: var(--ui-gold);
}

.dantian-inventory-panel .text-game-light-gray {
    color: var(--p-888888);
}

/* === PATH row info button (opens the bonuses modal) === */
.dtn-path-info-btn {
    width: 16px; height: 16px; line-height: 14px; padding: 0; flex-shrink: 0;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06);
    color: var(--p-cfeeea); font-size: .62rem; font-weight: 700; font-style: italic; font-family: Georgia, serif;
    cursor: pointer; transition: all .15s;
}
.dtn-path-info-btn:hover { background: rgba(78,205,196,.18); border-color: rgba(78,205,196,.6); color: var(--p-eafffb); }

/* === SETUP BANNER (Confirm & Begin) === */
.dtn-setup-banner { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; padding: 14px 18px; border-radius: 8px; border: 1px solid rgba(78,205,196,.25); background: rgba(0,0,0,.3); }
.dtn-setup-rune { flex-shrink: 0; }
.dtn-setup-eyebrow { font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; color: var(--p-e8c96a); font-weight: 700; }
.dtn-setup-sub { font-size: .9rem; color: var(--p-e4f3f0); font-weight: 600; margin-top: 2px; }
.dtn-setup-hint { font-size: .68rem; color: var(--p-8a8a9a); margin-top: 2px; }
.dtn-confirm-btn { margin-left: auto; flex-shrink: 0; cursor: pointer; padding: 9px 24px; border-radius: 6px; white-space: nowrap; font-weight: 700; font-size: .85rem; color: var(--p-04211f); border: none; background: var(--ui-teal); transition: background .15s; }
.dtn-confirm-btn:hover { background: var(--p-5fd8cf); }

/* === REFINED ELEMENTAL NODES PANEL (setup editor) === */
#dantianInventoryPanel { border: 1px solid rgba(255,255,255,.08); border-radius: 8px; background: rgba(0,0,0,.25); padding: 12px; max-height: 340px; overflow-y: auto; }
.dtn-node-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.06); }
.dtn-node-title { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--p-e8c96a); font-weight: 700; }
.dtn-node-hint { font-size: .64rem; color: var(--p-8a8a9a); font-style: italic; }
.dtn-mini-btn { font-size: .64rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--p-cfeeea); border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); transition: background .15s; }
.dtn-mini-btn:hover { background: rgba(78,205,196,.12); }
.dtn-elem-row { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 6px; margin-bottom: 3px; border-left: 2px solid var(--c-bd, transparent); }
.dtn-elem-label { display: flex; align-items: center; gap: 6px; min-width: 78px; flex-shrink: 0; }
.dtn-elem-name { font-size: .72rem; font-weight: 700; }
.dtn-node { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 9px; border-radius: 6px; cursor: grab; user-select: none; font-weight: 700; line-height: 1; border: 1px solid var(--c-bd); background: rgba(0,0,0,.4); color: var(--c); transition: background .12s, border-color .12s; }
.dtn-node:hover { border-color: var(--c); background: rgba(0,0,0,.6); }
.dtn-node:active { cursor: grabbing; }
.dtn-node .t { font-size: .6rem; opacity: .8; }
.dtn-node .p { font-size: .82rem; }
.dtn-node .c { font-size: .6rem; color: var(--p-93a3a0); font-weight: 600; }

/* Desktop: widen the node panel (the #id beats the .class max-width:400px); mobile untouched. */
@media (min-width: 769px) {
    #dantianInventoryPanel { max-width: min(620px, calc(100vw - 60px)); }
}

/* Draggable nodes */
.dantian-draggable-node {
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.dantian-draggable-node:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.dantian-draggable-node:active {
    cursor: grabbing;
}

/* Drop target highlight animation */
@keyframes drop-highlight-pulse {
    0%, 100% {
        opacity: 1;
        stroke-width: 3;
    }
    50% {
        opacity: 0.5;
        stroke-width: 5;
    }
}

.drop-highlight {
    animation: drop-highlight-pulse 0.5s ease-in-out infinite;
}

/* === ABSORBED DANTIANS SECTION (Demonic Cultivator) - Horizontal Scroll Layout === */
.absorbed-dantians-section {
    width: 100%;
    padding: 20px;
    background: rgba(220, 20, 60, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(220, 20, 60, 0.2);
    margin-top: 20px;
}

/* Header with absorb button and total power */
.absorbed-dantians-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(220, 20, 60, 0.2);
}

/* Total power display in header */
.total-power-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.total-power-label {
    font-size: 1em;
    color: var(--p-888888);
}

.total-power-value {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--ui-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Carousel wrapper with scroll buttons */
.dantians-carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* Scroll buttons on sides */
.carousel-scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(220, 20, 60, 0.2);
    border: 2px solid rgba(220, 20, 60, 0.4);
    color: var(--p-dc143c);
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 2;
}

.carousel-scroll-btn:hover {
    background: rgba(220, 20, 60, 0.3);
    transform: scale(1.1);
}

/* Scrollable cards container */
.dantians-cards-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 5px;
    flex: 1;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 20, 60, 0.5) rgba(0, 0, 0, 0.2);
}

.dantians-cards-scroll::-webkit-scrollbar {
    height: 8px;
}

.dantians-cards-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.dantians-cards-scroll::-webkit-scrollbar-thumb {
    background: rgba(220, 20, 60, 0.5);
    border-radius: 4px;
}

.dantians-cards-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(220, 20, 60, 0.7);
}

/* Individual dantian card in scroll layout */
.dantian-scroll-card {
    display: flex;
    flex-direction: column;
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 2px solid rgba(220, 20, 60, 0.3);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dantian-scroll-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.3);
}

.dantian-scroll-card.selected {
    border-color: var(--ui-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.dantian-scroll-card.selected .dantian-card-header {
    background: rgba(255, 215, 0, 0.2);
}

.dantian-scroll-card.main-dantian {
    border-color: rgba(220, 20, 60, 0.6);
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.15) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.dantian-scroll-card.absorbed-incomplete {
    border-color: rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(0, 0, 0, 0.4) 100%);
}

/* Card header */
.dantian-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(220, 20, 60, 0.1);
    border-bottom: 1px solid rgba(220, 20, 60, 0.2);
}

.dantian-card-number {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--p-dc143c);
    letter-spacing: 1px;
}

.dantian-incomplete-badge {
    font-size: 0.75em;
    font-weight: bold;
    color: var(--ui-gold);
    background: rgba(255, 215, 0, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Card body - orb + stats side by side */
.dantian-card-body {
    display: flex;
    gap: 15px;
    padding: 15px;
    align-items: flex-start;
}

/* Mini orb in card */
.dantian-card-orb {
    flex-shrink: 0;
}

.dantian-mini-orb {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.dantian-mini-orb.main,
.dantian-mini-orb.absorbed {
    background: radial-gradient(circle at 30% 30%, var(--p-ff6666) 0%, var(--p-dc143c) 50%, var(--p-8b0000) 100%);
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.5), inset 0 0 15px rgba(0, 0, 0, 0.3);
    animation: mini-orb-pulse 2s ease-in-out infinite;
}

.dantian-mini-orb.incomplete {
    background: radial-gradient(circle at 30% 30%, var(--p-555555) 0%, var(--p-333333) 50%, var(--p-1a1a1a) 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3), inset 0 0 15px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 215, 0, 0.3);
}

@keyframes mini-orb-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(220, 20, 60, 0.5), inset 0 0 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(220, 20, 60, 0.7), inset 0 0 20px rgba(0, 0, 0, 0.3);
    }
}

.mini-orb-text {
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Stats panel in card */
.dantian-card-stats-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dantian-card-type-label {
    font-size: 0.9em;
    font-weight: bold;
    color: var(--p-dc143c);
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.dantian-card-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
}

.dantian-card-stat-row .stat-label {
    color: var(--p-888888);
}

.dantian-card-stat-row .stat-value {
    font-weight: bold;
    color: var(--p-cccccc);
}

.dantian-card-stat-row .stat-value.text-game-crimson {
    color: var(--p-dc143c);
}

.dantian-card-stat-row .stat-value.text-game-gold {
    color: var(--ui-gold);
}

/* Completion bar for incomplete dantians */
.dantian-card-completion-bar {
    margin-bottom: 8px;
}

.dantian-card-completion-bar .completion-track {
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.dantian-card-completion-bar .completion-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--p-dc143c), var(--p-ff4444));
    transition: width 0.3s ease;
    border-radius: 5px;
}

.dantian-card-completion-bar .completion-label {
    text-align: center;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--ui-gold);
}

.dantian-card-incomplete-note {
    font-size: 0.75em;
    color: var(--p-888888);
    font-style: italic;
    text-align: center;
}

/* Completion bar in stats panel (for absorbed dantians) */
.absorbed-completion-bar {
    margin-bottom: 8px;
}

.absorbed-completion-bar .completion-track {
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(220, 20, 60, 0.3);
}

.absorbed-completion-bar .completion-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--p-8b0000), var(--p-dc143c), var(--p-ff4444));
    transition: width 0.3s ease;
    border-radius: 5px;
}

/* Card action area */
.dantian-card-action-area {
    padding: 12px 15px;
    border-top: 1px solid rgba(220, 20, 60, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.dantian-card-action-area .btn {
    width: 100%;
}

.dantian-card-maxed {
    text-align: center;
    font-weight: bold;
    color: var(--ui-gold);
    font-size: 0.9em;
    padding: 8px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 6px;
}

/* Footer */
.absorbed-dantians-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(220, 20, 60, 0.2);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.available-souls-label {
    font-size: 0.9em;
    color: var(--p-888888);
}

.available-souls-value {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--ui-gold);
}

/* Legacy styles kept for compatibility */
.carousel-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(220, 20, 60, 0.2);
    border: 2px solid rgba(220, 20, 60, 0.4);
    color: var(--p-dc143c);
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav-btn:hover:not(:disabled) {
    background: rgba(220, 20, 60, 0.3);
    transform: scale(1.1);
}

.carousel-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* === DEMONIC CULTIVATOR BUTTONS === */
.btn {
    padding: 10px 20px;
    font-size: 0.95em;
    font-weight: bold;
    color: var(--p-ffffff);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85em;
}

.btn-disabled,
.btn-disabled:hover {
    background: var(--p-444444);
    color: var(--p-888888);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    filter: none;
    box-shadow: none;
}

/* === RESPONSIVE === */
@media (max-width: 1100px) {
    .dantian-top-row {
        flex-wrap: wrap;
    }

    /* Absorbed dantians responsive */
    .dantian-scroll-card {
        min-width: 260px;
    }
}

@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
    .dantian-tab-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    /* Absorbed dantians mobile */
    .absorbed-dantians-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .total-power-display {
        justify-content: center;
    }

    .dantians-carousel-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .carousel-scroll-btn {
        display: none;
    }

    .dantians-cards-scroll {
        padding: 10px;
    }

    .dantian-scroll-card {
        min-width: 240px;
    }

    .dantian-card-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .dantian-card-stats-panel {
        align-items: center;
    }

    .dantian-card-stat-row {
        justify-content: center;
        gap: 10px;
    }

    .dantian-top-row {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .dantian-left-column {
        width: 100%;
    }

    .dantian-stats-panel {
        min-width: 280px;
        width: 100%;
    }

    .dantian-milestones-grid {
        flex-direction: column;
    }

    .milestone-row {
        max-width: 100%;
    }

    .dantian-radial-container {
        width: min(320px, calc(100vw - 40px));
        height: min(320px, calc(100vw - 40px));
    }

    .dantian-radial-container svg {
        width: 100%;
        height: 100%;
    }

    .dantian-inventory-panel {
        max-width: calc(100vw - 40px);
    }

    .dantian-stats-panel {
        min-width: 0;
        width: calc(100vw - 40px);
    }

    .dantian-parent-container {
        padding: 10px;
    }

    .dantian-roots-panel {
        min-width: 0;
        width: 100%;
    }

    .dantian-roots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
