/* Hero Detail View - Premium Glassmorphism & Neon Aesthetic */

.hero-detail-view {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Changed from 15px to 0 for the header */
    background: var(--surface-glass);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    padding: 0;
    /* Padding moved to sub-containers */
    color: var(--text-main);
    font-family: 'Outfit', 'Inter', sans-serif;
    width: 100%;
    max-width: 1100px;
    height: 98vh;
    max-height: 98vh;
    margin: 1vh auto;
    overflow: hidden;
    /* Prevent scrolls on outer container */
    border-radius: var(--border-radius);
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.4);
    position: relative;
    box-sizing: border-box;
}

.hero-modal-header {
    height: 80px;
    background: rgba(20, 20, 25, 0.6);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    position: relative;
    box-sizing: border-box;
    flex-shrink: 0;
}

.hero-modal-title {
    font-family: 'Press Start 2P', cursive;
    color: var(--neon-gold);
    font-size: 1.5rem;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.5),
        2px 2px 0 #000;
    margin: 0;
    text-align: center;
    flex: 1;
    letter-spacing: 2px;
}

.hero-modal-ident {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.hero-modal-subtitle {
    display: flex;
    gap: 15px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.hero-modal-level {
    color: var(--neon-gold);
}

.hero-modal-class {
    color: #aaa;
}

.hero-modal-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hero-detail-view.initial-fade {
    /* animation: hero-view-fade-in 0.5s cubic-bezier(0.16, 1, 0.3, 1); */
    opacity: 1 !important;
    animation: none !important;
}

@keyframes hero-view-fade-in {
    from {
        opacity: 1;
        /* Forced to 1 */
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header & Identity */
.hero-identity-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 25px;
    /* Reduced gap */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    padding: 15px 20px;
    /* Reduced padding */
    border-radius: 12px;
    border: none;
    /* Removed border */
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.hero-identity-portrait-frame {
    position: relative;
    width: 160px;
    /* Enlarged portrait */
    height: 160px;
}

.hero-identity-portrait {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    border: 2px solid var(--border-glass);
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-main);
    filter: contrast(1.1) brightness(1.1);
}

.hero-identity-portrait-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, var(--neon-gold) 0%, transparent 70%);
    opacity: 0.3;
    filter: blur(20px);
    z-index: 1;
    animation: portrait-pulse 3s infinite alternate ease-in-out;
}

@keyframes portrait-pulse {
    from {
        opacity: 0.2;
        transform: scale(0.95);
    }

    to {
        opacity: 0.4;
        transform: scale(1.05);
    }
}

.hero-identity-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0px;
    /* Removed gap to collapse space */
}

.hero-identity-name-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hero-identity-name {
    font-size: 1.6rem;
    /* Compact name */
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    background: linear-gradient(to bottom, #fff 40%, #ccc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.hero-level {
    color: var(--neon-gold);
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
    font-size: 1rem;
    font-weight: 800;
}

.hero-class {
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 600;
}

.hero-identity-status-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 10px;
}

.hero-identity-status-labels {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Tracking & Resources */
.hero-experience-tracker {
    height: 24px;
    /* Match vitals height */
    background: #1a1a1a;
    border: 2px solid #000;
    position: relative;
    overflow: hidden;
    max-width: 450px;
    margin: 8px 0;
    box-shadow: 2px 2px 0 #000;
}

.hero-experience-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 24px;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    font-weight: 900;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    z-index: 5;
    pointer-events: none;
    top: 0;
}

.hero-experience-fill {
    height: 100%;
    background: var(--gold-gradient);
    box-shadow: 0 0 15px var(--neon-gold);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-resource-vitals {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Tighter gap */
}

.hero-resource-bar {
    height: 24px;
    /* Increased from 12px */
    background: #2a2a2a;
    border: 2px solid #1a1a1a;
    /* Pixel-y thick border */
    border-radius: 0;
    /* No rounding for pixel style */
    position: relative;
    overflow: hidden;
    max-width: 450px;
    box-shadow: 2px 2px 0 #000;
    /* Distinct pixel shadow */
}

.hero-resource-fill {
    height: 100%;
    position: relative;
    transition: width 0.4s ease-out;
    image-rendering: pixelated;
    /* Ensure pixel-y look if patterns are used */
    border-right: 2px solid rgba(0, 0, 0, 0.3);
    /* Segmented block look */
}

/* Shimmer removed for pixel style */

.hero-resource-fill.health {
    background: #e63946;
    /* Solid Pixel Red */
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
    /* Top highlight */
}

.hero-resource-fill.mana {
    background: #0077b6;
    /* Solid Pixel Blue */
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
    /* Top highlight */
}

.hero-resource-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 24px;
    /* Match bar height */
    font-size: 0.8rem;
    /* Slightly larger text */
    font-family: 'Courier New', monospace;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    z-index: 5;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

/* Panels & Layout */
.hero-layout-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Tightened gap */
    margin-top: 5px;
    /* Reduced margin */
}

