@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

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

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    line-height: 1.5;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 500;
    z-index: 1000;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

.notification.error {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.notification.success {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.notification.warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.content-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 50px;
}

h1 {
    font-size: 3em;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.1em;
    color: #888;
    font-weight: 400;
    margin-bottom: 0;
}

/* Search Section */
.search-section {
    margin-bottom: 50px;
    text-align: center;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto 20px;
    gap: 8px;
    position: relative;
}

.search-box input {
    flex: 1;
    padding: 18px 24px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    color: #fff;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.search-box input::placeholder {
    color: #555;
}

.search-box input:focus {
    outline: none;
    border-color: #5a5a5a;
    background: #1f1f1f;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.2),
        0 0 0 3px rgba(255, 255, 255, 0.1);
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 32px;
    background: #ffffff;
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.search-btn:hover {
    background: #e0e0e0;
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 60px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.search-suggestion-item {
    padding: 12px 16px;
    border-bottom: 1px solid #222;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item.highlighted {
    background: rgba(255, 255, 255, 0.05);
}

.search-suggestion-item.highlighted {
    border-left: 3px solid #9147ff;
}

.suggestion-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #333;
    object-fit: cover;
    background: #2a2a2a;
    flex-shrink: 0;
}

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

.suggestion-username {
    font-size: 0.9em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.suggestion-display-name {
    font-size: 0.8em;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-badges {
    font-size: 0.8em;
    color: #9147ff;
    white-space: nowrap;
    font-weight: 500;
}

.search-suggestions:empty {
    display: none;
}

.suggestions-header {
    padding: 8px 16px;
    background: #2a2a2a;
    border-bottom: 1px solid #333;
    color: #888;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestions-loading {
    padding: 16px;
    text-align: center;
    color: #888;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.suggestions-footer {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid #333;
    color: #666;
    font-size: 0.75em;
    text-align: center;
    font-style: italic;
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-top: 2px solid #9147ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.suggestion-username mark,
.suggestion-display-name mark {
    background: rgba(145, 71, 255, 0.3);
    color: #fff;
    border-radius: 2px;
    padding: 1px 2px;
    font-weight: 600;
}

.quick-examples {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: #888;
}

.example-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    color: #bbb;
    border: 1px solid #333;
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.example-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #444;
    color: #fff;
}

/* Stats Overview */
.stats-overview {
    margin-bottom: 50px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    transition: background 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    background: #1f1f1f;
    border-color: #3a3a3a;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.stat-icon svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1;
}

.stat-label {
    font-size: 0.85em;
    color: #888;
    font-weight: 500;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.main-area {
    min-width: 0;
}

/* Sidebar Sections */
.section {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a2a;
    background: #171717;
}

.section-header h2 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h2 svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.refresh-mini-btn {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-mini-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.refresh-mini-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Leaderboard */
.leaderboard {
    padding: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid #222;
    transition: background 0.2s ease;
    cursor: pointer;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.rank {
    font-weight: 700;
    color: #fbbf24;
    min-width: 24px;
    font-size: 0.9em;
}

.rank.gold {
    color: #fbbf24;
}

.rank.silver {
    color: #e5e7eb;
}

.rank.bronze {
    color: #f97316;
}

.leaderboard-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
    background: #2a2a2a;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
    position: relative;

}

.leaderboard-avatar:hover {
    opacity: 0.9;
}

.leaderboard-avatar.loading {
    background: linear-gradient(-45deg, #2a2a2a, #3a3a3a, #2a2a2a, #3a3a3a);
    background-size: 400% 400%;
    animation: avatarLoading 1.5s ease-in-out infinite;
}

@keyframes avatarLoading {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

.leaderboard-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-name.staff {
    background: linear-gradient(
        90deg,
        #9147ff,
        #ffd700,
        #9147ff,
        #ffd700,
        #9147ff
    );
    background-size: 400% 100%;
    animation: staffGradient 4s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.leaderboard-name.special1 {
    background: linear-gradient(90deg, #ff69b4, #9370db, #ff69b4);
    background-size: 200% 100%;
    animation: special1Gradient 3s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.leaderboard-badges {
    font-size: 0.8em;
    color: #888;
}

/* Rare Badges */
.rare-badges {
    padding: 16px;
    min-height: 200px;
    position: relative;
}

.rare-badge-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
    position: relative;
}

.rare-badge-item:last-child {
    margin-bottom: 0;
}

.rare-badge-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rare-badge-image {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    background: #2a2a2a;
    display: block;
    flex-shrink: 0;
}

.rare-badge-info {
    flex: 1;
    min-width: 0;
}

.rare-badge-title {
    font-size: 0.8em;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rare-badge-rarity {
    font-size: 0.75em;
    color: #888;
}

.rare-badge-hint {
    font-size: 0.7em;
    color: #666;
    margin-top: 2px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rare-badge-hint svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    flex-shrink: 0;
}

.rare-badge-item:hover .rare-badge-hint {
    opacity: 1;
    color: #9147ff;
}

.hint-mobile {
    display: none;
}

.hint-desktop {
    display: inline;
}

.rare-badge-item .rare-badge-image[src=""] {
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rare-badge-item .rare-badge-image[src=""]:before {
    content: "?";
    color: #666;
    font-size: 14px;
}

/* Badge Owners Tooltip */
.badge-owners-tooltip {
    position: absolute;
    right: -320px;
    top: 0;
    width: 300px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-size: 0.85em;
    pointer-events: none;
}

/* Tooltip positioning for edge cases */
.rare-badge-item:nth-last-child(-n + 3) .badge-owners-tooltip {
    right: auto;
    left: -320px;
}

.sidebar .badge-owners-tooltip {
    max-width: 280px;
    width: 280px;
}

.owners-header {
    padding: 12px 16px;
    background: #2a2a2a;
    border-bottom: 1px solid #333;
    font-weight: 600;
    color: #fff;
    border-radius: 8px 8px 0 0;
}

.owners-list {
    max-height: 280px;
    overflow-y: auto;
}

.owner-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.owner-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.owner-avatar {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    background: #333;
    flex-shrink: 0;
}

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

.owner-username {
    font-weight: 500;
    color: #fff;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.owner-display-name {
    color: #888;
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.owner-badges {
    color: #9147ff;
    font-weight: 600;
    font-size: 0.8em;
    flex-shrink: 0;
}

.owners-loading,
.owners-error,
.owners-empty {
    padding: 16px;
    text-align: center;
    color: #888;
    font-style: italic;
}

.owners-error {
    color: #ff6b6b;
}

.owners-more {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid #333;
    text-align: center;
    color: #888;
    font-size: 0.75em;
    font-style: italic;
    border-radius: 0 0 8px 8px;
}

/* Modal Badge Owners */
.modal-owner-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.modal-owner-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.modal-owner-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: #333;
    flex-shrink: 0;
}

.modal-owner-info {
    flex: 1;
    min-width: 0;
}

.modal-owner-username {
    font-weight: 500;
    color: #fff;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.modal-owner-display-name {
    color: #888;
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.modal-owner-badges {
    color: #9147ff;
    font-weight: 600;
    font-size: 0.75em;
}

.loading-mini {
    padding: 24px;
    text-align: center;
    color: #888;
    font-size: 0.9em;
}

/* User Section */
.user-section .section-header {
    border-bottom: none;
    padding: 0;
    background: transparent;
}

.user-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 32px;
    background: linear-gradient(135deg, #1a1a1a 0%, #171717 100%);
    border-bottom: 1px solid #2a2a2a;
    gap: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #3a3a3a;
    flex-shrink: 0;
    object-fit: cover;
    background: #2a2a2a;
}

.user-details h2 {
    font-size: 2em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.user-details h2.staff {
    background: linear-gradient(
        90deg,
        #9147ff,
        #ffd700,
        #9147ff,
        #ffd700,
        #9147ff
    );
    background-size: 400% 100%;
    animation: staffGradient 4s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.user-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 0.9em;
}

.user-id {
    color: #666;
    font-family: monospace;
}

.user-rank {
    color: #666;
    font-family: monospace;
}

.user-details h2.special1 {
    background: linear-gradient(90deg, #ff69b4, #9370db, #ff69b4);
    background-size: 200% 100%;
    animation: special1Gradient 3s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

@keyframes staffGradient {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 400% 0%;
    }
}

@keyframes special1Gradient {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

.user-stats {
    display: flex;
    gap: 24px;
}

.user-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.user-stat span:first-child {
    font-size: 1.4em;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.user-stat span:last-child {
    font-size: 0.8em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.refresh-btn,
.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.refresh-btn:hover,
.share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #4a4a4a;
}

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

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* Badge Categories */
.badge-categories {
    padding: 24px 32px;
    border-bottom: 1px solid #2a2a2a;
}

.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    border-radius: 20px;
    color: #888;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.2s ease;
}

.category-tab:hover,
.category-tab.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: #444;
    color: #fff;
}

.category-tab .count {
    margin-left: 6px;
    opacity: 0.7;
}

/* Badge Grid */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 32px;
}

.badge-card {
    padding: 24px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    transition: background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.badge-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4ade80, #3b82f6, #8b5cf6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.badge-card:hover {
    background: #1f1f1f;
    border-color: #4a4a4a;
}

.badge-card:hover::before {
    transform: scaleX(1);
}

.badge-card:active {
    background: #151515;
}

.badge-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.badge-image {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    flex-shrink: 0;
    background: #2a2a2a;

    object-fit: cover;
    display: block;
}



.badge-title {
    flex: 1;
    min-width: 0;
}

.badge-title strong {
    color: #fff;
    font-weight: 600;
    font-size: 1.1em;
    display: block;
    margin-bottom: 6px;
    line-height: 1.3;
}

.badge-id {
    color: #666;
    font-size: 0.8em;
    font-family: monospace;
}

.badge-description {
    font-size: 0.9em;
    color: #bbb;
    line-height: 1.5;
    margin-bottom: 16px;
}

.badge-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.badge-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #151515;
    border-radius: 6px;
    font-size: 0.8em;
}

.badge-meta-label {
    color: #888;
    font-weight: 500;
}

.badge-meta-value {
    color: #fff;
    font-weight: 600;
}

.rarity-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    font-size: 0.75em;
    color: #fbbf24;
    font-weight: 500;
}

.rarity-indicator.common {
    background: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.3);
    color: #9ca3af;
}

.rarity-indicator.rare {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.rarity-indicator.epic {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
}

.rarity-indicator.legendary {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

/* Show More Button */
.show-more-container {
    display: flex;
    justify-content: center;
    padding: 32px;
}

.show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.show-more-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #5a5a5a;
}

.show-more-count {
    opacity: 0.7;
    font-weight: 400;
}

/* Loading States */
.loading-state {
    text-align: center;
    padding: 100px 20px;
}

.loading-spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid #2a2a2a;
    border-top-color: #fff;
    border-right-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

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

.loading-state p {
    color: #888;
    font-size: 1.1em;
    margin-bottom: 12px;
}

.loading-details {
    font-size: 0.9em;
    color: #666;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 40px;
}

.empty-icon {
    margin-bottom: 20px;
    opacity: 0.6;
    display: flex;
    justify-content: center;
}

.empty-icon svg {
    width: 64px;
    height: 64px;
    stroke: currentColor;
}

.empty-state h3 {
    font-size: 2em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

.empty-state p {
    color: #888;
    font-size: 1.1em;
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.empty-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 8px;
}

.feature-icon {
    margin-right: 12px;
    opacity: 0.8;
    display: flex;
    align-items: center;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;

}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid #2a2a2a;
    background: #171717;
}

.modal-header h3 {
    font-size: 1.5em;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
}

/* Special Heart Emoji */
.special-heart {
    cursor: default;
    font-size: 1em;
    display: inline-block;
    position: relative;
    background: none !important;
    background-image: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    color: inherit !important;
    animation: none !important;
}

/* Tooltip for heart emoji - positioned via JavaScript */
.heart-tooltip {
    position: fixed;
    background: #1a1a1a;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    white-space: nowrap;
    z-index: 10000;
    border: 1px solid #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.heart-tooltip.visible {
    opacity: 1;
}

.heart-tooltip::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 280px 1fr;
        gap: 30px;
    }

    .badge-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sidebar {
        order: 2;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }

    .main-area {
        order: 1;
    }
}

@media (max-width: 768px) {
    .content-container {
        padding: 20px 16px;
    }

    .sidebar {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    h1 {
        font-size: 2.2em;
    }

    .search-box {
        flex-direction: column;
        max-width: none;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }

    .user-header {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .user-info {
        justify-content: center;
        text-align: center;
    }

    .user-actions {
        justify-content: center;
    }

    .badge-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 16px;
    }

    .rare-badge-item {
        flex-direction: row;
        align-items: center;
        gap: 16px;
        padding: 16px;
        margin-bottom: 8px;
    }

    .rare-badge-image {
        width: 32px;
        height: 32px;
    }

    .rare-badge-title {
        font-size: 0.9em;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
    }

    .rare-badge-rarity {
        font-size: 0.7em;
        margin-top: 4px;
    }

    .rare-badge-hint {
        font-size: 0.65em;
    }

    .rare-badge-hint svg {
        width: 10px;
        height: 10px;
    }

    .hint-desktop {
        display: none;
    }

    .hint-mobile {
        display: inline;
    }

    .rare-badges {
        min-height: 150px;
        padding: 12px;
    }

    .badge-owners-tooltip {
        right: -280px;
        width: 260px;
        pointer-events: auto;
    }

    /* Mobile tooltip positioning */
    .rare-badge-item:last-child .badge-owners-tooltip,
    .rare-badge-item:nth-last-child(2) .badge-owners-tooltip {
        right: auto;
        left: -260px;
    }

    .owner-item {
        padding: 6px 12px;
        gap: 10px;
    }

    .owner-avatar {
        width: 20px;
        height: 20px;
    }

    .loading-mini {
        padding: 12px;
        min-height: 50px;
        font-size: 0.75em;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .modal-content {
        width: 100%;
        margin: 0;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        min-height: auto;
        border-radius: 8px;
    }

    .modal-header,
    .modal-body {
        padding: 16px;
    }

    .modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .modal-owner-item {
        padding: 8px;
        gap: 8px;
    }

    .modal-owner-avatar {
        width: 28px;
        height: 28px;
    }

    .modal-owner-username {
        font-size: 0.8em;
    }

    .modal-owner-display-name {
        font-size: 0.7em;
    }

    .modal-owner-badges {
        font-size: 0.7em;
    }

    #modalBadgeOwners > div {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .user-stats {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .badge-meta {
        grid-template-columns: 1fr;
    }

    .quick-examples {
        flex-direction: column;
        gap: 8px;
    }

    .rare-badge-item {
        gap: 12px;
        padding: 12px;
    }

    .rare-badge-image {
        width: 28px;
        height: 28px;
    }

    .rare-badge-title {
        font-size: 0.8em;
        line-height: 1.3;
    }

    .rare-badge-rarity {
        font-size: 0.7em;
    }

    .rare-badge-hint {
        font-size: 0.6em;
    }

    .rare-badge-hint svg {
        width: 9px;
        height: 9px;
    }

    .hint-desktop {
        display: none;
    }

    .hint-mobile {
        display: inline;
    }

    .badge-owners-tooltip {
        right: -240px;
        width: 220px;
        font-size: 0.8em;
        pointer-events: auto;
        max-height: 300px;
        overflow-y: auto;
    }

    /* Mobile positioning adjustments */
    .rare-badge-item:last-child .badge-owners-tooltip,
    .rare-badge-item:nth-last-child(2) .badge-owners-tooltip {
        right: auto;
        left: -220px;
    }

    /* Prevent tooltip from going off-screen */
    .badge-owners-tooltip {
        transform: translateX(-10px);
    }

    .rare-badge-item:last-child .badge-owners-tooltip,
    .rare-badge-item:nth-last-child(2) .badge-owners-tooltip {
        transform: translateX(10px);
    }

    .owners-header {
        padding: 8px 12px;
        font-size: 0.8em;
    }

    .owner-item {
        padding: 6px 12px;
        gap: 8px;
    }

    .owner-username {
        font-size: 0.8em;
    }

    .owner-display-name {
        font-size: 0.7em;
    }

    .owner-badges {
        font-size: 0.7em;
    }

    .main-content {
        gap: 16px;
    }

    .section {
        margin-bottom: 16px;
    }

    .section-header h2 {
        font-size: 1.2em;
    }

    .leaderboard-item {
        padding: 12px;
        gap: 12px;
    }

    .leaderboard-avatar {
        width: 36px;
        height: 36px;
    }

    .modal-close {
        font-size: 24px;
        padding: 8px;
    }
}
