:root {
    --text-color: #ffffff;
    --bg-color: #121212;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'JetBrains Sans', sans-serif;
    background-color: var(--bg-color);
    background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url("assets/background.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

* {
    box-sizing: border-box;
}

.main-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #000;
    border-bottom: 2px solid #222;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-rune {
    width: 40px;
    height: 40px;
}

.header-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    cursor: default;
}

.header-nav {
    display: flex;
    justify-content: flex-start;
    padding: 0;
    flex-grow: 1;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-button, .auth-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 8px;
}

.nav-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.nav-button:hover, .auth-btn:hover {
    filter: brightness(1.2);
    background-color: rgba(255, 255, 255, 0.1);
}

.game-time-display, .game-day-display, .game-weather-display, .game-temp-display {
    cursor: default;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#game-health-display {
    margin-left: auto;
}

.game-weather-display {
    margin-left: 0;
}

.game-temp-display, .game-day-display, .game-time-display {
    margin-left: 0;
}

.game-time-display:hover, .game-day-display:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

#app {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

body:has(.profile-header-container):not(:has(.admin-main)) #app {
    justify-content: flex-start;
    align-items: flex-start;
}

/* Specific centering for world.html explore container */
body:has(.explore-container) #app {
    justify-content: center;
    align-items: center;
}

.landing-container {
    text-align: center;
    padding: 60px;
}

body:has(.profile-header-container) .landing-container {
    text-align: left;
    padding: 20px 40px;
}

/* Ensure Explore container on world.html is centered correctly */
body:has(.explore-container) .landing-container {
    text-align: center;
    padding: 20px;
    margin: 0 auto;
}

.landing-rune {
    width: clamp(160px, 40vw, 320px);
    height: auto;
    aspect-ratio: 1/1;
    margin-bottom: 20px;
}

.welcome-text {
    font-size: clamp(1.8rem, 8vw, 3.5rem);
    margin-bottom: 40px;
    font-weight: bold;
    text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    padding: 0 10px;
}

.auth-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-btn {
    background-color: #222;
    padding: 15px 40px;
    border: 1px solid #444;
    border-radius: 8px;
}

