@font-face {
    font-family: 'BigNoodleToo';
    src: url('res/BigNoodleToo.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* Import Roboto font */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* Color palette */
    --bg-dark: #0a1525;
    --bg-darker: #081020;
    --bg-panel: #0c1a30;
    --bg-element: #1a2a4a;
    --border-primary: #2a4b8d;
    --border-secondary: #4a5a7a;
    --text-primary: #ffffff;
    --text-secondary: #8a9bbd;
    --accent-orange: #ff6b3d;
    --accent-green: #00ff00;
    --highlight-border: #ffffff;
    
    /* Item & power color gradients */
    --gradient-common-start: #2aff4a;
    --gradient-common-end: #0a8020;
    --gradient-rare-start: #2a9aff;
    --gradient-rare-end: #0a4080;
    --gradient-epic-start: #aa2aff;
    --gradient-epic-end: #5a0a80;
    --gradient-orange-start: #ff8a5c;
    --gradient-orange-end: #ff4d00;
    
    /* Additional component colors */
    --health-color: #e8e8e8;
    --armor-color: #f47c0b;
    --shield-color: #06b1f4;
    --power-bg: #3a5a9a;
    --power-border: #4a6ba6;
    --tooltip-stat: #9ee5ff;
    --tooltip-cost: #ffdd44;
    --subtle-text: #6a7b9d;
    
    /* Responsive breakpoints */
    --breakpoint-xl: 1199.98px;
    --breakpoint-lg: 991.98px;
    --breakpoint-md: 767.98px;
    --breakpoint-sm: 575.98px;
    --breakpoint-xs: 399.98px;
    
    /* Base sizing units */
    --base-spacing: 1rem;
    --touch-target-size: 44px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: clamp(0.5rem, 5vw, 1.25rem);
    font-size: 16px;
}

.container {
    width: 100%;
    max-width: 1360px;
    background-color: var(--bg-dark);
    border-radius: 10px;
    overflow: visible;
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-primary), transparent);
    top: 0;
    left: 0;
}

.header {
    padding: clamp(0.75rem, 4vw, 1.25rem) clamp(0.75rem, 4vw, 1.25rem) clamp(0.5rem, 3vw, 0.9rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
    margin-bottom: 0.625rem;
    position: relative;
    flex-wrap: wrap;
}

.header::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2a4b8d, transparent);
    bottom: 0;
    left: 0;
}

.character-info {
    display: flex;
    align-items: center;
}

.portrait {
    width: clamp(3.5rem, 15vw, 4.5rem);
    height: clamp(3.5rem, 15vw, 4.5rem);
    margin-right: 0.9375rem;
    border: 2px solid #3a5a9a;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 10px rgba(58, 90, 154, 0.6);
}

.portrait::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    pointer-events: none;
}

.portrait:hover::after {
    border-color: rgba(255, 107, 61, 0.6);
    box-shadow: inset 0 0 15px rgba(255, 107, 61, 0.3);
}

.portrait-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff4d8c, #ff8a5c);
    border-radius: 3px;
}

.name {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: clamp(200px, 50vw, 300px); /* Responsive width for the text */
}

.title {
    font-size: clamp(2.5rem, 10vw, 4rem);
    font-weight: bold;
    color: #8a9bbd;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(138, 155, 189, 0.5);
    font-family: 'BigNoodleToo', 'Roboto', sans-serif;
    font-style: italic;
    margin-bottom: clamp(-1.5rem, -5vw, -1.625rem);
    -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 90%);
    mask-image: linear-gradient(to bottom, black 30%, transparent 90%);
}

.hero {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'BigNoodleToo', 'Roboto', sans-serif;
    font-style: italic;
    position: relative;
    z-index: 10;
}

.main-content {
    display: flex;
    min-height: 700px;
    max-height: 80vh;
}

