/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    background-color: #0f172a; /* Fallback color */
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    transition: background-image 0.5s ease-in-out;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
    color: #fff;
    margin: 0;
    padding: 10px;
    font-size: 14px;
    min-height: 100vh;
}

/* Main container styling */
.container {
    position: relative;
    z-index: 2;
    background-color: rgba(15, 23, 42, 0.8); /* Semi-transparent background for content */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 95%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.37);
}

/* Header Buttons Container */
.header-buttons {
    position: absolute;
    top: 10px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .header-buttons {
        flex-wrap: wrap;
        gap: 8px;
        top: 5px;
        right: 10px;
    }
}

/* Unified Button Style */
.header-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: 'Lilita One', cursive;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-decoration: none;
    display: inline-block;
}

.header-btn:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

/* Side Panel for Background Picker */
.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background-color: #0f172a;
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease-out;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    border-left: 2px solid #3b82f6;
    opacity: 0;
}

.side-panel.is-open {
    transform: translateX(0);
    opacity: 1;
}

.side-panel h2 {
    font-family: 'Lilita One', cursive;
    color: #fbbf24;
    text-align: center;
    padding: 20px;
    margin: 0;
    background-color: #1e293b;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.2);
    border: none;
    border-radius: 50%;
    color: #e2e8f0;
    font-size: 2rem;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    background: #ef4444;
    color: #fff;
    transform: rotate(90deg);
}

.previews-container {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
}

.background-preview {
    cursor: pointer;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s, transform 0.2s;
    position: relative;
}

.background-preview:hover {
    transform: scale(1.03);
    border-color: #3b82f6;
}

.background-preview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.background-preview .preview-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px;
    text-align: center;
    font-size: 1rem;
    font-family: 'Lilita One', cursive;
    transition: background-color 0.3s;
}

.background-preview:hover .preview-name {
    background: rgba(59, 130, 246, 0.8);
}

/* Headings */
h1 {
    text-align: center;
    color: #fbbf24;
    text-shadow: 3px 3px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
    letter-spacing: 3px;
    font-size: 42px;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
    margin-top: 10px;
}

h2 {
    text-align: center;
    color: #e2e8f0;
    text-shadow: 2px 2px 0 #000;
    font-size: 28px;
    margin: 25px 0 15px 0;
    position: relative;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 2px;
}

/* Search bar styling */
.search-container {
    text-align: center;
    margin: 20px 0 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

#player-tag-input {
    padding: 14px 20px;
    font-size: 18px;
    border-radius: 25px;
    border: 3px solid #3b82f6;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    width: 280px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.7), 0 0 15px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

#player-tag-input:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.7), 0 0 20px rgba(251, 191, 36, 0.5);
}

#player-tag-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#search-button, #use-previous-button {
    padding: 14px 24px;
    font-size: 18px;
    border-radius: 25px;
    border: none;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#search-button {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    box-shadow: 0 6px 0 #d97706, 0 8px 15px rgba(0,0,0,0.3);
}

#use-previous-button {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 6px 0 #1d4ed8, 0 8px 15px rgba(0,0,0,0.3);
    display: none;
}

#search-button:hover, #use-previous-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #d97706, 0 12px 20px rgba(0,0,0,0.4);
}

#search-button:active, #use-previous-button:active {
    transform: translateY(6px);
    box-shadow: 0 0 0, 0 4px 8px rgba(0,0,0,0.2);
}

/* Layout toggle button */
.layout-toggle-container {
    text-align: center;
    margin: 15px 0 25px 0;
}

#layout-toggle-button {
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 20px;
    border: none;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
    cursor: pointer;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    box-shadow: 0 4px 0 #5b21b6, 0 6px 12px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#layout-toggle-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #5b21b6, 0 10px 16px rgba(0,0,0,0.4);
}

#layout-toggle-button:active {
    transform: translateY(4px);
    box-shadow: 0 0 0, 0 4px 8px rgba(0,0,0,0.2);
}

/* Player summary container (main box) */
.player-summary-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 32px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    border-radius: 20px;
    padding: 25px 40px 25px 40px;
    border: 3px solid #fbbf24;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.4), inset 0 0 30px rgba(0,0,0,0.7);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.player-summary-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #fbbf24);
    border-radius: 20px 20px 0 0;
}

/* Top profile row: Main Avatar, Secondary Avatars, Name/Title, and Stats */
.top-profile-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 32px;
    width: 100%;
    padding-bottom: 0;
    border-bottom: none;
    flex-wrap: nowrap;
}

/* Player Identity section (Avatar, Secondary Avatars, Name, Title) */
.player-identity {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    min-width: 320px;
}

.player-identity .player-avatar-main {
    width: 110px !important;
    height: 110px !important;
    min-width: 110px;
    min-height: 110px;
    max-width: 110px;
    max-height: 110px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
    background: #181e2a;
}

/* Secondary Avatars - on the right of main avatar, left of name, stacked vertically */
.secondary-avatars-inline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.secondary-avatars-inline .player-avatar-secondary {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    background: #181e2a;
    transition: all 0.3s ease;
}

.secondary-avatars-inline .player-avatar-secondary:hover {
    transform: scale(1.1);
    border-color: #fbbf24;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.player-identity .player-name-container {
    flex-grow: 1;
    min-width: 120px;
}

.player-identity h2 {
    text-align: left;
    margin: 0 0 5px 0;
    font-size: 36px;
    color: #fbbf24;
    text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    letter-spacing: 2px;
}

.player-identity h2::after {
    display: none; /* Remove h2 specific underline */
}

/* Player Title "Cool Cat" - now basic yellow and better alignment */
.player-identity #player-title {
    text-align: left;
    margin: 2px 0 0 0;
    font-size: 18px;
    color: #fbbf24;
    font-weight: normal;
    letter-spacing: 0.5px;
    opacity: 1;
    line-height: 1.2;
    padding-left: 2px;
    text-shadow: none;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

/* Stats Display Area (not in boxes, two rows) */
.stats-no-boxes {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 18px;
    min-width: 500px;
    max-width: 900px;
}

.stats-row-1, .stats-row-2 {
    display: flex;
    flex-wrap: nowrap;
    gap: 40px 40px;
    justify-content: flex-start;
    align-items: center;
}

/* Individual stat item styling - no boxes */
.stat-item-no-box {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0;
    background: none;
    border: none;
    box-shadow: none;
    transition: none;
    position: static;
    overflow: visible;
}

