:root {
    /* Luxury Palette (Rose Gold & Velvet) */
    --primary: #E0BFB8;
    /* Mapped to Rose Gold */
    --primary-dark: #8B008B;
    /* Deep Magenta */

    --rose-gold: #E0BFB8;
    --soft-pink: #FFC1CC;
    --deep-magenta: #8B008B;
    --velvet-bg: #1a0510;

    --bg-dark: #08080c;
    --bg-surface: rgba(22, 27, 34, 0.6);
    /* Glassy Surface */
    --bg-surface-glass: rgba(22, 27, 34, 0.4);

    --text-main: #FFFFFF;
    --text-muted: #B0B0B0;
    --border-color: rgba(224, 191, 184, 0.2);
    /* Rose Gold Border */
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --font-family: 'Outfit', sans-serif;
    --font-heading: 'Playfair Display', serif;

    /* Neon Colors - Remapped for Harmony */
    --neon-purple: #8B008B;
    --neon-blue: #FFC1CC;
    /* Soft Pink as accent */
    --neon-green: #39FF14;
    --neon-pink: #E0BFB8;
    /* Rose Gold */

    --glass-border: rgba(224, 191, 184, 0.3);

    /* Fusion Theme Colors */
    --fusion-ice: #FFC1CC;
    --fusion-glow: #E0BFB8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
}

body {
    background: linear-gradient(rgba(26, 5, 16, 0.4), rgba(8, 8, 12, 0.7)), url('assets/index_bg_serene.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-family);
    margin: 0;
    min-height: 100vh;
    /* Space for fixed header + Telegram native header (65px approx) */
    margin: 0;
    margin: 0;
    /* Space for Title Bar (65px) + Filter Header (65px) = 130px + buffer */
    padding-top: calc(160px + env(safe-area-inset-top));
    padding-bottom: 80px;
    overflow-x: hidden;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    /* Smooth momentum scrolling on iOS */
}

/* Tsundere Header */
/* Tsundere Header */
/* Tsundere Header */
.header {
    background: rgba(18, 20, 24, 0.95) !important;
    /* Almost solid to prevent merging */
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid var(--glass-border);

    /* Responsive Safe Area Padding */
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 1rem;
    padding-right: 1rem;

    position: fixed;
    /* Row 2: Filters start below the 65px Title Bar */
    top: calc(65px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    z-index: 30001 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
    height: auto;
    min-height: 65px;
    margin-bottom: 1rem;
    /* Spacing below header */

    /* Smooth transition for auto-hide */
    transform: translateY(0);
    transition: transform 0.3s ease-in-out;
}

.header.nav-hidden {
    transform: translateY(-100%);
}

.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    /* Never shrink logo */
    margin-right: 1rem;
}

.header-right {
    flex: 1;
    width: 0;
    /* Critical for flex child to scroll */
    min-width: 0;

    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;

    gap: 8px;
    /* Spacing between chips */

    overflow-x: auto !important;
    overflow-y: hidden !important;

    padding-left: 0.5rem;
    padding-right: 0.5rem;



    /* Scroll smoothing */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;

    /* Fade Masks */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10px, black 90%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 10px, black 90%, transparent 100%);
}

.header-right::-webkit-scrollbar {
    display: none;
}

