/* ============================================
   Dragon Den & Pond — v3 Reference Match
   Dark cosmic RPG theme
   ============================================ */

/* ---- Fullscreen modal ---- */
.modal-fullpage .modal-content {
    width: 96vw !important;
    max-width: 900px !important;
    height: 98vh;
    max-height: 98vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f0c29, #1a1245, #1e1842) !important;
    border: 1px solid rgba(120, 100, 255, 0.15) !important;
}

.modal-fullpage .modal-header {
    padding: 8px 16px !important;
    min-height: 36px !important;
    flex-shrink: 0;
}

.modal-fullpage .modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0 !important;
    min-height: 0;
}

/* ══ Dragon Den: Sidebar + Main Layout ══ */
.dd-layout {
    display: flex;
    height: 100%;
    min-height: 0;
    background: linear-gradient(180deg, rgba(15, 12, 41, 0.95), rgba(30, 24, 66, 0.98));
}

/* ── Left Sidebar (Roster) ── */
.dd-sidebar {
    width: 180px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid rgba(120, 100, 255, 0.08);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.dd-sidebar::-webkit-scrollbar {
    width: 3px;
}

.dd-sidebar::-webkit-scrollbar-thumb {
    background: rgba(120, 100, 255, 0.15);
    border-radius: 2px;
}

.dd-sidebar-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 14px 14px 8px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
}

/* Roster card */
.dd-roster-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.25s ease;
}

.dd-roster-card:hover {
    background: rgba(120, 100, 255, 0.08);
    border-color: rgba(120, 100, 255, 0.15);
}

.dd-roster-card.active {
    background: rgba(120, 100, 255, 0.12);
    border-color: var(--el-color, #6c5ce7);
    box-shadow: 0 0 16px rgba(120, 100, 255, 0.15);
}

/* Dragon avatar circle */
.dd-roster-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(120, 100, 255, 0.3);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
}

.dd-roster-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Roster text */
.dd-roster-info {
    flex: 1;
    min-width: 0;
}

.dd-roster-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dd-roster-level {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.7;
}

/* Right Main Content — uses flex-column layout (defined below) */


/* Hero Section */
.dd-hero {
    position: relative;
    min-height: 200px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.dd-hero-img {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dd-hero-img img {
    height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
    animation: dragonFloat 3s ease-in-out infinite;
    cursor: pointer;
}

@keyframes dragonFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.dd-hero-info {
    position: relative;
    z-index: 2;
    padding: 12px 14px;
    width: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.dd-hero-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.dd-hero-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.dd-hero-xp {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.dd-hero-xp-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.dd-hero-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    border-radius: 2px;
}

.dd-hero-xp span {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

/* HP Bar */
.dd-hp-bar {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.02);
}

.dd-hp-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.dd-hp-track {
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.dd-hp-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ── Stat Bars (ATK/DEF/SPD) ── */
.dd-stat-bars {
    padding: 8px 14px;
}

.dd-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.dd-stat-label {
    font-size: 0.82rem;
    font-weight: 700;
    width: 32px;
    color: rgba(255, 255, 255, 0.7);
}

.dd-stat-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.dd-stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.dd-stat-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    min-width: 50px;
    text-align: right;
}

/* ── Equipment Grid 3x2 ── */
/* ── Hero + Equipment Layout (3 columns) ── */
.dd-hero-equip-layout {
    display: flex;
    align-items: stretch;
    gap: 6px;
    padding: 6px 10px;
}

.dd-equip-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 90px;
    flex-shrink: 0;
}

.dd-hero-center {
    flex: 1;
    min-width: 0;
}

.dd-equip-section {
    padding: 6px 14px;
}

.dd-equip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.dd-eq-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.dd-eq-card:hover {
    transform: translateY(-2px);
    background: rgba(120, 100, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.dd-eq-card.filled {
    background: rgba(120, 100, 255, 0.05);
    border-style: solid;
}

.dd-eq-card.empty {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.08);
}

.dd-eq-lvl {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    color: #fff;
}

.dd-eq-icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.dd-eq-name {
    font-size: 0.55rem;
    font-weight: 600;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ── Bottom Tab Bar ── */
.dd-bottom-tabs {
    display: flex;
    gap: 0;
    margin: 8px 14px 4px;
    background: rgba(20, 15, 50, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(120, 100, 255, 0.15);
    overflow: hidden;
}

.dd-tab-btn {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    cursor: pointer;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(120, 100, 255, 0.1);
    line-height: 1.3;
    background: rgba(255, 255, 255, 0.03);
}

.dd-tab-btn:last-child {
    border-right: none;
}

.dd-tab-btn:hover {
    background: rgba(120, 100, 255, 0.15);
    color: #fff;
    text-shadow: 0 0 8px rgba(120, 100, 255, 0.5);
}

.dd-tab-btn.active {
    background: linear-gradient(135deg, rgba(120, 100, 255, 0.25), rgba(160, 130, 255, 0.15));
    color: #fff;
    box-shadow: 0 0 16px rgba(120, 100, 255, 0.3), inset 0 -2px 0 rgba(120, 100, 255, 0.5);
    text-shadow: 0 0 10px rgba(160, 130, 255, 0.6);
}

/* Tab content area — replaces main content when tab is active */
.dd-tab-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 100, 255, 0.08) transparent;
}

.dd-tab-content::-webkit-scrollbar {
    width: 3px;
}

.dd-tab-content::-webkit-scrollbar-thumb {
    background: rgba(120, 100, 255, 0.1);
    border-radius: 2px;
}

/* Star upgrade section */
.dd-star-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(255, 215, 0, 0.03);
    border-top: 1px solid rgba(255, 215, 0, 0.06);
    border-bottom: 1px solid rgba(255, 215, 0, 0.06);
}

.dd-star-display {
    font-size: 0.85rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

.dd-star-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.6);
    flex-wrap: wrap;
}

.dd-star-btn {
    padding: 3px 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a2e;
    font-weight: 800;
    font-size: 0.58rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.dd-star-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.dd-star-btn.disabled,
.dd-star-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Stat bonus display */
.dd-stat-total {
    color: #fff;
    font-weight: 700;
}

.dd-stat-bonus {
    color: #2ecc71;
    font-weight: 600;
    font-size: 0.62rem;
    margin-left: 2px;
}

/* Main content area layout */
.dd-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Override previous dd-main scroll */
.dd-layout .dd-main {
    overflow: hidden;
}


/* ══ Pond: Gacha Stage ══ */
.pond-stage {
    text-align: center;
    padding: 28px 16px 12px;
    background: radial-gradient(ellipse at 50% 60%, rgba(108, 92, 231, 0.08) 0%, transparent 70%);
}

.pond-lotus {
    font-size: 4.5rem;
    animation: pondFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 24px rgba(255, 150, 200, 0.4));
}

@keyframes pondFloat {

    0%,
    100% {
        transform: translateY(0) rotate(-3deg);
    }

    50% {
        transform: translateY(-12px) rotate(3deg);
    }
}

.pond-balance {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 16px 0;
}

.pond-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 16px auto;
    max-width: 500px;
    padding: 0 16px;
}