.stat-item-no-box::before {
    display: none; /* Remove pseudo-element border */
}

.stat-item-no-box:hover {
    transform: none; /* Remove hover transform */
    border-color: initial;
    box-shadow: none;
}

.stat-item-no-box h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #fbbf24;
    text-shadow: 1px 1px 0 #000;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.stat-item-no-box p, .stat-item-no-box .club-info, .stat-item-no-box .rank-display {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #e2e8f0;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
    overflow: hidden; /* Hides any content that overflows */
    white-space: nowrap; /* Keeps content on a single line */
    text-overflow: ellipsis; /* Adds "..." if text is truncated */
}

/* Ensuring consistent icon sizing for stat items */
.stat-item-no-box img,
.club-info img,
.rank-display img {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
    background: #181e2a;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    flex-shrink: 0; /* Ensures the image doesn't shrink */
}

.rank-display .rank-text {
    font-size: 16px;
    color: #e2e8f0;
    text-shadow: 1px 1px 0 #000;
    margin-left: 4px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.rank-display .rank-points {
    font-size: 14px;
    color: #94a3b8;
    text-shadow: 1px 1px 0 #000;
    margin-left: 2px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

/* Gradient bar at the bottom of the player summary container */
.gradient-bar {
    width: calc(100% + 60px);
    height: 6px;
    background: linear-gradient(90deg, #6a00ff, #ff00ea, #6a00ff);
    border-radius: 0 0 16px 16px;
    position: absolute;
    bottom: 0;
    left: -30px;
    right: -30px;
}

/* Section divider */
.section-divider {
    border: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fbbf24, transparent);
    margin: 30px 0 20px 0;
    border-radius: 2px;
}

/* Sort container */
.sort-container {
    display: flex;
    justify-content: center; /* Changed to center */
    align-items: center;
    gap: 15px; /* Added gap */
    margin-bottom: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    border-radius: 12px;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.sort-container label {
    color: #fbbf24;
    font-size: 16px;
    text-shadow: 1px 1px 0 #000;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

#sort-brawlers {
    padding: 10px 15px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    border: 2px solid #3b82f6;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Toggle switch styles */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Round sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* COMPACT BRAWLER GRID - MULTI-COLUMN LAYOUT */
.brawler-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    padding: 10px 0;
}

/* CLASSIC LAYOUT - FULL WIDTH ROWS */
.brawler-grid.classic-layout {
    display: block;
    padding: 10px 0;
}

.brawler-grid.classic-layout .brawler-card {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Default background for classic layout, will be overridden by rank-tier classes */
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 8px;
    border: 2px solid #3b82f6;
    will-change: transform, border-color;
    min-height: 80px;
    width: 100%;
    position: relative;
    overflow: visible; /* Changed to visible */
}

.brawler-grid.classic-layout .brawler-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.brawler-grid.classic-layout .brawler-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
    border-color: #fbbf24;
}

.brawler-grid.classic-layout .brawler-card:hover::before {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.brawler-grid.classic-layout .brawler-icon-container {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.brawler-grid.classic-layout .brawler-card img.brawler-icon {
    width: 70px;
    height: 70px;
    border-radius: 10px;
}

.brawler-grid.classic-layout .brawler-icon-container .rank-icon {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 26px;
    height: 26px;
    border: 2px solid #000;
    border-radius: 50%;
}

.brawler-grid.classic-layout .brawler-info {
    flex-grow: 1;
    min-width: 0;
    margin-right: 20px;
}

.brawler-grid.classic-layout .brawler-info h3 {
    margin: 0 0 8px 0;
    color: #e2e8f0;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 1px 1px 1px #000;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.brawler-grid.classic-layout .brawler-stats {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.brawler-grid.classic-layout .brawler-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 1px black;
    white-space: nowrap;
    padding: 3px 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.brawler-grid.classic-layout .mastery-container {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}

.brawler-grid.classic-layout .mastery-icon-container {
    position: relative;
    width: 24px;
    height: 24px;
}

.brawler-grid.classic-layout .mastery-icon-container .mastery-tier {
    font-size: 12px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.brawler-grid.classic-layout .brawler-abilities {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.brawler-grid.classic-layout .ability-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.brawler-grid.classic-layout .ability-icon img {
    max-width: 75%;
    max-height: 75%;
    border-radius: 6px;
}

.brawler-grid.classic-layout .gear-icon {
    width: 28px;
    height: 28px;
    border: 2px solid #64748b;
    border-radius: 50%;
    background: linear-gradient(135deg, #374151, #4b5563);
    padding: 3px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.brawler-card {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Default background, will be overridden by rank-tier classes */
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 12px;
    padding: 12px;
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: transform 0.2s ease, border-color 0.2s ease;
    will-change: transform, border-color;
    min-height: 70px;
    position: relative;
    overflow: visible; 
}

.brawler-rank {
    font-size: 0.9em; /* Adjust font size relative to parent */
    color: #e2e8f0;
    text-shadow: 1px 1px 1px #000;
    white-space: nowrap; /* Keep the text on a single line */
    overflow: hidden; /* Hide any text that goes beyond the single line */
    text-overflow: ellipsis; /* Show "..." for hidden text */
    margin-left: auto; /* Push the rank to the right, if in a flex row */
    padding-left: 5px;
    font-family: 'Lilita One', cursive;
    flex-shrink: 0; /* Prevent it from shrinking */
    min-width: fit-content; /* Ensure it takes at least enough width for its content */
}


.brawler-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.brawler-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
    border-color: #fbbf24;
}

.brawler-card:hover::before {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.brawler-icon-container {
    position: relative;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.brawler-card img.brawler-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
}

.brawler-icon-container .rank-icon {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 24px;
    height: 24px;
    border: 2px solid #000;
    border-radius: 50%;
}

.brawler-info {
    flex-grow: 1;
    min-width: 0;
    margin-right: 10px;
}

.brawler-info h3 {
    margin: 0 0 6px 0;
    color: #e2e8f0;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 1px 1px 1px #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.brawler-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.brawler-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 1px black;
    white-space: nowrap;
    padding: 2px 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.brawler-stats img {
    width: 18px;
    height: 18px;
}

.mastery-container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
}

.mastery-icon-container {
    position: relative;
    width: 22px;
    height: 22px;
}

.mastery-icon-container .mastery-bg {
    width: 100%;
    height: 100%;
}

.mastery-icon-container .mastery-tier {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 1px black;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.brawler-abilities {
    display: flex;
    gap: var(--ability-gap, 6px);
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ability-icon {
    position: relative;
    width: var(--ability-icon-size, 28px);
    height: var(--ability-icon-size, 28px);
    display: flex;
    align-items: center;
    justify-content: center;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.ability-icon.star-power {
    background-image: url('/images/star_power_blank.webp');
    background-size: contain;
}

.ability-icon.gadget {
    background-image: url('/images/gadget_blank.webp');
    background-size: contain;
}

.ability-icon img {
    max-width: 70%;
    max-height: 70%;
    border-radius: 4px;
}

.gear-icon {
    width: var(--gear-icon-size, 24px);
    height: var(--gear-icon-size, 24px);
    border: 2px solid #64748b;
    border-radius: 50%;
    background: linear-gradient(135deg, #374151, #4b5563);
    padding: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.brawler-card.locked {
    filter: grayscale(100%) brightness(0.6);
    opacity: 0.6;
}

.brawler-card.locked:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.loading-message, .unavailable-message {
    text-align: center;
    font-size: 24px;
    padding: 40px;
    color: #fbbf24;
    text-shadow: 2px 2px 0 #000;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.api-source-message {
    text-align: center;
    padding: 12px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.2));
    border: 2px solid #fbbf24;
    border-radius: 10px;
    color: #fbbf24;
    font-size: 16px;
    text-shadow: 1px 1px 0 #000;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

/* These original styles for rank display are for separate cards,
   they might not be needed or need adjustment based on final design decision
   for current/highest rank display in the combined box.
   Keeping them as display: none for now as per screenshot. */
#player-rank-card p {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

#player-rank-card img {
    height: 45px;
    margin-top: 8px;
}

#player-current-rank img, #player-highest-rank img {
    height: 45px;
}

#player-current-rank p, #player-highest-rank p {
    margin: 6px 0 0 0;
    font-size: 18px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

/* Responsive Design */
@media (max-width: 1200px) {
    .brawler-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    .player-summary-container {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 8px 18px 8px;
    }
    .top-profile-row {
        flex-direction: column;
        gap: 18px;
    }
    .stats-no-boxes {
        min-width: 0;
        max-width: 100%;
    }
}

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

    h1 {
        font-size: 32px;
        margin-top: 24px;
    }

    .search-container {
        flex-direction: column;
        gap: 10px;
    }

    #player-tag-input {
        width: 100%;
        max-width: 300px;
    }

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

    .sort-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .brawler-card {
        min-height: 65px;
    }

    .brawler-abilities {
        flex-direction: column;
        gap: 4px;
    }

    .brawler-grid.classic-layout .brawler-card {
        min-height: 70px;
        padding: 12px 15px;
    }

    .brawler-grid.classic-layout .brawler-icon-container {
        width: 50px;
        height: 50px;
    }

    .brawler-grid.classic-layout .brawler-card img.brawler-icon {
        width: 50px;
        height: 50px;
    }

    .brawler-grid.classic-layout .brawler-info h3 {
        font-size: 16px;
    }

    .brawler-grid.classic-layout .brawler-stats span {
        font-size: 13px;
    }

    .brawler-grid.classic-layout .brawler-abilities {
        gap: 6px;
    }

    /* Responsive for top profile row */
    .top-profile-row {
        flex-direction: column; /* Stack top elements vertically on small screens */
        gap: 15px;
        align-items: center; /* Center content when stacked */
    }
    /* Secondary avatars in player identity also stack vertically */
    .player-identity {
        flex-direction: column; /* Stack avatar + secondary + name/title vertically */
        text-align: center;
    }
    .secondary-avatars-inline {
        flex-direction: row; /* Secondary avatars can go horizontal on small screens */
        justify-content: center;
    }
    .player-identity h2, .player-identity #player-title {
        text-align: center; /* Center name/title when stacked */
    }
    .stats-no-boxes {
        width: 100%; /* Take full width */
        gap: 8px; /* Reduce gap between rows */
    }
    .stats-row-1, .stats-row-2 {
        justify-content: center; /* Center stat items */
        gap: 15px 20px; /* Smaller gaps */
    }
    .stat-item-no-box {
        padding: 5px; /* Adjust padding if needed */
    }
    .stat-item-no-box h3 {
        font-size: 13px;
    }
    .stat-item-no-box p, .stat-item-no-box .club-info, .stat-item-no-box .rank-display {
        font-size: 15px;
    }
    .stat-item-no-box img,
    .club-info img,
    .rank-display img {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px;
        min-height: 22px;
        max-width: 22px;
        max-height: 22px;
    }
}

@media (max-width: 480px) {
    .player-identity .player-avatar-main {
        width: 80px !important;
        height: 80px !important;
        min-width: 80px;
        min-height: 80px;
        max-width: 80px;
        max-height: 80px;
    }
    .player-identity h2 {
        font-size: 28px;
    }
    .player-identity #player-title {
        font-size: 18px;
    }
    .secondary-avatars-inline .player-avatar-secondary {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px;
        min-height: 32px;
        max-width: 32px;
        max-height: 32px;
    }
    .stats-row-1, .stats-row-2 {
        gap: 10px 15px; /* Even smaller gaps on very small screens */
    }
    .stat-item-no-box img,
    .club-info img,
    .rank-display img {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px;
        min-height: 22px;
        max-width: 22px;
        max-height: 22px;
    }
}

/* Animation for loading */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-message {
    animation: pulse 2s infinite;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

/* Responsive: allow wrapping on very small screens */
@media (max-width: 600px) {
    .brawler-abilities .star-power img {
        max-width: 60%;
        max-height: 60%;
    }
}

.brawler-grid .brawler-card {
    transition: width 0.2s, min-width 0.2s, max-width 0.2s, height 0.2s, min-height 0.2s, max-height 0.2s;
}

.display-options-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(0,0,0,0.25);
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.display-options-container > span {
    color: #fbbf24;
    font-size: 16px;
    text-shadow: 1px 1px 0 #000;
    margin-right: 10px;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.option-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.option-item label {
    color: #e2e8f0;
    font-size: 15px;
    cursor: pointer;
    transition: color 0.2s;
    font-family: 'Lilita One', cursive; /* Ensuring font is applied */
}

.option-item label:hover {
    color: #fbbf24;
}

.option-item input[type="checkbox"] {
    cursor: pointer;
    accent-color: #3b82f6;
    width: 16px;
    height: 16px;
}

/* --- DYNAMIC SIZING FOR BRAWLER CARDS --- */
/* Large Size (<=2 items) */
.brawler-card.size-large { min-height: 90px; }
.brawler-card.size-large .brawler-info h3 { font-size: 22px; }
.brawler-card.size-large .brawler-stats span { font-size: 18px; padding: 4px 10px; }
.brawler-card.size-large .brawler-stats img { width: 24px; height: 24px; }
.brawler-card.size-large .mastery-icon-container { width: 28px; height: 28px; }
.brawler-card.size-large .mastery-icon-container .mastery-tier { font-size: 14px; }
.brawler-card.size-large .brawler-abilities { gap: 8px; }
.brawler-card.size-large .ability-icon { width: 36px; height: 36px; }
.brawler-card.size-large .gear-icon { width: 32px; height: 32px; }
.classic-layout .brawler-card.size-large { min-height: 100px; }
.classic-layout .brawler-card.size-large .brawler-info h3 { font-size: 24px; }
.classic-layout .brawler-card.size-large .brawler-stats span { font-size: 20px; }
.classic-layout .brawler-card.size-large .brawler-abilities { gap: 12px; }
.classic-layout .brawler-card.size-large .ability-icon { width: 40px; height: 40px; }
.classic-layout .brawler-card.size-large .gear-icon { width: 36px; height: 36px; }

/* Medium Size (3 items) */
.brawler-card.size-medium { min-height: 80px; }
.brawler-card.size-medium .brawler-info h3 { font-size: 18px; }
.brawler-card.size-medium .brawler-stats span { font-size: 15px; }
.brawler-card.size-medium .brawler-stats img { width: 20px; height: 20px; }
.brawler-card.size-medium .mastery-icon-container { width: 24px; height: 24px; }
.brawler-card.size-medium .mastery-icon-container .mastery-tier { font-size: 12px; }
.brawler-card.size-medium .ability-icon { width: 32px; height: 32px; }
.brawler-card.size-medium .gear-icon { width: 28px; height: 28px; }
.classic-layout .brawler-card.size-medium { min-height: 90px; }
.classic-layout .brawler-card.size-medium .brawler-info h3 { font-size: 20px; }
.classic-layout .brawler-card.size-medium .brawler-stats span { font-size: 16px; }
.classic-layout .brawler-card.size-medium .brawler-abilities { gap: 10px; }
.classic-layout .brawler-card.size-medium .ability-icon { width: 36px; height: 36px; }
.classic-layout .brawler-card.size-medium .gear-icon { width: 32px; height: 32px; }

/* Small Size (default, 4 items) is the base style */
.highest-trophies-number, .coins-to-max-span { display:none; }
.brawler-grid.classic-layout .highest-trophies-number, .brawler-grid.classic-layout .coins-to-max-span { display:inline-flex; }

.vertical-cost { display:flex;flex-direction:column;align-items:center;line-height:1.1; }
.vertical-cost img{margin:2px auto;}

/* Styles for the modal content to ensure font consistency */
#stats-modal label,
#stats-modal select,
#stats-modal option {
    font-family: 'Lilita One', cursive;
}

/* New Advanced Filtering Options styles */
.advanced-filter-container {
    margin-top: 20px;
    background: rgba(0,0,0,0.25);
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    padding: 15px;
    font-family: 'Lilita One', cursive;
}

.advanced-filter-container .toggle-button {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    font-family: 'Lilita One', cursive;
    cursor: pointer;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    box-shadow: 0 4px 0 #5b21b6, 0 6px 12px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.advanced-filter-container .toggle-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #5b21b6, 0 10px 16px rgba(0,0,0,0.4);
}

.advanced-filter-container .toggle-button:active {
    transform: translateY(4px);
    box-shadow: 0 0 0, 0 4px 8px rgba(0,0,0,0.2);
}

.advanced-filter-panel {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(251, 191, 36, 0.2);
}

.filter-group {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
}
.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group label {
    display: block;
    color: #fbbf24;
    font-size: 15px;
    margin-bottom: 8px;
    text-shadow: 1px 1px 0 #000;
}

.filter-group select,
.filter-group input[type="number"] {
    padding: 8px 12px;
    font-family: 'Lilita One', cursive;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin-right: 10px;
}

.filter-group input[type="radio"] {
    margin-right: 5px;
    accent-color: #fbbf24; /* Highlight radio button */
}

.filter-group input[type="radio"] + label {
    display: inline-block;
    color: #e2e8f0;
    font-size: 14px;
    margin-right: 15px;
}

.filter-sub-group {
    margin-top: 10px;
}

.clear-filters-button {
    width: auto;
    padding: 8px 16px;
    margin-top: 10px;
    font-size: 14px;
    border-radius: 8px;
    border: none;
    font-family: 'Lilita One', cursive;
    cursor: pointer;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 3px 0 #991b1b;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block; /* Make it a block to center it */
    margin-left: auto;
    margin-right: auto;
}

.clear-filters-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #991b1b, 0 8px 12px rgba(0,0,0,0.3);
}

.clear-filters-button:active {
    transform: translateY(2px);
    box-shadow: 0 0 0, 0 2px 4px rgba(0,0,0,0.2);
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(251, 191, 36, 0.3);
}

.tab-button {
    padding: 12px 25px;
    font-size: 18px;
    font-family: 'Lilita One', cursive;
    color: #e2e8f0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    text-shadow: 1px 1px 0 #000;
}

.tab-button:hover {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.5);
}

.tab-button.active {
    color: #fbbf24;
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 -5px 15px rgba(251, 191, 36, 0.2);
}

/* Battle Log Styles - Compacted and Enhanced */
/* Battle Log Grid Container */
.battle-log-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.battle-log-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 14px;
    padding: 0 18px;
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
    min-height: 80px;
    height: 80px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: visible;
    font-family: 'Lilita One', cursive;
    gap: 0;
}
.battle-log-card.victory { background: #26c256; }
.battle-log-card.defeat { background: #ea4747; }
.battle-log-card.draw { background: #4d62ff; }

.battle-log-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 14px 14px 0 0;
}
.battle-log-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
    border-color: #fbbf24;
}
.battle-log-card:hover::before {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.battle-log-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 110px;
    height: 100%;
    line-height: 1.1;
    gap: 2px;
}
.battle-log-left .ago {
    font-size: 11px;
    color: #e0e0e0;
}
.battle-log-left .rank {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}
.battle-log-left .mode {
    font-size: 12px;
    font-weight: bold;
    color: #ffbd00;
    margin-top: 2px;
}

.battle-log-middle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    height: 100%;
    min-width: 0;
}
.battle-log-middle .trophy-change {
    font-size: 26px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
    display: flex;
    align-items: center;
    gap: 8px;
}
.battle-log-middle img {
    width: 26px;
    height: 26px;
    margin-left: 4px;
}
.battle-log-middle .outcome {
    margin-top: 2px;
    font-size: 14px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 5px;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(0,0,0,0.12);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    letter-spacing: 0.5px;
    color: #fff;
    min-width: 60px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}
.battle-log-middle .outcome.victory { background: #22c55e; color: #fff; }
.battle-log-middle .outcome.defeat { background: #ef4444; color: #fff; }
.battle-log-middle .outcome.draw { background: #eab308; color: #fff; }
.battle-log-middle .outcome.rank { background: #3b82f6; color: #fff; }

.battle-log-avatar {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
    background: #232946;
}
.battle-log-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 900px) {
    .battle-log-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    .battle-log-card {
        padding: 0 8px;
    }
    .battle-log-left {
        width: 80px;
    }
    .battle-log-avatar {
        width: 44px;
        height: 44px;
    }
}
@media (max-width: 600px) {
    .battle-log-grid {
        grid-template-columns: 1fr;
    }
    .battle-log-card {
        min-height: 64px;
        height: 64px;
        padding: 0 4px;
    }
    .battle-log-left {
        width: 60px;
    }
    .battle-log-avatar {
        width: 36px;
        height: 36px;
    }
    .battle-log-middle .trophy-change {
        font-size: 18px;
    }
    .battle-log-middle img {
        width: 18px;
        height: 18px;
    }
    .battle-log-middle .outcome {
        font-size: 11px;
        min-width: 40px;
        padding: 1px 4px;
    }
}
/* Remove legacy/duplicate SLTBOT card rules */
.battle-log-card.victory, .battle-log-card.defeat, .battle-log-card.draw {
    /* Already handled above, remove legacy backgrounds */
}

/* Main summary section of the battle log card */
.battle-summary {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Allows it to take available space */
    gap: 15px;
    flex-wrap: wrap; /* Added for responsiveness */
    width: 100%; /* Take full width of the card */
    position: relative; /* Ensure it stays on top of hidden details */
    z-index: 2; /* Higher than initial details z-index */
    background: linear-gradient(135deg, #1e293b, #334155); /* Reapply background to ensure it covers details when not expanded */
    border-radius: 12px; /* Ensure rounded corners */
}

/* Player Brawler Icon Container */
.player-brawler-icon-container {
    position: relative; /* For positioning the overlay icon */
    width: 50px; /* Same size as old game-mode-icon */
    height: 50px;
    flex-shrink: 0;
    border-radius: 8px; /* Match existing card styles */
    overflow: hidden; /* Hide anything overflowing the main icon container */
    background: rgba(0,0,0,0.3); /* Match existing background */
    border: 1px solid #475569; /* Match existing border */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Match existing shadow */
}

.brawler-main-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Remove extra space below image */
    border-radius: 8px; /* Inherit from container */
}

.mode-overlay-icon {
    position: absolute;
    bottom: 0px; /* Adjust to place it just inside the border */
    right: 0px; /* Adjust to place it just inside the border */
    width: 24px; /* Small size for overlay */
    height: 24px;
    object-fit: contain; /* Ensure the whole icon is visible */
    background: rgba(0, 0, 0, 0.6); /* Semi-transparent background */
    border-radius: 5px; /* Slightly rounded corners for the overlay */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Small border for definition */
    z-index: 3; /* Ensure it's above the brawler icon */
}

.game-mode-icon { /* This class is now unused for the main icon, but kept for clarity if needed elsewhere */
    display: none; /* Hide the old game-mode-icon if it were still present */
}

.battle-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 150px; /* Ensure info doesn't collapse too much */
}

.game-mode-name {
    font-size: 16px;
    color: #fbbf24;
    text-shadow: 1px 1px 0 #000;
}

.outcome {
    font-size: 14px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 5px;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 4px;
}
.outcome.victory { background-color: #22c55e; color: #fff; } /* Green for Win */
.outcome.defeat { background-color: #ef4444; color: #fff; } /* Red for Lose */
.outcome.draw { background-color: #eab308; color: #fff; } /* Yellow for Tie */
.outcome.rank { background-color: #3b82f6; color: #fff; } /* Blue for Ranked modes */

.trophy-change {
    font-size: 14px;
    font-weight: bold;
    margin-left: 5px;
    display: inline-flex; /* Use flexbox to align icon and text */
    align-items: center; /* Center vertically */
}
.trophy-change.positive { color: #22c55e; }
.trophy-change.negative { color: #ef4444; }
.trophy-change.no-change { color: #ccc; }

.battle-time {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 5px;
}

.match-duration {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.player-brawler-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* Prevent shrinking on smaller screens */
    margin-left: auto; /* Push to the right */
}

.player-brawler-info .brawler-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(0,0,0,0.3);
    border: 1px solid #475569;
}

.brawler-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align text to the right within its container */
}

.brawler-name {
    font-size: 15px;
    color: #e2e8f0;
    font-weight: bold;
}

.brawler-level, .brawler-trophies {
    font-size: 12px;
    color: #94a3b8;
}

/* Hide the expand button as the whole card is now clickable */
.expand-battle {
    display: none;
}

/* NEW: Styles for the expanded battle details overlay */
.battle-details {
    position: absolute; /* Take out of document flow */
    top: 0;
    left: 0;
    width: 100%;
    /* Initial hidden state for animation */
    max-height: 0;
    opacity: 0;
    transform: translateY(-20px); /* Start slightly above and move down */
    overflow: hidden;
    pointer-events: none; /* Make it unclickable when hidden */
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out, transform 0.4s ease-out, background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    
    /* Reapply background/border/shadow for overlay appearance */
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 12px;
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
    
    z-index: 1; /* Ensure it's above the summary when active */
    padding: 15px; /* Keep initial padding */
    padding-top: 60px; /* Adjust padding-top to ensure content starts below the summary */
    
    /* Original styles from before for content within details */
    color: #e2e8f0;
    font-size: 14px;
    font-family: 'Lilita One', cursive;
}

/* NEW: Expanded state for the battle log card */
.battle-log-card.expanded {
    z-index: 100; /* Bring the expanded card to the very front */
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.15); /* More prominent shadow */
    border-color: #fbbf24; /* Highlight border */
    transform: translateY(-5px) scale(1.01); /* Slightly raise and scale the card itself */
}

/* NEW: Visible state for the battle details when card is expanded */
.battle-log-card.expanded .battle-details {
    max-height: 1000px; /* Arbitrarily large enough to show all content */
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* Make it clickable when visible */
    border-color: #fbbf24; /* Ensure border color changes for the expanded details part too */
}


.battle-details p {
    margin-bottom: 5px;
}

.battle-details h4 {
    color: #fbbf24;
    margin-top: 10px;
    margin-bottom: 8px;
    font-size: 15px;
    text-shadow: 1px 1px 0 #000;
}

.player-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-list li {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    color: #ccc;
}

.player-list li img {
    width: 25px;
    height: 25px;
    border-radius: 50%; /* Make player icons round */
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}

.player-list li.team-header {
    width: 100%; /* Make team header take full width */
    font-weight: bold;
    color: #fbbf24;
    background: none;
    border-radius: 0;
    padding: 0;
    margin-top: 10px;
    margin-bottom: 5px;
    text-shadow: 1px 1px 0 #000;
}

/* Duels Specific Styles */
.player-list li.duel-player {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.duel-player span {
    font-weight: bold;
    color: #e2e8f0;
}

.duel-brawlers {
    display: flex;
    gap: 5px;
}

.duel-brawlers img {
    width: 30px;
    height: 30px;
    border-radius: 6px;
}

/* Responsive adjustments for battle log */
@media (max-width: 768px) {
    .battle-log-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Adjust grid on smaller screens */
    }
    .battle-summary {
        flex-wrap: wrap; /* Allow wrapping for smaller screens */
        justify-content: center;
    }
    .battle-info, .player-brawler-info {
        flex-grow: 0; /* Adjust flex-grow to prevent excessive stretching */
        flex-basis: 100%; /* Take full width when wrapped */
        text-align: center;
    }
    .brawler-details {
        align-items: center; /* Center brawler details when wrapped */
    }

    /* Adjusted overlay for smaller screens */
    .battle-log-card.expanded .battle-details {
        width: calc(100% + 30px); /* Account for card padding that might affect full width */
        left: -15px; /* Shift to align with card edge */
        padding-top: 60px;
    }
}

@media (max-width: 480px) {
    .battle-log-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
    .battle-log-card {
        padding: 10px;
    }
    .player-brawler-icon-container { /* Adjusted for small screens */
        width: 40px;
        height: 40px;
    }
    .mode-overlay-icon { /* Adjusted for small screens */
        width: 20px;
        height: 20px;
        bottom: -2px; /* Slightly more visible on smaller icon */
        right: -2px;
    }
    .player-brawler-info .brawler-icon {
        width: 35px;
        height: 35px;
    }
    .game-mode-name {
        font-size: 14px;
    }
    .outcome, .trophy-change, .brawler-name, .brawler-level, .brawler-trophies {
        font-size: 12px;
    }
    .battle-details, .player-list li {
        font-size: 12px;
    }
}

/* Styles for the modal content to ensure font consistency */
#stats-modal label,
#stats-modal select,
#stats-modal option {
    font-family: 'Lilita One', cursive;
}

/* Style for showdown no trophies */
.trophy-change.showdown-no-trophies {
    color: #22c55e;
}

/* Styles for the stats modal itself */
#stats-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#stats-modal > div { /* This targets the inner div of the modal */
    background:#1e293b;
    border-radius:12px;
    padding:24px;
    width:80vw;
    height:75vh;
    max-width:1200px;
    max-height:90vh;
    overflow:hidden;
    position:relative;
    display:flex;
    flex-direction:column;
}

#stats-modal button#close-chart {
    position:absolute;
    top:8px;
    right:8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    text-align: center;
}

#stats-modal > div > div:first-child { /* Targets the first div inside the modal content, which contains selects and label */
    margin-bottom:14px;
    display:flex;
    gap:14px;
    align-items:center;
    flex-wrap:wrap;
    flex-shrink:0;
}

#stats-modal label {
    color:#fff;
}

#stats-modal select {
    padding:10px 14px;
    font-size:18px;
    border-radius:8px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    border: 2px solid #3b82f6;
}

#chart-dynamic-label {
    color:#e2e8f0;
    font-size:18px;
    margin-left:10px;
    flex-grow:1;
    text-align:right;
    font-family: 'Lilita One', cursive;
}

#stats-chart {
    width:100%;
    flex:1 1 0;
}

/* Battle Log Header (Win/Loss and Filters) */
.battle-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}

.win-loss-container {
    padding: 10px 15px;
    font-size: 16px;
    font-family: 'Lilita One', cursive;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-grow: 0; /* Don't grow */
    white-space: nowrap; /* Prevent wrapping */
    cursor: help; /* Indicate there's a tooltip */
}

.battle-log-filters {
    flex-grow: 1; /* Take up remaining space */
    max-width: none; /* Remove max-width to allow it to fill */
}

/* Custom Multiselect for Battle Log Filters */
.custom-multiselect {
    position: relative;
    font-family: 'Lilita One', cursive;
}

.custom-multiselect .select-box {
    padding: 8px 12px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-align: center;
}

.custom-multiselect .checkboxes-container {
    display: none;
    position: absolute;
    background: #1e293b;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    width: 100%;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
    pointer-events: none; /* avoid accidental clicks while hidden */
}

.custom-multiselect .checkboxes-container label {
    display: block;
    color: #e2e8f0;
    padding: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.custom-multiselect .checkboxes-container label:hover {
    background-color: #334155;
}

.custom-multiselect .checkboxes-container input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #fbbf24;
}

/* Background Picker */
.background-picker-container {
    position: absolute;
    top: 20px;
    right: 150px; /* Adjusted to not overlap with changelog button */
    z-index: 10;
}

#background-select {
    background-color: #1e293b;
    color: #e2e8f0;
    border: 1px solid #3b82f6;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#background-select:hover {
    background-color: #334155;
}

.changelog-button {
    position: absolute;
    top: 20px;
    right: 150px; /* Adjusted to not overlap with changelog button */
    z-index: 10;
}

.version-text {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Image Generator Modal */
.image-generator-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002; /* Above side panel */
}

.image-generator-content {
    background: #0f172a;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #3b82f6;
    max-width: 95vw;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

.image-generator-content h2 {
    margin-top: 0;
}

.image-generator-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    justify-content: center;
}

.image-generator-controls label {
    color: #fbbf24;
    font-size: 16px;
}

.image-generator-controls select {
    padding: 8px 12px;
    font-family: 'Lilita One', cursive;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.canvas-container {
    width: 100%;
    max-width: 1280px; /* Limit preview size */
    margin: 0 auto;
}

#profile-image-canvas {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #ccc; /* Placeholder background */
}

/* Image Background Picker Panel */
#image-background-panel {
    z-index: 1003; /* Above the image generator modal */
    width: 280px; /* Slightly smaller than main background picker */
}