.page-title {
    position: fixed;
    /* Row 1: Title Bar at absolute top */
    top: calc(env(safe-area-inset-top));
    left: 0;
    right: 0;
    height: 65px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(18, 20, 24, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 30002;
    /* Above Filter Header (30001) */

    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #fff 0%, var(--rose-gold) 50%, #FFC1CC 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    margin: 0;
    letter-spacing: 1px;
    font-weight: 700;
    filter: drop-shadow(0 0 15px rgba(224, 191, 184, 0.3));
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Remove old conflicting class */
.header-filters {
    display: none !important;
}

.header-icon-chip {
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
    line-height: normal;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 1;
    flex-shrink: 0;
    white-space: nowrap;

    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.header-icon-chip:hover {
    background: rgba(224, 191, 184, 0.15);
    border-color: var(--rose-gold);
    color: var(--rose-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 191, 184, 0.2);
}

.header-icon-chip.active {
    background: rgba(224, 191, 184, 0.2);
    color: var(--rose-gold);
    border: 1px solid var(--rose-gold);
    box-shadow: 0 0 15px rgba(224, 191, 184, 0.3);
    font-weight: 700;
    transform: scale(1.05);
}

.header h1 {
    /* Legacy H1 style kept just in case, but hidden if removed from HTML */
    display: none;
}

.header h1 {
    margin: 0;
    font-size: 1.5rem;
    /* Larger */
    color: #fff;
    /* Solid White */
    text-shadow: 0 0 5px var(--neon-purple);
    /* Subtle Glow, not blur */
    font-weight: 800;
    letter-spacing: 1px;
    /* Removed transparent/gradient text that caused blur */
}

/* Replaced Menu Button with Logo */
.bot-logo-header {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 10px rgba(189, 0, 255, 0.5);
    object-fit: cover;
    cursor: pointer;
    /* Clickable */
    transition: transform 0.2s;
    /* Removed absolute positioning */
}

.bot-logo-header:active {
    transform: scale(0.9);
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: calc(65px + env(safe-area-inset-top));
    left: 0;
    width: 100%;
    height: calc(100% - 65px - env(safe-area-inset-top));
    background: rgba(0, 0, 0, 0.8);
    z-index: 30005;
    /* Above Header (30001) */
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s;
    display: flex;
    justify-content: flex-start;
}

.side-menu.active {
    visibility: visible;
    opacity: 1;
}

.menu-content {
    background: #161b22;
    width: 280px;
    height: 100%;
    padding: 1.2rem;
    box-sizing: border-box;
    transform: translateX(-100%);
    transition: transform 0.3s;
    border-right: 1px solid var(--neon-purple);
    box-shadow: 0 0 50px rgba(189, 0, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.side-menu.active .menu-content {
    transform: translateX(0);
}

.menu-footer {
    margin-top: auto;
    /* Pushes to bottom */
}

.close-menu {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.menu-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: white;
    padding: 10px 0;
    cursor: pointer;
    transition: color 0.2s;
}

.menu-item:hover {
    color: var(--neon-purple);
}

.tsundere-menu-btn {
    font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
    font-size: 0.9rem !important;
    /* Smaller */
    opacity: 0.8;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.tsundere-menu-btn:hover {
    color: var(--neon-blue);
    /* Different hover color for bottom actions */
    opacity: 1;
}

.profile-stat {
    margin: 10px 0;
    font-size: 0.9rem;
    color: #ccc;
}

.profile-stat strong {
    color: var(--neon-blue);
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Profile Action Buttons */
.profile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 10px;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

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

.profile-action-btn:hover::before {
    left: 100%;
}

.profile-action-btn .btn-icon {
    font-size: 1.2rem;
}

.profile-action-btn .btn-text {
    letter-spacing: 1px;
}

.reload-btn {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.2) 0%, rgba(176, 38, 255, 0.2) 100%);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.2);
}

.reload-btn:hover {
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.4) 0%, rgba(176, 38, 255, 0.4) 100%);
    box-shadow: 0 0 25px rgba(0, 191, 255, 0.4);
    transform: translateY(-2px);
}

.reload-btn:active {
    transform: translateY(0) scale(0.98);
}

.back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(176, 38, 255, 0.3);
    transform: translateY(-2px);
}

.back-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Navigation Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    margin-top: 5px;
    /* Shift tabs down slightly */
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 10px var(--primary);
}