.hero-top-row {
    display: flex;
    gap: 25px;
    align-items: stretch;
    /* Crucial: ensures Stats and Inventory have identical height */
}

.hero-bottom-row {
    width: 100%;
    border-top: none;
    padding-top: 2px;
    /* Minimal top padding */
}

.hero-main-stats-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Reduced gap */
}

.hero-stats-grid {
    display: flex;
    /* Switch to flex for easier 50/50 share inside the panel if needed, or keep grid but ensure 1fr 1fr */
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.hero-stats-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: none;
    /* Removed background */
    padding: 10px 0;
    /* Reduced padding, keeping context */
    border: none;
    /* Removed border */
    flex: 1;
    /* Allow to grow */
}

.hero-section-title {
    font-size: 0.9rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

/* Traits */
.hero-traits-section {
    position: relative;
    padding: 12px 16px 14px;
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
}

.hero-traits-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.hero-traits-header .hero-section-title {
    flex: 1;
    margin: 0;
}

.hero-traits-count {
    min-width: 24px;
    padding: 2px 7px;
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.hero-traits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-trait-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 4px 9px 4px 6px;
    border: 1px solid var(--border-glass);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.hero-trait-chip.positive {
    border-color: color-mix(in srgb, var(--success) 45%, transparent);
}

.hero-trait-chip.negative {
    border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

.hero-trait-chip.mixed {
    border-color: color-mix(in srgb, var(--warning) 45%, transparent);
}

.hero-trait-polarity {
    display: inline-grid;
    width: 22px;
    height: 22px;
    margin-right: 6px;
    place-items: center;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.82rem;
    font-weight: 900;
}

.positive .hero-trait-polarity { color: var(--success); }
.negative .hero-trait-polarity { color: var(--danger); }
.mixed .hero-trait-polarity { color: var(--warning); }

.hero-trait-name-trigger {
    position: relative;
    min-width: 0;
    border-radius: 3px;
    cursor: help;
}

.hero-trait-name-trigger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.hero-trait-name {
    display: block;
    max-width: 220px;
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-trait-duration {
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hero-trait-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    z-index: var(--z-tooltip);
    display: flex;
    width: max-content;
    max-width: min(320px, calc(100vw - 48px));
    box-sizing: border-box;
    padding: 11px 12px;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 7px;
    background: rgba(15, 15, 20, 0.98);
    box-shadow: var(--shadow-heavy);
    color: var(--text-main);
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity var(--transition-fast) ease, transform var(--transition-fast) ease;
    visibility: hidden;
}

.hero-trait-tooltip::after {
    position: absolute;
    top: 100%;
    left: 16px;
    width: 9px;
    height: 9px;
    border-right: 1px solid rgba(255, 215, 0, 0.35);
    border-bottom: 1px solid rgba(255, 215, 0, 0.35);
    background: rgba(15, 15, 20, 0.98);
    content: '';
    transform: translateY(-5px) rotate(45deg);
}

.hero-trait-name-trigger:hover .hero-trait-tooltip,
.hero-trait-name-trigger:focus .hero-trait-tooltip,
.hero-trait-name-trigger:focus-within .hero-trait-tooltip {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.hero-trait-tooltip-title {
    color: var(--neon-gold);
    font-size: 0.78rem;
    font-weight: 800;
}

.hero-trait-tooltip-effect {
    color: var(--text-main);
    font-size: 0.78rem;
}

.hero-trait-tooltip-meta {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.hero-traits-empty {
    padding: 4px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

@media (max-width: 560px) {
    .hero-traits-list,
    .hero-trait-chip {
        width: 100%;
    }

    .hero-trait-name-trigger {
        flex: 1;
        position: static;
    }

    .hero-trait-name {
        max-width: none;
    }

    .hero-trait-chip {
        box-sizing: border-box;
        position: relative;
    }

    .hero-trait-tooltip {
        right: 0;
        left: 0;
        width: auto;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-trait-tooltip {
        transition: none;
    }
}

/* Stat Rows */
.hero-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    height: 38px;
    /* Fixed height to prevent jumping */
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    /* Slightly smaller radius */
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.hero-stat-row:hover,
.hero-stat-row:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
    /* Smaller movement */
}

.hero-stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    /* Smaller font */
    font-weight: 600;
}

.hero-stat-value-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.hero-stat-value {
    font-size: 1rem;
    /* Smaller font */
    font-weight: 700;
    color: var(--text-muted);
    /* Muted by default for contrast with highlights */
}

.hero-stat-value.gold {
    color: var(--text-muted);
    /* Changed to muted to allow dependency highlights to pop */
}

.hero-stat-value.boosted {
    color: var(--success);
}

.hero-stat-diff {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
}

.hero-stat-preview-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-stat-value.old {
    opacity: 0.5;
}

.hero-stat-value.new {
    color: var(--success);
    font-weight: 800;
}

.hero-stat-arrow {
    color: var(--success);
    font-weight: 900;
    opacity: 0.8;
}

/* Skills Section */
.hero-skills-section {
    background: none;
    /* Removed background */
    border: none;
    /* Removed border */
    padding: 0;
}

.hero-skills-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Exactly 4 skills per row */
    gap: 12px;
    /* Balanced gap */
    margin-top: 8px;
}

/* Inventory Sidebar */
.hero-inventory-sidebar {
    flex: 1;
    /* Match the 50% split */
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    /* Reduced padding */
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.hero-equipment-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
}

/* Action Buttons */
.hero-action-btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.hero-action-btn-icon:hover {
    opacity: 1;
}

.hero-identity-actions {
    margin-top: 5px;
}

.hero-upgrade-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.hero-upgrade-btn.active {
    background: var(--gold-gradient);
    border-color: var(--neon-gold);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
}


/* Distribution Controls */
.hero-distribution-controls {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.hero-distro-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.hero-distro-btn.plus:hover {
    background: var(--success);
    border-color: var(--success);
}

.hero-distro-btn.minus:hover {
    background: var(--neon-red);
    border-color: var(--neon-red);
}

.hero-distro-btn.hidden {
    visibility: hidden;
    pointer-events: none;
}

.hero-points-distribution {
    margin-top: 20px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Minimal frame for interaction area */
}

.hero-skills-header {
    margin-top: -15px;
    /* Moved down (was -45px) */
    margin-bottom: 5px;
    line-height: 1;
}

.hero-points-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    width: 100%;
}

.hero-stat-row.distribution {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
}

.hero-points-label {
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
}

.hero-points-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.hero-points-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.hero-points-action-btn.confirm {
    color: var(--success);
    border-color: rgba(76, 175, 80, 0.3);
}

.hero-points-action-btn.confirm:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: var(--success);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.hero-points-action-btn.cancel {
    color: var(--danger);
    border-color: rgba(244, 67, 54, 0.3);
}

.hero-points-action-btn.cancel:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: var(--danger);
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.3);
}

.hero-points-label.gold {
    color: var(--neon-gold);
}

.hero-points-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    position: relative;
}

.hero-points-add-btn::before,
.hero-points-help::before {
    content: '';
    position: absolute;
    inset: -6px;
}

.hero-points-add-btn.active {
    background: rgba(255, 204, 0, 0.05);
    border: 2px solid var(--neon-gold);
    color: var(--neon-gold);
    text-shadow: 0 0 5px var(--neon-gold);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    animation: points-btn-breath 2s infinite alternate ease-in-out;
}

@keyframes points-btn-breath {
    from {
        transform: scale(1);
        box-shadow: 0 0 5px rgba(255, 204, 0, 0.2);
    }

    to {
        transform: scale(1.15);
        box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    }
}

.hero-points-add-btn.active:hover {
    background: rgba(255, 204, 0, 0.15);
    transform: scale(1.2) !important;
    box-shadow: 0 0 25px rgba(255, 204, 0, 0.7);
}

.hero-points-add-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    filter: grayscale(1);
}

.hero-points-help {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: help;
    transition: all 0.2s;
    user-select: none;
    font-weight: bold;
    margin-left: auto;
    padding: 0;
    position: relative;
}

.hero-points-help:hover {
    border-color: var(--neon-gold);
    color: var(--neon-gold);
    background: rgba(255, 204, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}

.hero-action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.hero-action-btn.primary {
    background: var(--accent);
    color: #fff;
}

.hero-action-btn.primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

.hero-action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.hero-action-btn.full {
    width: 100%;
}

.hero-distribution-actions {
    display: flex;
    gap: 10px;
}

/* Custom Scrollbar for the View */
.hero-detail-view::-webkit-scrollbar {
    width: 8px;
}

.hero-detail-view::-webkit-scrollbar-track {
    background: transparent;
}

.hero-detail-view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.hero-detail-view::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Skill Components */
.hero-skill-card {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Reduced gap */
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    /* More compact padding */
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    /* Changed from grab since selection is primary */
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    /* For absolute remove button */
    overflow: hidden;
    user-select: none;
}

.hero-skill-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.hero-skill-card.empty {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    justify-content: center;
    align-items: center;
    min-height: 66px;
    /* Ensure consistent height with filled slots */
    width: 100%;
    color: inherit;
    font: inherit;
}

.hero-skill-empty-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.hero-skill-icon {
    width: 44px;
    height: 44px;
    background-size: cover;
    border-radius: 6px;
    background-color: #222;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-skill-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hero-skill-name {
    font-weight: 800;
    color: #fff;
    font-size: 0.9rem;
    /* Slightly smaller */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-skill-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 900;
    letter-spacing: 1px;
}

.hero-skill-badge.active {
    color: var(--success);
    border: 1px solid var(--success);
}

.hero-skill-badge.passive {
    color: #888;
    border: 1px solid #444;
}

.hero-skill-cost {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Skill Slot Actions & Empty State */
.hero-skill-empty-plus {
    font-size: 2rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.hero-skill-card.empty:hover .hero-skill-empty-plus {
    color: var(--accent-light, #ffd700);
    transform: scale(1.2);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.hero-overlay-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    font-family: serif;
    width: 44px;
    height: 44px;
    padding: 10px;
    z-index: 10;
}

.hero-overlay-close:hover {
    color: #f44336;
    transform: scale(1.1) rotate(90deg);
}

.hero-skill-actions {
    display: contents;
    /* No longer a container for layout */
}

.hero-skill-action-btn.remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    /* Hidden by default */
    z-index: 10;
    border: 0;
    color: rgba(255, 255, 255, 0.65);
}

.hero-skill-card:hover .hero-skill-action-btn.remove,
.hero-skill-action-btn.remove:focus-visible {
    opacity: 1;
    /* Shown on card hover */
}

.hero-skill-action-btn.remove:hover {
    background: var(--danger);
    color: #fff;
    transform: scale(1.1);
}

/* Equipment Components */
.hero-equipment-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0;
    /* Gaps handled by justify-between or column margins */
    margin-top: 15px;
    flex: 1;
}

.hero-equipment-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    width: 70px;
    /* Precise width for the slots */
}

.hero-equipment-column.left {
    align-items: flex-start;
}

.hero-equipment-column.right {
    align-items: flex-end;
}

.hero-equipment-slot {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
    user-select: none;
}

.hero-equipment-slot.empty {
    border-color: rgba(217, 183, 110, 0.2);
    background:
        radial-gradient(circle at 50% 42%, rgba(217, 183, 110, 0.07), transparent 62%),
        rgba(0, 0, 0, 0.38);
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.32);
}

.hero-equipment-slot:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.hero-equipment-slot:focus-visible {
    outline: 2px solid rgba(234, 214, 157, 0.9);
    outline-offset: 3px;
}

.hero-equipment-slot.selected {
    border-color: var(--neon-gold);
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.16), 0 0 18px rgba(255, 215, 0, 0.18);
}