#image-background-panel .previews-container {
    padding: 10px;
}

#image-background-panel .background-preview {
    margin-bottom: 10px;
}

#image-background-panel .background-preview img {
    height: 120px; /* Smaller previews */
}

#image-background-panel .preview-name {
    font-size: 0.9rem;
    padding: 6px;
}

#image-background-picker-button {
    margin-left: 10px;
}

/* Previous Tags Dropdown */
.previous-tags-dropdown {
    position: relative;
    display: inline-block;
}

.previous-tags-dropdown .dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: linear-gradient(135deg, #1e293b, #334155);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    z-index: 1000;
    padding: 8px 0;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.previous-tags-dropdown .dropdown-content button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: #e2e8f0;
    font-family: 'Lilita One', cursive;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.previous-tags-dropdown .dropdown-content button:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.previous-tags-dropdown.show .dropdown-content {
    display: block;
    animation: fadeInDown 0.3s ease-out forwards;
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Custom scrollbar for the dropdown */
.previous-tags-dropdown .dropdown-content::-webkit-scrollbar {
    width: 8px;
}

.previous-tags-dropdown .dropdown-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.previous-tags-dropdown .dropdown-content::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

.previous-tags-dropdown .dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Skeleton Loading Styles */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%);
    animation: shimmer 2s infinite;
    background-size: 1000px 100%;
}