/* Filters Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    background: rgba(0, 0, 0, 0.2);
    /* Slight darken strip */
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    background: rgba(0, 0, 0, 0.7);
    /* Darker default */
    border: 1px solid var(--glass-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    user-select: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.filter-chip:hover {
    background: rgba(20, 20, 40, 0.9);
    border-color: var(--neon-purple);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(189, 0, 255, 0.2);
}

.filter-chip.active {
    background: #000;
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    font-weight: 600;
}

/* Grid */
.waifu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

/* Waifu Card */
.waifu-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.waifu-card:active {
    transform: scale(0.98);
}

.waifu-card.selected {
    border-color: var(--rose-gold);
    box-shadow: 0 0 20px rgba(224, 191, 184, 0.4);
}

.waifu-img-container {
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.waifu-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.waifu-card:hover .waifu-img {
    transform: scale(1.08);
}

.waifu-info {
    padding: 0.8rem;
}

.waifu-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.waifu-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grade-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

/* Merge Interface */
.fusion-lab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin: 1rem;
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.merge-slots {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
    position: relative;
    padding: 1rem 0;
}

.slot {
    width: 90px;
    height: 135px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-muted);
    font-size: 0.8rem;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.slot:hover {
    border-color: var(--rose-gold);
    box-shadow: 0 0 15px rgba(224, 191, 184, 0.2), inset 0 0 10px rgba(224, 191, 184, 0.1);
    transform: translateY(-2px);
}

.slot.filled {
    border-style: solid;
    border-color: var(--rose-gold);
    box-shadow: 0 0 20px rgba(224, 191, 184, 0.4);
    background: #000;
}

.slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.3s;
}

.slot:hover img {
    transform: scale(1.05);
}

.fusion-operator {
    font-size: 2rem;
    color: var(--rose-gold);
    text-shadow: 0 0 10px var(--rose-gold);
    font-weight: 300;
}

/* Role Tag */
.role-tag {
    font-size: 0.7rem;
    color: var(--neon-blue);
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 243, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

/* Grade Badges (Border Colors) */
.grade-Peachling {
    border-bottom: 2px solid #a8e6cf;
}

.grade-Charmete {
    border-bottom: 2px solid #ffd3b6;
}

.grade-Mystara {
    border-bottom: 2px solid #dcedc1;
}

.grade-Celestique {
    border-bottom: 2px solid #ffaaa5;
}

.grade-Eclipse {
    border-bottom: 2px solid #ff8b94;
    box-shadow: 0 0 10px #ff8b94;
}

/* Dupe Badge */
.dup-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--neon-pink);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    z-index: 10;
    text-shadow: 0 1px 2px black;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.target-slot {
    width: 100px;
    height: 150px;
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.2);
}