.left-panel {
    width: 340px;
    flex-shrink: 0;
    background-color: #0c1a30;
    padding: 1.5625rem 1.25rem 0;
    border: 1px solid #2a4b8d;
    border-radius: 10px;
    position: relative;
    margin-right: 0.9375rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    max-height: 700px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.left-panel::-webkit-scrollbar {
    display: none;
}

.build-cost {
    font-size: 20px;
    font-weight: 900;
    color: #8a9bbd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    letter-spacing: 1px;
    font-family: 'Roboto', sans-serif;
}

.diamond-icon {
    margin-left: 4px;
    color: transparent;
    font-size: 0;
    text-shadow: none;
    position: relative;
    display: inline-block;
    width: 26px;
    height: 26px;
    background-image: url("res/currency.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    vertical-align: middle;
    transform: translateY(1px);
}

.item-cost .diamond-icon {
    width: 12px;
    height: 13px;
    margin: 0 2px 0 0;
    background-position: center;
    transform: translateY(0) scale(0.9);
}

/* Currency icons - shared styles for all currency icons */
.item-cost i,
.currency-icon {
    font-size: 0;
    color: transparent;
    text-shadow: none;
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url("res/currency.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    transform: scale(1) translateY(-1px);
    content: "";
}

.cost {
    color: #ffffff;
}

/* Style for negative cash values */
.negative-cash {
    color: #ff3a3a;
    font-weight: bold;
    animation: pulsate 1.5s infinite alternate;
}

/* Animation keyframes - unified definitions */
@keyframes pulsate {
    0% { opacity: 1; }
    100% { opacity: 0.7; }
}

@keyframes breathe {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes pulse {
    0% { opacity: 0.5; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    50% { opacity: 1; box-shadow: 0 0 8px rgba(255, 255, 255, 0.7); }
    100% { opacity: 0.5; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
}

/* Cost label in the build cost display */
.cost-label {
    margin-right: 5px;
    color: #8a9bbd;
}

.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #2a4b8d, transparent);
    margin: 20px 0;
}

.section-header {
    display: flex;
    align-items: center;
    margin: 12px 0 15px;
    text-align: center;
}

.section-header::before,
.section-header::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2a4b8d, transparent);
}

.section-title {
    font-size: 13px;
    font-weight: 900;
    color: #8a9bbd;
    margin: 0 8px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 1px;
}

.power-slots {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.item-slots {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
}

.power-slot, .item-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(25% - 6px);
}

.item-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(33.33% - 6px);
    margin-bottom: 0.75rem;
}

.item-slot .empty-slot {
    border-radius: 50%;
    width: clamp(3.5rem, 15vw, 3.75rem);
    height: clamp(3.5rem, 15vw, 3.75rem);
    min-width: var(--touch-target-size);
    min-height: var(--touch-target-size);
    background-color: #1a2a4a;
    border: 1px solid #4a5a7a;
    margin-bottom: 0.1875rem;
}

.empty-slot {
    width: clamp(3.5rem, 15vw, 3.75rem);
    height: clamp(3.5rem, 15vw, 3.75rem);
    min-width: var(--touch-target-size);
    min-height: var(--touch-target-size);
    border-radius: 5px;
    background-color: #1a2a4a;
    border: 1px solid #4a5a7a;
    margin-bottom: 0.3125rem;
}

.slot-label {
    font-size: 9px;
    color: #8a9bbd;
    text-align: center;
}

.stats-section {
    margin-top: 5px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.stats-section::-webkit-scrollbar {
    display: none;
}

/* Stats section header */
.stats-section h2 {
    font-size: 16px;
    color: #8a9bbd;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Two-column layout for stats */
.stats-columns {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    gap: 15px;
}

.stats-column {
    width: calc(50% - 7.5px);
    overflow: hidden;
}

/* Full width stat (for life bar) */
.full-width {
    width: 100%;
    margin-bottom: 15px;
}

/* Stat group with header and bar */
.stat-group {
    margin-bottom: 8px;
}

/* Style for stat header section */
.stat-header {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    width: 100%;
}

.stat-header .stat-name {
    font-size: 9px;
    color: #8a9bbd;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.1em;
    flex-grow: 1;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 3px;
}

.stat-header .stat-value {
    min-width: 15px;
    text-align: right;
    font-weight: bold;
    font-size: 12px;
    color: #ffffff;
    margin-left: 6px;
    margin-right: 2px;
}

/* Base styles for all stat bars */
.stat-bar-wrapper {
    position: relative;
    height: 20px;
    display: flex;
    border-radius: 3px;
    background-color: transparent;
    width: 100%;
    overflow: visible;
}

.stat-icon {
    width: 22px;
    height: 20px;
    min-width: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    flex-shrink: 0;
    background-color: #253b5c;
    border: 1px solid #2a4b8d;
    color: #8a9bbd;
    border-radius: 3px;
    z-index: 3;
    position: absolute;
    left: 0;
    top: 0;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    padding: 2px;
}

.stat-icon-img {
    width: 98%;
    height: 98%;
    object-fit: contain;
    filter: brightness(1.5);
    transform: translateY(-1px);
}

/* Reserve space for the icon */
.stat-icon-space {
    width: 24px;
    height: 20px;
    flex-shrink: 0;
    visibility: hidden;
}

/* Regular stat tracks - simple non-segmented style */
.stat-track {
    flex-grow: 1;
    height: 20px;
    background-color: #253b5c;
    border: 1px solid #2a4b8d;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    width: 100%;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -2px; /* Adjust to overlap with icon border */
}

/* Style for regular stat tracks (non-segmented) */
.stat-track:not(.total-life-track) {
    background-color: #0a1525;
    display: block; /* Override flex display */
}

/* Life track - segmented view */
.total-life-track {
    position: relative;
    overflow: hidden;
    display: flex;
    background-color: transparent;
    border: none;
    margin-left: -2px; /* Align with icon border */
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    z-index: 1;
    gap: 1px; /* Small gap between segments */
    padding: 0 1px; /* Add a little padding to the container */
    background-color: rgba(10, 21, 37, 0.5); /* Subtle background */
}

/* Fill bar for regular stats */
.stat-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--health-color);
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Segments for life bar only */
.stat-segment {
    flex: 1;
    min-width: 0;
    height: 20px;
    border: 1px solid #2a4b8d;
    border-right: none;
    box-sizing: border-box;
    background-color: #253b5c;
    position: relative; /* For proper positioning of inner content */
    overflow: hidden; /* To keep rounded corners visible */
    border-radius: 2px;
    margin-right: 1px; /* Add a small gap between segments */
}

.stat-segment:last-child {
    border-right: 1px solid #2a4b8d;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    margin-right: 0; /* Remove margin from last segment */
}

/* Segment coloring based on health type */
.stat-segment.health {
    background-color: var(--health-color);
    z-index: 1;
    border-color: rgba(232, 232, 232, 0.5);
}

.stat-segment.armor {
    background-color: var(--armor-color);
    z-index: 1;
    border-color: rgba(244, 124, 11, 0.5);
}

.stat-segment.shield {
    background-color: var(--shield-color);
    z-index: 1;
    border-color: rgba(6, 177, 244, 0.5);
}

.stat-segment.empty {
    background-color: #0a1525;
    border-color: #1a2a4a;
    opacity: 0.6;
}

/* Partial segment styling */
.stat-segment .segment-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 2px;
}

.stat-segment .segment-fill.health {
    background-color: var(--health-color);
    z-index: 2;
}

.stat-segment .segment-fill.armor {
    background-color: var(--armor-color);
    z-index: 3;
}

.stat-segment .segment-fill.shield {
    background-color: var(--shield-color);
    z-index: 4;
}

.stat-segment.active {
    background-color: var(--health-color);
}

/* Right panel styles */

.right-panel {
    flex-grow: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex items from overflowing */
}

.tab-container {
    margin-bottom: 0.5rem;
    display: inline-block;
    max-width: 100%;
}

.tabs {
    display: inline-flex;
    background-color: #081020;
    border-radius: 5px;
    overflow: hidden;
    flex-wrap: wrap;
}

.tab {
    padding: clamp(0.625rem, 3vw, 0.9375rem) clamp(0.75rem, 4vw, 1.25rem);
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 3px;
    margin: 2px 3px;
    letter-spacing: 1px;
    min-height: var(--touch-target-size);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab:hover:not(.active) {
    background-color: rgba(255, 107, 61, 0.2);
    color: #ffffff;
    box-shadow: 0 0 5px rgba(255, 107, 61, 0.3);
}

.tab.active {
    background-color: #ff6b3d;
    color: white;
}

.tab-content {
    flex-grow: 1;
    height: 100%;
}

.tab-pane {
    display: none;
    height: 100%;
}

.tab-pane.active {
    display: block;
    height: 100%;
}

.items-grid {
    display: flex;
    flex-grow: 1;
    padding: 0;
    gap: 0.9375rem;
    height: 100%;
}

.power-grid {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    height: 100%;
    width: 100%;
    padding: 0;
    margin-left: 0;
    position: relative;
    z-index: 1;
    justify-content: space-between;
}

.power-row {
    display: flex;
    gap: 0.625rem;
    width: 100%;
    flex: 1;
}

.power-card {
    flex: 1;
    background-color: #1a2a4a;
    border: none;
    border-radius: 5px;
    padding: 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, border 0.2s ease;
    cursor: pointer;
    position: relative;
}

.power-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.power-card:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--highlight-border);
    border-radius: 4px;
    animation: breathe 2.0s infinite ease-in-out;
    pointer-events: none;
    opacity: 0.8;
}

/* Using the unified breathe animation from the top of the file */

.power-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #1a2a4a;
}