.skeleton-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #2a3a50;
    margin-right: 20px;
}

.skeleton-avatar-secondary {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #2a3a50;
    margin-bottom: 10px;
}

.skeleton-name {
    width: 200px;
    height: 32px;
    background: #2a3a50;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-title {
    width: 150px;
    height: 24px;
    background: #2a3a50;
    border-radius: 4px;
}

.skeleton-stat {
    min-width: 120px;
    height: 60px;
    background: #2a3a50;
    border-radius: 8px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.skeleton-card {
    min-height: 80px;
    background: #2a3a50;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

/* Responsive adjustments for skeleton loading */
@media (max-width: 768px) {
    .skeleton-avatar {
        width: 80px;
        height: 80px;
    }

    .skeleton-avatar-secondary {
        width: 40px;
        height: 40px;
    }

    .skeleton-name {
        width: 150px;
        height: 28px;
    }

    .skeleton-title {
        width: 120px;
        height: 20px;
    }

    .skeleton-stat {
        min-width: 100px;
        height: 50px;
    }

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

/* Hidden elements */
#create-image-button,
#api-source-message,
#loading-message,
#error-message,
#skeleton-loading,
#player-profile,
#player-avatar-1,
#player-avatar-2,
#club-card,
#current-rank-card,
#highest-rank-card,
#battle-log-tab-content,
#download-image-link,
#copy-image-button,
#image-generator-modal,
#image-generator-loading {
    display: none;
}

/* Sort order label */
#sort-order-label {
    color: #e2e8f0;
    font-size: 16px;
}

/* Card size slider container */
#card-size-slider-container,
#battle-log-card-size-slider-container {
    margin-bottom: 18px;
    text-align: center;
}