.merge-btn {
    background: linear-gradient(135deg, var(--rose-gold), var(--deep-magenta));
    border: none;
    color: white;
    /* Dark text for contrast on Rose Gold? No, white usually works with deep gradient */
    padding: 1rem 3rem;
    width: 100%;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(139, 0, 139, 0.3);
    opacity: 0.6;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.merge-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.merge-btn.ready:hover::after {
    left: 100%;
}

.merge-btn.ready {
    opacity: 1;
    pointer-events: all;
    background: linear-gradient(135deg, #FFC1CC, #8B008B);
    box-shadow: 0 0 30px rgba(224, 191, 184, 0.6);
    transform: scale(1.02);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 20px rgba(224, 191, 184, 0.4);
    }

    50% {
        box-shadow: 0 0 40px rgba(224, 191, 184, 0.8);
    }

    100% {
        box-shadow: 0 0 20px rgba(224, 191, 184, 0.4);
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 30005;
    /* Above Header (30001) */
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(18, 20, 24, 0.85);
    /* Dark Glass */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Bottom Sheet Modal Style */
.modal.bottom-sheet {
    align-items: flex-end !important;
    /* Align to bottom */
}

.modal.bottom-sheet .modal-content {
    animation: slideUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: #161b22;
    border-top: 1px solid var(--neon-purple);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.sort-options-list {
    display: flex;
    flex-direction: column;
}

.sort-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    color: var(--text-muted);
}

.sort-option.active {
    color: var(--neon-blue);
    font-weight: bold;
}

.sort-option .check {
    opacity: 0;
}

.sort-option.active .check {
    opacity: 1;
}

/* Detail Modal Specifics */
.detail-content {
    background: rgba(18, 20, 24, 0.9);
    backdrop-filter: blur(20px);
    width: 90%;
    max-width: 380px;
    border-radius: 24px;
    padding: 1.5rem;
    position: relative;
    border: 1px solid rgba(224, 191, 184, 0.2);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);

    /* Fit in one frame logic - reduced to prevent header overlap */
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* No scroll on container */
}

/* Close button absolute top right for backup, but footer button preferred */
/* Keep content organized */

.detail-img-container {
    width: 100%;
    position: relative;
    /* Anchor for absolute badge */
    /* Flexible height */
    flex: 1;
    /* Grow/Shrink to fill space */
    min-height: 200px;
    max-height: 60vh;
    /* Much taller now */
    background: radial-gradient(circle, #2a2a40 0%, #161b22 100%);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Align Top! */
    border: 1px solid var(--glass-border);
}

.detail-img-container img {
    width: 100%;
    height: auto;
    /* Preserve Ratio */
    min-height: 100%;
    /* Ensure it covers height too */
    object-fit: cover;
    /* Fallback */
    object-position: top center;
    transition: transform 0.5s;
}

.detail-grade {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--neon-blue);
    font-size: 1.2rem;
    box-shadow: 0 0 10px var(--neon-blue);
}

.detail-title {
    margin-top: 1rem;
    font-size: 1.5rem;
    background: linear-gradient(45deg, var(--neon-pink), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    padding: 0 1rem;
}

.detail-role {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--neon-blue);
}

.detail-stats-grid {
    width: 100%;
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s;
}

.detail-stat-box:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: var(--neon-purple);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    word-break: break-word;
    /* Prevent overflow for long anime names */
}

.search-bar {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-family: var(--font-family);
    margin-bottom: 1rem;
}

.search-results {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns for search results */
    gap: 0.8rem;
    min-height: 200px;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    gap: 0.5rem;
}

.search-item:hover {
    background: rgba(255, 105, 180, 0.1);
}

.search-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Role Options Container */
.role-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--neon-pink);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    font-weight: 600;
}

.toast.show {
    opacity: 1;
}

.role-chip {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    border: 1px solid transparent;
}

/* Profile Decorator */
.profile-decorator {
    text-align: center;
    color: var(--neon-purple);
    margin: 1rem 0;
    font-size: 0.9rem;
    opacity: 0.8;
    text-shadow: 0 0 5px var(--neon-purple);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid transparent;
}

.stat-box span {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 5px;
    color: var(--text-muted);
}

.stat-box strong {
    font-size: 1.1rem;
    color: white;
}

/* Specific Borders for Stats */
.stat-box.grade-Eclipse {
    border-color: #ff8b94;
    box-shadow: 0 0 5px rgba(255, 139, 148, 0.2);
}

.stat-box.grade-Celestique {
    border-color: #ffaaa5;
}

.stat-box.grade-Mystara {
    border-color: #dcedc1;
}

.stat-box.grade-Charmete {
    border-color: #ffd3b6;
}

@import "nav.css";

/* Bottom Navigation Dock - Floating Pill Style */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    height: auto;
    border-radius: 25px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 5000;
    padding: 12px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(176, 38, 255, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.bottom-nav.nav-hidden {
    transform: translate(-50%, 150%);
}

/* Fusion Role Selector & Chips */
.fusion-role-selector {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--glass-border);
    animation: fadeIn 0.5s;
}

.role-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.role-chip {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
}

.role-chip:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.role-chip.selected {
    background: var(--neon-blue);
    color: #000;
    /* Contrast */
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
    border-color: var(--neon-blue);
    font-weight: 700;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guide-content {
    background: #12121e;
    border: 1px solid var(--neon-purple);
    box-shadow: 0 0 30px rgba(189, 0, 255, 0.2);
}

/* Loading Pulse */
.loading-pulse {
    animation: pulseText 1.5s infinite;
}

@keyframes pulseText {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}



.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    flex: 1;
    height: 100%;
    padding-top: 0.5rem;
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
    transition: transform 0.3s;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--neon-purple);
    /* Active Color */
}