/* Unified power icon style - no rarity variants needed */
.power-icon {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    background-color: var(--power-bg);
    border: 1px solid var(--power-border);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Remove all power icon rarity variants since they're not used */
.power-icon.orange,
.power-icon.rare,
.power-icon.epic,
.power-icon.common {
    /* No special styling needed */
}

.power-title {
    font-weight: 900;
    font-size: 14px;
    padding-left: 10px;
    color: var(--text-primary);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    font-family: 'Roboto', sans-serif;
    letter-spacing: 1px;
}

.power-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 8px;
    background-color: var(--bg-darker);
    margin: 0 10px 10px;
    border-radius: 5px;
    flex-grow: 1;
}

.power-description strong {
    color: var(--text-primary);
    font-weight: bold;
}

.item-column {
    flex: 1;
    padding: 0.9375rem;
    border: 1px solid #2a4b8d;
    border-radius: 10px;
    background-color: #0c1a30;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 300px;
    min-width: 0; /* Prevent flex items from overflowing */
}

.column-header {
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 20px;
    color: #ffffff;
    letter-spacing: 1px;
}

.items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.item-row {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin-bottom: 10px;
}

.item, .empty-item {
    width: clamp(3.5rem, 15vw, 3.75rem);
    height: clamp(3.5rem, 15vw, 3.75rem);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: 1.5625rem;
    border: 1px solid #4a5a7a;
    transition: transform 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
    min-width: var(--touch-target-size);
    min-height: var(--touch-target-size);
}

.item:hover {
    transform: scale(1.1);
    z-index: 10;
}

.item:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid white;
    border-radius: 50%;
    animation: breathe 2.0s infinite ease-in-out;
    pointer-events: none;
}

.common-item {
    background: radial-gradient(circle, var(--gradient-common-start) 0%, var(--gradient-common-end) 100%);
    border: 1px solid var(--border-secondary);
}

.rare-item {
    background: radial-gradient(circle, var(--gradient-rare-start) 0%, var(--gradient-rare-end) 100%);
    border: 1px solid var(--border-secondary);
}

.epic-item {
    background: radial-gradient(circle, var(--gradient-epic-start) 0%, var(--gradient-epic-end) 100%);
    border: 1px solid var(--border-secondary);
}

.item.owned {
    position: relative;
}

.item.owned::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

.item.owned::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    z-index: 2;
    font-weight: bold;
}

.owned {
    color: #00ff00;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
}

.item-icon {
    width: 100% !important; /* Force it to always be 100% */
    height: 100% !important; /* Force it to always be 100% */
    margin: 0; /* Remove any margin */
    padding: 0; /* Ensure no padding */
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-sizing: border-box; /* Ensure border is included in the dimensions */
}

.item-cost {
    position: absolute;
    bottom: -25px;
    font-size: 14px;
    white-space: nowrap;
    text-align: center;
    width: 100%;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
}

.item-slot .rare-item .item-icon {
    border: 2px solid var(--gradient-rare-start);
}

.item-slot .epic-item .item-icon {
    border: 2px solid var(--gradient-epic-start);
}

.empty-item {
    background-color: transparent;
    border: none;
}

.item.owned:hover::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: calc(100% - 1px);
    height: calc(100% - 1px);
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(1) translateY(-1px);
}

/* Adjust the position of the breathing border for owned items */
.item.owned:hover::before {
    transform: translate(calc(-50% - 1px), calc(-50% - 1px));
}

/* Responsive adjustments */
/* XL Breakpoint - 1199.98px */
@media (max-width: 1199.98px) {
    .main-content {
        max-height: none;
    }
    
    .hero-roster {
        margin-top: 0.625rem;
        width: 100%;
    }
    
    .hero-icon {
        width: 40px;
        height: 40px;
        aspect-ratio: 1/1;
    }
}

/* LG Breakpoint - 991.98px */
@media (max-width: 991.98px) {
    .main-content {
        flex-direction: column;
        height: auto;
    }
    
    .left-panel {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #1a2a4a;
        margin-bottom: 0.9375rem;
        margin-right: 0;
        max-height: none;
        height: auto;
        overflow-y: visible;
    }
    
    .power-slot {
        width: calc(25% - 8px);
    }
    
    /* Maintain consistent 3x2 grid */
    .item-slot {
        width: calc(33.33% - 6px);
    }
    
    .round-tab.copy-button {
        font-size: 0.5rem;
        padding: 2px 4px;
        margin-left: 5px;
        height: 34px;
        min-width: 70px;
        max-width: 75px;
    }
    
    .item-column {
        max-width: none;
    }
    
    .power-grid {
        width: 100%;
    }
}