/* Card size slider labels */
#card-size-slider-container label,
#battle-log-card-size-slider-container label {
    color: #fbbf24;
    font-size: 16px;
    margin-right: 10px;
}

/* Card size slider inputs */
#card-size-slider,
#battle-log-card-size-slider {
    vertical-align: middle;
}

/* Battle log header */
.battle-log-header > div {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* Win loss container */
#battle-log-win-loss {
    font-size: 1rem;
    color: #e2e8f0;
}

/* Stats modal */
#stats-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Stats modal content */
#stats-modal > div {
    background: #1e293b;
    border-radius: 12px;
    padding: 24px;
    width: 80vw;
    height: 75vh;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Close chart button */
#close-chart {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    text-align: center;
}

/* Stats modal controls */
#stats-modal > div > div:first-child {
    margin-bottom: 14px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Stats modal labels */
#stats-modal label {
    color: #fff;
}

/* Stats modal selects */
#metric-select,
#history-period-select {
    padding: 10px 14px;
    font-size: 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    border: 2px solid #3b82f6;
}

/* Chart dynamic label */
#chart-dynamic-label {
    color: #e2e8f0;
    font-size: 18px;
    margin-left: 10px;
    flex-grow: 1;
    text-align: right;
    font-family: 'Lilita One', cursive;
}