.nav-item.active .nav-icon {
    transform: translateY(-5px) scale(1.2);
    text-shadow: 0 0 10px var(--neon-purple);
}

.nav-item:active {
    transform: scale(0.95);
}

/* Adjust Body Padding so content isn't hidden behind nav */
body {
    padding-bottom: 100px;
    /* 80px nav + 20px buffer */
}

/* Duplicate Badge in Detail View */
.dup-badge-detail {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading Sticker */
.loading-sticker {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 3px solid var(--neon-purple);
    box-shadow: 0 0 20px rgba(189, 0, 255, 0.5);
    animation: stickerBounce 1.5s infinite cubic-bezier(0.280, 0.840, 0.420, 1);
}

@keyframes stickerBounce {

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

    50% {
        transform: translateY(-15px) scale(1.1);
    }
}

/* Centered Loading Screen */
.loading-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    /* High visibility */
    text-align: center;
    width: 100%;
    pointer-events: none;
    /* Let clicks pass through if needed, though usually blocking */
}

/* Ensure text is readable */
.loading-text {
    margin-top: 15px;
    font-size: 1.2rem;
    color: var(--neon-purple);
    text-shadow: 0 0 10px rgba(189, 0, 255, 0.5);
    font-weight: 600;
    /* Fusion Heat Theme - Merge Page Specific Styles */

    /* Scoped Color Variables for Merge Page */
    #merge-view {
        --merge-primary: #FF6B35;
        --merge-secondary: #F7931E;
        --merge-accent: #E63946;
        --merge-energy: #06FFF0;
        --merge-bg: #1a1a1a;
        --merge-slot-bg: #0a0a0a;
        --merge-smoke: #2a2a2a;
        background: var(--merge-bg);
        min-height: 100vh;
    }

    /* Fusion Chamber Header */
    #merge-view h2 {
        background: linear-gradient(135deg, var(--merge-primary), var(--merge-secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-shadow: 0 0 30px rgba(255, 107, 53, 0.6);
        filter: drop-shadow(0 0 20px rgba(247, 147, 30, 0.4));
    }

    /* Fusion Lab Container */
    .fusion-lab {
        padding: 1rem;
        animation: fadeIn 0.5s;
    }

    .slots-container {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
        padding: 20px 0;
    }

    /* Fusion Slots - Empty State */
    .fusion-slot {
        width: 120px;
        height: 160px;
        background: var(--merge-slot-bg);
        border: 2px dashed rgba(255, 107, 53, 0.3);
        border-radius: 16px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    }

    .fusion-slot:hover {
        border-color: var(--merge-primary);
        box-shadow:
            inset 0 0 20px rgba(0, 0, 0, 0.5),
            0 0 20px rgba(255, 107, 53, 0.3);
        transform: translateY(-3px);
    }

    .fusion-slot:active {
        transform: scale(0.95);
    }

    /* Fusion Slots - Filled State */
    .fusion-slot.filled {
        border: 2px solid var(--merge-accent);
        background: black;
        box-shadow:
            0 0 25px rgba(230, 57, 70, 0.5),
            inset 0 0 30px rgba(255, 107, 53, 0.2);
        animation: slotPulse 2s infinite;
    }

    @keyframes slotPulse {

        0%,
        100% {
            box-shadow:
                0 0 25px rgba(230, 57, 70, 0.5),
                inset 0 0 30px rgba(255, 107, 53, 0.2);
        }

        50% {
            box-shadow:
                0 0 35px rgba(230, 57, 70, 0.7),
                inset 0 0 40px rgba(255, 107, 53, 0.4);
        }
    }

    .fusion-slot img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
    }

    .slot-placeholder {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        color: rgba(255, 107, 53, 0.6);
        transition: all 0.3s;
    }

    .fusion-slot:hover .slot-placeholder {
        color: var(--merge-primary);
        transform: scale(1.1);
    }

    .slot-remove {
        position: absolute;
        top: 5px;
        right: 5px;
        background: rgba(230, 57, 70, 0.9);
        color: white;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: none;
        justify-content: center;
        align-items: center;
        font-size: 0.9rem;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.2s;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    .slot-remove:hover {
        background: var(--merge-accent);
        transform: scale(1.15);
    }

    .fusion-slot.filled .slot-remove {
        display: flex;
    }

    /* Fusion Operator (+) with Electric Effect */
    .fusion-operator {
        font-size: 2.5rem;
        color: var(--merge-energy);
        font-weight: bold;
        text-shadow:
            0 0 15px var(--merge-energy),
            0 0 30px rgba(6, 255, 240, 0.5);
        animation: sparkle 1.5s infinite;
        filter: drop-shadow(0 0 10px var(--merge-energy));
    }

    @keyframes sparkle {

        0%,
        100% {
            opacity: 0.8;
            transform: rotate(0deg) scale(1);
        }

        50% {
            opacity: 1;
            transform: rotate(90deg) scale(1.1);
        }
    }

    /* Result Preview Box */
    .fusion-result-preview {
        background: rgba(42, 42, 42, 0.6);
        border: 2px solid rgba(255, 107, 53, 0.3);
        padding: 1rem;
        border-radius: 16px;
        text-align: center;
        min-height: 70px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: 600;
        margin: 20px 0;
        color: rgba(255, 107, 53, 0.7);
        transition: all 0.4s;
    }

    .fusion-result-preview.active {
        border-color: var(--merge-energy);
        color: var(--merge-energy);
        background: rgba(6, 255, 240, 0.1);
        box-shadow:
            0 0 20px rgba(6, 255, 240, 0.3),
            inset 0 0 20px rgba(6, 255, 240, 0.1);
        animation: energyPulse 1.5s infinite;
    }

    @keyframes energyPulse {

        0%,
        100% {
            box-shadow:
                0 0 20px rgba(6, 255, 240, 0.3),
                inset 0 0 20px rgba(6, 255, 240, 0.1);
        }

        50% {
            box-shadow:
                0 0 30px rgba(6, 255, 240, 0.5),
                inset 0 0 30px rgba(6, 255, 240, 0.2);
        }
    }

    /* Merge Button - Ignite Fusion */
    #merge-view .merge-btn {
        background: linear-gradient(135deg, var(--merge-primary), var(--merge-accent));
        border: 2px solid var(--merge-secondary);
        color: white;
        padding: 1rem 2rem;
        border-radius: 12px;
        font-size: 1.1rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s;
        box-shadow:
            0 4px 15px rgba(230, 57, 70, 0.4),
            inset 0 0 20px rgba(255, 107, 53, 0.2);
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 0 auto;
        display: block;
        width: 90%;
        max-width: 400px;
    }

    #merge-view .merge-btn:hover:not(:disabled) {
        background: linear-gradient(135deg, var(--merge-secondary), var(--merge-accent));
        box-shadow:
            0 6px 25px rgba(230, 57, 70, 0.6),
            inset 0 0 30px rgba(255, 107, 53, 0.3);
        transform: translateY(-2px);
    }

    #merge-view .merge-btn:active:not(:disabled) {
        transform: translateY(0) scale(0.98);
    }

    #merge-view .merge-btn:disabled {
        background: linear-gradient(135deg, #444, #333);
        border-color: #555;
        color: #888;
        cursor: not-allowed;
        box-shadow: none;
    }

    /* Selector Modal - Inherit Merge Theme */
    #merge-view .modal {
        background: rgba(10, 10, 10, 0.95);
    }

    #merge-view .modal-content {
        background: var(--merge-bg);
        border: 2px solid var(--merge-primary);
        box-shadow: 0 10px 50px rgba(255, 107, 53, 0.3);
    }

    #merge-view .modal-header {
        border-bottom: 1px solid rgba(255, 107, 53, 0.3);
    }

    #merge-view .modal-header h3 {
        color: var(--merge-primary);
    }

    #merge-view .waifu-card:hover {
        border-color: var(--merge-primary);
        box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    }

    /* Loading Text in Result Preview */
    .loading-text {
        color: var(--merge-secondary);
        animation: loadingPulse 1s infinite;
    }

    @keyframes loadingPulse {

        0%,
        100% {
            opacity: 0.6;
        }

        50% {
            opacity: 1;
        }
    }

    /* Floating Bottom Navigation (Premium) */
    .bottom-nav {
        position: fixed !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 90% !important;
        max-width: 400px !important;
        border-radius: 25px !important;
        background: rgba(20, 20, 20, 0.9) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(12px) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
        z-index: 30000 !important;
        padding: 10px 20px !important;
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
    }

    .bottom-nav.nav-hidden {
        transform: translate(-50%, 150%) !important;
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #888;
        cursor: pointer;
        transition: all 0.2s;
    }

    .nav-item.active {
        color: var(--neon-blue);
        transform: translateY(-2px);
    }

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

    .nav-label {
        font-size: 0.7rem;
        font-weight: 600;
    }

    /* Header Hide State */
    .header {
        transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    }

    .header.nav-hidden {
        transform: translateY(-100%);
    }
}