/* MD Breakpoint - 767.98px */
@media (max-width: 767.98px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .hero-roster {
        margin-left: 0;
        margin-top: 1rem;
        width: 100%;
        align-items: center;
    }
    
    .hero-grid {
        width: 100%;
        justify-content: center;
        flex-direction: row;
        gap: 8px; /* Slightly increase gap for better spacing on mobile */
        max-width: 360px; /* Force wrapping on smaller screens */
        margin: 0;
    }

    .tabs {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .tab {
        flex-grow: 1;
        text-align: center;
        font-size: 0.75rem;
    }
    
    /* Change round tab text to short form on mobile */
    .round-tab[data-round="1"] {
        font-size: 0;
    }
    .round-tab[data-round="1"]::before {
        content: "R1";
        font-size: 10px;
    }
    
    .round-tab[data-round="2"] {
        font-size: 0;
    }
    .round-tab[data-round="2"]::before {
        content: "R2";
        font-size: 10px;
    }
    
    .round-tab[data-round="3"] {
        font-size: 0;
    }
    .round-tab[data-round="3"]::before {
        content: "R3";
        font-size: 10px;
    }
    
    .round-tab[data-round="4"] {
        font-size: 0;
    }
    .round-tab[data-round="4"]::before {
        content: "R4";
        font-size: 10px;
    }
    
    .round-tab[data-round="5"] {
        font-size: 0;
    }
    .round-tab[data-round="5"]::before {
        content: "R5";
        font-size: 10px;
    }
    
    .round-tab[data-round="6"] {
        font-size: 0;
    }
    .round-tab[data-round="6"]::before {
        content: "R6";
        font-size: 10px;
    }
    
    .round-tab[data-round="7"] {
        font-size: 0;
    }
    .round-tab[data-round="7"]::before {
        content: "R7";
        font-size: 10px;
    }

    .items-grid {
        flex-direction: column;
    }
    
    .item-column {
        border-right: none;
        border-bottom: 2px solid #1a2a4a;
        width: 100%;
    }
    
    .item-column:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .round-tab.copy-button {
        font-size: 0.4375rem;
        padding: 2px 3px;
        margin-left: 3px;
        min-width: 60px;
        max-width: 65px;
        height: 34px;
    }
    
    .top-controls {
        flex-wrap: wrap;
        margin-right: 0;
    }
    
    .round-selector {
        width: 100%;
        margin-bottom: 0.5rem;
        order: 1;
    }
    
    .utility-buttons {
        order: 2;
        width: 100%;
        justify-content: space-between;
        margin-bottom: 0.5rem;
    }
    
    .round-tabs {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .power-row {
        flex-direction: column;
    }
    
    .power-card {
        margin-bottom: 0.625rem;
    }
}

/* SM Breakpoint - 575.98px */
@media (max-width: 575.98px) {
    .hero-grid {
        max-width: 320px; /* Even narrower to force more wrapping on small screens */
    }
    body {
        padding: 0.5rem;
    }
    
    .container {
        border-radius: 5px;
    }
    
    .title {
        font-size: 3.2rem;
        margin-bottom: -1rem;
    }
    
    .hero {
        font-size: 2.4rem;
    }
    
    .tab {
        padding: 0.5rem;
        font-size: 0.6875rem;
    }
    
    .item-slot .empty-slot,
    .empty-slot,
    .item,
    .empty-item {
        width: 3rem;
        height: 3rem;
    }
    
    .power-slot, .item-slot {
        width: calc(33.33% - 6px);
    }
    
    .stat-header .stat-name {
        font-size: 0.5625rem;
    }
    
    .stat-header .stat-value {
        font-size: 0.625rem;
    }
    
    .hero-icon {
        width: 32px;
        height: 32px;
        aspect-ratio: 1/1;
    }
    .footer {
        padding: 0.75rem 0;
        font-size: 0.75rem;
    }
}

/* XS Breakpoint - 399.98px */
@media (max-width: 399.98px) {
    .hero-grid {
        max-width: 240px; /* Force wrapping to 3-4 icons per row on very small screens */
    }
    .power-slot {
        width: calc(50% - 6px);
    }
    
    /* Maintain consistent 3x2 grid */
    .item-slot {
        width: calc(33.33% - 6px);
    }
    
    .item-slot .empty-slot,
    .empty-slot,
    .item,
    .empty-item {
        width: 2.75rem;
        height: 2.75rem;
    }
    
    .tab {
        padding: 0.375rem;
        font-size: 0.625rem;
        margin: 1px;
    }
    
    .hero-icon {
        width: 28px;
        height: 28px;
        aspect-ratio: 1/1;
    }
}

/* Message container styling */
.message-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    pointer-events: none; /* Allow clicking through the container */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Base message styling */
.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background-color: rgba(12, 26, 48, 0.85);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    border: 1px solid rgba(42, 75, 141, 0.6);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
    opacity: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    letter-spacing: 0.5px;
    max-width: 80%;
    text-align: center;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Message type-specific styling */
.message-error {
    background-color: rgba(220, 53, 69, 0.85);
    border-color: rgba(220, 53, 69, 0.6);
}

.message-warning {
    background-color: rgba(255, 193, 7, 0.85);
    border-color: rgba(255, 193, 7, 0.6);
    color: #333; /* Darker text for better contrast on yellow */
}

.message-success {
    background-color: rgba(40, 167, 69, 0.85);
    border-color: rgba(40, 167, 69, 0.6);
}

.message-info {
    background-color: rgba(23, 162, 184, 0.85);
    border-color: rgba(23, 162, 184, 0.6);
}

.item-slot .item {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 3px;
    box-sizing: border-box;
    border: 1px solid white;
}

.item-slot .common-item,
.item-slot .rare-item,
.item-slot .epic-item {
    background-repeat: no-repeat;
    border: 1px solid var(--border-secondary);
}

.item-slot .common-item {
    background: radial-gradient(circle, var(--gradient-common-start) 0%, var(--gradient-common-end) 100%);
}

.item-slot .rare-item {
    background: radial-gradient(circle, var(--gradient-rare-start) 0%, var(--gradient-rare-end) 100%);
}

.item-slot .epic-item {
    background: radial-gradient(circle, var(--gradient-epic-start) 0%, var(--gradient-epic-end) 100%);
}

.power-card.equipped {
    border: none;
    position: relative;
}

.power-card.equipped::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 18px;
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    z-index: 2;
    font-weight: bold;
}

.power-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(25% - 6px);
    height: 85px;
    position: relative;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.power-slot.unlocked {
    opacity: 1;
}

.power-slot:not(.unlocked) .empty-slot {
    position: relative;
}

.power-slot:not(.unlocked) .empty-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('res/ui/ui_lock.svg');
    background-size: 25%;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 3;
}