/* Stats chart */
#stats-chart {
    width: 100%;
    flex: 1 1 0;
}

/* Chart loading overlay */
#chart-loading-overlay {
    position: absolute;
    top: 70px;
    left: 24px;
    right: 24px;
    bottom: 24px;
    background: rgba(30, 41, 59, 0.9);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: 'Lilita One', cursive;
}

/* Image actions */
.image-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

/* Image generator loading */
#image-generator-loading {
    text-align: center;
    padding: 20px;
}

/* W/L Ratio Hover Effect */
.win-loss-container {
    position: relative;
    cursor: help;
}

.win-loss-container .win-loss-raw {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 120%; /* Position above the main text */
    left: 50%;
    transform: translateX(-50%) translateY(10px); /* Start slightly lower for animation */
    background-color: #2a3a50;
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 10;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
}

.win-loss-container:hover .win-loss-raw {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Multiselect Dropdown Functionality */
.custom-multiselect .checkboxes-container {
    display: none;
    position: absolute; /* Ensure it appears on top */
    background-color: #1e293b;
    border: 1px solid #3b82f6;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.custom-multiselect.is-open .checkboxes-container {
    display: block;
}

/* Changelog Button */
.changelog-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #3b82f6;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s, transform 0.2s;
    z-index: 10;
}