/* Closing media query if open, or file end */
/* Pagination - Load More Button */
.load-more-btn {
    display: block;
    width: calc(100% - 2rem);
    max-width: 400px;
    margin: 2rem auto;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.load-more-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.1));
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
    transform: translateY(-2px);
}

.load-more-btn:active {
    transform: translateY(0);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Nav Item Hover Effects */
.nav-item {
    position: relative;
    padding: 8px 16px;
    border-radius: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.nav-item:hover .nav-icon {
    transform: scale(1.2);
}

.nav-item:hover .nav-label {
    color: var(--neon-blue);
}

.nav-item:active {
    transform: translateY(0) scale(0.95);
}

.nav-icon {
    transition: transform 0.3s ease;
}

.nav-label {
    transition: color 0.3s ease;
}


/* Card Grade Overlay (on image) */
.grade-overlay {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.3);
    white-space: nowrap;
}

/* Anime name below character name */
.waifu-anime {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Updated card info section */
.waifu-info {
    padding: 0.8rem;
    text-align: center;
}

.waifu-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== HOLOGRAPHIC LOADING ANIMATION ===== */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #020205;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.8s ease-in-out;
}

.app-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.holo-spinner {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 2.5rem;
    transform-style: preserve-3d;
    perspective: 800px;
}

.holo-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
}