.hero-equipment-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-equipment-empty-icon {
    width: 38px;
    height: 38px;
    color: rgba(190, 177, 145, 0.42);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
    pointer-events: none;
    transition: color 180ms ease, filter 180ms ease, transform 180ms ease;
}

.hero-equipment-slot.empty:hover .hero-equipment-empty-icon,
.hero-equipment-slot.empty:focus-visible .hero-equipment-empty-icon {
    color: rgba(231, 207, 151, 0.76);
    filter: drop-shadow(0 0 5px rgba(217, 183, 110, 0.24));
    transform: scale(1.04);
}

.hero-equipment-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    position: absolute;
    bottom: 4px;
    text-transform: uppercase;
    font-weight: 800;
}

.hero-equipment-hint {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.1);
    font-style: italic;
    font-size: 0.8rem;
    text-align: center;
}

/* Full-width inventory inside hero details */
.hero-inline-inventory {
    display: flex;
    min-width: 0;
    padding: 18px;
    flex-direction: column;
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background:
        radial-gradient(circle at 86% 0%, rgba(255, 215, 0, 0.06), transparent 32%),
        rgba(0, 0, 0, 0.26);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.28);
}

.hero-inline-inventory-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.hero-inline-inventory-header .hero-section-title {
    margin-bottom: 4px;
}