.pond-btn {
    padding: 14px 24px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
    flex: 1;
}

.pond-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.pond-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pond-btn--single {
    background: linear-gradient(135deg, #FDCB6E, #F0B429);
    color: #1a1a2e;
}

.pond-btn--multi {
    background: linear-gradient(135deg, #e056a0, #9b59b6);
    color: #fff;
}

.pond-rates {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px 16px;
}

.pond-rate {
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.62rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pond-view-pool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    margin: 8px 0;
}

.pond-view-pool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Pool sub-modal grid */
.pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 5px;
    padding: 4px;
}

.pool-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid;
    transition: all 0.15s ease;
}

.pool-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

.pool-item-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.pool-item-name {
    font-weight: 600;
    font-size: 0.72rem;
}

.pool-item-stats {
    font-size: 0.55rem;
    opacity: 0.5;
}

.pool-item-rarity {
    font-size: 0.55rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: auto;
}

/* Gacha result cards */
.gacha-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 550px;
    margin: 0 auto;
}

/* ══ Responsive ══ */
@media (max-width: 600px) {
    .dd-sidebar {
        width: 120px;
    }

    .dd-roster-avatar {
        width: 34px;
        height: 34px;
    }

    .dd-roster-name {
        font-size: 0.68rem;
    }

    .dd-roster-level {
        font-size: 0.55rem;
    }

    .dd-hero-img img {
        height: 130px;
    }

    .dd-hero-equip-layout {
        gap: 4px;
        padding: 4px 6px;
    }

    .dd-equip-col {
        width: 70px;
    }

    .dd-eq-card {
        min-height: 50px;
        padding: 6px 3px 4px;
    }

    .dd-eq-name {
        font-size: 0.4rem;
    }

    .dd-tab-btn {
        font-size: 0.52rem;
        padding: 6px 2px;
    }

    .pool-grid {
        grid-template-columns: 1fr;
    }

    .gacha-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
}

@media (max-width: 420px) {
    .dd-sidebar {
        width: 90px;
    }

    .dd-roster-card {
        padding: 6px 6px;
        margin: 2px 4px;
        gap: 6px;
        flex-direction: column;
        text-align: center;
    }

    .dd-roster-avatar {
        width: 32px;
        height: 32px;
    }

    .dd-roster-name {
        font-size: 0.58rem;
    }

    .dd-hero-img img {
        height: 100px;
    }

    .dd-hero {
        min-height: 150px;
    }

    .dd-equip-col {
        width: 56px;
        gap: 3px;
    }

    .dd-eq-card {
        min-height: 44px;
        padding: 5px 2px 3px;
        border-radius: 8px;
    }

    .dd-eq-icon {
        font-size: 1rem;
    }

    .dd-eq-lvl {
        font-size: 0.35rem;
        padding: 0px 3px;
    }

    .dd-eq-name {
        font-size: 0.35rem;
    }

    .modal-fullpage .modal-content {
        width: 100vw !important;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0 !important;
    }

    .pond-actions {
        flex-direction: column;
    }

    .pond-btn {
        width: 100%;
    }
}