.holo-ring:nth-child(1) {
    border-top: 3px solid var(--neon-blue);
    border-bottom: 3px solid var(--neon-purple);
    animation: spin3D 3s linear infinite;
}

.holo-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-left: 3px solid var(--neon-pink);
    border-right: 3px solid var(--neon-gold);
    animation: spin3D 4s linear infinite reverse;
}

.holo-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border: 1px dashed white;
    opacity: 0.3;
    animation: spin3D 5s linear infinite;
}

.centered-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    animation: pulse 1s infinite alternate;
}

.holo-text {
    font-family: "Outfit", sans-serif;
    color: white;
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow: 0 0 20px var(--neon-blue);
    margin-bottom: 12px;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.holo-bar {
    width: 220px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.holo-bar-fill {
    height: 100%;
    width: 100%;
    transform: scaleX(0);
    transform-origin: left;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    box-shadow: 0 0 10px var(--neon-blue);
    animation: holoFill 2.5s ease-in-out forwards;
    will-change: transform;
}

.holo-log {
    margin-top: 10px;
    font-family: monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    min-height: 1.2em;
}

@keyframes spin3D {
    0% {
        transform: rotateX(60deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(60deg) rotateZ(360deg);
    }
}

@keyframes holoFill {
    0% {
        transform: scaleX(0);
    }

    100% {
        transform: scaleX(1);
    }
}

/* Card Image Loading Animation */
.waifu-img-container.loading {
    background: #121212;
    /* Dark placeholder */
    position: relative;
    overflow: hidden;
}

/* Arcane Loader Styles (Ported from Gacha) */
.app-loader {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #1a0b2e 0%, #000000 100%);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, filter 0.8s ease;
}

.app-loader.hidden {
    opacity: 0;
    pointer-events: none;
    filter: blur(10px);
}

.summon-circle-container {
    position: relative;
    width: 250px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.rune-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: 0 0 15px currentColor;
}

.ring-outer {
    width: 100%;
    height: 100%;
    border-top-color: var(--deep-magenta);
    border-bottom-color: var(--rose-gold);
    animation: spin 8s linear infinite;
    opacity: 0.8;
    filter: drop-shadow(0 0 5px var(--deep-magenta));
}

.ring-middle {
    width: 70%;
    height: 70%;
    border-left-color: var(--soft-pink);
    border-right-color: var(--rose-gold);
    animation: spin 5s linear infinite reverse;
    opacity: 0.9;
    filter: drop-shadow(0 0 5px var(--rose-gold));
}

.ring-inner {
    width: 40%;
    height: 40%;
    border: 2px dashed #fff;
    animation: spin 10s linear infinite;
    opacity: 0.6;
}

.core-gem {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 20px #fff, 0 0 40px var(--rose-gold), 0 0 65px var(--deep-magenta);
    animation: pulseCore 2s ease-in-out infinite;
    z-index: 10;
}

.core-pulse {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: ripple 2s ease-out infinite;
}

.summon-text-container {
    text-align: center;
    z-index: 10;
}

.summon-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: var(--rose-gold);
    text-shadow: 0 0 15px rgba(224, 191, 184, 0.4);
    margin-bottom: 10px;
    font-weight: 700;
    font-style: italic;
}

.summon-status {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    color: var(--soft-pink);
    letter-spacing: 2px;
    min-height: 1.2em;
    text-transform: uppercase;
}

.summon-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
}

.summon-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--deep-magenta), var(--rose-gold));
    animation: loadBar 3s ease-in-out forwards;
    box-shadow: 0 0 10px var(--rose-gold);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseCore {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 30px #fff, 0 0 65px #ff00ff;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes loadBar {
    0% {
        width: 0%;
    }

    50% {
        width: 40%;
    }

    70% {
        width: 60%;
    }

    100% {
        width: 100%;
    }
}