.hero-inline-inventory-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.hero-inventory-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.hero-inventory-filter,
.hero-inventory-context button,
.hero-inventory-action {
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-main);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 750;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.hero-inventory-filter:hover,
.hero-inventory-filter:focus-visible,
.hero-inventory-context button:hover,
.hero-inventory-context button:focus-visible,
.hero-inventory-action:hover,
.hero-inventory-action:focus-visible {
    border-color: rgba(255, 215, 0, 0.6);
    outline: none;
    background: rgba(255, 215, 0, 0.1);
}

.hero-inventory-filter.active {
    border-color: var(--neon-gold);
    background: var(--gold-gradient);
    color: #17130a;
}

.hero-inventory-context {
    display: flex;
    min-height: 46px;
    padding: 8px 10px 8px 14px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(255, 215, 0, 0.34);
    border-radius: 8px;
    background: rgba(255, 215, 0, 0.07);
    color: var(--text-main);
    font-size: 0.82rem;
}

.hero-inventory-context strong {
    color: var(--neon-gold);
}

.hero-inventory-context-actions,
.hero-inventory-selection-actions {
    display: flex;
    gap: 8px;
}

.hero-inline-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.hero-inventory-card {
    display: grid;
    min-width: 0;
    min-height: 72px;
    padding: 9px;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--item-rarity) 55%, #24242b);
    border-radius: 9px;
    background: rgba(18, 18, 23, 0.78);
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.hero-inventory-card:hover,
.hero-inventory-card:focus-visible {
    border-color: var(--item-rarity);
    outline: none;
    background: rgba(38, 38, 46, 0.92);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28);
    transform: translateY(-2px);
}