.form-container, .auth-container {
    background-color: rgba(0, 0, 0, 0.6);
    padding: clamp(30px, 8vw, 60px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 95%;
    max-width: 500px;
    margin: 40px auto;
}

.user-info {
    margin-top: 20px;
    color: #ccc;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.form-group label {
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 1px 1px 0 #000;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    border-color: #666;
    background-color: #222;
}

.register-submit {
    margin-top: 10px;
    align-self: center;
    width: 100%;
    justify-content: center;
}

.slideshow-container {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 250px;
    background-color: rgba(0, 0, 0, 0.4);
    padding: clamp(20px, 5vw, 40px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 95%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.slideshow-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition: opacity 0.5s ease-in-out;
}

.skill-icon {
    width: clamp(80px, 20vw, 120px);
    height: auto;
    aspect-ratio: 1/1;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.skill-icon.golden-flare {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

#skill-detail-icon.golden-flare {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

.skill-name {
    font-size: clamp(1.2rem, 5vw, 2rem);
    margin: 10px 0;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0 #000;
}

.skill-description {
    font-size: clamp(0.9rem, 3.5vw, 1.2rem);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    text-shadow: 1px 1px 0 #000;
    padding: 0 10px;
}

.auth-extra {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.auth-extra p {
    margin: 0;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
    width: 100%;
    text-align: center;
}

.health-popup {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 250px;
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #333;
    border-radius: 10px;
    z-index: 1000;
    overflow: hidden;
    resize: both;
    min-width: 200px;
    min-height: 250px;
}

.health-popup-header {
    background-color: #222;
    padding: 8px;
    cursor: move;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #444;
    position: relative;
}

.close-popup {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    color: #888;
    transition: color 0.2s;
}

.close-popup:hover {
    color: #fff;
}

.health-body-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    height: calc(100% - 40px);
    justify-content: center;
}

.health-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.health-part {
    width: 50px;
    height: 50px;
    background-color: #1a1a1a;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: box-shadow 0.3s ease;
    position: relative;
}

.hp-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-shadow: 1px 1px 2px #000;
}

.health-part:hover .hp-percent {
    opacity: 1;
}

.health-part:hover img {
    filter: brightness(0.4);
}

.health-part img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

/* Custom Tooltip */
.custom-tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: 'JetBrains Sans', sans-serif;
    font-size: 0.9rem;
    z-index: 10000;
    pointer-events: none;
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    max-width: 300px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.main-footer {
    padding: 20px;
    text-align: center;
    background-color: #000;
    border-top: 2px solid #222;
}

.main-footer p {
    margin: 0;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.profile-header-container {
    background-color: rgba(0, 0, 0, 0.4);
    margin: 20px auto 0;
    padding: 15px 40px;
    border-radius: 50px;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.profile-icon.golden-flare {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

.profile-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin: 0;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    color: #fff;
    text-align: center;
}

.profile-main {
    display: flex;
    justify-content: center !important;
    align-items: flex-start !important;
    width: 100%;
    margin-top: 20px;
    flex-grow: 1;
}

.profile-content-grid {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    justify-content: center;
    width: fit-content;
    margin: 0 auto;
}

.profile-content-grid .landing-container {
    text-align: left;
    padding: 0;
    margin: 0;
}

.profile-content-grid .auth-container {
    margin: 0;
    text-align: left;
    padding: 40px;
    width: 450px;
}

.profile-content-grid .stats-container {
    margin: 0;
    width: 450px;
}
.side-nav {
    position: fixed;
    top: 80px; /* Just below the header bar */
    right: 20px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 25px;
    padding: 20px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1000;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #fff;
    gap: 5px;
    width: 100%;
}

.nav-item-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.nav-item-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-item-text {
    font-size: 0.8rem;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
}

.nav-round-button {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.nav-item:hover .nav-round-button {
    background-color: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 10px #fff;
}

/* Character Stats Box */
.stats-container {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 95%;
    max-width: 500px;
    margin: 40px auto;
}

.stats-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-shadow: 2px 2px 0 #000;
}

.stats-scroll-box {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 15px;
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

.stats-scroll-box::-webkit-scrollbar {
    width: 8px;
}

.stats-scroll-box::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.stats-scroll-box::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.stats-scroll-box::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.stat-label {
    font-weight: bold;
    color: #ccc;
}

.stat-value {
    color: #fff;
}

.stats-sub-header {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 0 #000;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.stats-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

/* Explore Grid */
.explore-container {
    width: 100%;
    max-width: 1200px !important;
    max-height: 95vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.explore-container::-webkit-scrollbar {
    width: 8px;
}

.explore-container::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.explore-container::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    margin-top: 10px;
}

.location-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.location-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.location-btn img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.location-btn span {
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 1px 1px 0 #000;
    text-align: center;
}

/* Skills Grid */
.skills-grid-container {
    width: 100%;
    max-width: 1250px;
    margin: 40px auto;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skills-title {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-shadow: 2px 2px 0 #000;
    color: #fff;
    text-align: center;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    flex: 0 1 145px;
    max-width: 200px;
}

.skill-img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.skill-img-link:hover {
    transform: scale(1.15);
}

.skill-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.skill-img.golden-flare {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

.skill-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
}

.skill-name-text {
    font-size: 1rem;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
    text-align: center;
    color: #fff;
}

.skill-level-text {
    font-size: 0.9rem;
    color: #00ff00; /* RuneScape levels are often bright green */
    text-align: center;
    font-weight: bold;
}

@media (max-width: 600px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Leaderboard Styles */
.leaderboard-main {
    padding: 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start !important;
    flex-grow: 1;
}

.leaderboard-container {
    display: flex;
    gap: 20px;
    width: 100%;
    height: calc(100vh - 180px); /* Adjust based on header/footer height */
    min-height: 600px;
}

.leaderboard-sidebar {
    flex: 0 0 250px;
    height: 100%;
}

.sidebar-box {
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

.sidebar-box h3, .sidebar-box h4 {
    margin: 0;
    font-size: 1.2rem;
    text-align: center;
}

.sidebar-box-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.sidebar-box-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Stash Styles */
.stash-main {
    padding: 20px;
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-grow: 1;
    overflow-x: hidden;
}

.stash-container {
    display: flex;
    gap: 30px;
    width: 100%;
    height: calc(100vh - 160px);
    min-height: 700px;
}

.stash-sidebar {
    flex: 0 0 200px;
    height: 100%;
}

.stash-raid-sidebar {
    flex: 0 0 320px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.raid-equipment-box {
    flex: 0 0 auto;
    height: auto;
    max-height: none;
    overflow-y: visible;
}

.raid-inventory-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.raid-equipment-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 5px;
}

.equipment-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.equipment-slot {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.equipment-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.equipment-slot img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    opacity: 0.5;
}

.equipment-slot.occupied img {
    opacity: 1;
}

.equipment-slot.empty-placeholder {
    background: transparent;
    border: none;
    cursor: default;
}

.raid-inventory-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 8px;
    overflow-y: auto;
    flex-grow: 1;
}

.inventory-slot {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.inventory-slot:hover {
    background: rgba(255, 255, 255, 0.1);
}

.inventory-slot img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.inventory-slot .item-amount {
    font-size: 0.7rem;
}

.stash-grid-container {
    flex-grow: 1;
    min-width: 0;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stash-header {
    padding: 10px 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.transfer-mode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.transfer-mode-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.transfer-mode-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: white;
    padding: 4px 15px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.2s ease;
    width: 60px;
    text-align: center;
}

.transfer-mode-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.transfer-mode-btn.all-mode {
    background: rgba(255, 165, 0, 0.2);
    border-color: rgba(255, 165, 0, 0.5);
    color: #ffa500;
}

.transfer-mode-btn.all-mode:hover {
    background: rgba(255, 165, 0, 0.3);
}

.stash-search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stash-search-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

.stash-sort-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.stash-sort-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.stash-sort-btn:active {
    transform: scale(0.95);
}

.stash-sort-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.stash-search-container:focus-within {
    border-color: rgba(255, 255, 255, 0.4);
}

.stash-grid {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    align-content: flex-start;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

.stash-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    width: 100%;
}

.item-img-container {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    cursor: pointer;
    position: relative;
}

.item-img-container:hover {
    transform: scale(1.1);
}

.stash-item-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.1));
}

.item-amount {
    position: absolute;
    bottom: -2px;
    right: 2px;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    pointer-events: none;
}

.item-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    width: 100%;
}

.item-name-text {
    font-size: 0.85rem;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
    text-align: center;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.filter-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.filter-search-icon {
    width: 20px;
    height: 20px;
}

.filter-search-input {
    flex-grow: 1;
    background: none;
    border: none;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h4 {
    margin: 0 0 10px 0;
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #ccc;
    transition: color 0.2s;
}

.filter-checkbox:hover {
    color: white;
}

.filter-checkbox input {
    cursor: pointer;
}

.leaderboard-center {
    flex: 1;
    height: 100%;
}

.leaderboard-box {
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.leaderboard-box h2 {
    margin-top: 0;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #000;
}

.leaderboard-entries {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1a1a;
}

.leaderboard-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
    font-size: 0.95rem;
}

.leaderboard-list-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.leaderboard-list-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
}

.stat-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    padding: 10px;
    font-weight: bold;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: #888;
    background-color: rgba(0, 0, 0, 0.2);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.leaderboard-header .rank {
    width: 50px;
}

.leaderboard-header .name {
    flex: 1;
}

.leaderboard-header .total-level {
    width: 100px;
    text-align: right;
    margin-right: 10px;
    display: none;
}

.leaderboard-header .value {
    width: 120px;
    text-align: right;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.1rem;
}

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

.leaderboard-entry .rank {
    width: 50px;
    color: #888;
}

.leaderboard-entry .name {
    flex: 1;
}

.leaderboard-entry .total-level {
    width: 100px;
    text-align: right;
    color: #aaa;
    margin-right: 10px;
}

.leaderboard-entry .value {
    width: 120px;
    text-align: right;
    font-weight: bold;
    color: #44ff44;
}

.sidebar-box::-webkit-scrollbar, .leaderboard-entries::-webkit-scrollbar {
    width: 8px;
}

.sidebar-box::-webkit-scrollbar-track, .leaderboard-entries::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.sidebar-box::-webkit-scrollbar-thumb, .leaderboard-entries::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

@media (max-width: 1000px) {
    .leaderboard-container {
        flex-direction: column;
        height: auto;
    }
    .leaderboard-sidebar {
        flex: none;
        width: 100%;
        height: 300px;
    }
    .leaderboard-center {
        height: 600px;
    }
}
