:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --font-main: 'Roboto', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
}

#bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('images/maps-304.png');
    /* Default bg */
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4);
    transition: background-image 0.5s ease;
}

.view.hidden {
    display: none;
}

/* Login View */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Move from center to start */
    min-height: 100vh;
    padding: 10vh 20px 20px;
    /* Add top padding to position it */
}

.login-card {
    background: rgba(30, 41, 59, 0.9);
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    text-align: center;
}

.login-card textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    padding: 10px;
    border-radius: 0.5rem;
    margin: 1rem 0;
    resize: none;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

button:hover {
    background: var(--accent-hover);
}

/* Navigation */
/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.6);
    /* Black transparent */
    backdrop-filter: blur(10px);
    /* Frosted glass */
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ef4444;
    /* Red Title */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.actions button {
    background: rgba(255, 255, 255, 0.1);
    /* Dark transparent buttons */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.actions button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.section-title {
    margin: 2rem 0 1rem;
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
}

.summary-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .summary-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* QQ Group Invitation Card */
.qq-group-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.qq-group-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.qq-group-info {
    flex: 1;
}

.qq-group-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.qq-group-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.qq-group-btn {
    background: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.qq-group-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.qq-group-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.qq-group-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

@media (max-width: 600px) {
    .qq-group-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Map Card Specifics */
.map-card {
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-size: cover;
    background-position: center;
}

.map-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.9));
}

.map-card-content {
    position: relative;
    z-index: 1;
}

.map-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.map-stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.highlight-win {
    color: var(--success);
}

.highlight-loss {
    color: var(--danger);
}

.loading-spinner {
    text-align: center;
    margin-top: 5rem;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Helpers */
.hidden {
    display: none !important;
}

.info-banner {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--accent);
    padding: 1rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: 0.25rem;
}

.official-stats {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 2rem;
}

.recent-stats {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 2rem;
}