.power-slot:not(.unlocked) .empty-slot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.power-slot.unlocked .empty-slot::before {
    content: none;
}

/* Remove unused tooltip-power styling */
.tooltip-header.tooltip-power,
.tooltip-header.tooltip-power.orange,
.tooltip-header.tooltip-power.rare,
.tooltip-header.tooltip-power.epic,
.tooltip-header.tooltip-power.common {
    display: none; /* Hide all power tooltips */
}

/* Make sure there's only one instance of these common target slot highlighting styles */
.target-slot .empty-slot,
.target-slot .item,
.target-power-slot .empty-slot,
.target-power-slot .power-icon {
    position: relative;
    transform: scale(1.05);
    transition: all 0.2s ease;
    z-index: 5;
}

/* Add a distinctive highlight border using ::after pseudo-element that matches item hover style */
.target-slot .empty-slot::after,
.target-slot .item::after,
.target-power-slot .empty-slot::after,
.target-power-slot .power-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid white;
    border-radius: inherit;
    animation: breathe 2.0s infinite ease-in-out;
    pointer-events: none;
}

/* Animation keyframes are now unified at the top of the file */

/* Style for highlighting original items when hovering over slot items */
.highlight-original {
    transform: scale(1.1);
    z-index: 10;
    border: 2px solid var(--highlight-border);
    position: relative;
}

/* Style for highlighting original power cards when hovering over slot powers */
.power-card.highlight-original-power {
    transform: scale(1.05);
    z-index: 10;
    border: 2px solid var(--highlight-border);
    position: relative;
}

/* Prevent duplicate hover effects when highlighted */
.highlight-original:hover::after,
.power-card.highlight-original-power:hover::after {
    display: none;
}

/* Unified power icon in slots */
.power-slot .power-icon {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    cursor: pointer;
    transition: transform 0.2s ease;
    background-color: var(--power-bg);
    border: 1px solid var(--power-border);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.power-slot .power-icon:hover {
    transform: scale(1.05);
}

/* Remove all power slot icon rarity variants since they're not used */
.power-slot .power-icon.orange,
.power-slot .power-icon.rare,
.power-slot .power-icon.epic,
.power-slot .power-icon.common {
    /* No special styling needed */
}

.top-controls {
    display: flex;
    margin-right: clamp(0.75rem, 4vw, 1.25rem);
}

.round-selector {
    flex: 1;
    display: flex;
    justify-content: flex-start; /* Left align */
}

.utility-buttons {
    display: flex;
    justify-content: space-between;
}

.utility-buttons .left-buttons {
    display: flex;
}

.round-tabs {
    display: flex;
    background-color: #081020;
    border-radius: 5px;
    overflow: hidden;
    height: 36px;
}

.round-tab {
    padding: 0 10px;
    font-weight: 900;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
    border-radius: 3px;
    margin: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--subtle-text);
    font-size: 10px;
    letter-spacing: 1px;
    white-space: nowrap;
    flex: 1;
    min-width: 50px;
    text-transform: uppercase;
    background-color: rgba(26, 42, 74, 0.4);
    border: 1px solid rgba(42, 75, 141, 0.3);
}

.round-tab.active {
    background-color: #2a4b8d; /* Stronger highlight blue */
    color: #ffffff; /* Bright white text */
    border-color: #4a6ba6; /* Lighter border for contrast */
    box-shadow: 0 0 8px rgba(42, 75, 141, 0.8), inset 0 0 3px rgba(255, 255, 255, 0.3); /* Enhanced glow */
}

.round-tab:hover:not(.active) {
    background-color: rgba(26, 42, 74, 0.6); /* Slightly darker on hover */
    color: #8a9bbd; /* Brighter text on hover */
    border-color: rgba(42, 75, 141, 0.5); /* More visible border on hover */
    box-shadow: 0 0 5px rgba(42, 75, 141, 0.3); /* Subtle hover glow */
    cursor: pointer;
}

/* Style for utility buttons */
.utility-button {
    border-radius: 3px;
    margin: 2px;
    font-weight: bold;
    transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
    white-space: normal;
    font-size: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    padding: 3px 8px;
    min-width: 80px;
    cursor: pointer;
}

/* Style for copy to next round button */
.utility-button.copy-button {
    background-color: rgba(150, 50, 20, 0.5); /* Dark orange background */
    color: rgba(255, 120, 80, 1); /* Brighter orange text */
    border: 1px solid rgba(180, 60, 20, 0.9); /* Darker orange border */
    flex-direction: column;
    box-shadow: 0 0 5px rgba(180, 60, 20, 0.4), inset 0 0 3px rgba(255, 255, 255, 0.3); /* Adjusted glow to match darker border */
}