/* Particle Stars */
.star-particle {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: starFloat 2s linear infinite;
}

@keyframes starFloat {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.waifu-img-container.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 210, 255, 0.1), transparent);
    transform: skewX(-20deg) translateX(-150%);
    animation: loadShimmer 1.5s infinite;
    z-index: 2;
}

.waifu-img-container.loading .waifu-img {
    opacity: 0;
}

.waifu-img {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

@keyframes loadShimmer {
    0% {
        transform: skewX(-20deg) translateX(-150%);
    }

    100% {
        transform: skewX(-20deg) translateX(150%);
    }
}

/* Generic Skeleton Shimmer */
.skeleton-loading {
    background: #1e1e2e !important;
    position: relative;
    overflow: hidden;
}

.skeleton-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loadShimmer 1.5s infinite;
    z-index: 5;
}

/* Ensure image fades in */
#detail-img {
    transition: opacity 0.5s ease-in-out;
}

/* MyVerse Specific Loader */
.verse-loader {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    z-index: 10;
}

.verse-loader .verse-logo-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 191, 184, 0.4) 0%, transparent 70%);
    filter: blur(15px);
    animation: versePulse 2.5s infinite ease-in-out;
}

.verse-loader .verse-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 30px rgba(224, 191, 184, 0.5);
    border: 2px solid var(--rose-gold);
    animation: verseFloat 3s infinite ease-in-out;
}

@keyframes versePulse {

    0%,
    100% {
        transform: scale(0.95);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

@keyframes verseFloat {

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

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