.changelog-button:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}

/* Version Text */
.version-text {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: -15px;
    margin-bottom: 25px;
    text-align: center;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#player-profile, .brawler-card, .battle-log-card {
    animation: fadeInUp 0.5s ease-out forwards;
}

.toggle-button, #search-button, #use-previous-button, .tab-button, .clear-filters-button {
    transition: background-color 0.3s, transform 0.2s, filter 0.2s;
}

.toggle-button:hover, #search-button:hover, #use-previous-button:hover, .tab-button:hover:not(.active), .clear-filters-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.15);
}

.filter-panel {
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out, opacity 0.3s ease-in-out, border-width 0.4s ease-in-out;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
}

.filter-panel.is-open {
    max-height: 500px;
    opacity: 1;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-width: 1px;
}

/* ==== SLTBOT style battle log cards ===== */
.battle-log-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:12px;}
.battle-log-card{width:100%;height:80px;display:flex;align-items:center;justify-content:space-between;padding:6px 14px;border-radius:12px;box-shadow:0 2px 6px rgba(0,0,0,.25);font-family:'Lilita One',cursive;}
.battle-log-card.victory{background:#26c256;}
.battle-log-card.defeat{background:#ea4747;}
.battle-log-card.draw{background:#4d62ff;}
.battle-log-left{flex:0 0 105px;display:flex;flex-direction:column;line-height:1.1;}
.battle-log-left .ago{font-size:11px;color:#e0e0e0;}
.battle-log-left .rank{font-size:14px;font-weight:bold;color:#fff;}
.battle-log-left .mode{font-size:12px;font-weight:bold;color:#ffbd00;margin-top:2px;}
.battle-log-middle{flex:1 1 auto;display:flex;align-items:center;justify-content:center;gap:6px;font-size:26px;font-weight:bold;color:#fff;text-shadow:2px 2px 0 #000;}
.battle-log-middle img{width:26px;height:26px;}
.battle-log-avatar{flex:0 0 60px;width:60px;height:60px;border-radius:50%;overflow:hidden;border:2px solid #fff;filter:drop-shadow(0 1px 3px rgba(0,0,0,.6));}
.battle-log-avatar img{width:100%;height:100%;object-fit:cover;}
.battle-details{display:none!important;}

.battle-log-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
    min-height: 24px;
}
.win-loss-label {
    background: #232946;
    color: #22c55e;
    font-size: 13px;
    font-weight: bold;
    border-radius: 8px;
    padding: 3px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    margin-right: 8px;
    letter-spacing: 0.5px;
    min-width: 70px;
    text-align: center;
}
.advanced-filter-btn {
    width: 100%;
    margin: 0 0 10px 0;
    padding: 12px 0;
    font-size: 18px;
    font-family: 'Lilita One', cursive;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    margin-bottom: 0;
}
.advanced-filter-btn:hover {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    color: #232946;
}
#battle-log-filter-panel.filter-panel {
    width: 100%;
    margin-bottom: 12px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: rgba(30,41,59,0.97);
    border: 1px solid #3b82f6;
    border-top: none;
    padding-top: 18px;
    padding-bottom: 18px;
}
#battle-log-filter-panel:not(.is-open) {
    display: none;
}

/* --- Battle Log Card with Game Mode Icon and Power Level --- */
.battle-log-card {
    position: relative;
    padding-right: 18px;
}
.battle-log-card .game-mode-icon {
    width: 36px;
    height: 36px;
    margin-right: 12px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    object-fit: contain;
    flex-shrink: 0;
}
.battle-log-card .battle-log-avatar {
    margin-left: 0;
    margin-right: 8px;
}
.battle-log-card .brawler-power {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: bold;
    color: #fbbf24;
    background: rgba(0,0,0,0.10);
    border-radius: 8px;
    padding: 2px 8px;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-top: 6px;
    position: static;
    right: unset;
    top: unset;
    transform: none;
    min-width: 0;
}
.battle-log-card .brawler-power img {
    width: 18px;
    height: 18px;
    margin-right: 2px;
}
@media (max-width: 900px) {
    .battle-log-card .game-mode-icon {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }
    .battle-log-card .brawler-power {
        font-size: 13px;
        padding: 2px 6px;
        margin-top: 4px;
    }
}
@media (max-width: 600px) {
    .battle-log-card .game-mode-icon {
        width: 20px;
        height: 20px;
        margin-right: 3px;
    }
    .battle-log-card .brawler-power {
        font-size: 11px;
        padding: 1px 4px;
        margin-top: 2px;
    }
}
/* Win/Loss Ratio hover tooltip */
.win-loss-label {
    position: relative;
    cursor: pointer;
}
.win-loss-label .win-loss-tooltip {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    background: #232946;
    color: #fff;
    font-size: 13px;
    font-weight: normal;
    border-radius: 8px;
    padding: 10px 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    white-space: nowrap;
    z-index: 100;
    min-width: 140px;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
.win-loss-label:hover .win-loss-tooltip,
.win-loss-label:focus .win-loss-tooltip {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* -------------------------------------------------- */
/*  ✨  Subtle global animations & accessibility  ✨  */
/* -------------------------------------------------- */

/* 1. Respect users that prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* 2. Fade-&-slide for dropdown like multiselect checkboxes */
.custom-multiselect .checkboxes-container {
    /* hidden state */
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
    pointer-events: none; /* avoid accidental clicks while hidden */
}
.custom-multiselect.is-open .checkboxes-container {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 3. Previous-tags dropdown smoother reveal */
.previous-tags-dropdown .dropdown-content {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}
.previous-tags-dropdown.show .dropdown-content {
    opacity: 1;
    transform: translateY(0);
}

/* 4. Side-panel (background picker) fade-in in addition to slide-in */
.side-panel {
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease-out;
}
.side-panel.is-open {
    opacity: 1;
}

/* 5. Generic utility for elements that should softly appear when added to DOM */
.fade-in {
    animation: fade-in 0.35s ease-out forwards;
}
@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* You can add class="fade-in" to dynamically created elements (e.g., cards) for a lightweight entrance. */

/* Add a more specific style for the close button in the image generator modal */
.image-generator-modal .close-button {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 48px;
    height: 48px;
    background: #ef4444;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}
.image-generator-modal .close-button:hover {
    background: #d32f2f;
    transform: scale(1.08) rotate(90deg);
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 8px;
    font-family: 'Lilita One', cursive;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    text-align: center;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background: rgba(34, 197, 94, 0.9);
}

.notification.error {
    background: rgba(239, 68, 68, 0.9);
}

.notification.info {
    background: rgba(59, 130, 246, 0.9);
}

@media (max-width: 768px) {
    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* Advanced filter styles removed */
.advanced-filter-container, #advanced-filter-panel { display: none !important; }

/* Center the stat change indicator below stats */
.stat-change-today {
    display: block;
    margin: 2px auto 0 auto;
    font-family: 'Lilita One', cursive;
}