.utility-button.copy-button:hover {
    background-color: rgba(180, 60, 20, 0.7); /* Slightly brighter dark orange */
    color: #ffffff;
    border-color: rgba(200, 70, 30, 0.9);
    box-shadow: 0 0 8px rgba(200, 70, 30, 0.5), inset 0 0 3px rgba(255, 255, 255, 0.5);
}

.utility-button.copy-button:active {
    transform: translateY(1px);
}

/* Style for share button */
.utility-button.share-button {
    background-color: rgba(20, 100, 150, 0.5); /* Dark blue background */
    color: rgba(80, 180, 255, 1); /* Brighter blue text */
    border: 1px solid rgba(20, 120, 180, 0.9); /* Darker blue border */
    box-shadow: 0 0 5px rgba(20, 120, 180, 0.4), inset 0 0 3px rgba(255, 255, 255, 0.3); /* Adjusted glow to match darker border */
}

.utility-button.share-button:hover {
    background-color: rgba(20, 120, 180, 0.7); /* Slightly brighter dark blue */
    color: #ffffff;
    border-color: rgba(30, 140, 200, 0.9);
    box-shadow: 0 0 8px rgba(30, 140, 200, 0.5), inset 0 0 3px rgba(255, 255, 255, 0.5);
}

.utility-button.share-button:active {
    transform: translateY(1px);
}

.reset-tab {
    background-color: rgba(255, 107, 61, 0.15);
    color: #ff6b3d;
    border: 1px solid #ff6b3d;
    border-radius: 3px;
    margin: 2px;
    font-size: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
    padding: 0 15px; /* Slightly wider padding */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 32px; /* Match the round-tab height */
}

.reset-tab:hover {
    background-color: rgba(255, 107, 61, 0.3);
    color: white;
    box-shadow: 0 0 5px rgba(255, 107, 61, 0.3);
}

.reset-tab:active {
    transform: scale(0.95);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #0c1a30;
    border: 1px solid #2a4b8d;
    border-radius: 8px;
    width: 350px;
    max-width: 90%;
    padding: 25px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px);
    transition: transform 0.3s;
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-title {
    color: #ff6b3d;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 1px;
}

.modal-message {
    color: #8a9bbd;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.modal-button {
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.modal-button.cancel {
    background-color: #1a2a4a;
    color: #8a9bbd;
    border: 1px solid #2a4b8d;
}

.modal-button.confirm {
    background-color: #ff6b3d;
    color: white;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modal-button:active {
    transform: translateY(1px);
}

/* Hide lock icon when power is equipped */
.power-slot .power-icon + .empty-slot::before,
.power-slot .power-icon::before {
    content: none;
}

/* Remove all text indicators */
.power-slot.active-round.current-round::before,
.power-slot.active-round.between-rounds::before,
.power-slot.active-round::before,
.power-slot::before {
    content: none;
    display: none;
}

/* Remove all box indicators */
.power-slot.active-round.current-round::after,
.power-slot.active-round.between-rounds::after,
.power-slot.active-round::after,
.power-slot::after {
    content: none;
    border: none;
    animation: none;
    display: none;
}

/* Reset the label styling to default */
.power-slot.active-round.current-round .slot-label,
.power-slot.active-round.between-rounds .slot-label {
    color: #8a9bbd;  /* Default color */
    font-weight: normal;
}

.power-card.disabled {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.power-card.disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    z-index: 2;
}

.power-card.disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('res/ui/ui_lock.svg');
    background-size: 8%;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 3;
}

.power-slot.active-round {
    position: relative;
}

.power-slot.active-round::after {
    content: '';
    position: absolute;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    border: 2px solid #ff6b3d;
    border-radius: 8px;
    top: -5px;
    left: -5px;
    pointer-events: none;
    animation: pulse 2s infinite;
    display: block;
}

.power-slot.current-round::after {
    content: '';
    border: 2px solid #00ff00;
    animation: pulse 2s infinite;
    display: block;
}

.power-slot.current-round::before {
    content: 'CURRENT';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #00ff00;
    font-weight: bold;
    letter-spacing: 1px;
    display: block;
}

/* Using the unified pulse animation from the top of the file */

.power-slot.active-round.between-rounds::after {
    border: 2px dashed #ff6b3d;
    animation: pulse 3s infinite;
}

.power-slot.active-round.between-rounds::before {
    content: 'NEXT POWER';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #ff6b3d;
    font-weight: bold;
    letter-spacing: 1px;
}

.power-slot.active-round.current-round::before,
.power-slot.active-round.between-rounds::before,
.power-slot.active-round::before,
.power-slot::before {
    content: none;
    display: none;
}

.power-slot.active-round.current-round::after,
.power-slot.active-round.between-rounds::after,
.power-slot.active-round::after,
.power-slot::after {
    content: none;
    border: none;
    animation: none;
    display: none;
}

.power-slot.active-round.current-round .slot-label,
.power-slot.active-round.between-rounds .slot-label {
    color: #8a9bbd;  /* Default color */
    font-weight: normal;
}

/* Even more compact layout for narrow screens */
@media (max-width: 1100px) {
    .stat-header .stat-name {
        font-size: 8px;
        letter-spacing: 0;
    }

    .stat-header .stat-value {
        width: 35px;
        min-width: 35px;
        font-size: 10px;
    }
}

/* Remove all scrollbar styling throughout the app */
::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbars for Firefox, IE and Edge */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Tooltip Styles */
.item-tooltip {
    position: absolute;
    z-index: 10000; /* Increase z-index to ensure it's above everything */
    min-width: 220px;
    max-width: 280px;
    background-color: rgba(12, 26, 48, 0.95); /* Match --bg-panel with transparency */
    color: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 1px rgba(42, 75, 141, 0.4);
    padding: 12px;
    pointer-events: none; /* Ensure it doesn't interfere with mouse events */
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    transition: none !important;
    animation: tooltipFadeIn 0.2s ease-out forwards !important;
    will-change: left, top, opacity, transform; /* Optimize rendering performance */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(42, 75, 141, 0.8); /* Match --border-primary with transparency */
    margin-top: 8px; /* Space for the arrow */
}

/* Add arrow to tooltip */
.item-tooltip::before {
    content: '';
    position: absolute;
    top: -8px; /* Position at the top of the tooltip */
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(12, 26, 48, 0.95); /* Match updated tooltip background */
    z-index: 10001; /* Above the tooltip */
}

/* Tooltip fade-in animation */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tooltip-header {
    font-size: 18px;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25); /* More visible border */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* Text shadow for better readability */
}

