/* Google Fonts loaded via preload in HTML to avoid render-blocking @import */

* { margin: 0; padding: 0; box-sizing: border-box; }

        html {
            height: 100%;
        }

        body {
            font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: stretch;
            padding: 0;
            padding-bottom: 32px;
            position: relative;
            overflow-x: hidden;
        }
        .container {
            background: transparent;
            border: none;
            border-radius: 0;
            padding: 0;
            max-width: 100%;
            width: 100%;
            min-height: 100vh;
            position: relative;
            z-index: 1;
            overflow-x: hidden;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }
        
        .guild-layout {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 100vh;
            position: relative;
            z-index: 1;
            overflow-x: hidden;
            overflow-y: auto;
        }
        
        .guild-header {
            display: none;
        }
        
        /* ===== NEW SITE HEADER ===== */
        .site-header {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 60px;
            padding: 16px 30px;
            background: rgba(22, 27, 34, 0.9);
            border-bottom: 1px solid rgba(255, 149, 0, 0.15);
            flex-shrink: 0;
        }
        
        .header-brand {
            display: flex;
            align-items: center;
            gap: 14px;
        }
        
        .brand-icon {
            font-size: 1.8em;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .brand-icon svg {
            width: 48px;
            height: 48px;
        }
        
        .brand-text h1 {
            font-size: 1.4em;
            font-weight: 700;
            color: #FF9500;
            margin: 0;
            letter-spacing: 2px;
            text-transform: uppercase;
        }
        
        .brand-subtitle {
            font-size: 0.7em;
            color: rgba(176, 196, 222, 0.75);
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        .header-stats {
            display: flex;
            gap: 24px;
        }
        
        .header-stat {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }
        
        .header-stat-value {
            font-size: 1.2em;
            font-weight: 700;
            color: #FF9500;
        }
        
        .header-stat-label {
            font-size: 0.65em;
            color: rgba(176, 196, 222, 0.8);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        /* ===== TOOLBAR ===== */
        .toolbar {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
            padding: 12px 30px;
            background: rgba(15, 20, 28, 0.9);
            border-bottom: 1px solid rgba(255, 149, 0, 0.08);
            flex-shrink: 0;
        }
        
        .search-box {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(20, 26, 36, 0.9);
            border: 1px solid rgba(255, 149, 0, 0.15);
            border-radius: 8px;
            padding: 8px 14px;
            flex: 1;
            max-width: 320px;
        }
        
        .search-box:focus-within {
            border-color: rgba(255, 149, 0, 0.35);
        }
        
        .search-icon {
            font-size: 0.9em;
            opacity: 0.7;
        }
        
        .search-box input {
            background: transparent;
            border: none;
            outline: none;
            color: #E0E8F0;
            font-size: 0.9em;
            width: 100%;
        }
        
        .search-box input::placeholder {
            color: rgba(176, 196, 222, 0.5);
        }
        
        .btn-refresh {
            background: rgba(255, 149, 0, 0.12);
            border: 1px solid rgba(255, 149, 0, 0.25);
            border-radius: 8px;
            color: #B0D4F1;
            padding: 8px 16px;
            font-size: 0.85em;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .btn-refresh:hover {
            background: rgba(255, 149, 0, 0.18);
            border-color: rgba(255, 149, 0, 0.35);
        }
        
        /* Hide old styles */
        .header-top, .guild-stats, .stat-card, .stat-icon, .stat-content, .stat-value, .stat-label,
        .section-header, .section-title, .section-controls, .search-container, .search-input, .refresh-btn {
            /* Keeping for backwards compatibility but hiding old header */
            border-top: 1px solid rgba(255, 149, 0, 0.12);
            flex-wrap: wrap;
        }
        .stat-card {
            background: transparent;
            border: none;
            border-radius: 8px;
            margin: 6px 4px;
            padding: 12px 24px;
            display: flex;
            align-items: center;
            gap: 12px;
            transition: background 0.2s ease;
            position: relative;
        }
        .stat-card:last-child {
            border-right: none;
        }
        .stat-card:hover {
            background: rgba(93, 160, 255, 0.08);
        }
        .stat-icon {
            font-size: 1.3em;
            width: 38px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(93, 160, 255, 0.12);
            border-radius: 8px;
            flex-shrink: 0;
            transition: background 0.2s ease, box-shadow 0.2s ease;
        }
        .stat-card:hover .stat-icon {
            background: rgba(93, 160, 255, 0.18);
            box-shadow: 0 6px 16px rgba(93, 160, 255, 0.18);
        }
        .stat-content {
            text-align: left;
            flex: 1;
        }
        .stat-value {
            font-size: 1.3em;
            font-weight: 700;
            color: #dbe7f7;
            margin-bottom: 2px;
            letter-spacing: 0.3px;
        }
        .stat-label {
            font-size: 0.68em;
            color: rgba(176, 196, 222, 0.7);
            text-transform: uppercase;
            letter-spacing: 0.6px;
            font-weight: 500;
        }
        .content-wrapper {
            padding: 0;
            flex: 1;
            overflow: hidden;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        .section-header {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 40px;
            padding: 22px 40px 18px;
            flex-shrink: 0;
            background: linear-gradient(180deg, rgba(12, 16, 24, 0.98) 0%, rgba(10, 14, 22, 0.95) 100%);
            border-bottom: 1px solid rgba(255, 149, 0, 0.15);
            position: relative;
            z-index: 10;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        }
        @keyframes containerFloat {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-5px); }
        }
        .container::before {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            background: linear-gradient(135deg, 
                rgba(255, 149, 0, 0.15), 
                rgba(255, 165, 0, 0.1), 
                rgba(255, 149, 0, 0.15));
            border-radius: 16px;
            z-index: -1;
            opacity: 0;
            transition: opacity 0.3s;
        }
        .container:hover::before {
            opacity: 0.5;
        }
        h1 { 
            color: #FF9500;
            margin: 0;
            font-size: 1.7em; 
            font-weight: 700;
            letter-spacing: 3px;
            text-transform: uppercase;
        }
        .subtitle { 
            color: rgba(176, 196, 222, 0.7);
            margin: 3px 0 0 0;
            font-size: 0.78em; 
            font-weight: 500;
            letter-spacing: 1.5px;
        }
        .section-title {
            color: #FF9500;
            font-size: 1.05em;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
            text-transform: uppercase;
            letter-spacing: 1.5px;
        }
        .section-title::before {
            content: '';
            width: 4px;
            height: 18px;
            background: #FF7A00;
            border-radius: 2px;
        }
        .section-controls {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .search-container {
            position: relative;
        }
        .search-input {
            background: rgba(15, 20, 30, 0.9);
            border: 1px solid rgba(255, 149, 0, 0.3);
            border-radius: 8px;
            padding: 10px 16px 10px 38px;
            font-size: 0.85em;
            color: #B0C4DE;
            width: 220px;
            outline: none;
            transition: all 0.25s ease;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        .search-container::before {
            content: '🔍';
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.85em;
            opacity: 0.5;
            pointer-events: none;
            z-index: 1;
        }
        .search-input::placeholder {
            color: rgba(255, 165, 0, 0.4);
        }
        .search-input:focus {
            border-color: rgba(255, 149, 0, 0.7);
            background: rgba(20, 25, 35, 0.95);
            box-shadow: 
                inset 0 2px 4px rgba(0, 0, 0, 0.2),
                0 0 15px rgba(255, 149, 0, 0.15);
        }
        #content {
            position: relative;
            z-index: 1;
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            min-height: 0;
            padding: 20px 40px 50px;
            display: flex;
            flex-direction: column;
            align-items: center;
            -webkit-overflow-scrolling: touch;
            touch-action: pan-y;
        }
        #content > * {
            width: 100%;
            max-width: 1400px;
        }
        #content::-webkit-scrollbar {
            width: 8px;
        }
        #content::-webkit-scrollbar-track {
            background: rgba(15, 20, 30, 0.5);
            border-radius: 4px;
        }
        #content::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, rgba(255, 149, 0, 0.4) 0%, rgba(255, 165, 0, 0.3) 100%);
            border-radius: 4px;
        }
        #content::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, rgba(255, 149, 0, 0.6) 0%, rgba(255, 165, 0, 0.5) 100%);
        }
        .loading { 
            text-align: center; 
            padding: 60px 40px; 
            font-size: 1em; 
            color: #FF9500; 
            opacity: 0.95;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }
        .loading p {
            letter-spacing: 1px;
            text-transform: uppercase;
            font-size: 0.85em;
            animation: pulse 1.5s ease-in-out infinite;
        }
        @keyframes pulse {
            0%, 100% { opacity: 0.6; }
            50% { opacity: 1; }
        }
        .error { 
            background: linear-gradient(135deg, rgba(139, 0, 0, 0.2) 0%, rgba(100, 20, 20, 0.3) 100%); 
            border: 1px solid rgba(255, 85, 85, 0.4); 
            border-radius: 12px; 
            padding: 24px 30px; 
            text-align: center; 
            color: #ff8585;
            box-shadow: 0 4px 20px rgba(139, 0, 0, 0.2);
        }
        .error::before {
            content: '⚠️';
            display: block;
            font-size: 2em;
            margin-bottom: 10px;
        }
        .no-results {
            text-align: center;
            padding: 50px 30px;
            color: rgba(255, 165, 0, 0.6);
            font-size: 0.95em;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
        }
        .no-results::before {
            content: '🔍';
            font-size: 2.5em;
            opacity: 0.5;
        }
        .members-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 14px;
            overflow-x: hidden;
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 10px;
        }
        .character-card {
            background: linear-gradient(165deg, rgba(25, 32, 48, 0.92) 0%, rgba(16, 20, 32, 0.95) 50%, rgba(12, 16, 26, 0.98) 100%);
            border: 1px solid rgba(255, 149, 0, 0.12);
            border-radius: 16px;
            padding: 18px 22px 18px 20px;
            display: flex;
            align-items: center;
            gap: 18px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: visible;
            cursor: pointer;
            box-shadow: 
                0 4px 16px rgba(0, 0, 0, 0.25),
                0 1px 3px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.03);
            backdrop-filter: blur(8px);
        }
        .character-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent 0%, rgba(255, 149, 0, 0.2) 50%, transparent 100%);
            border-radius: 16px 16px 0 0;
        }
        .character-card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 16px;
            background: linear-gradient(135deg, rgba(255, 149, 0, 0.04) 0%, transparent 40%, rgba(80, 120, 200, 0.02) 100%);
            pointer-events: none;
        }
        .character-card:hover { 
            border-color: rgba(255, 149, 0, 0.4);
            background: linear-gradient(165deg, rgba(30, 40, 58, 0.95) 0%, rgba(20, 26, 42, 0.97) 50%, rgba(16, 20, 34, 0.99) 100%);
            box-shadow: 
                0 12px 40px rgba(0, 0, 0, 0.4),
                0 4px 12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 149, 0, 0.2),
                0 0 30px rgba(255, 149, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
            transform: translateY(-4px) scale(1.01);
        }
        .character-card:active {
            transform: translateY(-1px) scale(0.99);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
            transition: all 0.1s ease;
        }
        .character-card.loading-active {
            pointer-events: none;
            opacity: 0.85;
        }
        .character-card.loading-active::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            right: 0;
            bottom: 0;
            width: 200%;
            border-radius: 16px;
            background: linear-gradient(90deg, transparent 0%, rgba(255, 149, 0, 0.12) 25%, rgba(255, 149, 0, 0.2) 50%, rgba(255, 149, 0, 0.12) 75%, transparent 100%);
            animation: cardShimmer 1.5s ease-in-out infinite;
            z-index: 10;
        }
        @keyframes cardShimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }
        .profile-image-wrapper {
            position: relative;
            flex-shrink: 0;
        }
        .profile-image {
            width: 58px;
            height: 58px;
            border-radius: 14px;
            border: 2px solid rgba(255, 149, 0, 0.25);
            object-fit: cover;
            background: linear-gradient(145deg, rgba(20, 26, 38, 0.95) 0%, rgba(12, 16, 24, 0.9) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #FF7A00;
            font-size: 1.2em;
            flex-shrink: 0;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            box-shadow: 
                0 4px 12px rgba(0, 0, 0, 0.35),
                inset 0 0 0 1px rgba(255, 255, 255, 0.05);
        }
        .character-card:hover .profile-image {
            border-color: rgba(255, 149, 0, 0.5);
            box-shadow: 
                0 6px 20px rgba(0, 0, 0, 0.4),
                0 0 20px rgba(255, 149, 0, 0.15),
                inset 0 0 0 1px rgba(255, 255, 255, 0.08);
            transform: scale(1.03);
        }
        .profile-image img {
            width: 100%;
            height: 100%;
            border-radius: 10px;
            object-fit: cover;
            display: block;
        }
        .member-level-badge {
            position: absolute;
            bottom: -7px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, rgba(60, 80, 120, 0.95) 0%, rgba(45, 60, 95, 0.95) 100%);
            color: rgba(255, 255, 255, 0.95);
            font-size: 0.58em;
            font-weight: 700;
            padding: 3px 10px;
            border-radius: 10px;
            border: 1px solid rgba(255, 149, 0, 0.25);
            white-space: nowrap;
            box-shadow: 
                0 3px 8px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            letter-spacing: 0.3px;
            backdrop-filter: blur(4px);
        }
        .character-info { 
            flex-grow: 1; 
            display: flex;
            flex-direction: column;
            gap: 5px;
            min-width: 0;
        }
        .character-name { 
            font-size: 1em; 
            font-weight: 600; 
            color: #D0EAFF; 
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            letter-spacing: 0.4px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
            transition: color 0.2s ease;
        }
        .character-name:hover {
            color: #E8F4FF;
        }
        .gender-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75em;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            margin-left: 2px;
            flex-shrink: 0;
        }
        .gender-badge.female {
            color: #FF69B4;
            background: rgba(255, 105, 180, 0.15);
            border: 1px solid rgba(255, 105, 180, 0.3);
        }
        .gender-badge.male {
            color: #4DA6FF;
            background: rgba(77, 166, 255, 0.15);
            border: 1px solid rgba(77, 166, 255, 0.3);
        }
        .abyss-grade-badge {
            display: flex;
            align-items: center;
            margin-left: auto;
            padding-left: 8px;
        }
        .abyss-grade-icon {
            width: 24px;
            height: 24px;
            object-fit: contain;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
            transition: transform 0.2s ease;
        }
        .character-card:hover .abyss-grade-icon {
            transform: scale(1.1);
        }
        .rank-badge {
            display: inline-flex;
            align-items: center;
            background: rgba(35, 45, 65, 0.8);
            border-radius: 6px;
            padding: 3px 8px;
            font-size: 0.56em;
            color: rgba(180, 200, 225, 0.9);
            font-weight: 600;
            flex-shrink: 0;
            letter-spacing: 0.4px;
            border: 1px solid rgba(255, 149, 0, 0.2);
            text-transform: uppercase;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            backdrop-filter: blur(4px);
        }
        .rank-badge.rank-1 {
            color: #FFD700;
            border-color: rgba(255, 215, 0, 0.45);
            background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 180, 0, 0.1) 100%);
            box-shadow: 0 2px 8px rgba(255, 215, 0, 0.15);
        }
        .rank-badge.rank-2 {
            color: #E8E8E8;
            border-color: rgba(200, 200, 200, 0.4);
            background: linear-gradient(135deg, rgba(200, 200, 200, 0.12) 0%, rgba(160, 160, 160, 0.08) 100%);
            box-shadow: 0 2px 8px rgba(200, 200, 200, 0.1);
        }
        .rank-badge.rank-3 {
            color: #F0A850;
            border-color: rgba(220, 140, 60, 0.45);
            background: linear-gradient(135deg, rgba(220, 140, 60, 0.12) 0%, rgba(180, 100, 40, 0.08) 100%);
            box-shadow: 0 2px 8px rgba(205, 127, 50, 0.12);
        }
        .character-details {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: nowrap;
        }
        .character-class { 
            color: rgba(200, 220, 245, 0.9); 
            font-size: 0.82em;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 7px;
        }
        .class-icon {
            width: 24px;
            height: 24px;
            border-radius: 6px;
            background: linear-gradient(145deg, rgba(25, 32, 45, 0.95) 0%, rgba(18, 24, 36, 0.9) 100%);
            object-fit: contain;
            border: 1px solid rgba(255, 149, 0, 0.18);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
            transition: all 0.25s ease;
        }
        .character-card:hover .class-icon {
            border-color: rgba(255, 149, 0, 0.35);
        }
        .character-level {
            color: rgba(200, 218, 235, 0.9);
            font-size: 0.75em;
            font-weight: 500;
        }
        .item-level-container {
            text-align: right;
            min-width: 60px;
            flex-shrink: 0;
        }
        .wanted-badge {
            position: absolute;
            top: -8px;
            left: 10px;
            background: linear-gradient(135deg, #9a1010 0%, #6b0000 100%);
            color: #ffd700;
            padding: 4px 8px;
            border-radius: 5px;
            font-weight: bold;
            font-size: 0.58em;
            cursor: pointer;
            border: 1px solid rgba(255, 215, 0, 0.7);
            z-index: 10;
            text-transform: uppercase;
            letter-spacing: 0.6px;
            transform: rotate(-3deg);
            box-shadow: 
                0 3px 10px rgba(139, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            transition: all 0.2s ease;
        }
        .wanted-badge:hover {
            transform: rotate(-3deg) scale(1.08);
            box-shadow: 
                0 5px 15px rgba(139, 0, 0, 0.6),
                0 0 15px rgba(255, 215, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
        }
        .modal-tabs {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 10px;
            padding: 14px 0 6px;
            margin: 0;
            flex-shrink: 0;
            position: relative;
            z-index: 10;
            background: transparent;
            border: none;
            border-radius: 0;
            box-shadow: none;
            backdrop-filter: none;
        }
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            z-index: 2000;
            justify-content: center;
            align-items: center;
            padding: 32px;
            opacity: 0;
            transition: opacity 0.25s ease;
            overscroll-behavior: contain;
        }
        
        /* Prevent body scroll when modal is open */
        body:has(.modal.active) {
            overflow: hidden !important;
            position: fixed;
            width: 100%;
            height: 100%;
        }
        
        /* Hide cookie settings button when modal is open on mobile */
        @media (max-width: 768px) {
            body:has(.modal.active) .cookie-settings-btn {
                display: none !important;
            }
        }
        
        .modal.active {
            display: flex;
            opacity: 1;
            animation: modalFadeIn 0.3s ease;
        }

        .modal.closing {
            display: flex;
            pointer-events: none;
            animation: modalFadeOut 0.22s ease forwards;
        }

        @keyframes modalFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes modalFadeOut {
            from { opacity: 1; }
            to { opacity: 0; }
        }
        
        .modal-content {
            background: linear-gradient(150deg, rgba(15, 22, 36, 0.96) 0%, rgba(9, 13, 22, 0.96) 100%);
            border: 1px solid rgba(93, 160, 255, 0.18);
            border-radius: 18px;
            box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02);
            padding: 24px 28px;
            max-width: 720px;
            width: 100%;
            position: relative;
            overflow: hidden;
            max-height: 90vh;
            overflow-y: auto;
            transform: translateY(10px) scale(0.98);
            animation: modalContentSlide 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }

        @keyframes modalContentSlide {
            from { transform: translateY(18px) scale(0.97); opacity: 0; }
            to { transform: translateY(0) scale(1); opacity: 1; }
        }

        @keyframes modalContentSlideOut {
            from { transform: translateY(0) scale(1); opacity: 1; }
            to { transform: translateY(14px) scale(0.98); opacity: 0; }
        }
        .modal-content::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(circle at 25% 20%, rgba(255, 149, 0, 0.05), transparent 35%),
                        radial-gradient(circle at 80% 0%, rgba(74, 108, 247, 0.1), transparent 30%);
            pointer-events: none;
        }
        .modal-close {
            position: absolute;
            top: 6px;
            right: 6px;
            background: rgba(20, 26, 38, 0.92);
            color: rgba(235, 242, 255, 0.9);
            border: 1px solid rgba(93, 160, 255, 0.45);
            width: 32px;
            height: 32px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.95em;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            letter-spacing: 0.02em;
            transition: all 0.2s ease;
            z-index: 100;
            line-height: 1;
            padding: 0;
            backdrop-filter: blur(12px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
        }
        .modal-close:hover {
            background: linear-gradient(135deg, rgba(93, 160, 255, 0.16), rgba(93, 160, 255, 0.08));
            border-color: rgba(93, 160, 255, 0.55);
            color: #e7f0ff;
            box-shadow: 0 10px 28px rgba(93, 160, 255, 0.18);
            transform: translateY(-1px);
        }
        .modal-close:active {
            transform: translateY(0) scale(0.97);
        }
        
        /* Character modal specific close button */
        .character-modal-content .modal-close,
        .profile-header-section .modal-close {
            top: 8px;
            right: 8px;
        }

        .modal-header-actions {
            position: absolute;
            top: 8px;
            right: 8px;
            display: flex;
            gap: 8px;
            align-items: center;
            z-index: 101;
        }

        .modal-header-actions .modal-close {
            position: static;
        }

        .modal-refresh {
            background: rgba(20, 26, 38, 0.92);
            color: rgba(235, 242, 255, 0.9);
            border: 1px solid rgba(93, 160, 255, 0.45);
            border-radius: 10px;
            padding: 0 12px;
            height: 36px;
            cursor: pointer;
            font-weight: 600;
            letter-spacing: 0.01em;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.2s ease;
            backdrop-filter: blur(12px);
            box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
        }

        .modal-favorite {
            background: rgba(255, 255, 255, 0.04);
            color: rgba(235, 242, 255, 0.92);
            border: 1px solid rgba(255, 200, 120, 0.32);
            border-radius: 8px;
            padding: 6px 12px;
            min-height: 32px;
            cursor: pointer;
            font-weight: 600;
            letter-spacing: 0.01em;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            transition: all 0.2s ease;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            font-size: 0.85em;
            min-width: 100px;
            width: fit-content;
            white-space: nowrap;
            box-sizing: border-box;
        }

        .modal-favorite:hover {
            border-color: rgba(255, 200, 120, 0.55);
            color: #ffd27f;
            transform: translateY(-1px);
            box-shadow: 0 10px 22px rgba(255, 200, 120, 0.16);
        }

        .modal-favorite.active {
            background: linear-gradient(145deg, rgba(255, 180, 90, 0.18), rgba(255, 220, 150, 0.14));
            border-color: rgba(255, 200, 120, 0.78);
            color: #ffd27f;
            box-shadow: 0 10px 22px rgba(255, 200, 120, 0.22);
        }

        .modal-favorite .fav-icon {
            font-size: 1.1rem;
            line-height: 1;
            flex-shrink: 0;
        }

        .modal-favorite .fav-label {
            font-size: 0.9em;
            color: rgba(235, 242, 255, 0.9);
            white-space: nowrap;
        }

        /* Share button in modal */
        .modal-share {
            background: rgba(255, 255, 255, 0.04);
            color: rgba(235, 242, 255, 0.92);
            border: 1px solid rgba(100, 180, 255, 0.32);
            border-radius: 8px;
            padding: 6px 12px;
            min-height: 32px;
            cursor: pointer;
            font-weight: 600;
            letter-spacing: 0.01em;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            transition: all 0.2s ease;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            font-size: 0.85em;
            min-width: 85px;
            width: fit-content;
            white-space: nowrap;
            box-sizing: border-box;
        }

        .modal-share:hover {
            border-color: rgba(100, 180, 255, 0.55);
            color: #8fc4ff;
            transform: translateY(-1px);
            box-shadow: 0 10px 22px rgba(100, 180, 255, 0.16);
        }

        .modal-share.copied {
            background: linear-gradient(145deg, rgba(80, 200, 120, 0.18), rgba(80, 200, 120, 0.14));
            border-color: rgba(80, 200, 120, 0.78);
            color: #7defa0;
            box-shadow: 0 10px 22px rgba(80, 200, 120, 0.22);
        }

        .modal-share .share-icon {
            font-size: 0.95rem;
            line-height: 1;
            flex-shrink: 0;
        }

        .modal-share .share-label {
            font-size: 0.9em;
            color: rgba(235, 242, 255, 0.9);
            white-space: nowrap;
        }

        .modal-refresh:hover {
            background: linear-gradient(135deg, rgba(93, 160, 255, 0.16), rgba(93, 160, 255, 0.08));
            border-color: rgba(93, 160, 255, 0.55);
            color: #e7f0ff;
            box-shadow: 0 10px 28px rgba(93, 160, 255, 0.18);
            transform: translateY(-1px);
        }

        /* Favorites Panel (home) */
        .favorites-panel {
            margin-top: 24px;
            margin-bottom: 40px;
            background: linear-gradient(145deg, rgba(20, 28, 42, 0.95), rgba(16, 22, 34, 0.92));
            border: 1px solid rgba(255, 180, 80, 0.18);
            border-radius: 18px;
            padding: 20px 22px;
            box-shadow: 
                0 16px 40px rgba(0, 0, 0, 0.4),
                0 0 1px rgba(255, 180, 80, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(12px);
        }

        .favorites-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            margin-bottom: 16px;
            padding-bottom: 14px;
            border-bottom: 1px solid rgba(255, 180, 80, 0.1);
        }

        .favorites-header > div:first-child {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .favorites-title {
            font-size: 1.05em;
            font-weight: 700;
            color: #ffd27f;
            letter-spacing: 0.4px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .favorites-title::before {
            content: '★';
            font-size: 0.95em;
            color: #ffb74d;
            text-shadow: 0 0 10px rgba(255, 183, 77, 0.5);
        }

        .favorites-count {
            font-size: 0.8em;
            color: rgba(255, 210, 127, 0.7);
            background: rgba(255, 149, 0, 0.1);
            padding: 3px 10px;
            border-radius: 12px;
            border: 1px solid rgba(255, 149, 0, 0.15);
        }

        .favorites-header-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .favorites-delete-all {
            background: rgba(255, 80, 80, 0.08);
            color: rgba(255, 150, 150, 0.85);
            border: 1px solid rgba(255, 80, 80, 0.2);
            border-radius: 10px;
            padding: 8px 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 1em;
        }

        .favorites-delete-all:hover {
            background: rgba(255, 80, 80, 0.2);
            border-color: rgba(255, 80, 80, 0.5);
            color: #ff9999;
        }

        .favorites-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 14px;
        }

        .favorite-card {
            display: flex;
            align-items: center;
            gap: 12px;
            background: linear-gradient(145deg, rgba(26, 35, 52, 0.95), rgba(20, 28, 42, 0.9));
            border: 1px solid rgba(255, 180, 80, 0.12);
            border-radius: 14px;
            padding: 14px 16px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 
                0 6px 20px rgba(0, 0, 0, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.03);
            position: relative;
            overflow: hidden;
        }

        .favorite-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255, 180, 80, 0.2), transparent);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .favorite-card:active {
            opacity: 0.85;
        }

        /* Drag handle */
        .favorite-drag-handle {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            font-size: 14px;
            color: rgba(200, 215, 235, 0.35);
            cursor: grab;
            transition: color 0.2s ease;
            letter-spacing: -2px;
            flex-shrink: 0;
        }

        .favorite-drag-handle:hover {
            color: rgba(255, 180, 80, 0.7);
        }

        .favorite-card:active .favorite-drag-handle {
            cursor: grabbing;
        }

        /* Dragging states */
        .favorite-card.dragging {
            opacity: 0.5;
            background: rgba(255, 149, 0, 0.1);
            border-color: rgba(255, 149, 0, 0.4);
            box-shadow: 0 8px 32px rgba(255, 149, 0, 0.2);
        }

        .favorite-card.drag-placeholder {
            background: rgba(255, 149, 0, 0.08);
            border: 2px dashed rgba(255, 149, 0, 0.3);
            border-radius: 14px;
            pointer-events: none;
        }

        .favorite-main {
            flex: 1;
            min-width: 0;
        }

        .favorite-name-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }

        .favorite-name {
            font-weight: 700;
            color: #f0f6ff;
            font-size: 1em;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        }

        .favorite-level {
            font-size: 0.75em;
            font-weight: 600;
            color: #ffd27f;
            background: linear-gradient(135deg, rgba(255, 149, 0, 0.2), rgba(255, 120, 0, 0.12));
            border: 1px solid rgba(255, 149, 0, 0.3);
            border-radius: 6px;
            padding: 3px 8px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }

        .favorite-region-tag {
            font-size: 0.85em;
            margin-left: 4px;
            opacity: 0.9;
        }

        .favorite-meta {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 0.85em;
            color: rgba(200, 215, 235, 0.75);
        }

        .favorite-class {
            display: inline-flex;
            align-items: center;
            gap: 7px;
        }

        .favorite-class-icon {
            width: 20px;
            height: 20px;
            border-radius: 5px;
            object-fit: cover;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .favorite-server {
            color: rgba(130, 180, 255, 0.85);
            font-size: 0.9em;
        }

        .favorite-server::before {
            content: '•';
            margin-right: 8px;
            opacity: 0.5;
        }

        .favorites-empty {
            text-align: center;
            padding: 32px 20px 20px;
            color: rgba(220, 230, 245, 0.7);
        }

        .favorites-empty-icon {
            font-size: 2.2em;
            margin-bottom: 12px;
            color: rgba(255, 180, 80, 0.6);
            text-shadow: 0 0 20px rgba(255, 180, 80, 0.3);
        }

        .favorites-empty-text {
            font-weight: 700;
            font-size: 1.05em;
            margin-bottom: 6px;
            color: rgba(240, 245, 255, 0.85);
        }

        .favorites-empty-hint {
            font-size: 0.9em;
            color: rgba(200, 215, 235, 0.55);
            line-height: 1.5;
        }

        /* Favorites Show More Button */
        .favorites-show-more {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            width: 100%;
            margin-top: 16px;
            padding: 14px 20px;
            background: linear-gradient(135deg, rgba(255, 149, 0, 0.12), rgba(255, 120, 0, 0.08));
            border: 1px solid rgba(255, 180, 80, 0.25);
            border-radius: 12px;
            color: #ffd27f;
            font-size: 0.92em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

        .favorites-show-more::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
        }

        .favorites-show-more:active {
            opacity: 0.85;
        }

        .favorites-show-more-icon {
            font-size: 0.85em;
        }

        /* Expanded favorites panel - full screen mode */
        .favorites-panel.expanded {
            position: fixed;
            top: 80px;
            bottom: 64px;
            left: 50%;
            transform: translateX(-50%);
            width: calc(100% - 48px);
            max-width: 960px;
            overflow: hidden;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            margin-top: 0;
            margin-bottom: 0;
            padding: 24px 28px;
            background: linear-gradient(145deg, rgba(18, 25, 38, 0.98), rgba(14, 20, 32, 0.96));
            border: 1px solid rgba(255, 180, 80, 0.22);
            box-shadow: 
                0 25px 80px rgba(0, 0, 0, 0.6),
                0 0 1px rgba(255, 180, 80, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
        }

        .favorites-panel.expanded .favorites-header {
            margin-bottom: 18px;
            padding-bottom: 16px;
            border-bottom: 1px solid rgba(255, 180, 80, 0.15);
        }

        .favorites-panel.expanded .favorites-title {
            font-size: 1.2em;
        }

        .favorites-panel.expanded .favorites-list-wrapper {
            flex: 1;
            overflow-y: auto;
            margin: 0 -28px;
            padding: 0 28px;
            scrollbar-gutter: stable;
        }

        .favorites-panel.expanded .favorites-list {
            max-height: none;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 16px;
        }

        .favorites-panel.expanded .favorite-card {
            padding: 16px 18px;
        }

        /* Overlay backdrop for expanded mode */
        .favorites-panel.expanded::after {
            content: '';
            position: fixed;
            inset: 0;
            background: rgba(8, 12, 20, 0.75);
            backdrop-filter: blur(4px);
            z-index: -1;
        }

        /* Favorites list wrapper */
        .favorites-list-wrapper {
            overflow: hidden;
        }

        /* Favorites search bar */
        .favorites-search-wrapper {
            display: flex;
            align-items: center;
            gap: 12px;
            background: linear-gradient(135deg, rgba(13, 18, 28, 0.9), rgba(10, 15, 24, 0.85));
            border: 1px solid rgba(255, 180, 80, 0.18);
            border-radius: 12px;
            padding: 12px 16px;
            margin-bottom: 18px;
            transition: all 0.25s ease;
            box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
        }

        .favorites-search-wrapper:focus-within {
            border-color: rgba(255, 180, 80, 0.4);
            box-shadow: 
                inset 0 2px 6px rgba(0, 0, 0, 0.2),
                0 0 0 3px rgba(255, 149, 0, 0.1);
        }

        .favorites-search-icon {
            font-size: 1.05em;
            opacity: 0.65;
            transition: opacity 0.2s ease;
        }

        .favorites-search-wrapper:focus-within .favorites-search-icon {
            opacity: 0.9;
        }

        .favorites-search-input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: #f0f6ff;
            font-size: 0.98em;
            font-family: inherit;
        }

        .favorites-search-input::placeholder {
            color: rgba(180, 200, 230, 0.45);
        }

        .favorites-search-count {
            font-size: 0.82em;
            color: rgba(255, 210, 127, 0.85);
            white-space: nowrap;
            background: rgba(255, 149, 0, 0.12);
            padding: 4px 10px;
            border-radius: 8px;
            border: 1px solid rgba(255, 149, 0, 0.2);
        }

        /* No results message */
        .favorites-no-results {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 48px 24px;
            color: rgba(200, 220, 245, 0.6);
            text-align: center;
        }

        .favorites-no-results-icon {
            font-size: 2em;
            opacity: 0.4;
            margin-bottom: 4px;
        }

        .favorites-no-results span:last-child {
            font-size: 0.95em;
            color: rgba(180, 200, 230, 0.5);
        }

        /* Custom scrollbar for favorites */
        .favorites-list-wrapper::-webkit-scrollbar {
            width: 8px;
        }

        .favorites-list-wrapper::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 4px;
        }

        .favorites-list-wrapper::-webkit-scrollbar-thumb {
            background: rgba(255, 149, 0, 0.3);
            border-radius: 4px;
        }

        .favorites-list-wrapper::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 149, 0, 0.5);
        }

        /* Favorite toggle button within favorites panel */
        .favorites-panel .fav-toggle {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            border: 1px solid rgba(255, 180, 80, 0.15);
            background: linear-gradient(145deg, rgba(255, 149, 0, 0.08), rgba(255, 120, 0, 0.05));
            color: #ffd27f;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            flex-shrink: 0;
        }

        .favorites-panel .fav-toggle.active {
            background: linear-gradient(145deg, rgba(255, 149, 0, 0.25), rgba(255, 180, 80, 0.18));
            border-color: rgba(255, 180, 80, 0.5);
            color: #ffe082;
            box-shadow: 
                0 6px 20px rgba(255, 149, 0, 0.25),
                0 0 12px rgba(255, 180, 80, 0.15);
        }

        .favorites-panel .fav-toggle .fav-icon {
            font-size: 1.15em;
            line-height: 1;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }

        .favorites-panel .fav-toggle:active {
            opacity: 0.85;
        }

        /* Remove favorite animation */
        @keyframes favoriteRemove {
            0% {
                opacity: 1;
                transform: scale(1);
            }
            100% {
                opacity: 0;
                transform: scale(0.8);
            }
        }

        .favorite-card.removing {
            animation: favoriteRemove 0.25s ease forwards;
            pointer-events: none;
        }

        .modal-refresh:active {
            transform: translateY(0) scale(0.97);
        }

        .profile-name-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: flex-start;
            width: auto;
        }

        .profile-server-tag {
            font-size: 0.75em;
            font-weight: 500;
            color: rgba(200, 215, 235, 0.9);
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 6px;
            padding: 4px 10px;
            white-space: nowrap;
        }

        .modal-refresh-compact {
            height: 26px;
            width: 26px;
            padding: 0;
            font-size: 1rem;
            border-radius: 6px;
            box-shadow: none;
            backdrop-filter: blur(6px);
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: rgba(200, 215, 235, 0.7);
            opacity: 0.7;
            transition: all 0.2s ease;
        }

        .modal-refresh-compact svg {
            display: block;
            transition: transform 0.3s ease;
        }

        .modal-refresh-compact:hover {
            opacity: 1;
            color: rgba(93, 160, 255, 0.95);
            border-color: rgba(93, 160, 255, 0.4);
            background: rgba(93, 160, 255, 0.1);
            transform: none;
        }

        .modal-refresh-compact:hover svg {
            transform: rotate(-45deg);
        }

        .modal-refresh-compact:active {
            transform: scale(0.92);
        }

        .modal-refresh-compact.refreshing {
            opacity: 1;
            color: rgba(93, 160, 255, 0.95);
            pointer-events: none;
        }

        .modal-refresh-compact.refreshing svg {
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        .wanted-header {
            text-align: center;
            font-size: 3em;
            font-weight: bold;
            color: #8b0000;
            text-transform: uppercase;
            letter-spacing: 8px;
            margin-bottom: 5px;
            text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
            border: 4px solid #8b0000;
            padding: 10px;
            background: rgba(139, 0, 0, 0.05);
            font-family: 'Courier New', monospace;
        }
        .reward {
            text-align: center;
            font-size: 1.1em;
            color: #654321;
            margin: 10px 0;
            font-weight: bold;
            font-family: 'Courier New', monospace;
        }
        .photo-frame {
            border: 6px solid #654321;
            background: #ddd;
            padding: 5px;
            margin: 0 auto 15px;
            width: 180px;
            height: 180px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: inset 0 0 15px rgba(0,0,0,0.3);
            overflow: hidden;
        }
        .photo-frame img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            filter: sepia(30%);
        }
        .silhouette {
            font-size: 100px;
            color: #8b0000;
            opacity: 0.6;
        }
        .info-section {
            background: rgba(101, 67, 33, 0.1);
            border: 2px dashed #654321;
            padding: 12px 15px;
            margin: 10px 0;
            font-family: 'Courier New', monospace;
        }
        .info-row {
            display: flex;
            justify-content: space-between;
            margin: 8px 0;
            font-size: 1.1em;
            color: #2c1810;
        }
        .info-label {
            font-weight: bold;
            text-transform: uppercase;
        }
        .info-value {
            font-weight: bold;
            color: #8b0000;
        }
        .crime {
            text-align: center;
            font-size: 1.1em;
            color: #8b0000;
            font-weight: bold;
            margin: 12px 0;
            padding: 12px;
            border-top: 2px solid #654321;
            border-bottom: 2px solid #654321;
            font-style: italic;
            font-family: 'Courier New', monospace;
        }
        .footer {
            text-align: center;
            font-size: 0.85em;
            color: #654321;
            font-weight: bold;
            font-family: 'Courier New', monospace;
        }
        .modal-content .spinner {
            border: 3px solid rgba(93, 160, 255, 0.14);
            border-top: 3px solid rgba(93, 160, 255, 0.9);
            border-radius: 50%;
            width: 42px;
            height: 42px;
            animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
            margin: 0 auto;
            box-shadow: 0 0 18px rgba(255, 149, 0, 0.25);
        }
        
        @keyframes spin { 
            to { transform: rotate(360deg); } 
        }
        .modal-content .loading {
            text-align: center;
            padding: 20px;
            font-size: 1.05em;
            color: rgba(220, 230, 245, 0.86);
            letter-spacing: 0.2px;
        }
        
        /* Character Modal Loading State */
        .character-modal-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            min-height: 300px;
            gap: 24px;
        }
        .character-modal-loading .spinner {
            width: 56px;
            height: 56px;
        }
        .character-modal-loading p {
            color: #FF9500;
            font-size: 0.9em;
            letter-spacing: 1px;
            text-transform: uppercase;
            animation: pulse 1.5s ease-in-out infinite;
        }
        
        /* Character Modal Error State */
        .character-modal-error {
            display: flex;
            flex-direction: column;
            height: 100%;
            min-height: 300px;
        }
        
        .character-modal-error .modal-header-actions {
            display: flex;
            justify-content: flex-end;
            padding: 16px;
        }
        
        .character-modal-error .error-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            flex: 1;
            padding: 32px;
            text-align: center;
            gap: 16px;
        }
        
        .character-modal-error .error-icon {
            font-size: 48px;
            margin-bottom: 8px;
        }
        
        .character-modal-error h3 {
            color: #ff6b6b;
            font-size: 1.3em;
            margin: 0;
        }
        
        .character-modal-error p {
            color: #9ca3af;
            font-size: 0.95em;
            margin: 0;
            max-width: 400px;
        }
        
        .character-modal-error .error-hint {
            color: #6b7280;
            font-size: 0.85em;
            font-style: italic;
        }
        
        .character-modal-error .error-retry-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 24px;
            background: linear-gradient(135deg, #ff9500 0%, #e68500 100%);
            color: #fff;
            border: none;
            border-radius: 8px;
            font-size: 0.95em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-top: 8px;
        }
        
        .character-modal-error .error-retry-btn:hover {
            background: linear-gradient(135deg, #ffaa33 0%, #ff9500 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
        }
        
        .character-modal-error .error-retry-btn .refresh-icon {
            font-size: 1.1em;
        }
        
        /* Skeleton Loading */
        .skeleton-container {
            display: flex;
            flex-direction: column;
            gap: 20px;
            padding: 20px;
            width: 100%;
        }
        .skeleton-header {
            display: flex;
            gap: 20px;
            align-items: center;
        }
        .skeleton-avatar {
            width: 80px;
            height: 80px;
            border-radius: 12px;
            background: linear-gradient(90deg, rgba(40, 50, 70, 0.5) 25%, rgba(60, 75, 100, 0.5) 50%, rgba(40, 50, 70, 0.5) 75%);
            background-size: 200% 100%;
            animation: skeletonShimmer 1.5s ease-in-out infinite;
        }
        .skeleton-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .skeleton-line {
            height: 16px;
            border-radius: 4px;
            background: linear-gradient(90deg, rgba(40, 50, 70, 0.5) 25%, rgba(60, 75, 100, 0.5) 50%, rgba(40, 50, 70, 0.5) 75%);
            background-size: 200% 100%;
            animation: skeletonShimmer 1.5s ease-in-out infinite;
        }
        .skeleton-line.short { width: 60%; }
        .skeleton-line.medium { width: 80%; }
        .skeleton-line.full { width: 100%; }
        .skeleton-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 12px;
        }
        .skeleton-item {
            height: 100px;
            border-radius: 8px;
            background: linear-gradient(90deg, rgba(40, 50, 70, 0.5) 25%, rgba(60, 75, 100, 0.5) 50%, rgba(40, 50, 70, 0.5) 75%);
            background-size: 200% 100%;
            animation: skeletonShimmer 1.5s ease-in-out infinite;
        }
        @keyframes skeletonShimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }
        
        .character-modal-content {
            background: linear-gradient(155deg, rgba(14, 19, 30, 0.96) 0%, rgba(8, 12, 20, 0.95) 100%);
            border: 1px solid rgba(93, 160, 255, 0.16);
            border-radius: 18px;
            padding: 24px;
            max-width: 1400px;
            width: 100%;
            height: 90vh;
            max-height: 90vh;
            overflow: hidden;
            position: relative;
            backdrop-filter: blur(18px) saturate(125%);
            display: flex;
            flex-direction: column;
            box-shadow: 0 26px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.02);
            transform: translateY(12px) scale(0.98);
            opacity: 0;
            animation: none;
            will-change: transform, opacity;
        }

        .modal.active .character-modal-content {
            animation: modalContentSlide 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }

        .modal.closing .character-modal-content {
            animation: modalContentSlideOut 0.22s ease forwards;
        }

        #characterModalContent {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }

        .character-modal-header {
            display: none;
        }
        .modal-header-class-icon {
            width: 40px;
            height: 40px;
            border-radius: 6px;
            border: 1px solid rgba(100, 120, 150, 0.4);
            background: rgba(10, 15, 25, 0.8);
            object-fit: contain;
            padding: 4px;
            filter: drop-shadow(0 0 6px rgba(100, 120, 150, 0.3));
        }
        .equipment-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
            gap: 8px;
            margin-bottom: 0;
        }
        .equipment-item {
            background: rgba(20, 25, 35, 0.6);
            border: 1px solid rgba(100, 120, 150, 0.25);
            border-radius: 6px;
            padding: 8px;
            text-align: center;
            transition: all 0.2s ease;
            position: relative;
            cursor: pointer;
        }
        .equipment-item:hover {
            border-color: rgba(100, 140, 200, 0.5);
            background: rgba(28, 35, 50, 0.8);
        }

        /* --- STYLES DES GRADES D'ÉQUIPEMENT --- */
        .equipment-item.grade-normal { border-color: #ffffff; } 
        .equipment-item.grade-rare { border-color: #00870b; } 
        .equipment-item.grade-unique { border-color: #ffd700; } 
        .equipment-item.grade-hero { border-color: #ff8c00; } 
        .equipment-item.grade-legend { border-color: #3366ff; } 
        .equipment-item.grade-mythic { border-color: #ff00ff; } 
        
        .equipment-item.grade-normal .equipment-name, .equipment-item.grade-normal .equipment-grade, .equipment-item.grade-normal .equipment-enchant { color: #ffffff; }
        .equipment-item.grade-rare .equipment-name, .equipment-item.grade-rare .equipment-grade, .equipment-item.grade-rare .equipment-enchant { color: #00870b; }
        .equipment-item.grade-unique .equipment-name, .equipment-item.grade-unique .equipment-grade, .equipment-item.grade-unique .equipment-enchant { color: #ffd700; }
        .equipment-item.grade-hero .equipment-name, .equipment-item.grade-hero .equipment-grade, .equipment-item.grade-hero .equipment-enchant { color: #ff8c00; }
        .equipment-item.grade-legend .equipment-name, .equipment-item.grade-legend .equipment-grade, .equipment-item.grade-legend .equipment-enchant { color: #3366ff; }
        .equipment-item.grade-mythic .equipment-name, .equipment-item.grade-mythic .equipment-grade, .equipment-item.grade-mythic .equipment-enchant { color: #ff00ff; }

        /* Hover shadows for high grades */
        .equipment-item.grade-legend:hover { border-color: rgba(51, 102, 255, 0.7); } 
        .equipment-item.grade-hero:hover { border-color: rgba(255, 140, 0, 0.7); } 
        .equipment-item.grade-unique:hover { border-color: rgba(255, 215, 0, 0.7); } 

        .equipment-icon {
            width: 50px;
            height: 50px;
            margin: 0 auto 5px;
            border-radius: 4px;
        }
        .equipment-name {
            font-size: 0.7em;
            color: #B0C4DE;
            margin-bottom: 3px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .equipment-grade {
            font-size: 0.65em;
            color: #8ba4c4;
            opacity: 0.8;
        }
        .equipment-enchant {
            font-size: 0.7em;
            color: #90b0d0;
            font-weight: 600;
            margin-top: 3px;
        }
        .modal-section {
            margin-bottom: 16px;
        }
        
        .modal-section:first-of-type {
            margin-top: 20px;
        }
        
        .modal-section-title {
            color: #8ba4c4;
            font-size: 1em;
            font-weight: 600;
            margin-bottom: 10px;
            padding-bottom: 6px;
        }

        /* ===== MODAL TABS ===== */
        .modal-tabs {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 10px;
            padding: 14px 0 6px;
            margin: 0;
            flex-shrink: 0;
            position: relative;
            z-index: 10;
            background: transparent;
            border: none;
            border-radius: 0;
            box-shadow: none;
            backdrop-filter: none;
        }

        .modal-tab {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-height: 44px;
            padding: 10px 16px;
            background: linear-gradient(180deg, rgba(28, 34, 50, 0.85) 0%, rgba(20, 26, 42, 0.88) 100%);
            border: 1px solid rgba(120, 160, 255, 0.12);
            border-radius: 10px;
            color: rgba(180, 200, 230, 0.82);
            font-size: 0.92em;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
            text-transform: uppercase;
            letter-spacing: 0.55px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.02);
        }

        .modal-tab::after {
            content: '';
            position: absolute;
            left: 18%;
            right: 18%;
            bottom: 6px;
            height: 3px;
            border-radius: 999px;
            background: linear-gradient(90deg, rgba(120, 180, 255, 0) 0%, rgba(120, 180, 255, 0.4) 50%, rgba(120, 180, 255, 0) 100%);
            opacity: 0;
            transform: translateY(4px);
            transition: opacity 0.18s ease, transform 0.18s ease;
        }

        .modal-tab:hover {
            background: linear-gradient(180deg, rgba(36, 46, 68, 0.92) 0%, rgba(24, 32, 50, 0.92) 100%);
            color: #d5e3ff;
            border-color: rgba(120, 170, 255, 0.32);
            transform: translateY(-1px);
            box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
        }

        .modal-tab:focus-visible {
            outline: 2px solid rgba(120, 180, 255, 0.7);
            outline-offset: 2px;
        }

        .modal-tab.active {
            background: linear-gradient(180deg, rgba(110, 150, 230, 0.12) 0%, rgba(70, 110, 190, 0.2) 100%);
            border-color: rgba(120, 180, 255, 0.5);
            color: #e9f2ff;
            box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(120, 180, 255, 0.12);
        }

        .modal-tab.active::after {
            opacity: 1;
            transform: translateY(0);
            background: linear-gradient(90deg, rgba(120, 180, 255, 0.15) 0%, rgba(120, 180, 255, 0.8) 50%, rgba(120, 180, 255, 0.15) 100%);
        }

        .modal-tab-contents {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            overflow-x: hidden;
            background: transparent;
            border: none;
            border-radius: 0 0 12px 12px;
            padding: 20px;
            min-height: 0;
            -webkit-overflow-scrolling: touch;
            touch-action: pan-y;
            overscroll-behavior: contain;
        }

        .modal-tab-contents::-webkit-scrollbar {
            width: 8px;
        }

        .modal-tab-contents::-webkit-scrollbar-track {
            background: rgba(100, 120, 150, 0.1);
            border-radius: 10px;
        }

        .modal-tab-contents::-webkit-scrollbar-thumb {
            background: rgba(100, 120, 150, 0.4);
            border-radius: 10px;
        }

        .modal-tab-contents::-webkit-scrollbar-thumb:hover {
            background: rgba(100, 120, 150, 0.6);
        }

        .modal-tab-content {
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .modal-tab-content.active {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }

        .tab-empty {
            color: #8ba4c4;
            text-align: center;
            padding: 60px 20px;
            font-style: italic;
            opacity: 0.7;
            font-size: 1.1em;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* ===== PROFILE HEADER (MODAL HEADER) ===== */
        .profile-header-section.modal-header {
            display: flex;
            align-items: stretch;
            justify-content: flex-start;
            gap: 18px 20px;
            padding: 16px 20px;
            background: rgba(20, 26, 38, 0.95);
            border-radius: 12px;
            border: 1px solid rgba(100, 120, 150, 0.22);
            margin: 0;
            flex-shrink: 0;
            position: relative;
            flex-wrap: wrap;
            width: 100%;
            box-sizing: border-box;
        }

        .profile-main {
            display: flex;
            gap: 14px;
            flex: 0 1 auto;
            align-items: center;
            min-width: 0;
            position: relative;
            z-index: 1;
        }

        .profile-extras {
            display: flex;
            flex-direction: column;
            gap: 10px;
            align-items: flex-end;
            justify-content: center;
        }

        .profile-header-section {
            display: flex;
            gap: 20px;
            padding: 14px 16px;
            background: rgba(22, 28, 40, 0.9);
            border-radius: 10px;
            border: 1px solid rgba(100, 120, 150, 0.2);
            margin-bottom: 12px;
        }

        .profile-image-container {
            position: relative;
            flex-shrink: 0;
        }

        .profile-image {
            width: 96px;
            height: 96px;
            border-radius: 12px;
            border: 2px solid rgba(100, 140, 200, 0.5);
            object-fit: cover;
            background: rgba(0, 0, 0, 0.3);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .profile-level {
            position: absolute;
            bottom: -8px;
            left: 50%;
            transform: translateX(-50%);
            background: #4a5a7a;
            color: #fff;
            font-size: 0.8em;
            font-weight: 700;
            padding: 3px 12px;
            border-radius: 9px;
            border: 2px solid rgba(100, 140, 200, 0.4);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .profile-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            min-width: 0;
        }

        .profile-name {
            font-size: 1.32em;
            font-weight: 700;
            color: #fff;
            margin-bottom: 4px;
        }

        .profile-details {
            display: flex;
            align-items: center;
            gap: 3px;
            font-size: 0.82em;
            color: #B0C4DE;
            margin-bottom: 6px;
            flex-wrap: wrap;
        }

        .profile-class-icon {
            width: 20px;
            height: 20px;
            object-fit: contain;
            margin-right: 4px;
        }

        .profile-separator {
            margin: 0 6px;
            opacity: 0.5;
        }

        .profile-title {
            font-size: 0.78em;
            color: #ffd700;
            font-style: italic;
            margin-bottom: 8px;
        }

        .profile-item-level {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: rgba(100, 140, 200, 0.15);
            padding: 4px 9px;
            border-radius: 8px;
            border: 1px solid rgba(100, 140, 200, 0.3);
            width: fit-content;
        }

        .il-label {
            font-size: 0.75em;
            color: #8ba4c4;
        }

        .il-value {
            font-size: 1em;
            font-weight: 700;
            color: #B0C4DE;
        }

        /* Header Companions (Pet & Wings) */
        .header-companions {
            display: flex;
            flex-direction: row;
            gap: 12px;
            flex: 1 1 420px;
            flex-wrap: wrap;
            align-items: stretch;
            justify-content: flex-start;
            margin-left: auto;
            margin-right: auto;
            transform: none;
            align-self: center;
        }

        .header-companion-name {
            grid-area: name;
            font-size: 0.9em;
            color: #e9f2ff;
            opacity: 0.98;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            align-self: start;
            font-weight: 700;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
            position: relative;
            z-index: 1;
            max-width: 180px;
        }

        .header-companion-item {
            display: grid;
            grid-template-columns: 56px 1fr;
            grid-template-rows: auto auto;
            grid-template-areas:
                "icon label"
                "icon name";
            align-items: center;
            gap: 6px 12px;
            background: linear-gradient(145deg, rgba(24, 32, 50, 0.92) 0%, rgba(16, 24, 38, 0.9) 100%);
            border: 1px solid rgba(150, 210, 255, 0.25);
            border-radius: 12px;
            padding: 10px 12px;
            transition: all 0.25s ease;
            width: fit-content;
            min-width: 0;
            max-width: 240px;
            height: auto;
            min-height: 0;
            position: relative;
            overflow: hidden;
            box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
        }

        .header-companion-item::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(80% 80% at 70% 20%, rgba(120, 200, 255, 0.12), transparent 60%);
            pointer-events: none;
            z-index: 0;
        }

        .header-companion-item:hover {
            border-color: rgba(150, 210, 255, 0.45);
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.46);
            transform: translateY(-1px) scale(1.01);
        }

        .header-companion-icon {
            width: 56px;
            height: 56px;
            border-radius: 10px;
            border: 1px solid rgba(150, 210, 255, 0.35);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.32);
            background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), rgba(10, 16, 26, 0.75));
            object-fit: cover;
            grid-area: icon;
            align-self: center;
            position: relative;
            z-index: 1;
        }

        .header-companion-label {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 3px 8px;
            background: rgba(150, 210, 255, 0.12);
            border: 1px solid rgba(150, 210, 255, 0.4);
            border-radius: 999px;
            font-size: 0.7em;
            text-transform: uppercase;
            letter-spacing: 0.7px;
            color: #e3f3ff;
            font-weight: 700;
            margin-right: 0;
            grid-area: label;
            justify-self: start;
            align-self: start;
            position: relative;
            z-index: 1;
        }

        .header-companion-level {
            font-size: 0.72em;
            color: #f6d77a;
            font-weight: 700;
            background: rgba(246, 215, 122, 0.12);
            border: 1px solid rgba(246, 215, 122, 0.32);
            border-radius: 7px;
            padding: 3px 7px;
            position: absolute;
            top: 8px;
            right: 8px;
            z-index: 1;
        }

        /* Header Rankings - Flag Style */
        .header-rankings {
            flex: 1 1 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
            gap: 8px;
            min-width: 320px;
            max-width: 580px;
            padding: 0 10px;
            align-content: flex-start;
            position: relative;
            z-index: 1;
        }

        .header-rank-item {
            display: grid;
            grid-template-columns: auto 1fr auto;
            align-items: center;
            gap: 8px;
            background: linear-gradient(135deg, rgba(28, 38, 62, 0.9) 0%, rgba(20, 30, 48, 0.92) 100%);
            border: 1px solid rgba(140, 216, 255, 0.18);
            border-radius: 10px;
            padding: 7px 9px;
            transition: all 0.2s ease;
            position: relative;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.22);
        }

        .header-rank-item::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(160% 160% at 0% 0%, rgba(140, 216, 255, 0.12), transparent 55%);
            pointer-events: none;
        }

        .header-rank-item:hover {
            border-color: rgba(140, 216, 255, 0.35);
            box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
            transform: translateY(-1px);
        }

        .header-rank-type {
            font-size: 0.96em;
            flex-shrink: 0;
            width: 30px;
            height: 30px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: radial-gradient(circle at 30% 30%, rgba(140, 216, 255, 0.35), rgba(30, 50, 80, 0.8));
            border: 1px solid rgba(140, 216, 255, 0.3);
            box-shadow: 0 0 10px rgba(140, 216, 255, 0.14);
        }

        .header-rank-grade-icon {
            width: 22px;
            height: 22px;
            object-fit: contain;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
        }

        .header-rank-emoji {
            font-size: 0.95em;
        }

        .ranking-type-icon {
            width: 24px;
            height: 24px;
            object-fit: contain;
        }

        .ranking-type-emoji {
            font-size: 1em;
        }

        .header-rank-info {
            display: flex;
            flex-direction: column;
            gap: 3px;
            min-width: 0;
        }

        .header-rank-name {
            font-size: 0.7em;
            color: #cde9ff;
            font-weight: 650;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            line-height: 1.15;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
        }

        .header-rank-position {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .header-rank-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 3px 8px;
            background: linear-gradient(135deg, rgba(140, 216, 255, 0.35), rgba(60, 140, 200, 0.55));
            border-radius: 999px;
            border: 1px solid rgba(140, 216, 255, 0.4);
            color: #e9f7ff;
            font-size: 0.76em;
            font-weight: 700;
            min-width: 56px;
        }

        .header-rank-change {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 2px 7px;
            border-radius: 999px;
            border: 1px solid transparent;
            font-size: 0.65em;
            font-weight: 700;
            letter-spacing: 0.2px;
        }

        .header-rank-change.rank-up {
            color: #0fdb88;
            border-color: rgba(15, 219, 136, 0.35);
            background: rgba(15, 219, 136, 0.12);
            box-shadow: 0 0 8px rgba(15, 219, 136, 0.2);
        }

        .header-rank-change.rank-down {
            color: #ff8e8e;
            border-color: rgba(255, 142, 142, 0.35);
            background: rgba(255, 142, 142, 0.1);
            box-shadow: 0 0 8px rgba(255, 142, 142, 0.15);
        }

        .rankings-tab .header-rankings {
            min-width: 0;
            max-width: 100%;
            width: 100%;
            padding: 0;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        }

        /* Ranks tab cards */
        .rank-card-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 14px;
            width: 100%;
        }

        .rank-card {
            background: linear-gradient(145deg, rgba(24, 32, 52, 0.92), rgba(16, 24, 40, 0.94));
            border: 1px solid rgba(140, 216, 255, 0.18);
            border-radius: 12px;
            padding: 12px 14px;
            box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .rank-card-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
        }

        .rank-card-type {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
        }

        .rank-card-icon {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: radial-gradient(circle at 30% 30%, rgba(140, 216, 255, 0.35), rgba(30, 50, 80, 0.8));
            border: 1px solid rgba(140, 216, 255, 0.3);
            box-shadow: 0 0 10px rgba(140, 216, 255, 0.14);
            flex-shrink: 0;
        }

        .rank-card-text {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 0;
        }

        .rank-card-title {
            font-size: 0.95em;
            color: #e6f3ff;
            font-weight: 700;
            letter-spacing: 0.2px;
            line-height: 1.2;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .rank-card-sub {
            font-size: 0.8em;
            color: #8fb3d8;
        }

        .rank-card-position {
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .rank-card-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 4px 10px;
            background: linear-gradient(135deg, rgba(140, 216, 255, 0.3), rgba(60, 140, 200, 0.55));
            border-radius: 10px;
            border: 1px solid rgba(140, 216, 255, 0.35);
            color: #e9f7ff;
            font-size: 0.9em;
            font-weight: 800;
            min-width: 64px;
        }

        .rank-card-change {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 2px 8px;
            border-radius: 999px;
            border: 1px solid transparent;
            font-size: 0.78em;
            font-weight: 700;
            letter-spacing: 0.2px;
        }

        .rank-card-change.rank-up {
            color: #0fdb88;
            border-color: rgba(15, 219, 136, 0.35);
            background: rgba(15, 219, 136, 0.12);
            box-shadow: 0 0 8px rgba(15, 219, 136, 0.2);
        }

        .rank-card-change.rank-down {
            color: #ff8e8e;
            border-color: rgba(255, 142, 142, 0.35);
            background: rgba(255, 142, 142, 0.1);
            box-shadow: 0 0 8px rgba(255, 142, 142, 0.15);
        }

        .rank-card-main {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .rank-card-metrics {
            display: flex;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
        }

        .rank-card-score,
        .rank-card-grade {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 10px;
            border-radius: 10px;
            border: 1px solid rgba(140, 216, 255, 0.22);
            background: rgba(140, 216, 255, 0.08);
        }

        .rank-grade-icon {
            width: 24px;
            height: 24px;
            object-fit: contain;
        }

        .metric-label {
            font-size: 0.78em;
            color: #8fb3d8;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .metric-value {
            font-size: 1em;
            color: #e7f3ff;
            font-weight: 800;
        }

        .rank-card-extra {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .rank-extra {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 10px;
            border-radius: 10px;
            border: 1px solid rgba(140, 216, 255, 0.16);
            background: rgba(140, 216, 255, 0.05);
            color: #cde9ff;
        }

        .kda-badge {
            padding: 4px 8px;
            border-radius: 8px;
            font-weight: 800;
            letter-spacing: 0.2px;
            background: rgba(140, 216, 255, 0.14);
            border: 1px solid rgba(140, 216, 255, 0.3);
        }

        .kda-badge.high { color: #4de3a3; }
        .kda-badge.medium { color: #ffdf7f; }
        .kda-badge.low { color: #ff9b9b; }

        .kda-line .k { color: #22c55e !important; }
        .kda-line .a { color: #9ca3af !important; }
        .kda-line .d { color: #ef4444 !important; }

        .winrate-pill {
            padding: 4px 10px;
            border-radius: 20px;
            border: 1px solid rgba(140, 216, 255, 0.35);
            background: rgba(140, 216, 255, 0.1);
            font-weight: 800;
            color: #d6edff;
        }

        .winrate-pill.high { border-color: rgba(15, 219, 136, 0.35); color: #0fdb88; }
        .winrate-pill.medium { border-color: rgba(255, 215, 128, 0.35); color: #ffd780; }
        .winrate-pill.low { border-color: rgba(255, 142, 142, 0.35); color: #ff8e8e; }

        .winloss-pill {
            padding: 4px 10px;
            border-radius: 12px;
            background: rgba(140, 216, 255, 0.08);
            border: 1px solid rgba(140, 216, 255, 0.15);
            font-weight: 700;
            color: #cde9ff;
        }

        .level-chip,
        .boss-chip,
        .dungeon-chip {
            padding: 4px 9px;
            border-radius: 10px;
            border: 1px solid rgba(140, 216, 255, 0.25);
            background: rgba(140, 216, 255, 0.1);
            font-weight: 700;
            color: #d6eaff;
        }

        .boss-chip {
            max-width: 240px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .dungeon-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        /* Header Titles (kept for backwards compatibility) */
        .header-titles {
            flex: 1 1 auto;
            display: flex;
            flex-direction: column;
            gap: 6px;
            min-width: 150px;
            max-width: 350px;
            padding: 0 15px;
            align-items: center;
            justify-content: center;
            text-align: center;
        }

        .header-titles-label {
            font-size: 0.75em;
            color: #8ba4c4;
            font-weight: 600;
            margin-bottom: 4px;
            text-align: center;
        }

        .header-titles-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            align-items: center;
            width: 100%;
        }

        .header-title-item {
            background: rgba(20, 25, 35, 0.6);
            border: 1px solid rgba(100, 120, 150, 0.2);
            border-radius: 5px;
            padding: 4px 8px;
            transition: all 0.3s ease;
        }

        .header-title-item:hover {
            border-color: rgba(100, 140, 200, 0.5);
            background: rgba(30, 40, 60, 0.8);
        }

        .header-title-item.grade-common {
            background: linear-gradient(135deg, rgba(180, 180, 180, 0.15) 0%, rgba(20, 25, 35, 0.6) 100%);
        }

        .header-title-item.grade-special {
            background: linear-gradient(135deg, rgba(255, 149, 0, 0.15) 0%, rgba(20, 25, 35, 0.6) 100%);
        }

        .header-title-item.grade-rare {
            background: linear-gradient(135deg, rgba(50, 205, 50, 0.15) 0%, rgba(20, 25, 35, 0.6) 100%);
        }

        .header-title-item.grade-heroic {
            background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(20, 25, 35, 0.6) 100%);
        }

        .header-title-item.grade-legendary {
            background: linear-gradient(135deg, rgba(255, 140, 0, 0.15) 0%, rgba(20, 25, 35, 0.6) 100%);
        }

        .header-title-item.grade-mythic {
            background: linear-gradient(135deg, rgba(255, 0, 128, 0.15) 0%, rgba(20, 25, 35, 0.6) 100%);
        }

        .header-title-name {
            font-size: 0.75em;
            font-weight: 600;
            color: #E8E8E8;
            margin-bottom: 2px;
        }

        .header-title-stats {
            font-size: 0.65em;
            color: #FF9500;
        }

        .header-title-more {
            font-size: 0.7em;
            color: #FF7A00;
            text-align: center;
            padding: 4px;
            background: rgba(255, 149, 0, 0.1);
            border-radius: 4px;
        }

        /* ===== NEW EQUIPMENT LAYOUT ===== */
        .equipment-categories {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .equip-category {
            background: linear-gradient(145deg, rgba(18, 26, 42, 0.9), rgba(10, 16, 28, 0.92));
            border-radius: 14px;
            padding: 14px 16px;
            border: none;
            box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
            position: relative;
            overflow: hidden;
        }

        .equip-category-header {
            font-size: 0.9em;
            font-weight: 700;
            color: #b8dcff;
            margin-bottom: 10px;
            padding-bottom: 0;
            border: none;
            letter-spacing: 0.4px;
        }

        .cosmetics-section {
            background: none;
            border: none;
            border-radius: 10px;
            padding: 12px 14px;
        }

        .cosmetics-section .modal-section-title {
            color: #DDA0DD;
            border-bottom-color: rgba(180, 100, 220, 0.3);
        }

        .cosmetics-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 10px;
            background: none;
            border: none;
            border-radius: 0;
            padding: 0;
            box-shadow: none;
        }

        .cosmetic-slot {
            border-color: rgba(180, 100, 220, 0.25) !important;
            background: rgba(35, 28, 45, 0.7) !important;
        }

        .cosmetic-slot:hover {
            border-color: rgba(180, 100, 220, 0.5) !important;
            background: rgba(50, 35, 60, 0.8) !important;
        }

        .equip-category-items {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 8px;
        }

        .equip-slot {
            display: flex;
            align-items: center;
            gap: 12px;
            background: linear-gradient(145deg, rgba(18, 26, 42, 0.9), rgba(12, 18, 30, 0.9));
            border: 1px solid rgba(99, 189, 255, 0.35);
            border-radius: 10px;
            padding: 10px 12px;
            cursor: pointer;
            transition: border-color 0.18s ease, background 0.18s ease;
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
        }

        .equip-slot:hover {
            border-color: rgba(99, 189, 255, 0.7);
            background: linear-gradient(145deg, rgba(22, 32, 50, 0.95), rgba(14, 22, 36, 0.95));
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
        }

        .equip-slot-icon-wrapper {
            position: relative;
            flex-shrink: 0;
        }

        .equip-slot-icon {
            width: 44px;
            height: 44px;
            border-radius: 6px;
            border: none;
            transition: opacity 0.2s ease;
            /* Start invisible, fade in when loaded */
            opacity: 0;
        }
        
        .equip-slot-icon[src]:not([src=""]) {
            opacity: 1;
        }

        /* Image loading states for modal and tooltip */
        #characterModal img.img-loading,
        #equipmentTooltip img.img-loading {
            opacity: 0.5;
            animation: imgPulse 1s ease-in-out infinite;
        }

        #characterModal img.img-failed,
        #equipmentTooltip img.img-failed {
            opacity: 0.3;
        }
        
        /* Smooth fade-in for all modal images */
        #characterModal img,
        #equipmentTooltip img {
            transition: opacity 0.15s ease-out;
        }

        @keyframes imgPulse {
            0%, 100% { opacity: 0.5; }
            50% { opacity: 0.3; }
        }

        .equip-slot-enchant {
            position: absolute;
            bottom: -4px;
            right: -4px;
            background: rgba(0, 0, 0, 0.85);
            color: #5ad878;
            font-size: 0.7em;
            font-weight: 700;
            padding: 2px 5px;
            border-radius: 4px;
            border: 1px solid rgba(90, 216, 120, 0.4);
        }

        .equip-slot-enchant.legend-enchant {
            color: #ffd166;
            border-color: rgba(255, 209, 102, 0.5);
            background: linear-gradient(135deg, rgba(40, 30, 10, 0.95) 0%, rgba(70, 50, 20, 0.9) 100%);
            box-shadow: 0 0 8px rgba(255, 209, 102, 0.35);
        }

        .equip-slot-info {
            flex: 1;
            min-width: 0;
        }

        .equip-slot-name {
            font-size: 0.85em;
            font-weight: 600;
            color: #fff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .equip-slot-meta {
            display: flex;
            gap: 8px;
            margin-top: 3px;
        }

        .equip-slot-type {
            font-size: 0.75em;
            color: #b7c4d4;
            opacity: 0.85;
        }

        .equip-slot-exceed {
            font-size: 0.75em;
            color: #ff9933;
            font-weight: 600;
        }

        /* Equipment slot grade colors */
        .equip-slot.grade-common { border-color: rgba(128, 128, 128, 0.35); }
        .equip-slot.grade-common .equip-slot-name { color: #b0b0b0; }
        .equip-slot.grade-normal { border-color: rgba(255, 255, 255, 0.25); }
        .equip-slot.grade-normal .equip-slot-name { color: #ffffff; }
        .equip-slot.grade-rare { border-color: rgba(0, 135, 11, 0.4); }
        .equip-slot.grade-rare .equip-slot-name { color: #00cc00; }
        .equip-slot.grade-unique { border-color: rgba(255, 215, 0, 0.4); }
        .equip-slot.grade-unique .equip-slot-name { color: #ffd700; }
        .equip-slot.grade-hero { border-color: rgba(255, 140, 0, 0.4); }
        .equip-slot.grade-hero .equip-slot-name { color: #ff9933; }
        .equip-slot.grade-heroic { border-color: rgba(255, 140, 0, 0.4); }
        .equip-slot.grade-heroic .equip-slot-name { color: #ff9933; }
        .equip-slot.grade-legend { border-color: rgba(51, 102, 255, 0.4); }
        .equip-slot.grade-legend .equip-slot-name { color: #6699ff; }
        .equip-slot.grade-mythic { border-color: rgba(255, 0, 255, 0.4); }
        .equip-slot.grade-mythic .equip-slot-name { color: #ff66ff; }
        .equip-slot.grade-special { border-color: rgba(0, 191, 255, 0.4); }
        .equip-slot.grade-special .equip-slot-name { color: #00bfff; }

        /* ===== NEW TITLES LAYOUT ===== */
        .titles-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 8px;
        }

        .title-card {
            background: rgba(30, 38, 58, 0.95);
            border: 1px solid rgba(100, 115, 140, 0.4);
            border-radius: 6px;
            padding: 10px 12px;
            transition: all 0.25s ease;
        }

        .title-card:hover {
            border-color: rgba(140, 160, 190, 0.6);
            box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
        }

        .title-card-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 6px;
        }

        .title-card-category {
            font-size: 0.6em;
            padding: 2px 6px;
            border-radius: 3px;
            background: rgba(100, 120, 150, 0.4);
            color: #b0b8c8;
            font-weight: 600;
            letter-spacing: 0.3px;
        }

        .title-card.category-attack .title-card-category {
            background: rgba(255, 80, 80, 0.3);
            color: #ff9999;
        }

        .title-card.category-defense .title-card-category {
            background: rgba(80, 160, 255, 0.3);
            color: #99ccff;
        }

        .title-card.category-etc .title-card-category {
            background: rgba(180, 140, 255, 0.3);
            color: #ccaaff;
        }

        .title-card-name {
            font-size: 0.85em;
            font-weight: 700;
            flex: 1;
            color: #ffffff;
        }

        .title-card-grade {
            font-size: 0.55em;
            padding: 2px 5px;
            border-radius: 3px;
            background: rgba(100, 120, 150, 0.3);
            color: #a0a8b8;
            text-transform: uppercase;
        }

        .title-card-stats {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-bottom: 6px;
        }

        .title-stat-badge {
            font-size: 0.7em;
            background: rgba(80, 100, 130, 0.3);
            color: #c8d0e0;
            padding: 2px 8px;
            border-radius: 8px;
        }

        .title-card-progress {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .title-progress-bar {
            flex: 1;
            height: 3px;
            background: rgba(100, 120, 150, 0.3);
            border-radius: 2px;
            overflow: hidden;
        }

        .title-progress-fill {
            height: 100%;
            background: rgba(150, 170, 200, 0.7);
            border-radius: 2px;
            transition: width 0.3s ease;
        }

        .title-progress-text {
            font-size: 0.6em;
            color: #a0a8b8;
            white-space: nowrap;
        }

        /* Title card grade colors */
        .title-card.grade-common { border-color: rgba(128, 128, 128, 0.4); }
        .title-card.grade-common .title-card-name { color: #b0b0b0; }
        .title-card.grade-common .title-card-grade { background: rgba(128, 128, 128, 0.2); color: #b0b0b0; }
        .title-card.grade-normal { border-color: rgba(255, 255, 255, 0.3); }
        .title-card.grade-normal .title-card-name { color: #ffffff; }
        .title-card.grade-rare { border-color: rgba(0, 135, 11, 0.4); }
        .title-card.grade-rare .title-card-name { color: #00cc00; }
        .title-card.grade-rare .title-card-grade { background: rgba(0, 135, 11, 0.2); color: #00cc00; }
        .title-card.grade-unique { border-color: rgba(255, 215, 0, 0.4); }
        .title-card.grade-unique .title-card-name { color: #ffd700; }
        .title-card.grade-unique .title-card-grade { background: rgba(255, 215, 0, 0.2); color: #ffd700; }
        .title-card.grade-hero { border-color: rgba(255, 140, 0, 0.4); }
        .title-card.grade-hero .title-card-name { color: #ff9933; }
        .title-card.grade-hero .title-card-grade { background: rgba(255, 140, 0, 0.2); color: #ff9933; }
        .title-card.grade-legend { border-color: rgba(51, 102, 255, 0.4); }
        .title-card.grade-legend .title-card-name { color: #6699ff; }
        .title-card.grade-legend .title-card-grade { background: rgba(51, 102, 255, 0.2); color: #6699ff; }
        .title-card.grade-mythic { border-color: rgba(255, 0, 255, 0.4); }
        .title-card.grade-mythic .title-card-name { color: #ff66ff; }
        .title-card.grade-mythic .title-card-grade { background: rgba(255, 0, 255, 0.2); color: #ff66ff; }
        .title-card.grade-special { border-color: rgba(0, 191, 255, 0.4); }
        .title-card.grade-special .title-card-name { color: #00bfff; }
        .title-card.grade-special .title-card-grade { background: rgba(0, 191, 255, 0.2); color: #00bfff; }
        
        /* Layout for stats sections - stacked vertically */
        .modal-sections-wrapper {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 12px;
        }
        
        .modal-sections-wrapper > .modal-section {
            margin-bottom: 0;
            margin-top: 0;
        }
        
        /* Sections full-width */
        .modal-section.full-width {
            grid-column: 1 / -1;
        }
        /* Skills Section - New Layout */
        .skills-section {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .skills-container {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .skill-category {
            background: linear-gradient(150deg, rgba(18, 26, 42, 0.9), rgba(10, 16, 28, 0.92));
            border: none;
            border-radius: 14px;
            padding: 16px;
            box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
        }
        
        .skill-category-header {
            color: #b8dcff;
            font-size: 0.95em;
            font-weight: 700;
            margin-bottom: 12px;
            padding-bottom: 0;
            border: none;
            display: flex;
            align-items: center;
            gap: 8px;
            letter-spacing: 0.4px;
        }
        
        .skill-count {
            color: #8fd7ff;
            font-weight: 400;
            font-size: 0.9em;
        }

        .skill-equipped-count {
            color: #4ade80;
            font-weight: 500;
            font-size: 0.85em;
            margin-left: 8px;
        }
        
        .skill-category-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 10px;
        }
        
        .skill-category-grid.passive-grid {
            grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        }
        
        .skill-card {
            background: linear-gradient(150deg, rgba(18, 26, 42, 0.9), rgba(10, 18, 30, 0.9));
            border: 1px solid rgba(99, 189, 255, 0.4);
            border-radius: 10px;
            padding: 10px;
            text-align: center;
            transition: border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
        }

        .skill-card.skill-equipped {
            border-color: rgba(74, 222, 128, 0.5);
            background: linear-gradient(150deg, rgba(22, 32, 42, 0.95), rgba(12, 22, 32, 0.95));
        }

        .skill-card.skill-equipped::before {
            content: 'E';
            position: absolute;
            top: 4px;
            right: 6px;
            font-size: 0.55em;
            color: #4ade80;
            font-weight: bold;
        }

        .skill-card.skill-acquired {
            border-color: rgba(74, 222, 128, 0.35);
            background: linear-gradient(150deg, rgba(20, 30, 40, 0.9), rgba(12, 20, 30, 0.9));
        }

        .skill-card.skill-not-acquired {
            border-color: rgba(128, 128, 128, 0.4);
            background: linear-gradient(150deg, rgba(40, 40, 45, 0.7), rgba(30, 30, 35, 0.7));
            opacity: 0.5;
        }

        .skill-card.skill-not-acquired .skill-card-icon {
            filter: grayscale(100%);
        }

        .skill-card.skill-not-acquired:hover {
            opacity: 0.7;
        }
        
        .skill-card:hover {
            border-color: rgba(99, 189, 255, 0.55);
            box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
        }
        
        .skill-card-icon-wrapper {
            position: relative;
            margin-bottom: 8px;
        }
        
        .skill-card-icon {
            width: 48px;
            height: 48px;
            border-radius: 6px;
            border: 2px solid rgba(99, 189, 255, 0.4);
            background: rgba(0, 0, 0, 0.35);
        }
        
        .skill-card-level {
            position: absolute;
            bottom: -4px;
            right: -4px;
            background: linear-gradient(135deg, #38bdf8, #3b82f6);
            color: #04111f;
            font-size: 0.65em;
            font-weight: 700;
            padding: 2px 5px;
            border-radius: 8px;
            min-width: 16px;
            text-align: center;
        }
        
        .skill-card-info {
            width: 100%;
        }
        
        .skill-card-name {
            font-size: 0.7em;
            color: #E8E8E8;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .skill-item {
            background: rgba(20, 25, 35, 0.7);
            border: 1px solid rgba(255, 149, 0, 0.3);
            border-radius: 6px;
            padding: 5px;
            text-align: center;
            transition: all 0.3s ease;
        }
        .skill-item:hover {
            border-color: rgba(255, 149, 0, 0.6);
            transform: scale(1.05);
        }
        .skill-icon {
            width: 35px;
            height: 35px;
            margin: 0 auto 3px;
            border-radius: 4px;
        }
        .skill-level {
            font-size: 0.6em;
            color: #FF9500;
        }
        .pet-wing-info {
            display: flex;
            gap: 12px;
            margin-top: 0;
            justify-content: center;
            flex-wrap: wrap;
        }
        .pet-wing-item {
            display: grid;
            grid-template-columns: 60px 1fr;
            grid-template-rows: auto auto;
            grid-template-areas: "icon name" "icon level";
            align-items: center;
            gap: 6px 10px;
            background: linear-gradient(145deg, rgba(20, 28, 42, 0.88) 0%, rgba(14, 22, 34, 0.92) 100%);
            border: 1px solid rgba(255, 149, 0, 0.24);
            border-radius: 12px;
            padding: 12px 14px;
            flex: 1;
            min-width: 220px;
            max-width: 260px;
            text-align: left;
            transition: all 0.25s ease;
            box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
        }
        .pet-wing-item:hover {
            border-color: rgba(255, 149, 0, 0.5);
            transform: translateY(-2px) scale(1.01);
            box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
        }
        .pet-wing-icon {
            width: 60px;
            height: 60px;
            margin: 0;
            border-radius: 10px;
            filter: drop-shadow(0 0 6px rgba(255, 149, 0, 0.3));
            grid-area: icon;
        }
        .pet-wing-name {
            color: #e9f2ff;
            font-weight: 700;
            margin-bottom: 2px;
            font-size: 0.95em;
            grid-area: name;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .pet-wing-level {
            color: #f6d77a;
            font-size: 0.85em;
            grid-area: level;
        }
        .item-level { 
            font-size: 1.15em; 
            font-weight: 700; 
            color: #87AEDD; 
            text-align: right;
            line-height: 1.1;
        }
        .item-level-label { 
            font-size: 0.6em; 
            color: rgba(176, 196, 222, 0.8); 
            text-align: right; 
            font-weight: 400;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }
        .refresh-btn {
            background: linear-gradient(135deg, rgba(255, 149, 0, 0.15) 0%, rgba(255, 165, 0, 0.1) 100%);
            color: #FF9500;
            border: 1px solid rgba(255, 149, 0, 0.3);
            padding: 10px 18px;
            font-size: 0.85em;
            font-weight: 600;
            border-radius: 8px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: all 0.25s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .refresh-btn:hover { 
            background: linear-gradient(135deg, rgba(255, 149, 0, 0.25) 0%, rgba(255, 165, 0, 0.2) 100%);
            border-color: rgba(255, 149, 0, 0.5);
            color: #B0D4F1;
            box-shadow: 0 4px 15px rgba(255, 149, 0, 0.2);
            transform: translateY(-2px);
        }
        .refresh-btn:active {
            transform: translateY(0) scale(0.98);
        }
        .refresh-btn:hover .refresh-icon,
        .refresh-btn:focus .refresh-icon {
            animation: spin 0.8s linear;
        }
        .spinner {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: conic-gradient(from 0deg, transparent, #FF7A00);
            -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
            animation: spin 0.9s linear infinite;
            margin: 0 auto;
            position: relative;
        }
        .spinner::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 50%;
            box-shadow: 0 0 20px rgba(255, 149, 0, 0.4);
        }
        
        /* ================= RIFT FLOATING WIDGET ================= */
        .rift-floating-widget {
            position: fixed;
            bottom: 72px; /* clear the fixed footer */
            right: 20px;
            z-index: 1100; /* above footer */
        }

        /* Preview Card (always visible) */
        .rift-widget-preview {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            background: linear-gradient(135deg, rgba(25, 30, 45, 0.95) 0%, rgba(15, 20, 30, 0.98) 100%);
            border: 1px solid rgba(255, 149, 0, 0.4);
            border-radius: 12px;
            box-shadow: 
                0 4px 20px rgba(0, 0, 0, 0.4),
                0 0 15px rgba(255, 149, 0, 0.15);
            cursor: pointer;
            backdrop-filter: blur(10px);
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .rift-widget-preview:hover {
            border-color: rgba(255, 149, 0, 0.7);
            box-shadow: 
                0 6px 25px rgba(0, 0, 0, 0.5),
                0 0 20px rgba(255, 149, 0, 0.25);
        }

        .rift-preview-icon {
            font-size: 18px;
        }

        .rift-preview-info {
            display: flex;
            flex-direction: column;
            gap: 1px;
        }

        .rift-preview-label {
            font-size: 9px;
            color: rgba(176, 196, 222, 0.6);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .rift-preview-time {
            font-family: 'Orbitron', 'Segoe UI', sans-serif;
            font-size: 14px;
            font-weight: 700;
            color: #FF9500;
        }

        .rift-preview-countdown {
            font-size: 11px;
            color: #B0C4DE;
        }

        /* Status variants for preview */
        .rift-widget-preview.status-actif {
            border-color: rgba(0, 255, 0, 0.5);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 12px rgba(0, 255, 0, 0.2);
        }
        .rift-widget-preview.status-actif .rift-preview-label { color: #88ff88; }
        .rift-widget-preview.status-actif .rift-preview-time { color: #00ff00; text-shadow: 0 0 8px rgba(0, 255, 0, 0.4); }
        .rift-widget-preview.status-actif .rift-preview-countdown { color: #88ff88; }

        .rift-widget-preview.status-en-cours {
            border-color: rgba(255, 140, 0, 0.5);
        }
        .rift-widget-preview.status-en-cours .rift-preview-time { color: #ff8c00; }
        .rift-widget-preview.status-en-cours .rift-preview-countdown { color: #ffd699; }

        .rift-widget-preview.status-prochain {
            border-color: rgba(255, 215, 0, 0.4);
        }
        .rift-widget-preview.status-prochain .rift-preview-time { color: #FFD700; }
        .rift-widget-preview.status-prochain .rift-preview-countdown { color: #FFEB8C; }

        /* Expand indicator */
        .rift-preview-expand {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            margin-left: 4px;
            border-radius: 6px;
            background: rgba(255, 149, 0, 0.1);
            color: rgba(255, 149, 0, 0.6);
            transition: background 0.2s ease, color 0.2s ease;
        }

        .rift-widget-preview:hover .rift-preview-expand {
            background: rgba(255, 149, 0, 0.2);
            color: #FF9500;
        }

        .rift-expand-chevron {
            width: 14px;
            height: 14px;
            transition: transform 0.25s ease;
        }

        .rift-floating-widget.open .rift-expand-chevron {
            transform: rotate(180deg);
        }

        /* Panel */
        .rift-widget-panel {
            position: absolute;
            bottom: calc(100% + 10px);
            right: 0;
            width: 300px;
            max-height: 0;
            overflow: hidden;
            background: linear-gradient(165deg, rgba(20, 25, 38, 0.97) 0%, rgba(14, 18, 28, 0.99) 100%);
            border: 1px solid rgba(255, 149, 0, 0.25);
            border-radius: 16px;
            box-shadow: 
                0 12px 48px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(255, 255, 255, 0.03) inset,
                0 0 30px rgba(255, 149, 0, 0.08);
            backdrop-filter: blur(20px);
            opacity: 0;
            transform: translateY(12px) scale(0.96);
            transition: 
                max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.25s ease, 
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .rift-floating-widget.open .rift-widget-panel {
            max-height: 480px;
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        .rift-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 16px;
            background: linear-gradient(180deg, rgba(255, 149, 0, 0.08) 0%, transparent 100%);
            border-bottom: 1px solid rgba(255, 149, 0, 0.15);
        }

        .rift-panel-title {
            color: #FF9500;
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0.4px;
            text-shadow: 0 0 20px rgba(255, 149, 0, 0.3);
        }

        .rift-panel-close {
            width: 26px;
            height: 26px;
            border: none;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            color: rgba(200, 210, 225, 0.6);
            font-size: 11px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .rift-panel-close:hover {
            background: rgba(255, 100, 100, 0.15);
            border-color: rgba(255, 100, 100, 0.3);
            color: #ff8888;
            transform: scale(1.05);
        }

        .rift-panel-content {
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 300px;
            overflow-y: auto;
        }

        .rift-panel-content::-webkit-scrollbar {
            width: 5px;
        }

        .rift-panel-content::-webkit-scrollbar-track {
            background: rgba(255, 149, 0, 0.03);
            border-radius: 3px;
            margin: 4px 0;
        }

        .rift-panel-content::-webkit-scrollbar-thumb {
            background: rgba(255, 149, 0, 0.25);
            border-radius: 3px;
        }

        .rift-panel-content::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 149, 0, 0.4);
        }

        /* Rift Cards in Panel */
        .rift-card {
            background: linear-gradient(135deg, rgba(35, 42, 58, 0.6) 0%, rgba(25, 32, 45, 0.5) 100%);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 10px;
            padding: 12px 14px;
            display: flex;
            align-items: center;
            gap: 12px;
            transition: all 0.2s ease;
            position: relative;
            overflow: hidden;
        }

        .rift-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: rgba(255, 149, 0, 0.5);
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .rift-card:hover {
            background: linear-gradient(135deg, rgba(45, 52, 70, 0.7) 0%, rgba(30, 38, 52, 0.6) 100%);
            border-color: rgba(255, 149, 0, 0.25);
            transform: translateX(2px);
        }

        .rift-card:hover::before {
            opacity: 1;
        }

        .rift-card-icon {
            font-size: 18px;
            flex-shrink: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 149, 0, 0.1);
            border-radius: 8px;
        }

        .rift-card-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .rift-card-time {
            font-family: 'Orbitron', 'Segoe UI', sans-serif;
            font-weight: 700;
            font-size: 15px;
            color: #FF9500;
            letter-spacing: 0.5px;
        }

        .rift-card-date {
            color: rgba(176, 196, 222, 0.6);
            font-size: 11px;
            font-weight: 500;
        }

        .rift-card-countdown {
            font-size: 12px;
            font-weight: 600;
            color: rgba(200, 215, 235, 0.8);
            text-align: right;
            flex-shrink: 0;
            padding: 4px 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 6px;
            font-variant-numeric: tabular-nums;
        }

        /* Status variants */
        .status-actif {
            border-color: rgba(50, 205, 50, 0.4);
            background: linear-gradient(135deg, rgba(20, 60, 30, 0.7) 0%, rgba(15, 45, 25, 0.6) 100%);
            box-shadow: 0 0 20px rgba(50, 205, 50, 0.15) inset;
        }
        .status-actif::before { background: #32CD32; opacity: 1; }
        .status-actif .rift-card-icon { background: rgba(50, 205, 50, 0.2); }
        .status-actif .rift-card-time { color: #32CD32; text-shadow: 0 0 12px rgba(50, 205, 50, 0.5); }
        .status-actif .rift-card-countdown { 
            color: #90EE90; 
            background: rgba(50, 205, 50, 0.15);
            animation: pulse-glow 2s ease-in-out infinite;
        }

        @keyframes pulse-glow {
            0%, 100% { box-shadow: 0 0 0 rgba(50, 205, 50, 0); }
            50% { box-shadow: 0 0 8px rgba(50, 205, 50, 0.3); }
        }

        .status-en-cours {
            border-color: rgba(255, 140, 0, 0.4);
            background: linear-gradient(135deg, rgba(60, 40, 15, 0.7) 0%, rgba(45, 30, 10, 0.6) 100%);
        }
        .status-en-cours::before { background: #FF8C00; opacity: 1; }
        .status-en-cours .rift-card-icon { background: rgba(255, 140, 0, 0.2); }
        .status-en-cours .rift-card-time { color: #FF8C00; }
        .status-en-cours .rift-card-countdown { color: #FFD699; background: rgba(255, 140, 0, 0.12); }

        .status-prochain {
            border-color: rgba(255, 215, 0, 0.3);
            background: linear-gradient(135deg, rgba(55, 50, 20, 0.6) 0%, rgba(40, 38, 15, 0.5) 100%);
        }
        .status-prochain::before { background: #FFD700; opacity: 0.8; }
        .status-prochain .rift-card-icon { background: rgba(255, 215, 0, 0.15); }
        .status-prochain .rift-card-time { color: #FFD700; }
        .status-prochain .rift-card-countdown { color: #FFEB8C; background: rgba(255, 215, 0, 0.1); }

        .status-a-venir {
            border-color: rgba(255, 255, 255, 0.05);
        }
        .status-a-venir .rift-card-time { color: rgba(255, 180, 100, 0.85); }
        .status-a-venir .rift-card-countdown { color: rgba(176, 196, 222, 0.7); }

        /* Mobile adjustments for rift widget */
        @media (max-width: 768px) {
            .rift-floating-widget {
                bottom: 90px; /* Clear the taller mobile footer */
                right: 10px;
                left: auto;
                max-width: calc(100% - 20px);
            }
            
            .rift-widget-preview {
                padding: 6px 10px;
                gap: 8px;
            }
            
            .rift-preview-icon {
                font-size: 16px;
            }
            
            .rift-preview-label {
                font-size: 8px;
            }
            
            .rift-preview-time {
                font-size: 12px;
            }
            
            .rift-preview-countdown {
                font-size: 10px;
            }
            
            .rift-preview-expand {
                width: 24px;
                height: 24px;
            }
        }
        
        @media (max-width: 480px) {
            .rift-floating-widget {
                bottom: 85px; /* Clear the mobile footer which wraps */
                right: 8px;
            }
            
            /* Ultra-compact rift preview on small phones */
            .rift-widget-preview {
                padding: 5px 8px;
                gap: 6px;
                border-radius: 10px;
            }
            
            .rift-preview-info {
                gap: 0;
            }
            
            .rift-preview-label {
                display: none;
            }
            
            .rift-preview-time {
                font-size: 11px;
            }
            
            .rift-preview-countdown {
                font-size: 9px;
            }
            
            .rift-preview-expand {
                display: none;
            }
            
            /* Expanded rift panel adjustments */
            .rift-full-panel {
                max-height: 70vh;
                width: calc(100vw - 20px);
                right: 10px;
                bottom: 55px;
            }
            
            .rift-panel-header {
                padding: 10px 12px;
            }
            
            .rift-cards-grid {
                grid-template-columns: 1fr;
                gap: 8px;
                padding: 8px;
            }
            
            .rift-card {
                padding: 10px;
            }
        }


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

        /* ================= IMPROVED AION TOOLTIP STYLES ================= */
        #equipmentTooltip,
        .equipment-tooltip {
            display: none;
            position: fixed;
            z-index: 2000;
            width: 340px;
            background: rgba(18, 20, 24, 0.98);
            border-radius: 6px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
            pointer-events: none;
            font-family: 'Noto Sans', 'Segoe UI', sans-serif;
            opacity: 0;
            transform: translateY(10px) scale(0.98);
            transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
            color: #dcdcdc;
            overflow: hidden;
            font-size: 13px;
            border: 1px solid #444;
            will-change: transform, opacity;
        }

        #equipmentTooltip.visible,
        .equipment-tooltip.visible {
            display: block;
            opacity: 1;
            transform: translateY(0) scale(1);
        }
        
        /* Tooltip Grades Coloring - Borders & Titles */
        #equipmentTooltip.tooltip-grade-common,
        .equipment-tooltip.tooltip-grade-common { border-color: #808080; }
        #equipmentTooltip.tooltip-grade-normal,
        .equipment-tooltip.tooltip-grade-normal { border-color: #9e9e9e; }
        #equipmentTooltip.tooltip-grade-rare,
        .equipment-tooltip.tooltip-grade-rare { border-color: #00a651; }
        #equipmentTooltip.tooltip-grade-unique,
        .equipment-tooltip.tooltip-grade-unique { border-color: #e5b648; box-shadow: 0 10px 30px rgba(0,0,0,0.9), inset 0 0 20px rgba(255, 215, 0, 0.05); }
        #equipmentTooltip.tooltip-grade-hero,
        .equipment-tooltip.tooltip-grade-hero { border-color: #ff8400; }
        #equipmentTooltip.tooltip-grade-legend,
        .equipment-tooltip.tooltip-grade-legend { border-color: #6699ff; box-shadow: 0 10px 30px rgba(0,0,0,0.9), inset 0 0 20px rgba(102, 153, 255, 0.05); }
        #equipmentTooltip.tooltip-grade-mythic,
        .equipment-tooltip.tooltip-grade-mythic { border-color: #ff00ff; }
        #equipmentTooltip.tooltip-grade-special,
        .equipment-tooltip.tooltip-grade-special { border-color: #00bfff; box-shadow: 0 10px 30px rgba(0,0,0,0.9), inset 0 0 20px rgba(0, 191, 255, 0.05); }

        /* Tooltip close button - hidden on desktop, visible on touch/mobile */
        .tooltip-close-btn {
            display: none;
            position: absolute;
            top: 8px;
            right: 8px;
            width: 28px;
            height: 28px;
            border: none;
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            font-size: 20px;
            line-height: 1;
            border-radius: 50%;
            cursor: pointer;
            z-index: 10;
            transition: background 0.15s ease;
        }
        
        .tooltip-close-btn:hover,
        .tooltip-close-btn:active {
            background: rgba(255, 100, 100, 0.3);
        }
        
        /* Show close button on touch devices */
        @media (hover: none) and (pointer: coarse) {
            .tooltip-close-btn {
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            #equipmentTooltip,
            .equipment-tooltip {
                pointer-events: auto;
            }
        }
        
        /* Also show on small screens */
        @media (max-width: 768px) {
            .tooltip-close-btn {
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            #equipmentTooltip,
            .equipment-tooltip {
                pointer-events: auto;
            }
        }

        /* Loading indicator on equipment item while fetching tooltip data */
        .loading-tooltip {
            position: relative;
        }
        .loading-tooltip::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 20px;
            height: 20px;
            margin: -10px 0 0 -10px;
            border: 2px solid rgba(255,255,255,0.2);
            border-top-color: #6699ff;
            border-radius: 50%;
            animation: tooltipSpin 0.6s linear infinite;
            pointer-events: none;
            z-index: 10;
        }
        @keyframes tooltipSpin {
            to { transform: rotate(360deg); }
        }

        /* Tooltip loading state */
        .tooltip-loading {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 16px 20px;
            color: #a0a8b8;
            font-size: 13px;
        }
        .tooltip-loading-spinner {
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255,255,255,0.2);
            border-top-color: #6699ff;
            border-radius: 50%;
            animation: tooltipSpin 0.6s linear infinite;
        }
        .tooltip-error {
            padding: 16px 20px;
            color: #ff6b6b;
            font-size: 13px;
        }

        /* Tooltip Header Area */
        .tooltip-header-area {
            display: flex;
            padding: 12px;
            background: linear-gradient(to bottom, rgba(255,255,255,0.05), rgba(255,255,255,0));
            border-bottom: 1px solid rgba(255,255,255,0.08);
            gap: 12px;
        }

        .tooltip-icon-container {
            width: 52px;
            height: 52px;
            flex-shrink: 0;
            border-radius: 4px;
            overflow: hidden;
            border: 1px solid rgba(255,255,255,0.2);
            background: #000;
            position: relative;
        }
        
        .tooltip-icon-container img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .tooltip-title-block {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .tooltip-item-name {
            font-size: 15px;
            font-weight: 700;
            line-height: 1.2;
            margin-bottom: 4px;
            text-shadow: 0 2px 2px rgba(0,0,0,0.8);
        }
        
        .tooltip-item-category {
            font-size: 11px;
            color: #999;
        }
        
        .tooltip-item-enchant {
            display: inline-block;
            margin-left: 4px;
        }
        
        /* Exceed/Transcendence level */
        .exceed-level {
            display: inline-block;
            margin-left: 6px;
            padding: 1px 6px;
            background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
            border-radius: 3px;
            font-size: 11px;
            font-weight: 600;
            color: #fff;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }
        
        /* Section labels for tooltips */
        .tooltip-section-label {
            font-size: 11px;
            font-weight: 600;
            color: #888;
            margin-bottom: 4px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Colors for text based on grade */
        .text-grade-common { color: #b0b0b0; }
        .text-grade-normal { color: #ffffff; }
        .text-grade-rare { color: #00cc00; }
        .text-grade-unique { color: #f2c75b; } /* Gold */
        .text-grade-hero { color: #ff9933; }
        .text-grade-legend { color: #6699ff; } /* Blue - match equip slot */
        /* Ensure tooltip item name explicitly uses the legend blue (higher specificity) */
        .tooltip-item-name.text-grade-legend { color: #6699ff !important; }
        /* Very specific rules to avoid being overridden by other styles or user edits */
        #equipmentTooltip.tooltip-grade-legend .tooltip-item-name,
        .equipment-tooltip.tooltip-grade-legend .tooltip-item-name,
        #equipmentTooltip.visible.tooltip-grade-legend .tooltip-item-name {
            color: #6699ff !important;
        }
        #equipmentTooltip.tooltip-grade-legend .tooltip-item-category,
        .equipment-tooltip.tooltip-grade-legend .tooltip-item-category {
            color: #6699ff !important;
        }
        .text-grade-mythic { color: #ff4dff; }
        .text-grade-special { color: #00bfff; }

        /* Content Sections */
        .tooltip-content {
            padding: 8px 12px;
        }

        .tooltip-info-line {
            display: flex;
            justify-content: space-between;
            margin-bottom: 4px;
            color: #bbb;
            font-size: 12px;
        }

        .tooltip-section-divider {
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            margin: 8px 0;
        }

        /* Stats */
        .tooltip-stat-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 3px;
            font-size: 12px;
            line-height: 1.4;
            background: none !important;
            border: none !important;
            padding: 0;
            outline: none;
            text-decoration: none;
        }
        .tooltip-stat-row .stat-label { 
            color: #e0e0e0;
            font-size: 12px;
            text-transform: none;
            letter-spacing: normal;
            font-weight: normal;
            background: none !important;
            border: none !important;
            padding: 0;
            box-shadow: none;
            outline: none;
            text-decoration: none;
        }
        .tooltip-stat-row .stat-value {
            color: #fff;
            font-weight: 600;
            font-size: 12px;
            background: none !important;
            border: none !important;
            padding: 0;
            box-shadow: none;
            outline: none;
            text-decoration: none;
        }
        .tooltip-stat-row .stat-extra { 
            color: #4eff4e; 
            margin-left: 4px;
            font-size: 12px;
            background: none !important;
            border: none !important;
            padding: 0;
            outline: none;
            text-decoration: none;
        }
        .tooltip-stat-row .stat-bonus {
            color: #4eff4e;
            font-size: 12px;
        }
        
        /* Additional stats row styling */
        .tooltip-stat-row.additional-stat .stat-label {
            color: #4eff4e;
        }
        .tooltip-stat-row.additional-stat.skill-boost .stat-label {
            color: #FF9500;
        }
        
        /* Inline skill icon for skill boosts */
        .inline-skill-icon {
            width: 16px;
            height: 16px;
            vertical-align: middle;
            margin-right: 4px;
            border: none !important;
            outline: none;
        }
        
        /* Legacy support */
        .stat-val-white { color: #fff; font-weight: 600; }
        .stat-val-green { color: #4eff4e; }

        .sub-stat-row .stat-label { color: #4eff4e; } /* Sub stats are usually green in Aion */
        .sub-stat-row .stat-val-white { color: #4eff4e; }

        /* Magic Stones / Manastones */
        .manastone-list {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .manastone-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: #ccc;
        }
        .manastone-icon {
            width: 16px;
            height: 16px;
            border-radius: 2px;
        }
        
        /* Godstone */
        .godstone-container {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .godstone-header {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .godstone-icon {
            width: 24px;
            height: 24px;
            border: 1px solid #555;
            border-radius: 3px;
        }
        .godstone-name {
            font-weight: 700;
            font-size: 12px;
        }
        .godstone-desc {
            color: #aaa;
            font-size: 11px;
            font-style: italic;
            line-height: 1.3;
            margin-left: 32px; /* Indent below icon */
        }

        /* Subskills (Arcana) */
        .subskill-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .subskill-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .subskill-icon {
            width: 24px;
            height: 24px;
            border-radius: 3px;
            border: 1px solid #555;
        }
        .subskill-name {
            font-size: 12px;
            color: #FF9500;
            flex: 1;
        }
        .subskill-level {
            font-size: 11px;
            color: #888;
            margin-left: auto;
        }

        /* Set Bonuses (Arcana) */
        .set-bonus-container {
            background: rgba(0,0,0,0.2);
            border-radius: 4px;
            padding: 8px;
        }
        .set-bonus-title {
            font-size: 12px;
            font-weight: 700;
            color: #00bfff;
            margin-bottom: 6px;
        }
        .set-bonus-row {
            font-size: 11px;
            line-height: 1.4;
            margin-bottom: 2px;
        }
        .set-bonus-degree {
            color: #888;
            margin-right: 4px;
        }
        .set-bonus-active {
            color: #5ad878;
        }
        .set-bonus-inactive {
            color: #666;
        }

        /* Footer */
        .tooltip-footer {
            padding: 8px 12px;
            background: rgba(0,0,0,0.3);
            border-top: 1px solid rgba(255,255,255,0.05);
            font-size: 11px;
            color: #888;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        .trade-flag {
            color: #d85a5a; /* Reddish for soulbound/untradeable */
        }
        .trade-flag.can-trade {
            color: #5ad878;
        }

        .tooltip-loading {
            text-align: center;
            color: #FF9500;
            font-size: 12px;
            padding: 20px;
        }

        /* ==================== ENHANCED UI IMPROVEMENTS ==================== */
        
        /* Smooth animations for all transitions */
        @keyframes slideInUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        @keyframes fadeInScale {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }
        
        @keyframes glowPulse {
            0%, 100% { box-shadow: 0 0 15px rgba(130, 209, 255, 0.15); }
            50% { box-shadow: 0 0 25px rgba(130, 209, 255, 0.3); }
        }
        
        /* Enhanced scrollbar styling */
        .content-wrapper::-webkit-scrollbar {
            width: 8px;
        }
        
        .content-wrapper::-webkit-scrollbar-track {
            background: rgba(130, 209, 255, 0.05);
            border-radius: 10px;
        }

        .content-wrapper::-webkit-scrollbar-thumb {
            background: rgba(130, 209, 255, 0.3);
            border-radius: 10px;
            transition: all 0.3s ease;
        }

        .content-wrapper::-webkit-scrollbar-thumb:hover {
            background: rgba(130, 209, 255, 0.5);
        }

        /* ==================== NEW CHARACTER INFO STYLES ==================== */

        /* Character Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-bottom: 0;
        }

        .stat-card-detailed {
            background: rgba(20, 25, 35, 0.6);
            border: 1px solid rgba(100, 120, 150, 0.25);
            border-radius: 6px;
            padding: 12px 10px;
            text-align: center;
            transition: all 0.2s ease;
        }

        .stat-card-detailed::before {
            display: none;
        }

        .stat-card-detailed:hover {
            border-color: rgba(100, 140, 200, 0.5);
            background: rgba(28, 35, 50, 0.8);
        }

        .stat-name {
            color: #a0b8d0;
            font-size: 0.7em;
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-weight: 500;
        }

        .stat-value-large {
            color: #fff;
            font-size: 1.3em;
            font-weight: 700;
            line-height: 1;
        }

        .stat-secondary {
            color: #8aa0b8;
            font-size: 0.65em;
            margin-top: 4px;
        }

        /* Stats Category Sections */
        .stats-category {
            margin-bottom: 10px;
        }

        .stats-category:last-child {
            margin-bottom: 0;
        }

        .stats-category-title {
            font-size: 0.85em;
            font-weight: 600;
            color: #c0d0e0;
            margin-bottom: 10px;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(100, 120, 150, 0.3);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .stats-grid-divine {
            grid-template-columns: repeat(5, 1fr);
        }

        /* Stat icon image */
        .stat-icon-img {
            width: 24px;
            height: 24px;
            margin-bottom: 6px;
        }

        .stat-card-detailed {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 12px 10px;
            cursor: default;
        }

        .stat-name {
            font-size: 0.65em;
        }

        .stat-value-large {
            font-size: 1.1em;
        }

        .stat-secondaries {
            display: flex;
            flex-direction: column;
            gap: 3px;
            margin-top: 6px;
        }

        .stat-secondary {
            font-size: 0.6em;
            color: #8aa0b8;
            line-height: 1.3;
        }

        /* Daevanion Grid - Compact horizontal layout */
        .daevanion-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 6px;
            margin-bottom: 0;
        }

        .daevanion-item {
            background: linear-gradient(145deg, rgba(20, 30, 50, 0.95) 0%, rgba(10, 18, 35, 0.9) 100%);
            border: 1px solid rgba(56, 189, 248, 0.2);
            border-radius: 6px;
            padding: 6px 4px;
            text-align: center;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .daevanion-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.8) 50%, transparent 100%);
            opacity: 0.8;
        }

        .daevanion-item:hover {
            border-color: rgba(56, 189, 248, 0.5);
            transform: translateY(-2px);
        }

        /* Default color - #38bdf8 */
        .daevanion-item.daevanion-default .daevanion-name { color: #38bdf8; }
        .daevanion-item.daevanion-default .progress-fill { background: linear-gradient(90deg, #0284c7, #38bdf8, #7dd3fc); }
        .daevanion-item.daevanion-default::before { background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.8) 50%, transparent 100%); }
        .daevanion-item.daevanion-default::after { background: none; }
        .daevanion-item.daevanion-default { border-color: rgba(56, 189, 248, 0.2); }
        .daevanion-item.daevanion-default:hover { border-color: rgba(56, 189, 248, 0.5); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }

        /* Ariel color - #f97316 */
        .daevanion-item.daevanion-ariel .daevanion-name { color: #fb923c; }
        .daevanion-item.daevanion-ariel .progress-fill { background: linear-gradient(90deg, #c2410c, #f97316, #fdba74); }
        .daevanion-item.daevanion-ariel::before { background: linear-gradient(90deg, transparent 0%, rgba(249, 115, 22, 0.8) 50%, transparent 100%); }
        .daevanion-item.daevanion-ariel::after { background: none; }
        .daevanion-item.daevanion-ariel { border-color: rgba(249, 115, 22, 0.2); }
        .daevanion-item.daevanion-ariel:hover { border-color: rgba(249, 115, 22, 0.5); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }

        /* Azphel color - #a855f7 */
        .daevanion-item.daevanion-azphel .daevanion-name { color: #c084fc; }
        .daevanion-item.daevanion-azphel .progress-fill { background: linear-gradient(90deg, #7c3aed, #a855f7, #d8b4fe); }
        .daevanion-item.daevanion-azphel::before { background: linear-gradient(90deg, transparent 0%, rgba(168, 85, 247, 0.8) 50%, transparent 100%); }
        .daevanion-item.daevanion-azphel::after { background: none; }
        .daevanion-item.daevanion-azphel { border-color: rgba(168, 85, 247, 0.2); }
        .daevanion-item.daevanion-azphel:hover { border-color: rgba(168, 85, 247, 0.5); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }

        .daevanion-icon {
            width: 24px;
            height: 24px;
            margin: 0 auto 3px;
            border-radius: 3px;
        }

        .daevanion-name {
            color: #38bdf8;
            font-size: 0.55em;
            font-weight: 600;
            margin-bottom: 4px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .progress-bar {
            width: 100%;
            height: 4px;
            background: rgba(30, 40, 60, 0.8);
            border-radius: 2px;
            overflow: hidden;
            margin-bottom: 2px;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #0ea5e9, #38bdf8, #7dd3fc);
            transition: width 0.4s ease;
            border-radius: 2px;
        }

        .progress-text {
            color: #f0f9ff;
            font-size: 0.55em;
            font-weight: 600;
        }

        /* Ranking Grid */
        .ranking-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 12px;
            margin-bottom: 15px;
        }

        .ranking-item {
            background: linear-gradient(135deg, rgba(20, 25, 35, 0.8) 0%, rgba(25, 35, 50, 0.6) 100%);
            border: 1.5px solid rgba(255, 149, 0, 0.4);
            border-radius: 12px;
            padding: 14px;
            transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            backdrop-filter: blur(8px);
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            cursor: pointer;
        }

        .ranking-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle at 50% 0%, rgba(255, 149, 0, 0.15) 0%, transparent 70%);
            pointer-events: none;
        }

        .ranking-item:hover {
            border-color: rgba(255, 149, 0, 0.8);
            background: linear-gradient(135deg, rgba(30, 40, 55, 0.9) 0%, rgba(35, 50, 70, 0.7) 100%);
            transform: translateY(-5px);
            box-shadow: 
                0 12px 28px rgba(255, 149, 0, 0.25),
                0 0 20px rgba(255, 149, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
        }

        .grade-icon {
            width: 50px;
            height: 50px;
            margin-bottom: 8px;
            filter: drop-shadow(0 0 6px rgba(255, 149, 0, 0.4));
            transition: all 0.3s ease;
        }

        .ranking-item:hover .grade-icon {
            filter: drop-shadow(0 0 12px rgba(255, 149, 0, 0.7));
            transform: scale(1.1);
        }

        .ranking-header {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            margin-bottom: 8px;
            width: 100%;
        }

        .ranking-type {
            color: #FF9500;
            font-size: 1em;
            font-weight: 700;
            letter-spacing: 0.3px;
        }

        .ranking-rank {
            color: #FFD700;
            font-size: 1.4em;
            font-weight: 700;
            text-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
            margin-bottom: 4px;
        }

        .ranking-grade {
            color: #B0C4DE;
            font-size: 0.85em;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
            font-weight: 600;
        }

        .ranking-points {
            color: #FF9500;
            font-size: 0.9em;
            font-weight: 500;
            margin-bottom: 4px;
        }

        .ranking-change {
            position: absolute;
            top: 8px;
            right: 8px;
            background: rgba(255, 149, 0, 0.25);
            border: 1px solid rgba(255, 149, 0, 0.5);
            padding: 3px 6px;
            border-radius: 4px;
            font-weight: 700;
            font-size: 0.85em;
            color: #FF9500;
            transition: all 0.3s ease;
        }

        .ranking-change.rank-up {
            color: #00ff00;
            background: rgba(0, 255, 0, 0.2);
            border-color: rgba(0, 255, 0, 0.4);
            box-shadow: 0 0 8px rgba(0, 255, 0, 0.2);
        }

        .ranking-change.rank-down {
            color: #ff6b6b;
            background: rgba(255, 107, 107, 0.2);
            border-color: rgba(255, 107, 107, 0.4);
            box-shadow: 0 0 8px rgba(255, 107, 107, 0.2);
        }

        /* Titles Grid */
        .titles-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            margin-bottom: 0;
        }

        .title-item {
            background: rgba(20, 25, 35, 0.7);
            border: 2px solid rgba(255, 149, 0, 0.3);
            border-radius: 8px;
            padding: 12px;
            text-align: left;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .title-item:hover {
            border-color: rgba(255, 149, 0, 0.6);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .title-name {
            font-size: 0.9em;
            font-weight: 700;
            margin-bottom: 4px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .title-grade {
            font-size: 0.7em;
            margin-bottom: 8px;
            opacity: 0.8;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .title-stats {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .title-stat-item {
            font-size: 0.75em;
            color: #5ad878;
            background: rgba(90, 216, 120, 0.1);
            padding: 4px 8px;
            border-radius: 4px;
            border-left: 2px solid #5ad878;
        }
        .title-item.grade-common { border-color: #808080; }
        .title-item.grade-normal { border-color: #ffffff; }
        .title-item.grade-rare { border-color: #00870b; }
        .title-item.grade-unique { border-color: #ffd700; }
        .title-item.grade-hero { border-color: #ff8c00; }
        .title-item.grade-legend { border-color: #3366ff; }
        .title-item.grade-mythic { border-color: #ff00ff; }
        .title-item.grade-special { border-color: #00bfff; }

        .title-item.grade-common .title-name, .title-item.grade-common .title-grade { color: #b0b0b0; }
        .title-item.grade-normal .title-name, .title-item.grade-normal .title-grade { color: #ffffff; }
        .title-item.grade-rare .title-name, .title-item.grade-rare .title-grade { color: #00870b; }
        .title-item.grade-unique .title-name, .title-item.grade-unique .title-grade { color: #ffd700; }
        .title-item.grade-hero .title-name, .title-item.grade-hero .title-grade { color: #ff8c00; }
        .title-item.grade-legend .title-name, .title-item.grade-legend .title-grade { color: #3366ff; }
        .title-item.grade-mythic .title-name, .title-item.grade-mythic .title-grade { color: #ff00ff; }
        .title-item.grade-special .title-name, .title-item.grade-special .title-grade { color: #00bfff; }

        /* ==================== RESPONSIVE STYLES ==================== */
        
        /* Tablet and below */
        @media (max-width: 1024px) {
            .header-rankings {
                min-width: 250px;
                max-width: 400px;
            }
            .profile-header-section.modal-header {
                flex-wrap: wrap;
                gap: 15px;
            }
            .character-modal-content {
                padding: 15px;
                height: 95vh;
                max-height: 95vh;
            }
        }
        
        @media (max-width: 900px) {
            .site-header {
                padding: 14px 20px;
            }
            .header-stats {
                gap: 16px;
            }
            .header-stat-value {
                font-size: 1.1em;
            }
            .header-rankings {
                min-width: 100%;
                max-width: 100%;
                justify-content: center;
            }
            .profile-header-section.modal-header {
                flex-direction: column;
                align-items: center;
                text-align: center;
            }
            .profile-main {
                flex-direction: column;
                align-items: center;
            }
            .profile-info {
                align-items: center;
            }
            .profile-extras {
                align-items: center;
                width: 100%;
            }
            .header-companions {
                flex-direction: row;
                flex-wrap: wrap;
                justify-content: center;
            }
        }
        
        /* Mobile landscape and small tablets */
        @media (max-width: 768px) {
            .site-header {
                flex-direction: column;
                gap: 14px;
                padding: 14px 16px;
            }
            .header-brand {
                justify-content: center;
            }
            .header-stats {
                width: 100%;
                justify-content: space-around;
            }
            .toolbar {
                padding: 10px 16px;
            }
            .search-box {
                max-width: none;
            }
            #content {
                padding: 15px 15px 80px;
                -webkit-overflow-scrolling: touch;
                touch-action: pan-y;
            }
            .members-grid {
                grid-template-columns: 1fr;
                gap: 10px;
                padding: 0 5px;
                touch-action: pan-y;
            }
            .character-card {
                padding: 12px 14px 12px 12px;
                gap: 12px;
            }
            .profile-image-wrapper .profile-image {
                width: 48px;
                height: 48px;
            }
            .member-level-badge {
                font-size: 0.55em;
                padding: 2px 6px;
            }
            .item-level-container {
                min-width: 50px;
            }
            .item-level {
                font-size: 1.1em;
            }
            .modal-tabs {
                grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
                gap: 6px;
                padding: 12px 0 4px;
                margin: 0;
                border-radius: 0;
                background: transparent;
            }
            .modal-tab {
                min-height: 42px;
                padding: 9px 12px;
                font-size: 0.85em;
            }
            .modal-tab-contents {
                padding: 16px;
            }
            .equipment-grid {
                grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
                gap: 6px;
            }
            .equipment-icon {
                width: 40px;
                height: 40px;
            }
            /* Stats grid responsive for tablets */
            .stats-grid-divine {
                grid-template-columns: repeat(3, 1fr);
            }
        }
        
        /* Mobile portrait */
        @media (max-width: 480px) {
            body {
                padding-bottom: 20px;
            }
            .site-header {
                padding: 12px 14px;
                gap: 12px;
            }
            .brand-icon {
                font-size: 1.5em;
            }
            .brand-text h1 {
                font-size: 1.1em;
                letter-spacing: 1.5px;
            }
            .brand-subtitle {
                font-size: 0.6em;
            }
            .header-stats {
                gap: 12px;
            }
            .header-stat-value {
                font-size: 1em;
            }
            .header-stat-label {
                font-size: 0.55em;
            }
            .toolbar {
                padding: 10px 12px;
                flex-direction: column;
                gap: 10px;
            }
            .search-box {
                width: 100%;
                max-width: none;
            }
            .btn-refresh {
                width: 100%;
            }
            #content {
                padding: 12px 10px 100px;
            }
            .members-grid {
                grid-template-columns: 1fr;
                gap: 8px;
                padding: 0;
            }
            .character-card {
                padding: 10px 12px;
                gap: 10px;
                border-radius: 10px;
            }
            .profile-image-wrapper .profile-image {
                width: 44px;
                height: 44px;
            }
            .member-level-badge {
                font-size: 0.5em;
                padding: 1px 5px;
                bottom: -5px;
            }
            .character-name {
                font-size: 0.9em;
            }
            .rank-badge {
                font-size: 0.55em;
                padding: 1px 4px;
            }
            .character-class {
                font-size: 0.75em;
            }
            .class-icon {
                width: 16px;
                height: 16px;
            }
            .item-level-container {
                min-width: 45px;
            }
            .item-level {
                font-size: 1em;
            }
            .item-level-label {
                font-size: 0.55em;
            }
            /* Modal responsive */
            .character-modal-content {
                padding: 12px;
                height: 100vh;
                height: 100dvh;
                max-height: 100vh;
                max-height: 100dvh;
                border-radius: 0;
                display: flex;
                flex-direction: column;
                overflow: hidden;
            }
            
            #characterModalContent {
                flex: 1;
                min-height: 0;
                display: flex;
                flex-direction: column;
                overflow: hidden;
            }
            
            .modal-tabs {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 6px;
                padding: 10px 0 4px;
                margin: 0;
                border-radius: 0;
                background: transparent;
                flex-shrink: 0;
            }
            .modal-tab {
                min-height: 40px;
                padding: 8px 10px;
                font-size: 0.78em;
                letter-spacing: 0.35px;
            }
            .modal-tab-contents {
                padding: 12px;
                border-radius: 0 0 8px 8px;
                flex: 1;
                min-height: 0;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }
            .profile-header-section.modal-header {
                padding: 14px;
                border-radius: 8px;
            }
            .profile-image {
                width: 80px;
                height: 80px;
            }
            .profile-level {
                font-size: 0.75em;
                padding: 3px 10px;
            }
            .profile-name {
                font-size: 1.1em;
            }
            .profile-details {
                font-size: 0.8em;
            }
            .header-rank-item {
                padding: 3px 6px;
                min-width: 80px;
                gap: 4px;
            }
            .header-rank-name {
                font-size: 0.5em;
                max-width: 60px;
            }
            .header-rank-number {
                font-size: 0.7em;
            }
            .header-rank-type {
                width: 18px;
                height: 18px;
            }
            .header-rank-grade-icon {
                width: 16px;
                height: 16px;
            }
            .header-rankings {
                min-width: unset;
                max-width: 100%;
                padding: 0 8px;
                gap: 4px;
                justify-content: center;
            }
            .equipment-grid {
                grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
                gap: 5px;
            }
            .equipment-item {
                padding: 6px;
            }
            .equipment-icon {
                width: 36px;
                height: 36px;
            }
            .equipment-name {
                font-size: 0.6em;
            }
            .equipment-grade {
                font-size: 0.55em;
            }
            .modal-close {
                width: 32px;
                height: 32px;
                font-size: 1.2em;
                top: 10px;
                right: 10px;
            }
        }
        
        /* Very small phones */
        @media (max-width: 360px) {
            .brand-text h1 {
                font-size: 0.95em;
                letter-spacing: 1px;
            }
            .brand-icon {
                font-size: 1.3em;
            }
            .header-stat-value {
                font-size: 0.9em;
            }
            .header-stat-label {
                font-size: 0.5em;
            }
            .character-card {
                padding: 8px 10px;
            }
            .profile-image-wrapper .profile-image {
                width: 40px;
                height: 40px;
            }
            /* Stats grid responsive */
            .stats-grid-divine {
                grid-template-columns: repeat(2, 1fr);
            }
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .stat-icon-img {
                width: 24px;
                height: 24px;
            }
        }

        /* ==================== ADDITIONAL RESPONSIVE FIXES ==================== */
        
        /* Rift Timer responsive */
        @media (max-width: 768px) {
            .rift-timer-band {
                height: auto;
                min-height: 32px;
                padding: 4px 0;
            }
            .rift-header {
                padding: 0 8px;
                font-size: 0.75em;
            }
            .rift-timers-scroll {
                gap: 8px;
            }
            .rift-timer-item {
                padding: 3px 8px;
                font-size: 0.7em;
            }
        }
        
        @media (max-width: 480px) {
            .rift-timer-band {
                flex-direction: column;
                height: auto;
                padding: 6px 8px;
                gap: 4px;
            }
            .rift-header {
                width: 100%;
                justify-content: center;
                padding: 0;
            }
            .rift-timers-scroll {
                width: 100%;
                justify-content: center;
                flex-wrap: wrap;
                gap: 6px;
            }
        }
        
        /* Modal sections responsive */
        @media (max-width: 768px) {
            .modal-sections-wrapper {
                flex-direction: column;
            }
            .modal-section {
                min-width: 100%;
            }
            .daevanion-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 4px;
            }
            .daevanion-item {
                padding: 5px 3px;
            }
            .daevanion-name {
                font-size: 0.5em;
            }
            .skill-cards-grid {
                grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
                gap: 6px;
            }
            .skill-card {
                padding: 8px 4px;
            }
            .skill-card-icon {
                width: 40px;
                height: 40px;
            }
            .skill-card-name {
                font-size: 0.65em;
            }
        }
        
        @media (max-width: 480px) {
            .daevanion-grid {
                grid-template-columns: repeat(3, 1fr);
            }
            .daevanion-icon {
                width: 20px;
                height: 20px;
            }
            .skill-cards-grid {
                grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
                gap: 5px;
            }
            .skill-card-icon {
                width: 36px;
                height: 36px;
            }
            .skill-card-level {
                font-size: 0.55em;
                padding: 1px 4px;
            }
            .companion-card {
                padding: 10px;
            }
            .companion-icon {
                width: 50px;
                height: 50px;
            }
            .companion-name {
                font-size: 0.8em;
            }
            .companion-level {
                font-size: 0.7em;
            }
        }
        
        /* Touch device improvements */
        @media (hover: none) and (pointer: coarse) {
            .character-card:active {
                transform: scale(0.98);
                transition: transform 0.1s ease;
            }
            .equipment-item:active {
                transform: scale(0.95);
            }
            /* On touch devices, tooltip shows on tap via JS - position fixed for mobile */
            #equipmentTooltip {
                position: fixed !important;
                max-width: 90vw !important;
                max-height: 70vh !important;
                overflow-y: auto !important;
                left: 50% !important;
                top: 50% !important;
                transform: translate(-50%, -50%) !important;
                z-index: 10000 !important;
            }
            #equipmentTooltip.visible {
                display: block !important;
            }
            /* Backdrop for mobile tooltip */
            .tooltip-backdrop {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.7);
                z-index: 9999;
                display: none;
            }
            /* Close button for mobile tooltip */
            .tooltip-close-btn {
                position: absolute;
                top: 8px;
                right: 8px;
                width: 28px;
                height: 28px;
                border: none;
                background: rgba(255, 255, 255, 0.15);
                color: #fff;
                border-radius: 50%;
                font-size: 16px;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                z-index: 1;
                transition: background 0.2s ease;
            }
            .tooltip-close-btn:hover,
            .tooltip-close-btn:active {
                background: rgba(255, 255, 255, 0.25);
            }
        }
        
        /* ===== COMPACT MOBILE MODAL HEADER ===== */
        @media (max-width: 600px) {
            /* Full screen modal overlay on mobile */
            .modal {
                padding: 0;
            }
            
            /* Full screen modal on mobile */
            .character-modal-content {
                width: 100vw;
                width: 100dvw;
                height: 100vh;
                height: 100dvh;
                max-width: 100vw;
                max-width: 100dvw;
                max-height: 100vh;
                max-height: 100dvh;
                border-radius: 0;
                padding: 8px;
                padding-top: max(8px, env(safe-area-inset-top));
                padding-bottom: max(8px, env(safe-area-inset-bottom));
                padding-left: max(8px, env(safe-area-inset-left));
                padding-right: max(8px, env(safe-area-inset-right));
                margin: 0;
                border: none;
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                overflow: hidden;
                display: flex;
                flex-direction: column;
            }
            
            /* Ensure modal content fills available space and scrolls properly */
            #characterModalContent {
                flex: 1;
                min-height: 0;
                display: flex;
                flex-direction: column;
                overflow: hidden;
            }
            
            /* Ultra-compact modal header on mobile */
            .profile-header-section.modal-header {
                padding: 10px 12px;
                gap: 10px;
            }
            
            .profile-main {
                flex-direction: row;
                align-items: center;
                gap: 12px;
            }
            
            .profile-image-wrapper {
                flex-shrink: 0;
            }
            
            .profile-image {
                width: 56px;
                height: 56px;
            }
            
            .profile-level {
                font-size: 0.6em;
                padding: 2px 6px;
                bottom: -4px;
            }
            
            .profile-info {
                gap: 2px;
                align-items: flex-start;
            }
            
            .profile-name {
                font-size: 1em;
            }
            
            .profile-name-row {
                max-width: calc(100% - 110px);
            }
            
            .profile-details {
                font-size: 0.7em;
                flex-wrap: wrap;
                gap: 4px;
            }
            
            .profile-extras {
                display: none;
            }
            
            /* Fix modal header actions overlap */
            .modal-header-actions {
                gap: 5px;
            }
            
            .modal-favorite {
                padding: 4px 6px;
                min-height: 26px;
            }
            
            .modal-share {
                padding: 4px 6px;
                min-height: 26px;
                min-width: 70px;
            }
            
            .modal-refresh,
            .modal-refresh-compact {
                height: 26px;
                padding: 0 6px;
            }
            
            .modal-close {
                width: 26px;
                height: 26px;
            }
            
            /* Compact rankings row */
            .header-rankings {
                padding: 6px;
                gap: 4px;
                flex-wrap: wrap;
                justify-content: center;
            }
            
            .header-rank-item {
                padding: 3px 5px;
                min-width: 60px;
                gap: 3px;
            }
            
            .header-rank-type {
                width: 14px;
                height: 14px;
            }
            
            .header-rank-number {
                font-size: 0.65em;
            }
            
            .header-rank-name {
                display: none;
            }
            
            /* Companions in header - hide on small screens (moved to Cosmetics tab) */
            .header-companions {
                display: none;
            }
            
            /* Compact modal action buttons on mobile */
            .modal-header-actions {
                top: 6px;
                right: 6px;
                gap: 6px;
            }
            
            .modal-close {
                width: 28px;
                height: 28px;
                font-size: 0.85em;
                border-radius: 6px;
            }
            
            .modal-favorite {
                padding: 5px 8px;
                min-height: 28px;
                font-size: 1em;
                min-width: auto;
                border-radius: 6px;
            }
            
            .modal-favorite .fav-label {
                display: none;
            }
            
            .modal-favorite .fav-icon {
                font-size: 1.1em;
            }
            
            .modal-refresh,
            .modal-refresh-compact {
                height: 28px;
                padding: 0 8px;
                font-size: 0.75em;
                border-radius: 6px;
            }
            
            /* Hide floating logo on small screens */
            .modal-floating-logo {
                display: none !important;
            }
            
            /* Compact tabs */
            .modal-tabs {
                grid-template-columns: repeat(3, 1fr);
                gap: 4px;
                padding: 6px 0;
            }
            
            .modal-tab {
                min-height: 36px;
                padding: 6px 8px;
                font-size: 0.7em;
            }
            
            /* Tab content adjustments */
            .modal-tab-contents {
                padding: 10px;
                flex: 1;
                min-height: 0;
                overflow-y: auto;
                overflow-x: hidden;
                -webkit-overflow-scrolling: touch;
                overscroll-behavior: contain;
            }
            
            /* Ensure tab content fills available space */
            .modal-tab-content.active {
                flex: 1;
                min-height: 0;
                overflow-y: auto;
                overflow-x: hidden;
            }
        }
        
        /* Ultra-compact profile header for small phones */
        @media (max-width: 480px) {
            .profile-header-section.modal-header {
                padding: 8px 10px;
                gap: 8px;
                border-radius: 8px;
            }
            
            .profile-main {
                gap: 10px;
            }
            
            .profile-image {
                width: 48px;
                height: 48px;
                border-radius: 8px;
            }
            
            .profile-level {
                font-size: 0.55em;
                padding: 1px 5px;
                bottom: -3px;
                border-width: 1px;
            }
            
            .profile-name {
                font-size: 0.9em;
            }
            
            .profile-details {
                font-size: 0.65em;
                gap: 3px;
            }
            
            .profile-details .detail-separator {
                display: none;
            }
            
            /* Even more compact action buttons */
            .modal-header-actions {
                top: 5px;
                right: 5px;
                gap: 4px;
            }
            
            .modal-close {
                width: 24px;
                height: 24px;
                font-size: 0.75em;
            }
            
            .modal-favorite {
                padding: 3px 5px;
                min-height: 24px;
            }
            
            .modal-share {
                padding: 3px 5px;
                min-height: 24px;
                min-width: 60px;
            }
            
            .modal-share .share-label {
                font-size: 0.8em;
            }
            
            .modal-favorite .fav-icon {
                font-size: 1em;
            }
            
            .modal-refresh,
            .modal-refresh-compact {
                height: 24px;
                padding: 0 5px;
                font-size: 0.7em;
            }
            
            /* Compact rankings */
            .header-rankings {
                padding: 4px;
                gap: 3px;
            }
            
            .header-rank-item {
                padding: 2px 4px;
                min-width: 50px;
            }
            
            .header-rank-type {
                width: 12px;
                height: 12px;
            }
            
            .header-rank-number {
                font-size: 0.6em;
            }
            
            /* Tabs even more compact */
            .modal-tabs {
                gap: 3px;
                padding: 4px 0;
            }
            
            .modal-tab {
                min-height: 32px;
                padding: 5px 6px;
                font-size: 0.65em;
            }
            
            .modal-tab-contents {
                padding: 8px;
                flex: 1;
                min-height: 0;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            /* Ensure character modal content properly fills screen */
            .character-modal-content {
                padding: 6px;
                padding-top: max(6px, env(safe-area-inset-top));
                padding-bottom: max(6px, env(safe-area-inset-bottom));
            }
        }
        
        /* Minimal profile header for very small phones */
        @media (max-width: 360px) {
            .profile-header-section.modal-header {
                padding: 6px 8px;
                gap: 6px;
                border-radius: 6px;
            }
            
            .profile-main {
                gap: 8px;
            }
            
            .profile-image {
                width: 40px;
                height: 40px;
                border-radius: 6px;
                border-width: 1px;
            }
            
            .profile-level {
                font-size: 0.5em;
                padding: 1px 4px;
                bottom: -2px;
            }
            
            .profile-name {
                font-size: 0.85em;
            }
            
            .profile-details {
                font-size: 0.6em;
                gap: 2px;
            }
            
            /* Minimal action buttons */
            .modal-header-actions {
                top: 4px;
                right: 4px;
                gap: 3px;
            }
            
            .modal-close {
                width: 22px;
                height: 22px;
                font-size: 0.7em;
            }
            
            .modal-favorite {
                padding: 2px 4px;
                min-height: 22px;
            }
            
            .modal-favorite .fav-icon {
                font-size: 0.9em;
            }
            
            .modal-refresh,
            .modal-refresh-compact {
                height: 22px;
                padding: 0 4px;
                font-size: 0.65em;
            }
            
            /* Minimal rankings row */
            .header-rankings {
                padding: 3px;
                gap: 2px;
            }
            
            .header-rank-item {
                padding: 2px 3px;
                min-width: 45px;
            }
            
            .header-rank-type {
                width: 10px;
                height: 10px;
            }
            
            .header-rank-number {
                font-size: 0.55em;
            }
            
            /* Minimal tabs */
            .modal-tabs {
                gap: 2px;
                padding: 3px 0;
            }
            
            .modal-tab {
                min-height: 28px;
                padding: 4px 5px;
                font-size: 0.6em;
                border-radius: 4px;
            }
            
            .modal-tab-contents {
                padding: 6px;
                border-radius: 0 0 6px 6px;
                flex: 1;
                min-height: 0;
                overflow-y: auto;
            }
        }
        
        /* Landscape phone optimization */
        @media (max-height: 500px) and (orientation: landscape) {
            .character-modal-content {
                height: 100vh;
                height: 100dvh;
                max-height: 100vh;
                max-height: 100dvh;
                padding: 10px;
                padding-left: max(10px, env(safe-area-inset-left));
                padding-right: max(10px, env(safe-area-inset-right));
                display: flex;
                flex-direction: column;
                overflow: hidden;
            }
            
            #characterModalContent {
                flex: 1;
                min-height: 0;
                display: flex;
                flex-direction: column;
                overflow: hidden;
            }
            
            .modal-tabs {
                padding: 5px 0;
                position: relative;
                z-index: 10;
                background: rgba(12, 16, 24, 0.97);
                flex-shrink: 0;
            }
            
            .modal-tab-contents {
                flex: 1;
                min-height: 0;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            .modal-tab {
                padding: 6px 10px;
            }
            .profile-header-section.modal-header {
                padding: 10px;
            }
            .profile-image {
                width: 60px;
                height: 60px;
            }
        }

        /* ===== MOBILE COMPANIONS IN COSMETICS TAB ===== */
        /* Hidden on desktop, shown on mobile */
        .cosmetics-companions-mobile {
            display: none;
        }
        
        @media (max-width: 600px) {
            .cosmetics-companions-mobile {
                display: block;
                margin-bottom: 16px;
                padding-bottom: 16px;
                border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            }
            
            .cosmetics-section-title {
                font-size: 0.75em;
                color: rgba(176, 196, 222, 0.7);
                text-transform: uppercase;
                letter-spacing: 1px;
                margin-bottom: 10px;
            }
            
            .companions-mobile-grid {
                display: flex;
                flex-direction: column;
                gap: 10px;
            }
            
            .companion-mobile-item {
                display: flex;
                align-items: center;
                gap: 10px;
                background: linear-gradient(145deg, rgba(24, 32, 50, 0.9) 0%, rgba(16, 24, 38, 0.85) 100%);
                border: 1px solid rgba(150, 210, 255, 0.2);
                border-radius: 10px;
                padding: 10px;
            }
            
            .companion-mobile-icon {
                width: 44px;
                height: 44px;
                border-radius: 8px;
                border: 1px solid rgba(150, 210, 255, 0.3);
                object-fit: cover;
            }
            
            .companion-mobile-info {
                display: flex;
                flex-direction: column;
                gap: 2px;
                min-width: 0;
            }
            
            .companion-mobile-label {
                font-size: 0.65em;
                color: rgba(176, 196, 222, 0.6);
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }
            
            .companion-mobile-name {
                font-size: 0.8em;
                color: #e9f2ff;
                font-weight: 600;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
        }


/* ================= RIFT REMINDER SETTINGS ================= */
.rift-reminder-section {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 149, 0, 0.12);
    background: linear-gradient(180deg, rgba(255, 149, 0, 0.04) 0%, transparent 100%);
}

.rift-reminder-header {
    margin-bottom: 12px;
}

.rift-reminder-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 200, 140, 0.95);
    letter-spacing: 0.3px;
}

.rift-reminder-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Toggle Switch */
.rift-reminder-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.rift-reminder-toggle input {
    display: none;
}

.rift-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(80, 90, 110, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rift-toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: rgba(200, 210, 225, 0.85);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.rift-reminder-toggle input:checked + .rift-toggle-slider {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.65) 0%, rgba(255, 119, 0, 0.55) 100%);
    border-color: rgba(255, 149, 0, 0.4);
    box-shadow: 0 0 12px rgba(255, 149, 0, 0.2);
}

.rift-reminder-toggle input:checked + .rift-toggle-slider::before {
    transform: translateX(20px);
    background: #fff;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.5);
}

.rift-toggle-label {
    font-size: 12px;
    color: rgba(176, 196, 222, 0.75);
    font-weight: 500;
    min-width: 24px;
    transition: color 0.2s ease;
}

.rift-reminder-toggle input:checked ~ .rift-toggle-label {
    color: #FF9500;
}

/* Time Select Dropdown */
.rift-reminder-time-select {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rift-reminder-time-label {
    font-size: 11px;
    color: rgba(176, 196, 222, 0.55);
}

.rift-time-dropdown {
    position: relative;
}

.rift-time-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: rgba(200, 220, 245, 0.9);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.rift-time-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 149, 0, 0.3);
}

.rift-time-dropdown.open .rift-time-toggle {
    border-color: rgba(255, 149, 0, 0.5);
    background: rgba(255, 149, 0, 0.1);
}

#riftTimeValue {
    font-weight: 600;
    color: #FF9500;
}

.rift-dropdown-arrow {
    width: 12px;
    height: 12px;
    margin-left: 2px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.rift-time-dropdown.open .rift-dropdown-arrow {
    transform: rotate(180deg);
}

.rift-time-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 100%;
    background: rgba(22, 28, 40, 0.98);
    border: 1px solid rgba(255, 149, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.rift-time-dropdown.open .rift-time-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rift-time-option {
    padding: 8px 12px;
    font-size: 11px;
    color: rgba(200, 220, 245, 0.8);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.rift-time-option:hover {
    background: rgba(255, 149, 0, 0.15);
    color: #FFD700;
}

.rift-time-option.selected {
    background: rgba(255, 149, 0, 0.2);
    color: #FF9500;
}

/* Test Sound Button */
.rift-reminder-test {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
}

.rift-test-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: rgba(255, 149, 0, 0.06);
    border: 1px solid rgba(255, 149, 0, 0.18);
    border-radius: 8px;
    color: rgba(255, 200, 140, 0.8);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rift-test-btn:hover {
    background: rgba(255, 149, 0, 0.12);
    border-color: rgba(255, 149, 0, 0.35);
    color: #FF9500;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.15);
}

.rift-test-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: none;
}

/* Reminder Animation Effects */
.rift-floating-widget.reminder-pulse {
    animation: reminderPulse 0.5s ease-out 3;
}

@keyframes reminderPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.rift-widget-preview.reminder-flash {
    animation: reminderFlash 0.4s ease-out 4;
}

@keyframes reminderFlash {
    0%, 100% { 
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 149, 0, 0.15);
    }
    50% { 
        box-shadow: 0 4px 30px rgba(255, 149, 0, 0.5), 0 0 25px rgba(255, 149, 0, 0.4), 0 0 40px rgba(255, 149, 0, 0.2);
    }
}

/* Preview Bell Button (on collapsed card) */
.rift-preview-bell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(100, 110, 130, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.rift-preview-bell:hover {
    background: rgba(255, 149, 0, 0.2);
    border-color: rgba(255, 149, 0, 0.4);
}

.rift-preview-bell.active {
    background: rgba(255, 149, 0, 0.25);
    border-color: rgba(255, 149, 0, 0.5);
    box-shadow: 0 0 8px rgba(255, 149, 0, 0.3);
}

.rift-preview-bell.active:hover {
    background: rgba(255, 149, 0, 0.35);
}

.rift-bell-icon {
    font-size: 14px;
    line-height: 1;
}

.rift-preview-bell.active .rift-bell-icon {
    animation: bellRing 0.5s ease-in-out;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-15deg); }
    60% { transform: rotate(10deg); }
    80% { transform: rotate(-10deg); }
}

/* Mobile Adjustments for Reminder */
@media (max-width: 768px) {
    .rift-reminder-section {
        padding: 10px 12px;
    }
    
    .rift-reminder-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .rift-reminder-time-select {
        flex: 1;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .rift-reminder-section {
        padding: 8px 10px;
    }
    
    .rift-reminder-title {
        font-size: 11px;
    }
    
    .rift-toggle-slider {
        width: 36px;
        height: 20px;
    }
    
    .rift-toggle-slider::before {
        width: 14px;
        height: 14px;
    }
    
    .rift-reminder-toggle input:checked + .rift-toggle-slider::before {
        transform: translateX(16px);
    }
    
    .rift-time-toggle {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .rift-test-btn {
        padding: 5px 10px;
        font-size: 10px;
    }
    
    .rift-preview-bell {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }
    
    .rift-bell-icon {
        font-size: 12px;
    }
}

/* ===== DAEVANION BOARD TAB STYLES ===== */

.daevanion-tab-container {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent;
    border-radius: 0;
    flex: 1;
    min-height: 0;
    height: 100%;
}

/* Fullscreen Mode - True fullscreen with floating UI */
.daevanion-tab-container.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background: #060809;
    border-radius: 0;
    padding: 0;
    gap: 0;
    margin: 0;
}

.daevanion-tab-container.is-fullscreen .daevanion-header {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: rgba(15, 20, 30, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(80, 100, 130, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 8px;
}

.daevanion-tab-container.is-fullscreen .daevanion-main-content {
    flex: 1;
    width: 100vw;
    height: 100vh;
    gap: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.daevanion-tab-container.is-fullscreen .daevanion-board-wrapper {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: #060809;
    flex-shrink: 0;
}

/* Floating effects hidden in normal mode, visible in fullscreen */
.daevanion-effects-floating {
    display: none;
}

.daevanion-tab-container.is-fullscreen .daevanion-effects-floating {
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 16px;
    top: 80px;
    bottom: 20px;
    width: 220px;
    z-index: 100;
    overflow: hidden;
}

.daevanion-tab-container.is-fullscreen .daevanion-effects-floating .daevanion-effects {
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    background: rgba(15, 20, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(80, 100, 130, 0.3);
    overflow: hidden;
}

.daevanion-tab-container.is-fullscreen .daevanion-effects-floating .effects-all-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Hide sidebar effects in fullscreen (use floating instead) */
.daevanion-tab-container.is-fullscreen .daevanion-effects-summary {
    display: none;
}

/* Override modal styles when daevanion is in fullscreen */
.modal:has(.daevanion-tab-container.is-fullscreen) {
    padding: 0;
}

.modal:has(.daevanion-tab-container.is-fullscreen) .character-modal-content {
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    padding: 0;
}

.modal:has(.daevanion-tab-container.is-fullscreen) #characterModalContent {
    overflow: visible;
}

.modal:has(.daevanion-tab-container.is-fullscreen) .modal-tabs,
.modal:has(.daevanion-tab-container.is-fullscreen) .modal-close {
    display: none;
}

.modal:has(.daevanion-tab-container.is-fullscreen) .modal-tab-contents {
    height: 100vh;
    overflow: visible;
}

.daevanion-main-content {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Header with compact selector - centered */
.daevanion-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(15, 20, 30, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(80, 100, 130, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    align-self: center;
    width: fit-content;
}

/* Floating Logo/Nav-brand - visible in modal and fullscreen */
.daevanion-floating-logo {
    display: none !important;
}

/* Modal floating logo - outside modal, fixed to viewport */
.modal-floating-logo {
    display: none;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 10000;
    padding: 8px 14px;
    background: rgba(15, 20, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(80, 100, 130, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    text-decoration: none;
    pointer-events: none;
    user-select: none;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.modal-floating-logo.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    animation: floatingLogoIn 0.3s ease forwards;
}

@keyframes floatingLogoIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-floating-logo .logo-icon-wrapper {
    width: 32px;
    height: 32px;
    background: linear-gradient(145deg, rgba(255, 149, 0, 0.15) 0%, rgba(255, 119, 0, 0.1) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.modal-floating-logo .logo-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.modal-floating-logo .logo-text-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.modal-floating-logo .logo-text {
    color: #FF9500;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.modal-floating-logo .logo-tagline {
    color: rgba(200, 220, 245, 0.6);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.daevanion-tab-container.is-fullscreen .daevanion-floating-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    padding: 8px 14px;
    background: rgba(15, 20, 30, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(80, 100, 130, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    text-decoration: none;
    pointer-events: none;
    user-select: none;
}

.daevanion-floating-logo .logo-icon-wrapper {
    width: 32px;
    height: 32px;
    background: linear-gradient(145deg, rgba(255, 149, 0, 0.15) 0%, rgba(255, 119, 0, 0.1) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.daevanion-floating-logo .logo-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.daevanion-floating-logo .logo-text-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.daevanion-floating-logo .logo-text {
    color: #FF9500;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.daevanion-floating-logo .logo-tagline {
    color: rgba(200, 220, 245, 0.6);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Compact Board Selector with buttons */
.daevanion-board-selector-compact {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* Fullscreen Button - positioned in board corner */
.daevanion-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(35, 45, 70, 0.9) 0%, rgba(25, 32, 50, 0.95) 100%);
    border: 1px solid rgba(100, 120, 150, 0.25);
    border-radius: 5px;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    pointer-events: auto;
}

.daevanion-fullscreen-btn:hover {
    border-color: rgba(100, 150, 200, 0.5);
    background: linear-gradient(145deg, rgba(45, 58, 85, 0.95) 0%, rgba(35, 45, 65, 0.98) 100%);
    color: #e0f2fe;
}

.daevanion-tab-container.is-fullscreen .daevanion-fullscreen-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.3) 0%, rgba(185, 28, 28, 0.4) 100%);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.daevanion-tab-container.is-fullscreen .daevanion-fullscreen-btn:hover {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.4) 0%, rgba(185, 28, 28, 0.5) 100%);
    color: #fecaca;
}

/* Compact Board Buttons */
.daevanion-board-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(145deg, rgba(35, 45, 70, 0.9) 0%, rgba(25, 32, 50, 0.95) 100%);
    border: 1px solid rgba(100, 120, 150, 0.25);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 90px;
    position: relative;
    overflow: hidden;
}

.daevanion-board-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.daevanion-board-btn:hover {
    border-color: rgba(100, 150, 200, 0.5);
    background: linear-gradient(145deg, rgba(45, 58, 85, 0.95) 0%, rgba(35, 45, 65, 0.98) 100%);
}

.daevanion-board-btn.active {
    border-color: rgba(56, 189, 248, 0.6);
    background: linear-gradient(145deg, rgba(56, 189, 248, 0.15) 0%, rgba(30, 45, 70, 0.95) 100%);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.board-btn-name {
    color: #e0f2fe;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.board-btn-progress {
    color: #94a3b8;
    font-size: 0.6rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.board-btn-bar {
    width: 100%;
    height: 3px;
    background: rgba(20, 30, 50, 0.8);
    border-radius: 2px;
    overflow: hidden;
}

.board-btn-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Ariel board styling (orange) */
.daevanion-board-btn.board-ariel .board-btn-name {
    color: #ee6c2a;
}
.daevanion-board-btn.board-ariel .board-btn-progress {
    color: #ee6c2a;
}
.daevanion-board-btn.board-ariel .board-btn-fill {
    background: linear-gradient(90deg, #ee6c2a, #f59e0b);
}
.daevanion-board-btn.board-ariel.active {
    border-color: rgba(238, 108, 42, 0.8);
    box-shadow: 0 0 15px rgba(238, 108, 42, 0.3);
}

/* Azphel board styling (purple) */
.daevanion-board-btn.board-azphel .board-btn-name {
    color: #7e3dcf;
}
.daevanion-board-btn.board-azphel .board-btn-progress {
    color: #7e3dcf;
}
.daevanion-board-btn.board-azphel .board-btn-fill {
    background: linear-gradient(90deg, #7e3dcf, #a855f7);
}
.daevanion-board-btn.board-azphel.active {
    border-color: rgba(126, 61, 207, 0.8);
    box-shadow: 0 0 15px rgba(126, 61, 207, 0.3);
}

/* Board Wrapper for zoom and pan */
.daevanion-board-wrapper {
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(145deg, #0f1215 0%, #0a0c0e 100%);
    border: 1px solid rgba(80, 100, 130, 0.2);
    flex: 1;
    min-width: 0;
    min-height: 0;
    position: relative;
    cursor: grab;
    user-select: none;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4), 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.daevanion-board-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.daevanion-board-wrapper:active {
    cursor: grabbing;
}

.daevanion-board-wrapper.is-dragging {
    cursor: grabbing;
}

/* Board Grid Display */
.daevanion-board-display {
    padding: 12px;
    transform-origin: center center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.daevanion-board-grid {
    display: grid;
}

.daevanion-board-display img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

.daevanion-board-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #94a3b8;
    z-index: 5;
}

.daevanion-board-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.daevanion-error {
    text-align: center;
    color: #f87171;
    padding: 40px;
}

/* Node Styles */
.daevanion-node {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.15s ease, filter 0.15s ease;
    cursor: pointer;
    border-radius: 4px;
}

.daevanion-node:hover {
    transform: scale(1.2);
    z-index: 10;
    filter: brightness(1.1);
}

.daevanion-node .node-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

/* Locked nodes - slightly dimmed */
.daevanion-node.node-locked {
    opacity: 0.85;
}

.daevanion-node.node-locked:hover {
    opacity: 1;
}

/* Open (unlocked) nodes */
.daevanion-node.node-open {
    opacity: 1;
}

/* Effects Summary Section - Sidebar in normal mode */
.daevanion-effects-summary {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.daevanion-effects {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: linear-gradient(145deg, rgba(20, 28, 45, 0.7) 0%, rgba(15, 22, 38, 0.8) 100%);
    border-radius: 10px;
    border: 1px solid rgba(80, 100, 130, 0.2);
    height: 100%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.effects-header {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    flex-shrink: 0;
}

.effects-header-title {
    color: #e0f2fe;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.effects-all-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.effects-all-list::-webkit-scrollbar {
    width: 4px;
}

.effects-all-list::-webkit-scrollbar-track {
    background: rgba(15, 20, 30, 0.5);
    border-radius: 2px;
}

.effects-all-list::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 2px;
}

.effects-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.effects-group-title {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.effects-group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Legacy effects section styles - keeping for backwards compatibility */
.effects-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.effects-title {
    color: #e0f2fe;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.effects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    align-content: flex-start;
    padding-right: 4px;
}

.effects-list::-webkit-scrollbar {
    width: 4px;
}

.effects-list::-webkit-scrollbar-track {
    background: rgba(15, 20, 30, 0.5);
    border-radius: 2px;
}

.effects-list::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 2px;
}

.effect-tag {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.effect-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.effect-tag.stat-effect {
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.15) 0%, rgba(107, 114, 128, 0.25) 100%);
    border: 1px solid rgba(156, 163, 175, 0.35);
    color: #d1d5db;
}

.effect-tag.skill-effect {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.25) 100%);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.effect-tag.passive-effect {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(22, 163, 74, 0.25) 100%);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

/* Node Tooltip */
.daevanion-node-tooltip {
    position: fixed;
    z-index: 10000;
    padding: 12px 16px;
    background: linear-gradient(145deg, rgba(25, 35, 55, 0.98) 0%, rgba(15, 22, 35, 0.99) 100%);
    border: 1px solid rgba(80, 120, 180, 0.3);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.1);
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: 280px;
    backdrop-filter: blur(10px);
}

.daevanion-node-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.node-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.node-tooltip-name {
    color: #e0f2fe;
    font-size: 0.85rem;
    font-weight: 600;
}

.node-tooltip-grade {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.node-tooltip-header.grade-common .node-tooltip-grade {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.node-tooltip-header.grade-rare .node-tooltip-grade {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.node-tooltip-header.grade-unique .node-tooltip-grade {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

.node-tooltip-header.grade-legend .node-tooltip-grade {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;;
}

.node-tooltip-effect {
    color: #a5f3fc;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.node-tooltip-status {
    font-size: 0.7rem;
}

.node-tooltip-status .status-unlocked {
    color: #4ade80;
}

.node-tooltip-status .status-locked {
    color: #f87171;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .daevanion-node {
        width: 26px;
        height: 26px;
    }
    
    .daevanion-node .node-icon {
        width: 20px;
        height: 20px;
    }
    
    .daevanion-board-btn {
        min-width: 80px;
        padding: 6px 10px;
    }
    
    .board-btn-name {
        font-size: 0.65rem;
    }
    
    .daevanion-main-content {
        flex-direction: column;
    }
    
    .daevanion-effects-summary {
        width: 100%;
        max-height: 150px;
    }
    
    .daevanion-board-wrapper {
        height: 300px;
    }
    
    /* Optimized daevanion header for mobile */
    .daevanion-header {
        flex-wrap: wrap;
        padding: 4px 8px;
        gap: 4px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .daevanion-board-selector-compact {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }
    
    .daevanion-board-btn {
        min-width: 75px;
        padding: 5px 8px;
    }
    
    .board-btn-name {
        font-size: 0.6rem;
    }
    
    .board-btn-progress {
        font-size: 0.55rem;
    }
    
    .daevanion-board-select {
        min-width: 150px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-main-content {
        flex-direction: column;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-effects-summary {
        width: 100%;
        max-height: 120px;
    }
}

@media (max-width: 480px) {
    .daevanion-node {
        width: 22px;
        height: 22px;
    }
    
    .daevanion-node .node-icon {
        width: 16px;
        height: 16px;
    }
    
    .daevanion-board-selector {
        padding: 4px;
        gap: 4px;
    }
    
    .daevanion-board-btn {
        min-width: 60px;
        padding: 3px 5px;
    }
    
    .board-btn-name {
        font-size: 0.55rem;
    }
    
    .board-btn-progress {
        font-size: 0.5rem;
    }
    
    .board-btn-bar {
        height: 2px;
    }
    
    .effects-group-items {
        gap: 3px;
    }
    
    .effect-tag {
        padding: 2px 6px;
        font-size: 0.6rem;
    }
    
    .daevanion-board-wrapper {
        height: 250px;
    }
    
    /* Ultra-compact daevanion header for small phones */
    .daevanion-header {
        padding: 3px 6px;
        gap: 3px;
        border-radius: 6px;
    }
    
    .daevanion-board-selector-compact {
        gap: 3px;
    }
    
    .daevanion-board-select {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    .daevanion-fullscreen-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* Very small phones - 360px and below */
@media (max-width: 360px) {
    .daevanion-header {
        padding: 2px 4px;
        gap: 2px;
        border-radius: 4px;
    }
    
    .daevanion-board-selector-compact {
        gap: 2px;
    }
    
    .daevanion-board-btn {
        min-width: 50px;
        padding: 2px 4px;
    }
    
    .board-btn-name {
        font-size: 0.5rem;
    }
    
    .board-btn-progress {
        display: none; /* Hide progress text on very small screens */
    }
    
    .board-btn-bar {
        height: 1.5px;
    }
    
    .daevanion-board-select {
        font-size: 0.7rem;
        padding: 4px 8px;
        min-width: 120px;
    }
    
    .daevanion-fullscreen-btn {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .daevanion-node {
        width: 18px;
        height: 18px;
    }
    
    .daevanion-node .node-icon {
        width: 12px;
        height: 12px;
    }
    
    .daevanion-board-wrapper {
        height: 220px;
    }
}

/* ===== FULLSCREEN DAEVANION RESPONSIVE ===== */
/* Tablet fullscreen */
@media (max-width: 1024px) {
    .daevanion-tab-container.is-fullscreen .daevanion-effects-floating {
        width: 180px;
        right: 10px;
        top: 70px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-header {
        padding: 5px 10px;
        gap: 6px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-board-btn {
        min-width: 75px;
        padding: 5px 8px;
    }
}

/* Mobile fullscreen - hide floating effects, show toggle button */
@media (max-width: 768px) {
    .daevanion-tab-container.is-fullscreen .daevanion-header {
        top: 10px;
        left: 10px;
        right: auto;
        transform: none;
        max-width: calc(100vw - 80px);
        overflow-x: auto;
        padding: 4px 8px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-board-selector {
        flex-wrap: nowrap;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-board-btn {
        min-width: 65px;
        padding: 4px 6px;
    }
    
    .daevanion-tab-container.is-fullscreen .board-btn-name {
        font-size: 0.6rem;
    }
    
    .daevanion-tab-container.is-fullscreen .board-btn-progress {
        font-size: 0.55rem;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-fullscreen-btn {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    /* Hide floating effects panel on mobile - too small */
    .daevanion-tab-container.is-fullscreen .daevanion-effects-floating {
        display: none;
    }
    
    /* Hide Shugo.GG logo in fullscreen on mobile */
    .daevanion-tab-container.is-fullscreen .daevanion-floating-logo {
        display: none !important;
    }
    
    /* Adjust board canvas to use full space */
    .daevanion-tab-container.is-fullscreen .daevanion-board-wrapper {
        width: 100vw;
        height: 100vh;
    }
}

/* Small phone fullscreen */
@media (max-width: 480px) {
    .daevanion-tab-container.is-fullscreen .daevanion-header {
        top: 8px;
        left: 8px;
        max-width: calc(100vw - 60px);
        padding: 3px 6px;
        gap: 4px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-board-btn {
        min-width: 55px;
        padding: 3px 5px;
    }
    
    .daevanion-tab-container.is-fullscreen .board-btn-name {
        font-size: 0.55rem;
    }
    
    .daevanion-tab-container.is-fullscreen .board-btn-progress {
        font-size: 0.5rem;
    }
    
    .daevanion-tab-container.is-fullscreen .board-btn-bar {
        height: 2px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-fullscreen-btn {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    /* Hide Shugo.GG logo in fullscreen on small phones */
    .daevanion-tab-container.is-fullscreen .daevanion-floating-logo {
        display: none !important;
    }
    
    /* Node sizes in fullscreen on small screens */
    .daevanion-tab-container.is-fullscreen .daevanion-node {
        width: 20px;
        height: 20px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-node .node-icon {
        width: 14px;
        height: 14px;
    }
    
    /* Fix modal header actions overlap on small screens */
    .modal-header-actions {
        flex-wrap: wrap;
        max-width: 120px;
        justify-content: flex-end;
    }
    
    .modal-favorite {
        order: 2;
    }
    
    .modal-refresh,
    .modal-refresh-compact {
        order: 1;
    }
    
    .modal-close {
        order: 3;
    }
}

/* Very small phones fullscreen */
@media (max-width: 360px) {
    .daevanion-tab-container.is-fullscreen .daevanion-header {
        top: 6px;
        left: 6px;
        max-width: calc(100vw - 50px);
        padding: 2px 4px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-board-btn {
        min-width: 48px;
        padding: 2px 4px;
    }
    
    .daevanion-tab-container.is-fullscreen .board-btn-name {
        font-size: 0.5rem;
    }
    
    .daevanion-tab-container.is-fullscreen .board-btn-progress {
        display: none;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-fullscreen-btn {
        top: 6px;
        right: 6px;
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    /* Hide Shugo.GG logo in fullscreen on very small phones */
    .daevanion-tab-container.is-fullscreen .daevanion-floating-logo {
        display: none !important;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-node {
        width: 18px;
        height: 18px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-node .node-icon {
        width: 12px;
        height: 12px;
    }
}

/* Landscape orientation fullscreen adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .daevanion-tab-container.is-fullscreen .daevanion-header {
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        max-width: 70vw;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-fullscreen-btn {
        top: 8px;
        right: 8px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-effects-floating {
        display: flex;
        width: 160px;
        right: 8px;
        top: 50px;
        bottom: 10px;
    }
    
    .daevanion-tab-container.is-fullscreen .daevanion-effects-floating .daevanion-effects {
        font-size: 0.85rem;
    }
    
    .daevanion-tab-container.is-fullscreen .effects-header-title {
        font-size: 0.7rem;
    }
    
    .daevanion-tab-container.is-fullscreen .effect-tag {
        font-size: 0.55rem;
        padding: 2px 5px;
    }
}

/* ===== MOBILE PROFILE HEADER OPTIMIZATION ===== */
@media (max-width: 768px) {
    .profile-header-section.modal-header {
        padding: 12px;
        gap: 12px;
    }
    
    .modal-header-actions {
        position: absolute;
        top: 6px;
        right: 6px;
        gap: 6px;
    }
    
    .modal-header-actions .modal-favorite,
    .modal-header-actions .modal-share {
        padding: 6px 10px;
        font-size: 0.85em;
    }
    
    .modal-header-actions .fav-label,
    .modal-header-actions .share-label {
        display: none;
    }
    
    .modal-header-actions .modal-close {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .profile-main {
        gap: 12px;
        width: 100%;
    }
    
    .profile-image {
        width: 72px;
        height: 72px;
        border-radius: 10px;
    }
    
    .profile-level {
        font-size: 0.7em;
        padding: 2px 10px;
    }
    
    .profile-name {
        font-size: 1.1em;
    }
    
    .profile-name-row {
        flex-wrap: wrap;
        gap: 6px;
        max-width: calc(100% - 120px);
    }
    
    .profile-server-tag {
        font-size: 0.7em;
        padding: 2px 6px;
    }
    
    .modal-refresh-compact {
        width: 28px;
        height: 28px;
    }
    
    .modal-refresh-compact svg {
        width: 12px;
        height: 12px;
    }
    
    .profile-details {
        font-size: 0.75em;
        gap: 2px;
    }
    
    .profile-class-icon {
        width: 16px;
        height: 16px;
    }
    
    .profile-title {
        font-size: 0.7em;
        margin-bottom: 6px;
    }
    
    .profile-item-level {
        padding: 3px 8px;
        gap: 6px;
    }
    
    .il-label {
        font-size: 0.7em;
    }
    
    .il-value {
        font-size: 0.9em;
    }
    
    /* Header companions (pet/wings) mobile */
    .header-companions {
        width: 100%;
        flex: 1 1 100%;
        gap: 8px;
        margin: 0;
    }
    
    .header-companion-item {
        grid-template-columns: 44px 1fr;
        padding: 8px 10px;
        gap: 4px 10px;
        max-width: none;
        flex: 1 1 calc(50% - 4px);
        min-width: 140px;
    }
    
    .header-companion-icon {
        width: 44px;
        height: 44px;
        border-radius: 8px;
    }
    
    .header-companion-label {
        font-size: 0.65em;
    }
    
    .header-companion-name {
        font-size: 0.8em;
        max-width: 100px;
    }
    
    .header-companion-level {
        font-size: 0.7em;
        padding: 1px 4px;
    }
}

@media (max-width: 480px) {
    .profile-header-section.modal-header {
        padding: 10px;
        gap: 10px;
    }
    
    .modal-header-actions {
        top: 4px;
        right: 4px;
        gap: 4px;
    }
    
    .modal-header-actions .modal-favorite,
    .modal-header-actions .modal-share {
        padding: 5px 8px;
    }
    
    .modal-header-actions .modal-close {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .profile-main {
        gap: 10px;
    }
    
    .profile-image {
        width: 60px;
        height: 60px;
        border-radius: 8px;
    }
    
    .profile-level {
        font-size: 0.65em;
        padding: 2px 8px;
        bottom: -6px;
    }
    
    .profile-name {
        font-size: 1em;
    }
    
    .profile-name-row {
        max-width: calc(100% - 100px);
    }
    
    .profile-server-tag {
        font-size: 0.65em;
    }
    
    .profile-details {
        font-size: 0.7em;
    }
    
    .profile-class-icon {
        width: 14px;
        height: 14px;
    }
    
    .profile-title {
        font-size: 0.65em;
    }
    
    .profile-item-level {
        padding: 2px 6px;
    }
    
    .il-label {
        font-size: 0.65em;
    }
    
    .il-value {
        font-size: 0.85em;
    }
    
    /* Companions stack vertically on very small screens */
    .header-companions {
        flex-direction: column;
        gap: 6px;
    }
    
    .header-companion-item {
        flex: 1 1 100%;
        min-width: 0;
        grid-template-columns: 40px 1fr;
        padding: 6px 8px;
    }
    
    .header-companion-icon {
        width: 40px;
        height: 40px;
    }
    
    .header-companion-name {
        max-width: none;
    }
}