.hero-inventory-card.selected {
    border-color: var(--neon-gold);
    background: rgba(255, 215, 0, 0.08);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.16);
}

.hero-inventory-card-icon {
    position: relative;
    display: block;
    width: 50px;
    height: 50px;
    border: 1px solid color-mix(in srgb, var(--item-rarity) 45%, transparent);
    border-radius: 7px;
    background-color: #131318;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    image-rendering: pixelated;
}

.hero-inventory-card-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.hero-inventory-card-copy strong,
.hero-inventory-card-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-inventory-card-copy strong {
    color: var(--item-rarity);
    font-size: 0.78rem;
}

.hero-inventory-card-copy span {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: capitalize;
}

.hero-inventory-count,
.hero-inventory-badge {
    position: absolute;
    display: grid;
    min-width: 17px;
    height: 17px;
    padding: 0 3px;
    place-items: center;
    box-sizing: border-box;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.86);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 900;
}

.hero-inventory-count { right: 2px; bottom: 2px; }
.hero-inventory-badge.locked { top: 2px; left: 2px; color: var(--neon-gold); }
.hero-inventory-badge.junk { top: 2px; right: 2px; color: #ff9a8f; }

.hero-inventory-selection {
    display: flex;
    min-height: 60px;
    padding: 10px 12px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-inventory-selection.empty {
    min-height: 40px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.hero-inventory-selection-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.hero-inventory-selection-copy strong {
    color: var(--text-main);
}

.hero-inventory-selection-copy > span:last-child,
.hero-inventory-selection-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.hero-inventory-selection-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hero-inventory-action.primary {
    border-color: var(--neon-gold);
    background: var(--gold-gradient);
    color: #17130a;
}

.hero-inventory-feedback {
    min-height: 18px;
    color: #b9ffad;
    font-size: 0.74rem;
}

.hero-inventory-empty {
    grid-column: 1 / -1;
    min-height: 90px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.hero-inventory-context-menu {
    position: fixed;
    z-index: 1000001;
    display: flex;
    width: 220px;
    padding: 6px;
    flex-direction: column;
    gap: 3px;
    border: 1px solid rgba(255, 215, 0, 0.38);
    border-radius: 8px;
    background: rgba(17, 17, 22, 0.98);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(12px);
}

.hero-inventory-context-menu button {
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    text-align: left;
}

.hero-inventory-context-menu button:hover,
.hero-inventory-context-menu button:focus-visible {
    outline: none;
    background: rgba(255, 215, 0, 0.12);
    color: var(--neon-gold);
}

@media (max-width: 760px) {
    .hero-inline-inventory-header,
    .hero-inventory-context,
    .hero-inventory-selection {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-inventory-filters {
        justify-content: flex-start;
    }

    .hero-inventory-filter {
        min-height: 44px;
    }

    .hero-inline-inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .hero-inventory-context-actions,
    .hero-inventory-selection-actions {
        width: 100%;
    }

    .hero-inventory-context-actions button,
    .hero-inventory-selection-actions button {
        min-height: 44px;
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-inventory-card,
    .hero-inventory-filter,
    .hero-inventory-context button,
    .hero-inventory-action {
        transition: none;
    }
}

/* Overlays & Selection */
.hero-selection-header,
.hero-skill-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-overlay-title {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-selection-row {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.hero-selection-row:hover,
.hero-selection-row:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.hero-selection-item-icon {
    width: 40px;
    height: 40px;
    background-size: cover;
    border-radius: 6px;
    background-color: #111;
}

.hero-selection-item-details {
    flex: 1;
}

.hero-selection-item-name {
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.hero-selection-item-type {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hero-selection-equip-prompt {
    font-weight: 900;
    color: var(--success);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-currently-equipped {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 62, 62, 0.05);
    border: 1px solid rgba(255, 62, 62, 0.2);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-equipped-brief {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hero-equipped-item-icon {
    width: 44px;
    height: 44px;
    background-size: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-equipped-status {
    font-size: 0.75rem;
    color: var(--neon-red);
    font-weight: 800;
    text-transform: uppercase;
}

.hero-equipped-name {
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.2;
}

.hero-action-btn-small {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: all 0.2s;
}

.hero-action-btn-small.unequip:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Skill Selection Specifics */
.hero-skill-selectable-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
}

.hero-skill-selectable-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.hero-skill-selectable-card.learnable {
    border-color: rgba(30, 255, 0, 0.35);
    background: rgba(30, 255, 0, 0.06);
}

.hero-skill-selectable-card:focus-visible,
.hero-skill-card:focus-visible,
.hero-overlay-close:focus-visible,
.hero-selection-row:focus-visible,
.hero-points-add-btn:focus-visible,
.hero-points-help:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.hero-skill-selection-icon {
    width: 44px;
    height: 44px;
    background-size: cover;
    border-radius: 10px;
    background-color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.hero-skill-selection-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.hero-skill-selection-name {
    font-weight: 800;
    color: #fff;
}

.hero-skill-selection-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-skill-selection-cost {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
    margin-top: 2px;
}

.hero-skill-selection-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 400px;
    padding-right: 5px;
}

.hero-skill-selection-section + .hero-skill-selection-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-skill-selection-section-title {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-skill-selection-empty,
.hero-skill-learning-error {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-muted);
    line-height: 1.5;
}

.hero-skill-learning-error {
    margin-top: 10px;
    border-color: rgba(244, 67, 54, 0.55);
    color: #ffb4ae;
}