.tooltip-stats {
    padding: 2px 0;
    margin-bottom: 5px;
}

.tooltip-description {
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25); /* More visible border */
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* Text shadow for better readability */
}

.tooltip-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.stat-name {
    color: var(--tooltip-stat);
    font-weight: 500;
}

.stat-value {
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); /* Text shadow for better readability */
}

.tooltip-cost {
    color: var(--tooltip-cost);
    margin-top: 5px;
    text-align: right;
    font-weight: bold;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); /* Text shadow for better readability */
}

.tooltip-cost i {
    color: var(--tooltip-cost);
    margin-right: 5px;
    font-size: 14px;
}

/* Hero roster in header */
.hero-roster {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 15px;
}

.hero-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
    max-width: 480px; /* Set max-width to create two rows by default on desktop */
}

.hero-row {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}

.hero-icon {
    width: 48px;
    height: 48px;
    aspect-ratio: 1/1;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #3a5a9a;
    transition: all 0.2s ease;
    opacity: 0.8;
    position: relative;
    box-shadow: 0 0 5px rgba(58, 90, 154, 0.4);
}

.hero-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    pointer-events: none;
}

.hero-icon:hover {
    border-color: #ff6b3d;
    opacity: 1;
    transform: scale(1.1);
    z-index: 5;
    box-shadow: 0 0 8px rgba(255, 107, 61, 0.5);
}

.hero-icon:hover::after {
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-icon.active {
    border-color: #ff6b3d;
    opacity: 1;
    box-shadow: 0 0 10px rgba(255, 107, 61, 0.6);
}

.hero-icon.active::after {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3);
}

.hero-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 1/1;
}

.power-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain; /* Adjust as needed: contain, cover, scale-down */
    display: block; /* Or inline-block if preferred for layout */
    margin: 0; /* Reset any potential default margin */
    border: 1px solid var(--power-border); /* Added border */
    border-radius: 3px; /* Add slight rounding to match other elements */
}

/* Advanced Options Styles */
.advanced-options {
    font-family: 'Roboto', sans-serif;
    font-size: 14px; /* Base font size for consistency */
}

.advanced-section {
    background-color: var(--bg-panel);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.option-row {
    display: flex;
    margin-bottom: 15px;
}

.option-label {
    font-weight: 500;
    width: 150px;
    padding-right: 15px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
}

.option-control {
    flex: 1;
    display: flex;
    align-items: center;
}

.option-control.center-button {
    justify-content: center;
}

/* Toggle Switch */
.toggle-switch, .preset-toggle-switch {
    display: flex;
    align-items: center;
}

.toggle-switch input[type="checkbox"],
.preset-toggle-switch input[type="checkbox"] {
    display: none;
}

/* Apply styles to both toggle types */
.toggle-label,
.preset-toggle-switch .toggle-label {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: var(--bg-element);
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.toggle-label::after,
.preset-toggle-switch .toggle-label::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background-color: var(--text-secondary);
    top: 4px;
    left: 4px;
    transition: all 0.3s ease;
}

input[type="checkbox"]:checked + .toggle-label,
.preset-toggle-switch input[type="checkbox"]:checked + .toggle-label {
    background-color: var(--accent-orange);
}

input[type="checkbox"]:checked + .toggle-label::after,
.preset-toggle-switch input[type="checkbox"]:checked + .toggle-label::after {
    transform: translateX(20px);
    background-color: white;
}

.toggle-text {
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Roboto', sans-serif;
    margin-left: 2px;
}

/* Preset toggle row */
.preset-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Button container for Apply and Reset buttons */
.preset-toggle-row .button-group {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
}

/* Button styles for Reset Presets button */
#reset-presets {
    background-color: rgba(26, 42, 74, 0.4);
    color: var(--text-secondary);
    border: 1px solid rgba(42, 75, 141, 0.3);
    padding: 5px 10px;
    border-radius: 3px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    margin: 0 5px;
    min-width: 80px;
    text-align: center;
}

#reset-presets:hover {
    background-color: rgba(26, 42, 74, 0.6);
    color: #8a9bbd;
    border-color: rgba(42, 75, 141, 0.5);
    box-shadow: 0 0 5px rgba(42, 75, 141, 0.3);
}

/* Economy slider styles */
.economy-slider {
    width: calc(100% - 60px);
    height: 8px;
    appearance: none;
    background: #1a2a4a;
    outline: none;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: opacity 0.3s;
    /* Always visible, even when disabled */
    opacity: 1 !important;
}

.economy-slider:disabled {
    cursor: not-allowed;
}

.economy-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: var(--accent-orange);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    /* Always visible */
    opacity: 1;
    transition: all 0.2s ease;
    border: 1px solid #ff8d6a;
}

.economy-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: var(--accent-orange);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    border: 1px solid #ff8d6a;
    /* Always visible */
    opacity: 1;
    transition: all 0.2s ease;
}

.economy-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(255, 107, 61, 0.6);
}

.economy-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(255, 107, 61, 0.6);
}

.slider-value {
    width: 50px;
    text-align: right;
    color: var(--text-primary);
    font-size: 14px;
    opacity: 1;
    transition: opacity 0.3s;
}