/* Match History Section */
.mode-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.mode-tab {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mode-tab.active {
    background: var(--accent);
    color: white;
}

.match-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.match-item {
    background: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.match-item:hover {
    transform: translateX(4px);
}

.match-item.win {
    border-left-color: var(--success);
}

.match-item.loss {
    border-left-color: var(--danger);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.match-mode {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
}

.match-map {
    font-weight: bold;
}

.match-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.match-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.match-stats span {
    color: var(--text-secondary);
}

.match-details {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.match-item.expanded .match-details {
    display: block;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.detail-item {
    text-align: center;
}

.detail-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.detail-item .value {
    font-size: 1.25rem;
    font-weight: bold;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.pagination button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 0.5rem 1rem;
    color: white;
    border-radius: 0.25rem;
    cursor: pointer;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

#page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Player List Details */
.player-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.player-item.self {
    background: rgba(var(--accent-rgb), 0.15);
    border: 1px solid var(--accent);
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #333;
}

.player-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.player-name {
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
}

/* Force display of match items */
.match-item {
    display: block !important;
    min-height: 50px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    margin-bottom: 10px;
}

/* Detail Row Responsive */
.user-detail-row {
    flex-wrap: wrap;
}

.user-detail-row .detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem;
}

@media (max-width: 600px) {
    .user-detail-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Teammate Card Improvements */
.player-list {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
}

.player-item {
    padding: 0.8rem 1rem !important;
    display: flex;
    align-items: center;
}

.player-name {
    font-size: 1.1rem !important;
    margin-bottom: 0.25rem;
}

.player-stats {
    font-size: 0.9rem !important;
    gap: 1rem !important;
}

.player-avatar {
    width: 48px !important;
    height: 48px !important;
}

/* Enhanced Teammate Stats */
.player-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}

.stat-group {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.stat-group.extra {
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.25rem;
    margin-top: 0.25rem;
}

/* Upper Stats Cards to Glassmorphism */
/* Upper Stats Cards to Glassmorphism */
.stat-card.summary-card {
    background-color: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Ensure mode stats cards also match */
.stat-card {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Fix Map Card Backgrounds explicitly */
.stat-card.map-card {
    background-color: transparent;
    /* Let image show */
    background-size: cover !important;
    background-position: center !important;
    border: none !important;
    /* Match other cards border style */
}

/* Enhance grid gaps if needed */
.summary-section {
    gap: 1rem;
}

/* Stronger Gradient Overlay override */
.map-card::before {
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.4) 40%, rgba(15, 23, 42, 0.95) 100%) !important;
}

/* Floating GitHub Button */
.github-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 41, 59, 0.9);
    padding: 10px 16px;
    border-radius: 50px;
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.github-fab:hover {
    background: #24292e;
    /* GitHub Black */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.github-fab img {
    width: 20px;
    height: 20px;
    filter: invert(1);
}

/* Login Layout Updates - Asymmetric */
.login-layout {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 2rem;
}

.login-card {
    position: relative;
    z-index: 2;
    margin: 0 auto;
    /* Ensure no flex shrink */
    flex: 0 0 400px;
    max-width: 400px;
}

.info-card-transparent {
    position: absolute;
    left: 50%;
    top: 0;
    margin-left: 230px;
    /* 200px (half login card) + 30px gap */
    width: 400px;
    max-width: 400px;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(5px);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    text-align: left;
    height: auto;
}

.info-card-transparent h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* ... list styles preserved ... */
.info-card-transparent ul {
    list-style: none;
    padding: 0;
}

.info-card-transparent li {
    margin-bottom: 1.5rem;
}

.info-card-transparent strong {
    color: var(--accent);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: bold;
}

.info-card-transparent p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

@media (max-width: 950px) {
    .login-layout {
        flex-direction: column;
        align-items: center;
        margin-top: 0;
        /* Reset relative positioning if needed */
        display: flex;
    }

    .login-card {
        margin-bottom: 2rem;
    }

    .info-card-transparent {
        position: static;
        margin-left: 0;
        width: 100%;
        max-width: 450px;
    }
}

/* Match History Redesign */
.match-item {
    display: flex !important;
    flex-direction: column;
    padding: 0 !important;
    background: transparent !important;
    /* Fully transparent as requested */
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    /* Lighter separator */
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    transition: background 0.2s;
}

.match-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.match-content-row {
    position: relative;
    /* For absolute centering of toggle */
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    width: 100%;
}

.match-thumb {
    width: 80px;
    height: 48px;
    /* 16:9 ratioish */
    object-fit: cover;
    border-radius: 4px;
    background: #333;
    flex-shrink: 0;
}

.match-info-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    /* Reserve space for center toggle */
    padding-right: 80px;
}

.match-info-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: bold;
}

.text-red {
    color: #ef4444;
    /* Red for Victory as requested (or just result) */
}

.match-mode-text {
    color: #ef4444;
    /* Red as requested */
    font-weight: normal;
    /* Keep normal or make bold? Screenshot implies same visual weight, but normal is fine if color matches. User said "name also red". */
    font-size: 0.95rem;
    /* Match result text size a bit better if needed, or keep 0.85rem */
    margin-left: 4px;
    /* Add slight spacing from result */
}

.match-info-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #cbd5e1;
    /* Light gray */
}

.match-map-name {
    color: #94a3b8;
}

.match-date {
    color: #64748b;
    font-size: 0.8rem;
}

.match-info-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    /* Reserve space for center toggle */
    padding-left: 80px;
}

.match-score-text {
    color: #ef4444;
    /* Red Score */
    font-family: 'Impact', sans-serif;
    /* Try to mimic the blocky font */
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.match-duration-text {
    color: #f1f5f9;
    font-size: 0.9rem;
    font-weight: bold;
}

.match-arrow {
    display: none;
    /* Removed */
}

.match-toggle-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    /* Default color lighter */
    font-size: 0.85rem;
    /* Bigger font */
    cursor: pointer;
    width: 140px;
    /* Fixed width area */
    transition: all 0.2s;
    z-index: 5;
    opacity: 0.7;
}

.match-item:hover .match-toggle-btn {
    opacity: 1;
    color: #f1f5f9;
    /* Bright white on hover */
}

.toggle-text {
    margin-bottom: 4px;
    font-weight: 500;
}

/* Line Arrow Design - Bigger and Brighter */
.toggle-icon {
    width: 10px;
    /* Bigger */
    height: 10px;
    border: solid currentColor;
    /* Inherit color */
    border-width: 0 2px 2px 0;
    /* Thicker */
    transform: rotate(45deg);
    /* Point down */
    transition: transform 0.3s;
    margin-bottom: 2px;
}

/* Expanded State */
.match-item.expanded .toggle-icon {
    transform: rotate(-135deg);
    /* Point up */
    margin-top: 6px;
    border-color: var(--accent);
    /* Highlight when open */
}

.match-item.expanded .match-toggle-btn {
    color: var(--accent);
    /* Blue text when open */
    opacity: 1;
}

.match-item.expanded .toggle-text {
    display: none;
}

.match-item.expanded .match-toggle-btn::before {
    content: "收起详细数据";
    margin-bottom: 4px;
    font-weight: bold;
}

/* Simplified Text Logic */
.toggle-text {
    font-size: 0;
}

.toggle-text::after {
    content: "展开详细数据";
    font-size: 0.85rem;
    /* Bigger */
}

.match-item.expanded .toggle-text::after {
    content: "收起详细数据";
}

/* Details container */
.match-details {
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 0 !important;
    padding: 1rem;
}

/* ============ Navigation Tabs ============ */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    background: transparent;
    border: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

/* ============ Stats Layout with Sidebar ============ */
.stats-layout {
    position: relative;
    margin-top: 1rem;
}

.stats-main {
    width: 100%;
}

/* ============ Fragment Progress Sidebar ============ */
/* ============ Fragment Progress Sidebar ============ */
.progress-sidebar {
    position: fixed;
    right: 20px;
    top: 80px;
    width: 300px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 100;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.progress-sidebar h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-icon {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px;
}

.progress-info {
    flex: 1;
    min-width: 0;
}

.progress-name {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-bar-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-bar-fill.complete {
    background: var(--success);
}

.progress-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* ============ Collection Grid ============ */
.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.collection-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.filter-btn.legendary.active {
    background: #f59e0b;
    border-color: #f59e0b;
}

.filter-btn.epic.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.filter-btn.rare.active {
    background: #3b82f6;
    border-color: #3b82f6;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.collection-item {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.collection-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.collection-item.not-owned {
    opacity: 0.4;
    filter: grayscale(0.8);
}

.collection-item-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
}

.collection-item-info {
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.3);
}

.collection-item-name {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-item-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: bold;
}

.badge-legendary {
    background: #f59e0b;
    color: #000;
}

.badge-epic {
    background: #8b5cf6;
    color: #fff;
}

.badge-rare {
    background: #3b82f6;
    color: #fff;
}

.badge-common {
    background: #6b7280;
    color: #fff;
}

/* ============ Responsive for new layout ============ */
@media (max-width: 1200px) {
    .progress-sidebar {
        display: none;
    }
}

@media (max-width: 900px) {
    .navbar {
        flex-wrap: wrap;
    }

    .nav-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}