/* Additional responsive styles for advanced options */
@media (max-width: 992px) {
    .economy-preset-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
        border: 1px solid var(--border-secondary);
        border-radius: 5px;
        margin-bottom: 15px;
    }
    
    .preset-table-header {
        display: none;
    }
    
    .round-column {
        width: 100%;
        margin-bottom: 10px;
        font-size: 16px;
        padding-bottom: 5px;
        border-bottom: 1px solid var(--border-secondary);
    }
    
    .preset-column-container {
        display: flex;
        width: 100%;
        justify-content: space-between;
        margin-bottom: 10px;
    }
    
    .preset-column {
        width: calc(33.33% - 10px);
        margin: 5px;
    }
    
    .custom-column {
        width: 100%;
        padding: 10px 0 0 0;
    }
    
    /* Ensure sliders are wider on smaller screens */
    .economy-slider {
        width: calc(100% - 80px);
        margin-right: 10px;
    }
    
    .slider-value {
        width: 70px;
        text-align: right;
    }
    
    /* Improve custom column layout */
    .custom-column {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 5px;
    }
    
    .preset-toggle-row {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        margin-bottom: 15px;
    }
    
    .preset-toggle-switch {
        margin-bottom: 5px;
    }
    
    .button-group {
        display: flex;
        margin-left: auto;
    }
    
    #reset-presets {
        margin: 2px;
        min-width: 60px;
    }
}

@media (max-width: 768px) {
    .option-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .option-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .option-control {
        width: 100%;
    }
    
    .toggle-switch {
        width: 100%;
    }
    
    /* Further adjustments for smaller mobile screens */
    .preset-column {
        font-size: 12px;
        padding: 6px 4px;
    }
}

/* Main option button style */
.option-button {
    background-color: #ff6b3d; /* Solid orange background */
    color: #ffffff; /* White text */
    border: 1px solid #ff8d6a; /* Lighter orange border for contrast */
    border-radius: 3px;
    font-weight: 900;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(255, 107, 61, 0.4), inset 0 0 3px rgba(255, 255, 255, 0.3); /* Enhanced glow */
}

/* Option button hover and active states */
.option-button:hover {
    background-color: #ff8054; /* Slightly lighter orange on hover */
    color: #ffffff;
    border-color: #ff9e80;
    box-shadow: 0 0 8px rgba(255, 107, 61, 0.7), inset 0 0 3px rgba(255, 255, 255, 0.5);
}

.option-button:active {
    transform: scale(0.95);
    background-color: #e65d34; /* Slightly darker when clicked */
    box-shadow: 0 0 5px rgba(255, 107, 61, 0.3), inset 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Preset Table Header */
.preset-table-header {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-secondary);
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 14px;
}

/* Preset Column in the header only */
.preset-table-header .preset-column {
    background-color: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-primary);
    pointer-events: none;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    padding: 6px 8px;
    text-align: center;
    width: 18%;
    margin: 0 2px;
    font-size: 14px;
}

/* Regular preset column (not in header) */
.economy-preset-row .preset-column {
    font-family: 'Roboto', sans-serif;
    padding: 6px 8px;
    text-align: center;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
    width: 18%;
    max-width: 200px;
    margin: 0 2px;
    color: var(--text-secondary);
    opacity: 1 !important; /* Always visible */
    pointer-events: auto !important; /* Always clickable */
    background-color: rgba(26, 42, 74, 0.4);
    border: 1px solid rgba(42, 75, 141, 0.3);
}

/* Economy Preset Row */
.economy-preset-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Default styling for preset-column-container (desktop) */
.preset-column-container {
    display: flex;
    flex: 1;
}

.economy-preset-row .preset-column {
    flex: 1;
}

.economy-preset-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.round-column {
    padding-right: 20px;
}

/* Custom column styles */
.custom-column {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    padding: 0 5px;
    transition: opacity 0.3s ease;
}

/* Only the custom column is disabled by default, not its children */
.custom-column {
    opacity: 0.5;
    pointer-events: none;
}

.custom-column.active {
    opacity: 1;
    pointer-events: auto;
}

/* Add the highlight-enabled class for preset columns */
.preset-column.highlight-enabled:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Only show selected state when highlight-enabled */
.preset-column.selected.highlight-enabled {
    background-color: #2a4b8d; /* Stronger highlight blue */
    color: #ffffff; /* Bright white text */
    border-color: #4a6ba6; /* Lighter border for contrast */
    box-shadow: 0 0 8px rgba(42, 75, 141, 0.8), inset 0 0 3px rgba(255, 255, 255, 0.3); /* Enhanced glow */
}

/* Budget selector styles */
.budget-selector {
    cursor: pointer;
    text-decoration: underline;
    color: #f8e58c;
    transition: color 0.3s ease;
    font-weight: bold;
}

.budget-selector:hover {
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.budget-preset-menu {
    background-color: rgba(12, 26, 48, 0.85);
    border: 1px solid rgba(42, 75, 141, 0.6);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    overflow: hidden;
    width: 180px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.budget-preset-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.budget-preset-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #8a9bbd;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(42, 75, 141, 0.3);
    position: relative;
}

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

.budget-preset-item::after {
    content: '';
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    opacity: 0.7;
}

.budget-preset-item:hover {
    background-color: rgba(42, 75, 141, 0.4);
    color: #fff;
}

/* Low preset color indicator - RED */
.budget-preset-item[data-preset-type="low"]::after {
    background-color: #ff4d4d;
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.5);
}

/* Normal preset color indicator - BLUE */
.budget-preset-item[data-preset-type="normal"]::after {
    background-color: #2a9aff;
    box-shadow: 0 0 8px rgba(42, 154, 255, 0.5);
}

/* High preset color indicator - GREEN */
.budget-preset-item[data-preset-type="high"]::after {
    background-color: #2aff4a;
    box-shadow: 0 0 8px rgba(42, 255, 74, 0.5);
}

/* Footer styles */
.footer {
    width: 100%;
    background-color: var(--bg-darker);
    padding: 1rem 0;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2a4b8d, transparent);
    top: 0;
    left: 0;
}

.footer-content {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.footer a {
    color: var(--accent-orange);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}